
Security News
Official Go SDK for MCP in Development, Stable Release Expected in August
The official Go SDK for the Model Context Protocol is in development, with a stable, production-ready release expected by August 2025.
.. image:: https://img.shields.io/pypi/v/zlib-ng.svg :target: https://pypi.org/project/zlib-ng/ :alt:
.. image:: https://img.shields.io/conda/v/conda-forge/python-zlib-ng.svg :target: https://github.com/conda-forge/python-zlib-ng-feedstock :alt:
.. image:: https://img.shields.io/pypi/pyversions/zlib-ng.svg :target: https://pypi.org/project/zlib-ng/ :alt:
.. image:: https://img.shields.io/pypi/l/zlib-ng.svg :target: https://github.com/pycompression/python-zlib-ng/blob/main/LICENSE :alt:
.. image:: https://img.shields.io/conda/pn/conda-forge/python-zlib-ng.svg :target: https://github.com/conda-forge/python-zlib-ng-feedstock :alt:
.. image:: https://github.com/pycompression/python-zlib-ng//actions/workflows/ci.yml/badge.svg :target: https://github.com/pycompression/python-zlib-ng/actions :alt:
.. image:: https://codecov.io/gh/pycompression/python-zlib-ng/branch/develop/graph/badge.svg :target: https://codecov.io/gh/pycompression/python-zlib-ng :alt:
.. image:: https://readthedocs.org/projects/python-zlib-ng/badge :target: https://python-zlib-ng.readthedocs.io :alt:
.. introduction start
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 <https://github.com/zlib-ng/zlib-ng>
_ library.
python-zlib-ng
provides the bindings by offering three modules:
zlib_ng
: A drop-in replacement for the zlib module that uses zlib-ng to
accelerate its performance.
gzip_ng
: A drop-in replacement for the gzip module that uses zlib_ng
instead of zlib
to perform its compression and checksum tasks, which
improves performance.
gzip_ng_threaded
offers an open
function which returns buffered read
or write streams that can be used to read and write large files while
escaping the GIL using one or multiple threads. This functionality only
works for streaming, seeking is not supported.
zlib_ng
and gzip_ng
are almost fully compatible with zlib
and
gzip
from the Python standard library. There are some minor differences
see: differences-with-zlib-and-gzip-modules_.
.. introduction end
.. quickstart start
The python-zlib-ng modules can be imported as follows
.. code-block:: python
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 <https://python-zlib-ng.readthedocs.io>
_.
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 <https://python-zlib-ng.readthedocs.io>
_.
.. quickstart end
pip install zlib-ng
conda install python-zlib-ng
Installation is supported on Linux, Windows and MacOS. For more advanced
installation options check the documentation <https://python-zlib-ng.readthedocs.io/en/stable/index.html#installation>
_.
.. dependency start
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']
},
.. dependency end
.. _differences-with-zlib-and-gzip-modules:
.. differences start
gzip_ng.open
returns a class GzipNGFile
instead of GzipFile
. Since
there are differences between the compressed ratios between levels, a
difference in naming was chosen to reflect this.
gzip_ng.GzipFile
does exist as an alias of
gzip_ng.GzipNGFile
for compatibility reasons... differences end
.. contributing start
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 <https://github.com/rhpvorderman/python-zlib-ng/issues>
_.
.. contributing end
.. acknowledgements start
This project builds upon the software and experience of many. Many thanks to:
zlib-ng contributors <https://github.com/zlib-ng/zlib-ng/graphs/contributors>
_ for making the
zlib-ng library.CPython contributors <https://github.com/python/cpython/graphs/contributors>
_.
Python-zlib-ng mimicks zlibmodule.c
and gzip.py
from the standard
library to make it easier for python users to adopt it.github actions team <https://github.com/orgs/actions/people>
_ for
creating the actions CI service that enables building and testing on all
three major operating systems... acknowledgements end
FAQs
Drop-in replacement for zlib and gzip modules using zlib-ng
We found that zlib-ng demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 2 open source maintainers collaborating on the project.
Did you know?
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.
Security News
The official Go SDK for the Model Context Protocol is in development, with a stable, production-ready release expected by August 2025.
Security News
New research reveals that LLMs often fake understanding, passing benchmarks but failing to apply concepts or stay internally consistent.
Security News
Django has updated its security policies to reject AI-generated vulnerability reports that include fabricated or unverifiable content.