You're Invited: Meet the Socket team at BSidesSF and RSAC - April 27 - May 1.RSVP
Socket
Sign inDemoInstall
Socket

unlzw3

Package Overview
Dependencies
Maintainers
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

unlzw3

Pure Python decompression module for .Z files compressed using Unix compress utility

0.2.3
PyPI
Maintainers
1

unlzw3

ci PyPi Download stats

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

Keywords

lzw

FAQs

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts