GitHub - pycompression/python-zlib-ng: A drop-in replacement for Python's zlib and gzip modules using zlib-ng (original) (raw)

python-zlib-ng

Faster zlib and gzip compatible compression and decompression by providing Python bindings for the zlib-ng library.

This package provides Python bindings for the zlib-ng library.

python-zlib-ng provides the bindings by offering three modules:

zlib_ng and gzip_ng are almost fully compatible with zlib andgzip from the Python standard library. There are some minor differences see: differences-with-zlib-and-gzip-modules.

Quickstart

The python-zlib-ng modules can be imported as follows

from zlib_ng import zlib_ng from zlib_ng import gzip_ng from zlib_ng import gzip_ng_threaded

zlib_ng and gzip_ng are meant to be used as drop in replacements so their api and functions are the same as the stdlib's modules.

A full API documentation can be found on our readthedocs page.

python -m zlib_ng.gzip_ng implements a fully featured gzip-like command line application (just like python -m gzip, but better). Full usage documentation can be found on our readthedocs page.

Installation

Installation is supported on Linux, Windows and MacOS. For more advanced installation options check the documentation.

python-zlib-ng as a dependency in your project

zlib-ng supports numerous platforms but not all of these have pre-built wheels available. To prevent your users from running into issues when installing your project please list a python-zlib-ng dependency as follows.

setup.cfg:

install_requires = zlib-ng; platform.machine == "x86_64" or platform.machine == "AMD64"

setup.py:

extras_require={ ":platform.machine == 'x86_64' or platform.machine == 'AMD64'": ['zlib-ng'] },

Differences with zlib and gzip modules

Contributing

Please make a PR or issue if you feel anything can be improved. Bug reports are also very welcome. Please report them on the github issue tracker.

Acknowledgements

This project builds upon the software and experience of many. Many thanks to: