zlib-rust
Python bindings for the Trifecta Tech Foundation's
zlib-rs, a fast Rust
implementation of zlib.
The foundation develops and maintains zlib-rs as part of its data compression initiative. The compression engine, its optimizations, and its Rust API are their work. This package brings that work to Python, with a familiar interface and installable wheels, independently of the library your Python distributor chose.
How to use
pip install zlib-rust
The public API follows Python's standard-library zlib module. The package
imports as zlib_rust, so switching your own code is explicit:
import zlib_rust as zlib
compressed = zlib.compress(b"hello")
assert zlib.decompress(compressed) == b"hello"
Streaming compression and decompression use compressobj() and
decompressobj(). Raw DEFLATE, zlib, and gzip streams are supported through
the usual wbits parameter. Streaming decompression supports max_length
to bound the output of each call.
For gzip files, use the familiar GzipFile and open() interfaces:
from zlib_rust.gzip import GzipFile
with GzipFile("events.gz", "wb") as stream:
stream.write(b"hello\n")
The file-handling code comes from CPython's gzip module, using zlib-rs for compression, decompression, and checksums. Both checksum-combine functions are available on every supported Python version.
The binding forbids unsafe Rust and releases the GIL during codec operations. Package versions follow the pinned zlib-rs crate version.
__version__ identifies this Python package; ZLIB_RS_VERSION identifies the
pinned Rust engine. ZLIB_VERSION and ZLIB_RUNTIME_VERSION follow zlib-rs's
zlibVersion() convention:
1.3.0-zlib-rs-0.6.9 identifies both its zlib API compatibility level and its
Rust release. They are equal because the engine is linked into the wheel;
there is no separately loaded zlib library or C header version.
Python 3.16's zlib_version alias and four-field ZLIB_VERSION_INFO and
zlib_version_info named tuples are also available on older Python versions.
CPython's unrelated, fixed zlib.__version__ == "1.0" is
deprecated from Python 3.15.
It is not the compression library's version. This independently released
package keeps its own version in __version__ without that deprecation.
Development
Install Rust 1.85 or newer and Python 3.11 or newer. Build a wheel with
maturin build --release --locked, install it into your development
environment, then run pytest.
This package was built with heavy use of LLMs. Its tests combine CPython's zlib and gzip suites with interoperability tests against the standard-library codec and tests for the Python binding. Imported tests retain their source references and documented adaptations.
The Trifecta Tech Foundation's work makes this package possible. You can support the foundation to help sustain zlib-rs and its other public-interest infrastructure projects.
Alternatives (Python 3.16, conditions apply)
From Python 3.16 onwards you can also use zlib-rs through Python's
standard-library zlib module. CPython 3.16 adds a --with-zlib=zlib-rs
build option.
That's great, but Python 3.16 doesn't exist yet, and you'd depend on the choices of your Python distributor (often: Linux distributions, container images, or Python installers).
This package lets you select zlib-rs for your own code while using an existing Python installation, including older Python versions.
Metadata
Release files for zlib-rust 0.6.9.post1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| zlib_rust-0.6.9.post1.tar.gz | 345.2 kB | With provenance | Details for zlib_rust-0.6.9.post1.tar.gz |
Built distributions (wheels)
Total release size: 4.1 MB
Release files / zlib_rust-0.6.9.post1.tar.gz
| Download URL | zlib_rust-0.6.9.post1.tar.gz |
|---|---|
| Size | 345.2 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
8d7e4c8fb8b540f559a33c90588bf3c62846b8cb1c799a393ea9665e268d29a2
|
|
BLAKE2b-256 checksum How to use checksums |
65eb08d8f734089d2c7ac99c123900b01a42a508c65f4cb7c86e700a7cec21bf
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.16
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Nov 26, 2026.
Transparency logRelease files / zlib_rust-0.6.9.post1-cp311-abi3-win_arm64.whl
| Download URL | zlib_rust-0.6.9.post1-cp311-abi3-win_arm64.whl |
|---|---|
| Size | 305.6 kB |
| Tags | CPython 3.11 Windows ARM64 abi3 |
|
SHA-256 checksum How to use checksums |
d7eff905178b0591824450b80516ac8aa3185e3733c98af471ab01181204e043
|
|
BLAKE2b-256 checksum How to use checksums |
0e14c3564e411c32602b0a14f37af71fa125985ac1f1bd3b6a9bd74e509e608c
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.16
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Nov 26, 2026.
Transparency logRelease files / zlib_rust-0.6.9.post1-cp311-abi3-win_amd64.whl
| Download URL | zlib_rust-0.6.9.post1-cp311-abi3-win_amd64.whl |
|---|---|
| Size | 316.2 kB |
| Tags | CPython 3.11 Windows x86-64 abi3 |
|
SHA-256 checksum How to use checksums |
4228f2a947d612a346c92107775ccdd58a6aa7945d29f147bd73817a4d6463fb
|
|
BLAKE2b-256 checksum How to use checksums |
632004a3d5d2235d51fac8d780e5cfe6a43bef15da99205e4ff6d692347d15c6
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.16
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Nov 26, 2026.
Transparency logRelease files / zlib_rust-0.6.9.post1-cp311-abi3-musllinux_1_2_x86_64.whl
| Download URL | zlib_rust-0.6.9.post1-cp311-abi3-musllinux_1_2_x86_64.whl |
|---|---|
| Size | 673.5 kB |
| Tags | CPython 3.11 Linux musl 1.2+ x86-64 abi3 |
|
SHA-256 checksum How to use checksums |
841a7deabd5197c64d19a64c55aff356fa35efced03c7503d5751b61cd2565a9
|
|
BLAKE2b-256 checksum How to use checksums |
79139afe04d6694668aac4c1124648857621662926f3dd03c0f5b51de6c1e354
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.16
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Nov 26, 2026.
Transparency logRelease files / zlib_rust-0.6.9.post1-cp311-abi3-musllinux_1_2_aarch64.whl
| Download URL | zlib_rust-0.6.9.post1-cp311-abi3-musllinux_1_2_aarch64.whl |
|---|---|
| Size | 638.4 kB |
| Tags | CPython 3.11 Linux musl 1.2+ ARM64 abi3 |
|
SHA-256 checksum How to use checksums |
892922fda0e658b4d9daac99cd8aad00b8b561997ce45eae2b9b05a22d7b4c2b
|
|
BLAKE2b-256 checksum How to use checksums |
30d93aae8586e360006958f708d4bbdbaae3dcb96be0325bb7fe29560d3a0b26
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.16
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Nov 26, 2026.
Transparency logRelease files / zlib_rust-0.6.9.post1-cp311-abi3-manylinux2014_x86_64.manylinux_2_17_x86_64.whl
| Download URL | zlib_rust-0.6.9.post1-cp311-abi3-manylinux2014_x86_64.manylinux_2_17_x86_64.whl |
|---|---|
| Size | 463.3 kB |
| Tags | CPython 3.11 Linux glibc 2.17+ x86-64 abi3 |
|
SHA-256 checksum How to use checksums |
82cc9eca94c53e0b98b984322fe4f99dccc7b686d29398bf55674169b9685302
|
|
BLAKE2b-256 checksum How to use checksums |
b62f194f98baad89f737755c8d8bc0a5ba38cb40912d7b244ac0a268c60dc159
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.16
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Nov 26, 2026.
Transparency logRelease files / zlib_rust-0.6.9.post1-cp311-abi3-manylinux2014_aarch64.manylinux_2_17_aarch64.whl
| Download URL | zlib_rust-0.6.9.post1-cp311-abi3-manylinux2014_aarch64.manylinux_2_17_aarch64.whl |
|---|---|
| Size | 463.2 kB |
| Tags | CPython 3.11 Linux glibc 2.17+ ARM64 abi3 |
|
SHA-256 checksum How to use checksums |
7f28b8b1fb6bb68bd0481563aecc8eb3a0975735192bd8cacfce3aafcc441806
|
|
BLAKE2b-256 checksum How to use checksums |
d4877c8a16922aabbc1c1af40a58964bbd08387066a38d5b0c7adb09d33f4ff3
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.16
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Nov 26, 2026.
Transparency logRelease files / zlib_rust-0.6.9.post1-cp311-abi3-macosx_11_0_arm64.whl
| Download URL | zlib_rust-0.6.9.post1-cp311-abi3-macosx_11_0_arm64.whl |
|---|---|
| Size | 421.0 kB |
| Tags | CPython 3.11 abi3 macOS 11.0+ ARM64 |
|
SHA-256 checksum How to use checksums |
fbc8308721ae4f055bb9e73addc8615008c769119e3b42bdad24220aa4ae6e57
|
|
BLAKE2b-256 checksum How to use checksums |
a56e8a0033439d9ee0851a7a6f7abfa39505a40e68d63b255bfc1894aeab63ad
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.16
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Nov 26, 2026.
Transparency logRelease files / zlib_rust-0.6.9.post1-cp311-abi3-macosx_10_12_x86_64.whl
| Download URL | zlib_rust-0.6.9.post1-cp311-abi3-macosx_10_12_x86_64.whl |
|---|---|
| Size | 427.9 kB |
| Tags | CPython 3.11 abi3 macOS 10.12+ x86-64 |
|
SHA-256 checksum How to use checksums |
f9ce4755d7efeee6e5b96f2e1dc9143d95a3b2ac34b825f676b89314cee41166
|
|
BLAKE2b-256 checksum How to use checksums |
f446a8b21d3825071a6458290bf8ab3cdff2583723a59b855064263151719f97
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.16
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Nov 26, 2026.
Transparency logSecurity for zlib-rust 0.6.9.post1
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
Full provenance
All 9 files in this release have been uploaded with provenance metadata.
Attestation for zlib_rust-0.6.9.post1.tar.gz
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Nov 26, 2026.
Transparency logA note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.