compressed-rtf
Compressed Rich Text Format (RTF) compression and decompression package
What it is and what it does
compressed_rtf is a Python implementation of the LZFu compression algorithm used by Microsoft for Rich Text Format data. It provides two functions—compress() and decompress()—to encode and decode RTF streams according to the Microsoft RTF Compression Algorithm specification. The package has no runtime dependencies and works on both Windows and POSIX systems.
The library is useful when working with RTF data that has been compressed using the Microsoft format, such as email attachments or Office document streams. It implements both the compressed (LZFu) and raw (MELA) encoding variants, allowing round-trip conversion between compressed and decompressed RTF representations.
Use it for:
- Decompress RTF data embedded in Microsoft Exchange or Outlook email messages
- Convert between compressed and uncompressed RTF formats for document processing
- Extract readable RTF content from binary streams that use LZFu compression
- Integrate RTF compression/decompression into document conversion pipelines
Worth the install?
AI-flagged interpretation of the facts on this page — verify before relying
Compresses and decompresses Rich Text Format (RTF) data using the LZFu compression algorithm, implementing the Microsoft RTF Compression format.
Yes, if you need to work with Microsoft-compressed RTF data. The package is stable, has no dependencies, and carries permissive licensing. However, maintenance is aging with no recent updates; verify that it meets your RTF variant requirements before relying on it for new projects.
Install
compressed-rtf on PyPI
pip
pip install compressed-rtfuv
uv add compressed-rtfpoetry
poetry add compressed-rtfInstalling compressed-rtf
Before you install
Low install friction with no runtime dependencies. Maintenance is aging—last commit was 2025-06-29, but the package remains in production/stable status with no recent activity.
License in practice
MIT license permits commercial and private use with minimal restrictions, requiring only attribution and inclusion of the license notice.
Quickstart
from compressed_rtf import compress, decompress
data = '{\\rtf1\\ansi\\ansicpg1252\\pard test}'
compressed = compress(data, compressed=True)
original = decompress(compressed)
Verify before relying
- Whether the package handles edge cases or malformed RTF data gracefully
- Performance characteristics on large RTF documents
- Compatibility with modern RTF variants beyond the MSDN specification
Package facts
| License | MIT (permissive) |
| Python support | not specified |
| Install friction | low — pure-Python wheel |
| Runtime dependencies | none |
| Maintenance | aging — 508 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 6,711,619/month — #1,866 on PyPI (30-day window, as of 2026-08-14) |
| Known vulnerabilities | none known (OSV.dev, checked 2026-08-14) |
Evidence: compressed_rtf-1.0.7-py3-none-any.whl
Keywords: compressed-rtf, lzfu, mela, rtf
Tags
More Text Processing packages
A drop-in replacement for Python's standard…
permissive · top 100 on PyPI
pyparsingpyparsing provides a library for building text…
permissive · top 1,000 on PyPI
docutilsDocutils converts plaintext documentation in…
unclear · top 1,000 on PyPI
RapidFuzzRapidFuzz provides fast fuzzy string matching…
permissive · top 1,000 on PyPI
tinycss2tinycss2 parses CSS strings into token and…
permissive · top 1,000 on PyPI
llama-parseLlamaParse parses complex documents (PDFs,…
permissive · top 1,000 on PyPI
rtfparseParses Microsoft Rich Text Format (RTF)…
permissive · top 15,000 on PyPI
lzstringCompresses and decompresses text using the…
permissive · top 15,000 on PyPI
PyRTF3PyRTF3 generates Rich Text Format (RTF)…
copyleft · top 15,000 on PyPI
unlzw3Decompresses .Z files (Unix compress format)…
permissive · top 15,000 on PyPI
python-neo-lzfProvides fast compression and decompression of…
permissive · top 15,000 on PyPI
ncompressProvides LZW compression and decompression…
permissive · top 15,000 on PyPI
python-lzfProvides Python bindings to the liblzf…
permissive · top 15,000 on PyPI
listcrunchCompresses sequences of repeated values into a…
permissive · top 15,000 on PyPI
striprtfConverts Rich Text Format (RTF) files to plain…
permissive · top 5,000 on PyPI
xpress8xpress8 provides Python bindings to Microsoft's…
permissive · top 15,000 on PyPI