Skip to main content

The leightweight parser for emlx files.

Project description

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:

  1. bytecount on first line;
  2. email content in MIME format (headers, body, attachments);
  3. 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.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

emlx-1.0.4.tar.gz (4.6 kB view details)

Uploaded Source

Built Distribution

emlx-1.0.4-py3-none-any.whl (6.2 kB view details)

Uploaded Python 3

File details

Details for the file emlx-1.0.4.tar.gz.

File metadata

  • Download URL: emlx-1.0.4.tar.gz
  • Upload date:
  • Size: 4.6 kB
  • Tags: Source
  • Uploaded using 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

File hashes

Hashes for emlx-1.0.4.tar.gz
Algorithm Hash digest
SHA256 f1ca1e106f3cdfab10b1888c2520ea6d92ad2a21769f603e345d3458194ae18f
MD5 72710e925c8cd6d999d284f43a362e28
BLAKE2b-256 217a8ad824b90f356ad3f1fb990e93136150b3fc8f2559eedc185ced2d32968e

See more details on using hashes here.

File details

Details for the file emlx-1.0.4-py3-none-any.whl.

File metadata

  • Download URL: emlx-1.0.4-py3-none-any.whl
  • Upload date:
  • Size: 6.2 kB
  • Tags: Python 3
  • Uploaded using 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

File hashes

Hashes for emlx-1.0.4-py3-none-any.whl
Algorithm Hash digest
SHA256 1ccfdca58c659f1e06f1629bf9e830bbebf9c128493d1d82692447d3f929a31b
MD5 6b5ef3282a99ee2f48691833d1035cdb
BLAKE2b-256 52cbc5c098ee9ef35fb450a17e6bb81f22cf0f8b4a84da84756693300e733858

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page