{"id":9093,"library":"mail-parser-reply","title":"mail-parser-reply","description":"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.","status":"active","version":"1.36","language":"en","source_language":"en","source_url":"https://github.com/alfonsrv/mail-parser-reply","tags":["email","parser","reply","multilingual","text-processing"],"install":[{"cmd":"pip install mail-parser-reply","lang":"bash","label":"Install latest version"}],"dependencies":[],"imports":[{"note":"Python package names often use hyphens, but import paths typically use underscores. The correct import module name is `mailparser_reply`.","wrong":"from mail_parser_reply import EmailReplyParser","symbol":"EmailReplyParser","correct":"from mailparser_reply import EmailReplyParser"}],"quickstart":{"code":"from mailparser_reply import EmailReplyParser\n\nmail_body = \"\"\"Awesome! I haven't had another problem with it. Thanks, alfonsrv\n\nOn Wed, Dec 20, 2023 at 13:37, RAUSYS <info@rausys.de> wrote:\n> The good news is that I've found a much better query for lastLocation.\n> It should run much faster now. Can you double-check?\n\"\"\"\n\n# Instantiate the parser with desired languages\nparser = EmailReplyParser(languages=['en', 'de'])\n\n# Parse the entire email and get a list of EmailReply objects\nemail_message = parser.read(text=mail_body)\nprint(\"All replies:\")\nfor reply in email_message.replies:\n    print(f\"- {reply.text}\")\n\n# Or get only the latest reply as a string\nlatest_reply = parser.parse_reply(text=mail_body)\nprint(\"\\nLatest reply:\")\nprint(latest_reply)","lang":"python","description":"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."},"warnings":[{"fix":"Thoroughly test with various email formats specific to your use case. Consider pre-processing inconsistent inputs if issues arise.","message":"Mail 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.","severity":"gotcha","affected_versions":"All versions"},{"fix":"If using an untested language, perform extensive testing to verify parsing quality. Contributions for improving these languages are welcome by the maintainers.","message":"Some 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.","severity":"gotcha","affected_versions":"All versions"},{"fix":"For HTML emails, ensure they are converted to a plain text representation before feeding them to the `EmailReplyParser` for best results.","message":"The 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.","severity":"gotcha","affected_versions":"All versions"}],"env_vars":null,"last_verified":"2026-04-16T00:00:00.000Z","next_check":"2026-07-15T00:00:00.000Z","problems":[{"fix":"Instantiate `EmailReplyParser` by providing a list of language codes, e.g., `EmailReplyParser(languages=['en'])`.","cause":"The `EmailReplyParser` class requires the `languages` argument during instantiation.","error":"TypeError: EmailReplyParser() missing 1 required positional argument: 'languages'"},{"fix":"First, create an instance: `parser = EmailReplyParser(languages=['en'])`. Then, call the methods on the instance: `email_message = parser.read(text=mail_body)`.","cause":"Methods like `read()` and `parse_reply()` are instance methods and must be called on an instantiated `EmailReplyParser` object, not directly on the class.","error":"AttributeError: 'EmailReplyParser' object has no attribute 'replies' (or 'parse_reply')"}]}