tcmpr.algorithms.huffman package

Submodules

tcmpr.algorithms.huffman.compressor module

This module is responsible for implementing HUFFMAN CODING algorithm which can be used to compressing input file.

tcmpr.algorithms.huffman.compressor.build_binary_tree(frequencies)[source]

Function to create binary huffman tree based on counted frequencies in input data

tcmpr.algorithms.huffman.compressor.compress_huffman(input_file)[source]

Function compress input file and create new compressed file in the same folder (or in defined output path). Algorithm uses a priority queue where the node with lowest probability (frequency) is given highest priority. :param: input_file, :return: compressed output file path

tcmpr.algorithms.huffman.compressor.put_frequencies_into_priority_queue(frequencies)[source]

Create PriorityQueue and put there frquencies

tcmpr.algorithms.huffman.decompressor module

tcmpr.algorithms.huffman.decompressor.decompress_huffman(input_file)[source]

Module contents