quotequail
A library that identifies quoted text in plain text and HTML email messages.
What it is and what it does
quotequail is a Python library for parsing email message structure, specifically identifying quoted text in both plain text and HTML formats. It provides four main functions: quote() and quote_html() to separate original text from quoted sections (returning tuples indicating whether each section should be expanded by default), and unwrap() and unwrap_html() to extract forwarded messages or replies by parsing headers and separating top/bottom text from the wrapped content.
The library is designed for email processing workflows where you need to distinguish between a user's original message and quoted or forwarded content. It has one runtime dependency (typing_extensions) and optionally requires libxml for HTML parsing. The package is actively maintained, supports Python 3.10 through 3.12, and carries no known security vulnerabilities.
Use it for:
- Email client or web mail interface that needs to hide quoted text by default and show only new replies.
- Email parsing pipeline that extracts forwarded message headers and original content for storage or analysis.
- Conversation threading system that separates user-written content from quoted context in threaded replies.
- Email archival or search system that indexes only original content, excluding quoted sections.
- Automated email response system that needs to identify and extract the actual user message from a reply.
Worth the install?
AI-flagged interpretation of the facts on this page — verify before relying
Identifies and separates quoted text from original content in plain text and HTML email messages, and unwraps forwarded messages or replies to extract headers and body text.
Yes, with conditions. The library is actively maintained, has no security vulnerabilities, and solves a specific email parsing problem well. However, high install friction (source-only distribution) may cause deployment friction in some environments. Install it if you need robust email quote detection and can tolerate building from source; skip it if your deployment pipeline requires pre-built wheels.
Install
quotequail on PyPI
pip
pip install quotequailuv
uv add quotequailpoetry
poetry add quotequailInstalling quotequail
Before you install
High install friction due to source distribution only (no wheels). Actively maintained with a recent release (78 days ago) and steady repository activity. Single lightweight runtime dependency (typing_extensions) keeps the footprint minimal.
License in practice
MIT license is permissive and places no restrictions on use, modification, or distribution in commercial or private projects.
Quickstart
pip install quotequail
import quotequail
result = quotequail.quote("Hello\n\n> Quoted text")
print(result) # [(True, 'Hello'), (False, '\n> Quoted text')]
HTML methods require libxml to be installed on the system; plain text methods work without it.
Verify before relying
- Whether the high install friction (source-only distribution) is due to platform-specific compilation needs or simply lack of wheel publishing.
- Performance characteristics when processing large email messages or bulk operations.
- Accuracy rates for different email client quote formats and edge cases.
Package facts
| License | MIT (permissive) |
| Python support | not specified |
| Install friction | high — source build required |
| Runtime dependencies | 1 — typing_extensions |
| Maintenance | actively maintained — 78 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 118,128/month — #12,131 on PyPI (30-day window, as of 2026-08-14) |
| Known vulnerabilities | none known (OSV.dev, checked 2026-08-14) |
Evidence: quotequail-0.5.0.tar.gz
Tags
More Python Modules packages
Converts domain names between Unicode and…
permissive · top 100 on PyPI
setuptoolsSetuptools is a Python build backend and…
permissive · top 100 on PyPI
PyYAMLPyYAML parses and emits YAML 1.1 data format,…
permissive · top 100 on PyPI
pydanticPydantic validates Python data structures…
permissive · top 100 on PyPI
annotated-typesProvides reusable metadata objects for use with…
permissive · top 100 on PyPI
typing-inspectionProvides runtime tools to inspect and…
permissive · top 100 on PyPI
mail-parser-replySplits incoming email messages into separate…
permissive · top 15,000 on PyPI
email-reply-parserExtracts the most recent reply from an email…
permissive · top 5,000 on PyPI
RTFDEExtracts encapsulated HTML and plain text…
copyleft · top 5,000 on PyPI
mslexProvides Windows-compatible command-line…
permissive · top 5,000 on PyPI
mail-parserParses raw email messages into structured…
permissive · top 5,000 on PyPI
email-toWraps Python's standard email modules to…
permissive · top 15,000 on PyPI
mailbitsProvides utilities for parsing, converting, and…
permissive · top 15,000 on PyPI
eml-parserParses EML (email) files and extracts…
agpl · top 15,000 on PyPI
pylint-quotesA Pylint plugin that enforces consistent use of…
permissive · top 15,000 on PyPI