---
title: "compressed-rtf | pypx"
description: "Compressed Rich Text Format (RTF) compression and decompression package"
canonical_url: "https://pypx.app/packages/compressed-rtf"
meta:
  "og:description": "Compressed Rich Text Format (RTF) compression and decompression package"
  "og:image": "https://pypx.app/_og/d/h_630%2Cc_PackageCard%2Cname_compressed-rtf%2Cversion_1.0.7%2Csummary_Compressed%2BRich%2BText%2BFormat%2B(RTF)%2Bcompression%2Band%2Bdecompression%2Bpackage%2Clicense_MIT%2Cp_Ii9wYWNrYWdlcy9jb21wcmVzc2VkLXJ0ZiI%2Cs_Km8mIBmb3J9GkHhw.png"
  "og:image:height": "630"
  "og:image:type": image/png
  "og:image:width": "1200"
  "og:title": "compressed-rtf 1.0.7"
  "twitter:image": "https://pypx.app/_og/d/h_630%2Cc_PackageCard%2Cname_compressed-rtf%2Cversion_1.0.7%2Csummary_Compressed%2BRich%2BText%2BFormat%2B(RTF)%2Bcompression%2Band%2Bdecompression%2Bpackage%2Clicense_MIT%2Cp_Ii9wYWNrYWdlcy9jb21wcmVzc2VkLXJ0ZiI%2Cs_Km8mIBmb3J9GkHhw.png"
---

> Index of every page on this site: [llms.txt](https://pypx.app/llms.txt)

# **compressed-rtf**

v1.0.7

Compressed Rich Text Format (RTF) compression and decompression package

8 KBpy3-none-anyMIT

[**Diff **](https://pypx.app/packages/compressed-rtf/diff)

`$ uv add compressed-rtf`

# compressed\_rtf

[![PyPI](https://img.shields.io/pypi/v/compressed_rtf)](https://pypi.org/project/compressed-rtf/) [![Build Status](https://travis-ci.org/delimitry/compressed_rtf.svg?branch=master)](https://travis-ci.org/delimitry/compressed_rtf) [![Coverage Status](https://coveralls.io/repos/github/delimitry/compressed_rtf/badge.svg?branch=master)](https://coveralls.io/github/delimitry/compressed_rtf?branch=master) [![MIT license](http://img.shields.io/badge/license-MIT-brightgreen.svg)](https://github.com/delimitry/compressed_rtf/blob/master/LICENSE)

Compressed Rich Text Format (RTF) compression worker in Python

## Description:

Compressed RTF also known as "LZFu" compression format

Based on Rich Text Format (RTF) Compression Algorithm:

https://msdn.microsoft.com/en-us/library/cc463890(v=exchg.80).aspx

## Usage example:

```
>>> from compressed_rtf import compress, decompress
>>>
>>> data = '{\\rtf1\\ansi\\ansicpg1252\\pard test}'
>>> comp = compress(data, compressed=True)  # compressed
>>> comp
'#\x00\x00\x00"\x00\x00\x00LZFu3\\\xe8t\x03\x00\n\x00rcpg125\x922\n\xf3 t\x07\x90t}\x0f\x10'
>>>
>>> raw = compress(data, compressed=False)  # raw/uncompressed
>>> raw
'.\x00\x00\x00"\x00\x00\x00MELA \xdf\x12\xce{\\rtf1\\ansi\\ansicpg1252\\pard test}'
>>>
>>> decompress(comp)
'{\\rtf1\\ansi\\ansicpg1252\\pard test}'
>>>
>>> decompress(raw)
'{\\rtf1\\ansi\\ansicpg1252\\pard test}'
>>>
```

## License:

Released under [The MIT License](https://github.com/delimitry/compressed_rtf/blob/master/LICENSE).

## **Details **

<dl>

<dt>Version</dt>
<dd>1.0.7</dd>

<dt>License</dt>
<dd>MIT</dd>

<dt>Maintainer</dt>
<dd>Dmitry Alimov</dd></dl>

## **Links**

- [Homepage](https://github.com/delimitry/compressed_rtf)
- [View on PyPI](https://pypi.org/project/compressed-rtf/)

## **Maintainers **

- Dmitry Alimov

```json
{"@context":"https://schema.org","@graph":[{"@id":"https://pypx.app/#website","@type":"WebSite","description":"The Python Package Index, reimagined. Fast search, dependency insights, download trends, and changelogs — all in one place.","name":"pypx","url":"https://pypx.app/"},{"@id":"https://pypx.app/packages/compressed-rtf#webpage","@type":"WebPage","description":"Compressed Rich Text Format (RTF) compression and decompression package","name":"compressed-rtf","url":"https://pypx.app/packages/compressed-rtf","isPartOf":{"@id":"https://pypx.app/#website"},"potentialAction":[{"@type":"ReadAction","target":["https://pypx.app/packages/compressed-rtf"]}]},{"@id":"https://pypx.app/packages/compressed-rtf#/schema/software-application/1","@type":"SoftwareApplication","applicationCategory":"DeveloperApplication","description":"Compressed Rich Text Format (RTF) compression and decompression package","license":"MIT","name":"compressed-rtf","softwareVersion":"1.0.7"}]}
```

## Sitemap

See the full [sitemap](https://pypx.app/sitemap.md) for all pages.
