Registry / communication / mail-parser-reply

mail-parser-reply

JSON →
library1.36pypypi✓ verified 85d ago

mail-parser-reply is a Python library (current version 1.36) designed to parse and split incoming email messages into individual replies. It supports multiple languages and makes it easier to extract relevant text content, with options to strip headers, signatures, and disclaimers. The library is actively maintained, providing an improved, fully type-annotated implementation over older email reply parsing tools.

pip install mail-parser-reply
INSTALL
IMPORT
SIG · MAIL-PARSER-REPLY
M
mail-parser-reply
communicationpythonv1.36
Install
1.5s avg
Import
58ms
Disk
16MB
Pass rate
10/ 10
Env Coverage10 / 10
glibc
3.93.13
musl
3.93.13
Install & Compatibility
Where this runs
tested against v1.36 · pip install
no network on importno background threads
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
musl
py 3.103.910 runs
installs and imports cleanly · install 0.0s · import 0.059s · 17.8MB
glibc
py 3.103.910 runs
installs and imports cleanly · install 1.5s · import 0.056s · 18MB
16MB installed
● package 16MB
Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

EmailReplyParser
from mailparser_reply import EmailReplyParser
from mail_parser_reply import EmailReplyParser
Python package names often use hyphens, but import paths typically use underscores. The correct import module name is `mailparser_reply`.

This quickstart demonstrates how to instantiate `EmailReplyParser` with a list of languages and then use `read()` to get all parsed replies or `parse_reply()` to extract only the most recent reply from a given email body text.

from mailparser_reply import EmailReplyParser mail_body = """Awesome! I haven't had another problem with it. Thanks, alfonsrv On Wed, Dec 20, 2023 at 13:37, RAUSYS <info@rausys.de> wrote: > The good news is that I've found a much better query for lastLocation. > It should run much faster now. Can you double-check? """ # Instantiate the parser with desired languages parser = EmailReplyParser(languages=['en', 'de']) # Parse the entire email and get a list of EmailReply objects email_message = parser.read(text=mail_body) print("All replies:") for reply in email_message.replies: print(f"- {reply.text}") # Or get only the latest reply as a string latest_reply = parser.parse_reply(text=mail_body) print("\nLatest reply:") print(latest_reply)
Debug
Known issues
gotchaMail clients handle reply formatting in diverse ways, which can make consistent and reliable parsing inherently challenging. The library is designed to mitigate this but edge cases may still exist.
fix
Thoroughly test with various email formats specific to your use case. Consider pre-processing inconsistent inputs if issues arise.
affects: All versions
gotchaSome supported languages (e.g., Czech, Spanish, Korean, Chinese) are explicitly marked as 'untested' in the documentation. Parsing accuracy for these languages may be less reliable than for thoroughly tested ones.
fix
If using an untested language, perform extensive testing to verify parsing quality. Contributions for improving these languages are welcome by the maintainers.
affects: All versions
gotchaThe library primarily focuses on 'text-based mail parsing'. While it can handle headers and signatures, complex HTML-rich emails might require prior conversion to plain text for optimal and accurate reply extraction.
fix
For HTML emails, ensure they are converted to a plain text representation before feeding them to the `EmailReplyParser` for best results.
affects: All versions
Errors
Common errors & fixes
TypeError: EmailReplyParser() missing 1 required positional argument: 'languages'
The `EmailReplyParser` class requires the `languages` argument during instantiation.
fix
Instantiate `EmailReplyParser` by providing a list of language codes, e.g., `EmailReplyParser(languages=['en'])`.
AttributeError: 'EmailReplyParser' object has no attribute 'replies' (or 'parse_reply')
Methods like `read()` and `parse_reply()` are instance methods and must be called on an instantiated `EmailReplyParser` object, not directly on the class.
fix
First, create an instance: `parser = EmailReplyParser(languages=['en'])`. Then, call the methods on the instance: `email_message = parser.read(text=mail_body)`.
Upgrade
Version history
1.36latest on PyPI · released Dec 1, 2025
Audit
Dependencies

No dependency data recorded yet.

Agent activity
51 hits · last 30 days
node
48
Amazon
1
OpenAI (training)
1
Resources
mail-parser-reply — pip install mail-parser-reply · libregistry