tcmpr.algorithms.lzw package

Submodules

tcmpr.algorithms.lzw.compressor module

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

tcmpr.algorithms.lzw.compressor.compress_lzw(input_file)[source]

Function compress input file and create new compressed file with extension “.lzw” (for decompression purposes) in place of use. Algorithm create dictionary of encoding base on input file and frequent subsequence of chars. :param input_file: :return: compressed file path

tcmpr.algorithms.lzw.compressor.encode_data(data)[source]

Create dictionary base on input data and encode data and look for frequent subsequences and assign them to proper codes in dictionary. :param data: :return:

tcmpr.algorithms.lzw.decompressor module

This module is responsible for implementing LZW CODING algorithm which can be used to decompress input file with extension “.lzw”.

class tcmpr.algorithms.lzw.decompressor.Step[source]

Bases: object

get_step()[source]
set_step(step)[source]
tcmpr.algorithms.lzw.decompressor.decode_codes(codes)[source]
tcmpr.algorithms.lzw.decompressor.decompress_lzw(input_file)[source]

Function to decompress input file with extension “.lzw”

Module contents