{"id":4527,"library":"email-reply-parser","title":"Email Reply Parser","description":"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.","status":"maintenance","version":"0.5.12","language":"en","source_language":"en","source_url":"https://github.com/zapier/email-reply-parser","tags":["email","parsing","reply","text","email-thread"],"install":[{"cmd":"pip install email-reply-parser","lang":"bash","label":"Install stable version"}],"dependencies":[],"imports":[{"symbol":"EmailReplyParser","correct":"from email_reply_parser import EmailReplyParser"}],"quickstart":{"code":"from email_reply_parser import EmailReplyParser\n\nemail_body = '''Hi there,\n\nI appreciate your help with this issue.\n\nBest regards,\nJohn\n\nOn Mon, Apr 8, 2026 at 10:00 AM, Support <support@example.com> wrote:\n> How can we help you today?\n>\n> Thanks,\n> Support Team'''\n\n# Get the full parsed email structure (list of fragments)\nparsed_email = EmailReplyParser.read(email_body)\nprint(\"--- Full Parsed Email Fragments ---\")\nfor fragment in parsed_email.fragments:\n    print(f\"Content: {fragment.content.strip()}\\nIs a signature: {fragment.is_signature}\\nIs quoted: {fragment.is_quoted}\\nIs hidden: {fragment.is_hidden}\\n---\")\n\n# Get only the reply message (stripping quotes and signatures)\nreply_text = EmailReplyParser.parse_reply(email_body)\nprint(\"\\n--- Extracted Reply Text ---\")\nprint(reply_text)","lang":"python","description":"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."},"warnings":[{"fix":"For multi-language support, consider using a more actively maintained library or a service designed for international email parsing.","message":"The parser primarily relies on English-specific heuristics (e.g., 'On <date>, <author> wrote:') for identifying quoted replies. It may not work correctly or be less effective with emails in other languages or with different reply header formats.","severity":"gotcha","affected_versions":"<=0.5.12"},{"fix":"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.","message":"This library is strictly designed for plain text emails. It does not process HTML email content, and feeding it HTML input may lead to incorrect or incomplete parsing results.","severity":"gotcha","affected_versions":"<=0.5.12"},{"fix":"Review parsed output for emails with unusual signature formats and consider custom pre-processing or post-processing if precise signature stripping is critical.","message":"Signature detection is heuristic-based (e.g., looking for lines starting with `--` or `__`). Its accuracy can vary significantly depending on the email client, custom signature formats, and general email content.","severity":"gotcha","affected_versions":"<=0.5.12"},{"fix":"No direct fix within the library; manual pre-processing to normalize such headers might be necessary, but this can be complex.","message":"Quoted headers (like 'On <date>, <author> wrote:') that span multiple lines due to email client formatting (e.g., Gmail's line-wrapping) may not be correctly identified and stripped, leading to quoted content appearing in the reply.","severity":"gotcha","affected_versions":"<=0.5.12"}],"env_vars":null,"last_verified":"2026-04-12T00:00:00.000Z","next_check":"2026-07-11T00:00:00.000Z"}