Compressor and decompressor for arbitrary files that use LZW algorithm
Project description
Compressor and decompressor that uses LZW algorithm written in Python3.
REQUIREMENTS
Requires at least Python 3.5.
INSTALLATION
pip install lzw3
USAGE
Two scripts will be installed in your local binary path (e.g. /home/user/.local/bin): compress and uncompress. If you want to invoke these scripts, ensure that your $PATH contains the python binary path Note that this compressor just compress regular files (i.e. doesn’t create an archive such as .zip or .tar.gz). Anyhow, directory can still be compressed using the option: -r
Compression
The compression phases replaces the original files with the compressed ones, appending the extension “.Z”
Compress a list of files:
python3 -m lzw3.compressor doc1.txt doc2.txt
Compress a directory recursively
python3 -m lzw3.compressor -r /home/user/Docs/Project
Alternatively you can user the compress script as follows:
compress doc1.txt doc2.txt
Options
-r Recursively compress the files inside the directories within the given file list. If not specified, directories in the file list are skipped. -v Prints information about the handled files and the percentage of saved space for each compressed file. -t Prints the time spent for compress each file. -k Keeps the original files instead of replace those with the compressed ones. -d Prints debug messages.
Decompression
The decompression phases replaces the compressed files (with extension “.Z”) with the uncompressed ones.
Decompress a list of files
python3 -m lzw3.decompressor doc1.txt.Z doc2.txt.Z
Decompress a directory recursively
python3 -m lzw3.decompressor -r /home/user/Docs/Project
Alternatively you can user the uncompress script as follows:
uncompress doc1.txt.Z doc2.txt.Z
Options
-r Recursively decompress the files inside the directories within the given file list. If not specified, directories in the file list are skipped. -v Prints information about the handled files. -t Prints the time spent for decompress each file. -k Keeps the decompressed files after the decompression. -d Prints debug messages.
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file lzw3-0.3.tar.gz
.
File metadata
- Download URL: lzw3-0.3.tar.gz
- Upload date:
- Size: 15.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/1.13.0 pkginfo/1.5.0.1 requests/2.21.0 setuptools/40.8.0 requests-toolbelt/0.9.1 tqdm/4.31.1 CPython/3.5.3
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 43f63b92c0ae8b51f84442a327a0b679e891b0b35698a1976206a52f055c9666 |
|
MD5 | fb2181b83ad687b35be2fe22ed87275b |
|
BLAKE2b-256 | 9c3c04c1cd4ae3d2c9bc97fd66850c96a7dd7579eb5755b3805d9bf9442cb3df |
File details
Details for the file lzw3-0.3-py3-none-any.whl
.
File metadata
- Download URL: lzw3-0.3-py3-none-any.whl
- Upload date:
- Size: 21.2 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/1.13.0 pkginfo/1.5.0.1 requests/2.21.0 setuptools/40.8.0 requests-toolbelt/0.9.1 tqdm/4.31.1 CPython/3.5.3
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 0b22a0597161527d57ef1dc3201e211c557134fcffc1e4b3c67e99940fe8d84d |
|
MD5 | 23d969e8a80cf8c3716abd915f305982 |
|
BLAKE2b-256 | b57a4035cb1707145d2dc00981715605b86f43b3765f607e65f2120577d72a02 |