This project was done as mini project. Here, Huffman algorithm is used to convert string to the Huffman codes and to compress/decompress a file.
-
Clone the repository
-
The program consists of two python files,
huffman.py
anduse.py
. To convert string to respective huffman code, runhuffman.py
. -
To compress a file, you can use
use.py
, the compress_decompress() function will perform compression and decompression simultaneously on the file ofpath
. the choose_own_file() will allow user to browse for a file and compress them. The mapping key will be stored inkey.json
file. Using the key, user can again choose the compressed file and decompress it sample file.