A minimalistic LZW implementation in Python 3, compatible with Unix compress program (typically .Z extension).
$ python3 lzw.py --help
usage: lzw.py [-h] [-d] [-o OUTPUT] INPUT
LZW Compress/Decompress
positional arguments:
INPUT Input file
optional arguments:
-h, --help show this help message and exit
-d, --decompress Decompress mode
-o OUTPUT, --output OUTPUT
Output file
$ python3 lzw.py -o test/output.txt.Z test/Lorem_Ipsum.txt
$ sudo apt install ncompress
$ compress -d test/output.txt.Z
GPL-3.0