skillfed

rtfparse

Tool to parse Microsoft Rich Text Format (RTF)

rtfparse v0.9.5 307.1K downloads/30d#7,781 on PyPI20
Permissive license MIT AGING released

What it is and what it does

rtfparse is a Python library that reads Microsoft RTF documents and builds an in-memory object tree representing their structure. It then passes that tree to a renderer—currently only HTML_Decapsulator is provided, which extracts HTML that has been embedded within RTF (a common pattern in Outlook email messages). The library also handles RTF decompression, which Outlook uses to reduce file size.

You can use it as a command-line tool or import it into your own Python code. The CLI writes logs to ~/rtfparse/ and supports workflows like extracting HTML from .msg files, decompressing RTF, and saving attachments. The library depends on extract-msg to read Outlook message files and compressed-rtf to decompress them when needed.

Use it for:

  • Extract HTML content from RTF-formatted email messages saved by Microsoft Outlook.
  • Decompress RTF files that have been compressed by Outlook or other Microsoft applications.
  • Parse RTF documents programmatically and render them to HTML for web display or archival.
  • Batch-process .msg files to recover embedded HTML and attachments from email archives.
  • Build custom renderers for RTF documents by extending the parser's tree structure.

Worth the install?

AI-flagged interpretation of the facts on this page — verify before relying

Parses Microsoft Rich Text Format (RTF) documents into an in-memory tree structure and renders them—primarily extracting encapsulated HTML, with optional RTF decompression support for Outlook messages.

Yes, if you need to extract HTML from Outlook emails or parse RTF documents. The library is stable (Production/Stable classifier), has no known vulnerabilities, and low install friction. However, maintenance is aging—the last release was over a year ago—so consider whether you need active support or can tolerate a stable but slowly-evolving codebase.

Install

rtfparse on PyPI

pip

pip install rtfparse

uv

uv add rtfparse

poetry

poetry add rtfparse

Installing rtfparse

Before you install

Low friction: pure Python wheel with four runtime dependencies (argcomplete, compressed-rtf, extract-msg, provide-dir). Maintenance status is aging—last release was 402 days ago, though the repository remains active with a recent commit on 2025-09-10.

License in practice

MIT license permits commercial and private use with minimal restrictions; you must include a copy of the license and copyright notice in distributions.

Quickstart

pip install rtfparse

from rtfparse.parser import Rtf_Parser
from rtfparse.renderers.html_decapsulator import HTML_Decapsulator

parser = Rtf_Parser(rtf_path="document.rtf")
parsed = parser.parse_file()
renderer = HTML_Decapsulator()
with open("output.html", "w") as f:
    renderer.render(parsed, f)

Requires Python 3.10 or later.

Verify before relying

  • Whether the HTML_Decapsulator renderer handles all RTF variants and edge cases reliably in production.
  • Performance characteristics when parsing large or complex RTF documents.
  • Whether custom renderers beyond HTML_Decapsulator are documented or supported.

Package facts

License MIT (permissive)
Python support supports the current Python release (>=3.10)
Install friction low — pure-Python wheel
Runtime dependencies 4 — argcomplete, compressed-rtf, extract-msg, provide-dir
Maintenance aging — 402 days since the last release
Last repo commit
First released
Downloads 307,054/month — #7,781 on PyPI (30-day window, as of 2026-08-14)
Known vulnerabilities none known (OSV.dev, checked 2026-08-14)

Evidence: rtfparse-0.9.5-py3-none-any.whl

Keywords: parse, rtf

Development Status :: 5 - Production/StableEnvironment :: ConsoleIntended Audience :: DevelopersNatural Language :: EnglishOperating System :: MacOS :: MacOS XOperating System :: Microsoft :: WindowsOperating System :: OS IndependentOperating System :: POSIX :: LinuxProgramming Language :: Python :: 3.10Programming Language :: Python :: 3.11Topic :: Software Development :: TestingTopic :: Utilities

Tags

rtf parserextract html from rtfoutlook msg to htmlrtf document parsingdecompress rtfrtf rendererparse rich text format
email-extractionrtf-parsingoutlook-msg

More Utilities packages