Skip to main content

Huffman compression and decompression (Pure Python implementation)

Reason this release was yanked:

Typo & Bug when installing & Bug when using

Project description


Usage

from pyhuff import compress
text=b'A'*100
print(text) # b'AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA'
comp=compress(text)
print(comp) # b'\x041\x00A\x010\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00'

Or use:

pyhuff compress in.txt out.bin
pyhuff decompress out.bin dec.txt

Disadvantages

  1. The code is very messy because of compatibility of Python 2 (And I don't know the six package).
  2. Decompression is very slow.
  3. Not very good, sometimes the compressed file is larger than the original one.

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

PythonHuff-1.0.0.tar.gz (3.5 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

PythonHuff-1.0.0-py3-none-any.whl (4.0 kB view details)

Uploaded Python 3

File details

Details for the file PythonHuff-1.0.0.tar.gz.

File metadata

  • Download URL: PythonHuff-1.0.0.tar.gz
  • Upload date:
  • Size: 3.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.7.0

File hashes

Hashes for PythonHuff-1.0.0.tar.gz
Algorithm Hash digest
SHA256 091a4f9f471ba3a824d4c47577c81559013762e80fd91c55f6aca4d1ade563f9
MD5 4dad750e6808bcdf4060614280165c88
BLAKE2b-256 1c25cd8907d019afaee18ad00f4534dd0317fe1471612e71f64bbec8aa642a5c

See more details on using hashes here.

File details

Details for the file PythonHuff-1.0.0-py3-none-any.whl.

File metadata

  • Download URL: PythonHuff-1.0.0-py3-none-any.whl
  • Upload date:
  • Size: 4.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.7.0

File hashes

Hashes for PythonHuff-1.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 cfba9cb240ead821ac40cb9fcffa7222e45bb806e4e579f34228eec57d9d8afa
MD5 e3ef60af68d58db4a63edf806a2d6116
BLAKE2b-256 44e23f549a93fcaacc10fce73c0472042151cd3e90f7c94521a6a7db5731e366

See more details on using hashes here.

Supported by

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