skillfed

eml-parser

Python EML parser library

eml-parser v3.0.3 689.6K downloads/30d#5,336 on PyPI244
AGPL license AGPLv3+ Active released

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-parser

uv

uv add eml-parser

poetry

poetry add eml-parser

Installing 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

Development Status :: 5 - Production/StableIntended Audience :: DevelopersLicense :: OSI Approved :: GNU Affero General Public License v3 or later (AGPLv3+)Operating System :: OS IndependentProgramming Language :: Python :: 3 :: OnlyProgramming Language :: Python :: 3.10Programming Language :: Python :: 3.11Programming Language :: Python :: 3.12Programming Language :: Python :: 3.13Programming Language :: Python :: 3.14Topic :: Communications :: Email

Tags

eml file parseremail parsing pythonextract email headersparse eml attachmentsemail message analysisemail forensicsemail metadata extraction
email-parsingforensicsmetadata-extraction

More Email packages