Skip to main content

maillib

maillib is a wrapper around Python’s email package to provide simple and automatic decoding of messages to unicode and several other conveniences.

Example

>>> import maillib
>>> import datetime
>>>
>>> RAW_MESSAGE = """\
... MIME-version: 1.0
... Date: Sun, 25 Oct 2009 21:12:18 -0500
... Message-id: <c90890f0910251912y40797940ga9f22413411d59dc@mail.gmail.com>
... Subject: =?UTF-8?B?0JLQsNGI0YMg0LzRi9GB0LvRjA==?=
... From: Sender <sender@example.com>
... To: =?UTF-8?B?0JLQu9Cw0LTQuMyB0LzQuNGAINCc0LDRj9C60L7MgdCy0YHQutC40Lk=?=
...  <mayakovsky@example.com>
... Content-type: multipart/alternative; boundary=001636ed670f4e3ad20476cd176b
...
... --001636ed670f4e3ad20476cd176b
... Content-Type: text/plain; charset=UTF-8
... Content-Transfer-Encoding: base64
...
... KtGB0L/QsNGB0LjQsdC+Kgo=
... --001636ed670f4e3ad20476cd176b
... Content-Type: text/html; charset=UTF-8
... Content-Transfer-Encoding: quoted-printable
...
... <span class=3D"Apple-style-span" style=3D"font-family: arial, sans-serif; f=
... ont-size: 13px; border-collapse: collapse; "><b>=D1=81=D0=BF=D0=B0=D1=81=D0=
... =B8=D0=B1=D0=BE</b></span>
...
... --001636ed670f4e3ad20476cd176b--
... """
>>> msg = maillib.Message.from_string(RAW_MESSAGE)
>>> msg.subject
Вашу мысль
>>> msg.sender
(u'Sender', u'sender@example.com')
>>> msg.to
(u'Влади́мир Маяко́вский' u'mayakovsky@example.com')
>>> msg.date
datetime.datetime(2009, 10, 26, 2, 12, 18)
>>> msg.body
спасибо
>>> msg.html
<span class=3D"Apple-style-span" style=3D"font-family: arial, sans-serif; font-size: 13px; border-collapse: collapse; "><b>спасибо</b></span>

Metadata

Release files for maillib 0.1.3

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for maillib 0.1.3
File Size Uploaded Provenance Actions
maillib-0.1.3.tar.gz 63.2 kB Without provenance Details for maillib-0.1.3.tar.gz

Release files / maillib-0.1.3.tar.gz

Download URL maillib-0.1.3.tar.gz
Size 63.2 kB
Tags Source
SHA-256 checksum
How to use checksums
ea97bddee8d58bacbf96187eb456ce203dd642b412962d0191b02a6ad2edc4ff
BLAKE2b-256 checksum
How to use checksums
eb6f5c7bb366ae1df25835397c1bec9e41b2ce1e0cce481ab4a3c4e47fa17b8f
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No

Security for maillib 0.1.3

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page