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-replyVerified import paths — ran on the pinned version, not inferred.
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.
Thoroughly test with various email formats specific to your use case. Consider pre-processing inconsistent inputs if issues arise.
If using an untested language, perform extensive testing to verify parsing quality. Contributions for improving these languages are welcome by the maintainers.
For HTML emails, ensure they are converted to a plain text representation before feeding them to the `EmailReplyParser` for best results.
Instantiate `EmailReplyParser` by providing a list of language codes, e.g., `EmailReplyParser(languages=['en'])`.
First, create an instance: `parser = EmailReplyParser(languages=['en'])`. Then, call the methods on the instance: `email_message = parser.read(text=mail_body)`.
No dependency data recorded yet.