eml-parser
Python EML parser library
What it is and what it does
eml_parser is a Python library that reads EML (email message) files and returns a structured dictionary containing extracted email metadata and content. It parses standard email headers (from, to, cc, subject, date), reconstructs the server path from received headers, extracts attachment information including file hashes and names, and identifies URLs embedded in message bodies and HTML content. The library is designed for email analysis and forensics workflows where you need programmatic access to email components.
The package depends on three common utilities: charset-normalizer for character encoding detection, publicsuffixlist for domain parsing, and python-dateutil for date handling. It is actively maintained, supports current Python versions (3.10 through 3.14), and carries no known security vulnerabilities. Installation is straightforward via pip, though macOS users must have libmagic installed separately if they want the optional filemagic extra.
Use it for:
- Extract and analyze email headers and metadata from EML files for security investigations or email audits.
- Batch process email archives to build indexes of senders, recipients, and subjects for discovery or compliance.
- Parse attachment information and compute hashes for malware scanning or deduplication workflows.
- Reconstruct email routing paths from received headers to trace message origin and server hops.
- Harvest URLs from email bodies and attachments for threat intelligence or link analysis.
Worth the install?
AI-flagged interpretation of the facts on this page — verify before relying
Parses EML (email) files and extracts structured information including headers, body content, attachments with hashes, recipient lists, received server paths, subjects, and URLs found in message text.
Yes. The package is actively maintained, has no security vulnerabilities, and provides a straightforward way to parse EML files into structured data. Low install friction and broad Python version support make it accessible. The AGPLv3+ license is a constraint for proprietary software but not for internal tools, open-source projects, or research. Install it if you need to programmatically extract email metadata or content.
Install
eml-parser on PyPI
pip
pip install eml-parseruv
uv add eml-parserpoetry
poetry add eml-parserInstalling eml-parser
Before you install
Low friction install with a pure Python wheel; three lightweight runtime dependencies (charset-normalizer, publicsuffixlist, python-dateutil). Actively maintained with a release 26 days ago and recent commits. Requires Python 3.10 or later.
License in practice
Licensed under AGPLv3+, a copyleft license requiring that any derivative work or distribution also be licensed under AGPLv3 or compatible terms. Suitable for internal tools and open-source projects, but not for proprietary closed-source software without careful legal review.
Quickstart
pip install eml_parser
import eml_parser
with open('sample.eml', 'rb') as fhdl:
raw_email = fhdl.read()
ep = eml_parser.EmlParser()
parsed_eml = ep.decode_email_bytes(raw_email)
print(parsed_eml)
Requires Python 3.10 or later. Optional: libmagic system library if using the filemagic extra on macOS.
Verify before relying
- Whether the package handles modern email formats (DKIM, SPF, DMARC headers) beyond basic parsing.
- Performance characteristics when parsing large emails or batch processing many files.
- Completeness of URL extraction from complex MIME structures and encoded content.
Package facts
| License | AGPLv3+ (agpl) |
| Python support | supports the current Python release (>=3.10) |
| Install friction | low — pure-Python wheel |
| Runtime dependencies | 3 — charset-normalizer, publicsuffixlist, python-dateutil |
| Maintenance | actively maintained — 26 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 689,644/month — #5,336 on PyPI (30-day window, as of 2026-08-14) |
| Known vulnerabilities | none known (OSV.dev, checked 2026-08-14) |
Evidence: eml_parser-3.0.3-py3-none-any.whl
Keywords: email
Tags
More Email packages
aiosmtplib is an asynchronous SMTP client that…
permissive · top 5,000 on PyPI
Wikipedia-APIWikipedia-API is a Python wrapper for…
permissive · top 5,000 on PyPI
python-oxmsgParses Outlook MSG files to extract email…
permissive · top 5,000 on PyPI
django-anymailSends and receives email in Django through…
permissive · top 5,000 on PyPI
IMAPClientIMAPClient provides a Pythonic interface to…
permissive · top 5,000 on PyPI
mailjet-restA Python wrapper for the Mailjet Email API that…
permissive · top 5,000 on PyPI
mail-parserParses raw email messages into structured…
permissive · top 5,000 on PyPI
msg-parserParses Microsoft Outlook MSG email files,…
permissive · top 15,000 on PyPI
extract-msgExtracts email metadata (from, to, cc, date,…
copyleft · top 5,000 on PyPI
tnefparseDecodes Microsoft's Transport Neutral…
copyleft · top 15,000 on PyPI
comment-parserExtracts comments from source code files across…
permissive · top 15,000 on PyPI
mail-parser-replySplits incoming email messages into separate…
permissive · top 15,000 on PyPI
email-reply-parserExtracts the most recent reply from an email…
permissive · top 5,000 on PyPI
quotequailIdentifies and separates quoted text from…
permissive · top 15,000 on PyPI
SickleSickle is a lightweight Python client library…
permissive · top 15,000 on PyPI