Skip to main content

Compressed Rich Text Format (RTF) compression and decompression package

Project description

compressed_rtf

PyPI Build Status Coverage Status MIT 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.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

compressed_rtf-1.0.7.tar.gz (8.2 kB view details)

Uploaded Source

Built Distribution

compressed_rtf-1.0.7-py3-none-any.whl (8.0 kB view details)

Uploaded Python 3

File details

Details for the file compressed_rtf-1.0.7.tar.gz.

File metadata

  • Download URL: compressed_rtf-1.0.7.tar.gz
  • Upload date:
  • Size: 8.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.9.19

File hashes

Hashes for compressed_rtf-1.0.7.tar.gz
Algorithm Hash digest
SHA256 7c30859334839f3cdc7d10796af5b434bb326b9df7cb5a65e95a8eacb2951b0e
MD5 e81c0293d9f5b27f2023cf881998ab98
BLAKE2b-256 b70c929a4e8ef9d7143f54d77dadb5f370cc7b98534b1bd6e1124d0abe8efb24

See more details on using hashes here.

File details

Details for the file compressed_rtf-1.0.7-py3-none-any.whl.

File metadata

  • Download URL: compressed_rtf-1.0.7-py3-none-any.whl
  • Upload date:
  • Size: 8.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.9.19

File hashes

Hashes for compressed_rtf-1.0.7-py3-none-any.whl
Algorithm Hash digest
SHA256 b7904921d78c67a0a4b7fff9fb361a00ae2b447b6edca010ce321cd98fa0fcc0
MD5 7ca188f7aa6eff54497bf1e5618b6d23
BLAKE2b-256 071d62f5bf92e12335eb63517f42671ed78512d48bbc69e02a942dd7b90f03f0

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page