Skip to content

Latest commit

 

History

History
39 lines (30 loc) · 1.05 KB

README.md

File metadata and controls

39 lines (30 loc) · 1.05 KB

PyHuff

PyPI format

Description

This package allows its users to shrink any ASCII based file using Huffman Code algorithm.


Installing

PyHuff is available in PyPi:

$ pip install pyhuff

Usage

To shrink a file named example.txt:

$ pyhuff example.txt

Two files will be created:

  • example.huff: the encoded file
  • example.tree.huff: the huffman tree used to encode the file

To restore the original file:

$ pyhuff example.huff example.tree.huff decoded_example.txt

In the example above, the decoded file will be created as decoded_example.txt. You can pass any filename as argument. Notice that, if the given file already exists, it will be overwritten.

To get help, simply call:

$ pyhuff

created by Durval Carvalho and Victor Moura