Compression Tool is a tool prepared using Leveraging Huffman coding, it efficiently compresses files, optimizing storage and enhancing data management using Python .
This tool is in Python , so please ensure that you have latest Python version installed in your devicestep 1: git clone https://github.com/priyapatelsp/CompressionTool.git
step 2: Follow the below steps to start the program
Please type the below command to execute this python programStep 1: Navigate to the location of the folder and then type below code(since I've used Python3)
Python3
Step 2: Then import the compressionTool
from compressionTool import CompressionTool
Step 3: Define a path variable - it's the location of the text file you need to compress.
path="{PATH OF THE TEXT FILE YOU NEED TO COMPRESS}"
Step 4: Make an object for compression tool
compressionObj=CompressionTool(path)
Step 5: Call the function to compress the file
compressionObj.compress()
You will get the path of compressed file, you can observe the decresed file size. To get it decompressed and open the file you can follow below steps
Step 1: Define a path variable - it's the location of the compressed text file.
pathCompressedFile="{PATH OF THE COMPRESSED .BON FILE YOU GOT}"
Step 2:Call the function to compress the file on terminal after following above steps
compressionObj.decompress(pathCompressedFile)
huffman-coding-using-priority-queue
huffman-coding-python
Priya Patel
Github : priyapatelsp