Pure Python decompression module for .Z files compressed using Unix compress utility
Project description
unlzw3
Pure Python decompression module for .Z files compressed using Unix compress utility.
Unlike the faster but Linux-specific
unlzw
using Python CFFI, unlzw3 is slower but works on any platform that runs Python including Windows.
This is a purely Python adaptation of Mark Adler's 'unlzw' C function on Stackoverflow. Python can be much slower than using any compiled utility for the same purpose.
Usage
unlzw3.unlzw(data) takes LZW .Z compressed data as any type which can be converted to a bytearray (generally a string).
It returns a UTF-8 decoded string containing the decompressed data.
import unlzw3
from pathlib import Path
uncompressed_data = unlzw3.unlzw(Path('file.Z').read_bytes())
# or
uncompressed_data = unlzw3.unlzw(Path('file.Z'))
Contributions
- reference C code: Mark Adler
- pure Python implemetation: Brandon Owen
- modernization, test / CI and PyPi: Michael Hirsch
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
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file unlzw3-0.2.2.tar.gz.
File metadata
- Download URL: unlzw3-0.2.2.tar.gz
- Upload date:
- Size: 5.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.10.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
d037a9b6823d1a455d6de1e0258af8c0f5dbf40aba3b19cc514448e78da77062
|
|
| MD5 |
e8612f0e9e505896bc75ab6518dc05da
|
|
| BLAKE2b-256 |
f1d4cb866f43d87a6b35caef7f8ca51558f531d1efb2742bb2c77be0e8cd9dae
|
File details
Details for the file unlzw3-0.2.2-py3-none-any.whl.
File metadata
- Download URL: unlzw3-0.2.2-py3-none-any.whl
- Upload date:
- Size: 6.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.10.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
f2a40fbd2a3c9648745227e5d269a851dbed7802999db4654d358a40a5d61c2f
|
|
| MD5 |
0b0aba78ecb2e124c7dc018f33e236cf
|
|
| BLAKE2b-256 |
6dfd185cc015344f10173afd8ed8c5b71cd5833e9782edccd31fe258834b9a58
|