Emlx
Emlx is the lightweight parser for .emlx files as used by Mail.app.
Install
Install and update using pip:
pip install emlx
Basic usage
>>> import emlx
>>> m = emlx.read("12345.emlx")
>>> m.headers
{'Subject': 'Re: Emlx library ✉️',
'From': 'Michael <michael@example.com>',
'Date': 'Thu, 30 Jan 2020 20:25:43 +0100',
'Content-Type': 'text/plain; charset=utf-8',
...}
>>> m.text
"You're welcome. :)\n\n> Python <python@example.com> wrote:\n>\n> Thank you!\n\n"
>>> m.html is None
True
>>> m.plist
{'color': '000000',
'conversation-id': 12345,
'date-last-viewed': 1580423184,
'flags': {...}
...}
>>> m.flags
{'read': True, 'answered': True, 'attachment_count': 2}
Architecture
An .emlx file consists of three parts:
- bytecount on first line;
- email content in MIME format (headers, body, attachments);
- Apple property list (plist) with metadata.
The second part (2.) is parsed by the email library. It is included in the Python standard library. Message objects generated by emlx extend email.message.Message and thus give access to its handy features. Additionally, emlx message objects provide the attributes bytecount (1.) as integer and plist (3.) as a Python dictionary. For convenience, it also offers the attributes headers, text, html, url, id, and flags.
History
The emlx file format was introduced by Apple in 2005. It is similar to eml-files popular with other email clients; the difference is the added bytecount (start) and plist (end). For more, see here.
Release files for emlx 1.0.4
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| emlx-1.0.4.tar.gz | 4.6 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| emlx-1.0.4-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 10.8 kB
Release files / emlx-1.0.4.tar.gz
| Download URL | emlx-1.0.4.tar.gz |
|---|---|
| Size | 4.6 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
f1ca1e106f3cdfab10b1888c2520ea6d92ad2a21769f603e345d3458194ae18f
|
|
BLAKE2b-256 checksum How to use checksums |
217a8ad824b90f356ad3f1fb990e93136150b3fc8f2559eedc185ced2d32968e
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.4.1 importlib_metadata/3.9.1 pkginfo/1.7.0 requests/2.24.0 requests-toolbelt/0.9.1 tqdm/4.59.0 CPython/3.9.2
|
Release files / emlx-1.0.4-py3-none-any.whl
| Download URL | emlx-1.0.4-py3-none-any.whl |
|---|---|
| Size | 6.2 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
1ccfdca58c659f1e06f1629bf9e830bbebf9c128493d1d82692447d3f929a31b
|
|
BLAKE2b-256 checksum How to use checksums |
52cbc5c098ee9ef35fb450a17e6bb81f22cf0f8b4a84da84756693300e733858
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.4.1 importlib_metadata/3.9.1 pkginfo/1.7.0 requests/2.24.0 requests-toolbelt/0.9.1 tqdm/4.59.0 CPython/3.9.2
|