MailKite mail-parse (Python)
Streaming, memory-efficient MIME email parser — the Python port of @mailkite/mail-parse.
Same parsed Message shape, and a failure-signature primitive whose hashes match the TypeScript package byte-for-byte.
Docs · Libraries · Node / TypeScript · mailkite.dev
·
Maintained in the MailKite monorepo; this is the public home for the Python port. The TypeScript package (
mail-parse) is the reference implementation.
Why
- Cross-language SSOT —
compute_signature()produces the same failure-signature hash as the TypeScript package for the same failure (conformance-tested against hashes captured from TS). - Same
Messageshape —parse()returns the same structured fields, so payloads are consistent across your stack. - Tolerant — malformed input never raises.
Install
pip install mailparse-mailkite
Quickstart
from mailparse import parse, compute_signature
msg = parse(raw_bytes)
msg.from_ # Address(address=..., name=...)
msg.subject
msg.text; msg.html
msg.attachments # [Attachment(filename, mimeType, content: bytes, size, ...)]
# Deterministic, PII-free fingerprint of a parse failure — identical hash to the TS package.
sig = compute_signature({"scope": "part", "diagnosticCodes": ["UNKNOWN_CHARSET"],
"contentType": "text/plain"})
sig["hash"]
Status
The failure-signature primitive is fully ported and cross-language conformance-tested. parse() is
built on the stdlib email package (the documented ContentManager precedent) — the buffered path.
Porting the streaming splitter + middleware registry to Python is in progress; the
TypeScript package is the reference.
Develop
python3 -m unittest discover -s tests
All MailKite libraries
| Library | Repo | Distribution |
|---|---|---|
| mail-parse (Node / TypeScript) | mail-parse |
npm |
| mail-parse (Python) (this repo) | mail-parse-py |
PyPI |
| MailKite for Python | mailkite-python |
PyPI |
| MailKite for Node.js | mailkite-node |
npm |
Full list: https://mailkite.dev/docs/libraries.
Docs & links
- 📚 Documentation: https://mailkite.dev/docs
- 🟦 TypeScript reference: https://github.com/mailkite/mail-parse
- 🌐 Website: https://mailkite.dev
MIT licensed. © MailKite.
Metadata
Release files for mailparse-mailkite 0.1.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| mailparse_mailkite-0.1.0.tar.gz | 22.1 kB | Without provenance | Details for mailparse_mailkite-0.1.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| mailparse_mailkite-0.1.0-py3-none-any.whl | Python 3 | none | any | Details for mailparse_mailkite-0.1.0-py3-none-any.whl |
Total release size: 44.9 kB
Release files / mailparse_mailkite-0.1.0.tar.gz
| Download URL | mailparse_mailkite-0.1.0.tar.gz |
|---|---|
| Size | 22.1 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
7ad25ef56fa8a04b8ea6d046b1eaf27036cfc955269aa5613f0f88738e3793b8
|
|
BLAKE2b-256 checksum How to use checksums |
81c80fff8206953ff2f39882d739300838af1100d40e09fa0edfb106a9a73ab9
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.9.6
|
Release files / mailparse_mailkite-0.1.0-py3-none-any.whl
| Download URL | mailparse_mailkite-0.1.0-py3-none-any.whl |
|---|---|
| Size | 22.8 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
76f0972b86cf9a554c7cdec57093d0faf87ad9741ed642fb23c99b396ee21944
|
|
BLAKE2b-256 checksum How to use checksums |
f3f101b9d34fd0bcea1c42c5775c279753dbae2b37a7299b9f6428e588fd79ee
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.9.6
|
Security for mailparse-mailkite 0.1.0
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.