Email Reply Parser is a Python library that simplifies the process of extracting the most recent reply from plain text email conversations. It is a port of GitHub's original Ruby email_reply_parser. The library helps in automatically stripping out quoted previous messages, signatures, and disclaimers, providing a cleaner, actionable response. The current version, 0.5.12, was released in October 2020, indicating a slow release cadence.
pip install email-reply-parserVerified import paths — ran on the pinned version, not inferred.
This example demonstrates how to use `EmailReplyParser.read()` to get a detailed breakdown of email fragments and `EmailReplyParser.parse_reply()` to extract only the most recent, non-quoted, non-signature reply from an email body.
For multi-language support, consider using a more actively maintained library or a service designed for international email parsing.
Ensure that the email content is converted to plain text before passing it to the parser. If HTML parsing is required, a different library capable of handling HTML email structures is needed.
Review parsed output for emails with unusual signature formats and consider custom pre-processing or post-processing if precise signature stripping is critical.
No direct fix within the library; manual pre-processing to normalize such headers might be necessary, but this can be complex.
Install the package using `pip install email-reply-parser` and ensure the import statement is `from email_reply_parser import EmailReplyParser`.
Import the `EmailReplyParser` class directly using `from email_reply_parser import EmailReplyParser` and then call its methods: `EmailReplyParser.read(email_content)` or `EmailReplyParser.parse_reply(email_content)`.
There is no single code fix as this often indicates a limitation in the parsing logic for specific email formats. Users may need to manually inspect the `EmailReplyParser.read(email_content).fragments` to understand how the email was parsed, consider pre-processing the email content, or accept that certain complex email structures may not be perfectly handled.
Ensure that the input passed to 'EmailReplyParser.read()' is a string and handle cases where the input might be 'None' or another unexpected type.
No dependency data recorded yet.