skillfed

compressed-rtf

Compressed Rich Text Format (RTF) compression and decompression package

compressed-rtf v1.0.7 6.7M downloads/30d#1,866 on PyPI25
Permissive license MIT AGING released

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-rtf

uv

uv add compressed-rtf

poetry

poetry add compressed-rtf

Installing 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

Development Status :: 5 - Production/StableEnvironment :: ConsoleEnvironment :: Win32 (MS Windows)Operating System :: Microsoft :: WindowsOperating System :: POSIX :: LinuxProgramming Language :: Python :: 2.7Programming Language :: Python :: 3Topic :: System :: Archiving :: CompressionTopic :: Text Processing

Tags

rtf compression decompressionlzfu compressioncompressed rtf formatrtf lzfu encoder decodermicrosoft rtf compressionmela rtf compression
rtf-compressionlzfu-codecdocument-processing

More Text Processing packages