Metadata-Version: 2.4
Name: compressed-rtf
Version: 1.0.7
Summary: Compressed Rich Text Format (RTF) compression and decompression package
Home-page: https://github.com/delimitry/compressed_rtf
Author: Dmitry Alimov
License-Expression: MIT
Project-URL: Homepage, https://github.com/delimitry/compressed_rtf
Keywords: compressed-rtf,lzfu,mela,rtf
Classifier: Development Status :: 5 - Production/Stable
Classifier: Environment :: Console
Classifier: Environment :: Win32 (MS Windows)
Classifier: Operating System :: Microsoft :: Windows
Classifier: Operating System :: POSIX :: Linux
Classifier: Programming Language :: Python :: 2.7
Classifier: Programming Language :: Python :: 3
Classifier: Topic :: System :: Archiving :: Compression
Classifier: Topic :: Text Processing
Description-Content-Type: text/markdown
License-File: LICENSE
Dynamic: home-page
Dynamic: license-file
# compressed_rtf
[](https://pypi.org/project/compressed-rtf/)
[](https://travis-ci.org/delimitry/compressed_rtf)
[](https://coveralls.io/github/delimitry/compressed_rtf?branch=master)
[](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:
--------------
```python
>>> 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).