Getting Started

tcmpr is a text compression program that uses most popular lossless algorithms. It can compress using following algorithms:

  • Huffman coding
  • LZSS
  • LZW
  • Shannon coding

Note

It’s not the fastest program to compression, rather should be considered as demonstration of basic lossless algorithms.

Quick start

To install tcmpr use following command (assuming that you have pip installed):

$ pip install tcmpr

Compress file filename.txt with default algorithm (huffman coding):

$ tcmpr filename.txt

Decompress file filename.txt.huffman with appropriate algorithm based on extension (here .huffman):

$ tcmpr -d filename.txt.huffman

Parameters

Compress file filename.txt with chosen algorithm (here with huffman coding):

$ tcmpr -alg=huffman filename.txt

or

$ tcmpr --algorithm=huffman filename.txt

Help

Help can be invoked in following way: