Email Reply Parser

0.5.12 · maintenance · verified Sun Apr 12

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.

Warnings

Install

Imports

Quickstart

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.

from email_reply_parser import EmailReplyParser

email_body = '''Hi there,

I appreciate your help with this issue.

Best regards,
John

On Mon, Apr 8, 2026 at 10:00 AM, Support <support@example.com> wrote:
> How can we help you today?
>
> Thanks,
> Support Team'''

# Get the full parsed email structure (list of fragments)
parsed_email = EmailReplyParser.read(email_body)
print("--- Full Parsed Email Fragments ---")
for fragment in parsed_email.fragments:
    print(f"Content: {fragment.content.strip()}\nIs a signature: {fragment.is_signature}\nIs quoted: {fragment.is_quoted}\nIs hidden: {fragment.is_hidden}\n---")

# Get only the reply message (stripping quotes and signatures)
reply_text = EmailReplyParser.parse_reply(email_body)
print("\n--- Extracted Reply Text ---")
print(reply_text)

view raw JSON →