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.headers['Subject']
'Re: Emlx library ✉️'
>>> 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, 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.0.tar.gz (4.2 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

emlx-1.0.0-py3-none-any.whl (6.0 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: emlx-1.0.0.tar.gz
  • Upload date:
  • Size: 4.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.22.0 setuptools/45.1.0 requests-toolbelt/0.9.1 tqdm/4.40.0 CPython/3.7.6

File hashes

Hashes for emlx-1.0.0.tar.gz
Algorithm Hash digest
SHA256 f1ec9cfa181c109f41e40b54a84538459302664d185dd816baa8660106b224e7
MD5 8206c189217d0e0cd5a6b5861c8f651d
BLAKE2b-256 c117657c4760fa92983a8f042b72a4c7f6062a8f8782abfd8dfb86b479eda8df

See more details on using hashes here.

File details

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

File metadata

  • Download URL: emlx-1.0.0-py3-none-any.whl
  • Upload date:
  • Size: 6.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.22.0 setuptools/45.1.0 requests-toolbelt/0.9.1 tqdm/4.40.0 CPython/3.7.6

File hashes

Hashes for emlx-1.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 ab36cd5f7e719e1b5f3d11d6de73c073c39f4e25473bd27c9fe3d9b4b9e93dbf
MD5 531b6da2e82b91009ad37ea66eb274ef
BLAKE2b-256 7b46e857f6220dcfadc9676bae0f8c857e793f929c7a1be516e5d71997349ae3

See more details on using hashes here.

Supported by

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