skillfed

striprtf

A simple library to convert rtf to text

striprtf v0.0.32 7.5M downloads/30d#1,723 on PyPI117
Permissive license BSD-3-Clause Active released

What it is and what it does

striprtf is a lightweight Python library that extracts plain text from Rich Text Format (RTF) documents by parsing and removing RTF control codes and formatting directives. It solves the problem of processing medical and other documents that are commonly stored in RTF format but need to be converted to plain text for further analysis or storage.

The library provides a single primary function, rtf_to_text(), which accepts an RTF-encoded string and returns plain text. It supports customizable character encoding (defaulting to cp1252) and error handling modes, allowing users to work around encoding issues that may arise from malformed or non-standard RTF input. With no external runtime dependencies, it installs and runs with minimal friction.

Use it for:

  • Extract text from medical documents stored in RTF format for downstream NLP or data analysis
  • Batch convert legacy RTF files to plain text for archival or migration to modern formats
  • Parse RTF content in data pipelines where only plain text is needed, discarding formatting
  • Handle encoding edge cases in RTF files using custom encoding parameters or error modes
  • Integrate RTF-to-text conversion into document processing workflows without heavy dependencies

Worth the install?

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

Converts Rich Text Format (RTF) files to plain text, stripping formatting and control codes to produce readable output suitable for parsing and processing.

Yes. striprtf is a focused, dependency-free tool for a specific problem (RTF-to-text conversion) with active maintenance, permissive licensing, and no known vulnerabilities. Install it if you need to process RTF files; skip it if your documents are already in plain text or modern formats.

Install

striprtf on PyPI

pip

pip install striprtf

uv

uv add striprtf

poetry

poetry add striprtf

Installing striprtf

Before you install

Low install friction with no runtime dependencies. Actively maintained with recent commits and a stable release history since 2018. Supports current Python versions (3.8+).

License in practice

BSD-3-Clause permissive license allows commercial and private use with minimal restrictions, requiring only license and copyright notice preservation.

Quickstart

pip install striprtf

from striprtf.striprtf import rtf_to_text
rtf = "some rtf encoded string"
text = rtf_to_text(rtf)
print(text)

Verify before relying

  • Whether encoding parameter behavior differs meaningfully across Python versions or RTF variants
  • Performance characteristics on large RTF files or batch processing scenarios
  • Completeness of RTF standard coverage (which RTF features are preserved vs. stripped)

Package facts

License BSD-3-Clause (permissive)
Python support supports the current Python release (>=3.8)
Install friction low — pure-Python wheel
Runtime dependencies none
Maintenance actively maintained — 109 days since the last release
Last repo commit
First released
Downloads 7,543,370/month — #1,723 on PyPI (30-day window, as of 2026-08-14)
Known vulnerabilities none known (OSV.dev, checked 2026-08-14)

Evidence: striprtf-0.0.32-py3-none-any.whl

Keywords: rtf

License :: OSI Approved :: BSD License

Tags

rtf to text conversionstrip rtf formattingconvert rtf filesrtf parserremove rtf markuprtf decoderplain text from rtf
document-conversiontext-extractionrtf-parsing

More Text Processing packages