Skip to main content

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.

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)

You can also use zlib-rs through Python's standard-library zlib module. CPython 3.16 adds a --with-zlib=zlib-rs build option. Install zlib-rs's C-compatible library (version 0.6.0 or newer), make it discoverable through pkg-config as libz_rs, and compile CPython with that option. A Python distributor can provide such a build too. Then ordinary import zlib, including its use by gzip and zipfile, uses zlib-rs.

Python 3.16's final release is not scheduled until October 5, 2027. Even then, that choice belongs to the interpreter build. Your operating system, container image, or Python installer may choose another backend; installing an application dependency cannot change it. 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.8.post2

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for zlib-rust 0.6.8.post2
File Size Uploaded Provenance Actions
zlib_rust-0.6.8.post2.tar.gz 240.5 kB With provenance Details for zlib_rust-0.6.8.post2.tar.gz

Built distributions (wheels)

Table of built distributions (wheels) for zlib-rust 0.6.8.post2
File Actions
zlib_rust-0.6.8.post2-cp311-abi3-win_arm64.whl CPython 3.11 abi3 Windows ARM64 Details for zlib_rust-0.6.8.post2-cp311-abi3-win_arm64.whl
zlib_rust-0.6.8.post2-cp311-abi3-win_amd64.whl CPython 3.11 abi3 Windows x86-64 Details for zlib_rust-0.6.8.post2-cp311-abi3-win_amd64.whl
zlib_rust-0.6.8.post2-cp311-abi3-musllinux_1_2_x86_64.whl CPython 3.11 abi3 Linux musl 1.2+ x86-64 Details for zlib_rust-0.6.8.post2-cp311-abi3-musllinux_1_2_x86_64.whl
zlib_rust-0.6.8.post2-cp311-abi3-musllinux_1_2_aarch64.whl CPython 3.11 abi3 Linux musl 1.2+ ARM64 Details for zlib_rust-0.6.8.post2-cp311-abi3-musllinux_1_2_aarch64.whl
zlib_rust-0.6.8.post2-cp311-abi3-manylinux2014_x86_64.manylinux_2_17_x86_64.whl CPython 3.11 abi3 Linux glibc 2.17+ x86-64 Details for zlib_rust-0.6.8.post2-cp311-abi3-manylinux2014_x86_64.manylinux_2_17_x86_64.whl
zlib_rust-0.6.8.post2-cp311-abi3-manylinux2014_aarch64.manylinux_2_17_aarch64.whl CPython 3.11 abi3 Linux glibc 2.17+ ARM64 Details for zlib_rust-0.6.8.post2-cp311-abi3-manylinux2014_aarch64.manylinux_2_17_aarch64.whl
zlib_rust-0.6.8.post2-cp311-abi3-macosx_11_0_arm64.whl CPython 3.11 abi3 macOS 11.0+ ARM64 Details for zlib_rust-0.6.8.post2-cp311-abi3-macosx_11_0_arm64.whl
zlib_rust-0.6.8.post2-cp311-abi3-macosx_10_12_x86_64.whl CPython 3.11 abi3 macOS 10.12+ x86-64 Details for zlib_rust-0.6.8.post2-cp311-abi3-macosx_10_12_x86_64.whl

Total release size: 3.9 MB

Release files / zlib_rust-0.6.8.post2.tar.gz

Download URL zlib_rust-0.6.8.post2.tar.gz
Size 240.5 kB
Tags Source
SHA-256 checksum
How to use checksums
82bf46f059e187ac2aff0c5a0c76fd319af0aad6553ca221d616d8f4468ac0d6
BLAKE2b-256 checksum
How to use checksums
d7d8d08837cc8cd3102bc505a3d77d4acef1147d85ee910917f2b99082c10e4d
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 6, 2026.

Transparency log

Release files / zlib_rust-0.6.8.post2-cp311-abi3-win_arm64.whl

Download URL zlib_rust-0.6.8.post2-cp311-abi3-win_arm64.whl
Size 297.5 kB
Tags CPython 3.11 Windows ARM64 abi3
SHA-256 checksum
How to use checksums
732ac1f827d0826db71f0015574d737803953924c9bce5a73ffe192b26dac9d6
BLAKE2b-256 checksum
How to use checksums
c2b980b2cb99be2dfeb6448f97e12e5559f87a8c02d3cd9edeb52c1dca3bfb1f
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 6, 2026.

Transparency log

Release files / zlib_rust-0.6.8.post2-cp311-abi3-win_amd64.whl

Download URL zlib_rust-0.6.8.post2-cp311-abi3-win_amd64.whl
Size 311.0 kB
Tags CPython 3.11 Windows x86-64 abi3
SHA-256 checksum
How to use checksums
976caa2aab68b196dba7fe754c3b432e2e2a22a663156009ebccab12e885a7c3
BLAKE2b-256 checksum
How to use checksums
8760c64efa551633c850f11b13d33f9ef1d01b6107977930f01d6441b2f72ac7
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 6, 2026.

Transparency log

Release files / zlib_rust-0.6.8.post2-cp311-abi3-musllinux_1_2_x86_64.whl

Download URL zlib_rust-0.6.8.post2-cp311-abi3-musllinux_1_2_x86_64.whl
Size 668.9 kB
Tags CPython 3.11 Linux musl 1.2+ x86-64 abi3
SHA-256 checksum
How to use checksums
4ef82cba7fcd0f5d152dc9ae3ea1c472670160b773172e2b8b14f52c1a11e5a3
BLAKE2b-256 checksum
How to use checksums
64d512c3ff01ccd8f3f2b2b9278b15ec32dd1e578f7b094c0cbff70cce712322
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 6, 2026.

Transparency log

Release files / zlib_rust-0.6.8.post2-cp311-abi3-musllinux_1_2_aarch64.whl

Download URL zlib_rust-0.6.8.post2-cp311-abi3-musllinux_1_2_aarch64.whl
Size 631.7 kB
Tags CPython 3.11 Linux musl 1.2+ ARM64 abi3
SHA-256 checksum
How to use checksums
448c0b4593f964399051ac60f18160d08b92d4ed44b73865f7298225bf635c95
BLAKE2b-256 checksum
How to use checksums
56cda21751161d93a35bb7ebc16e1a9a09f638b4d4027543108d4dc0b53f815f
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 6, 2026.

Transparency log

Release files / zlib_rust-0.6.8.post2-cp311-abi3-manylinux2014_x86_64.manylinux_2_17_x86_64.whl

Download URL zlib_rust-0.6.8.post2-cp311-abi3-manylinux2014_x86_64.manylinux_2_17_x86_64.whl
Size 458.9 kB
Tags CPython 3.11 Linux glibc 2.17+ x86-64 abi3
SHA-256 checksum
How to use checksums
8b001a4564647cc8d91c03306d3c79d4d5d53a4f69b159bf8b0ff1a2101afc4c
BLAKE2b-256 checksum
How to use checksums
e67c28baeb72b776f0c8b1c45bce149f59dba83e5a19cba6182794b98f29815a
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 6, 2026.

Transparency log

Release files / zlib_rust-0.6.8.post2-cp311-abi3-manylinux2014_aarch64.manylinux_2_17_aarch64.whl

Download URL zlib_rust-0.6.8.post2-cp311-abi3-manylinux2014_aarch64.manylinux_2_17_aarch64.whl
Size 456.6 kB
Tags CPython 3.11 Linux glibc 2.17+ ARM64 abi3
SHA-256 checksum
How to use checksums
ab5342c96ee73badbaa13b21e59247bd019e3ddeeca84034b8e5b9ec01f0c067
BLAKE2b-256 checksum
How to use checksums
134e02285f921e27456d315dc76db6e2c9c39299b47957df4f7fb6541b2d593a
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 6, 2026.

Transparency log

Release files / zlib_rust-0.6.8.post2-cp311-abi3-macosx_11_0_arm64.whl

Download URL zlib_rust-0.6.8.post2-cp311-abi3-macosx_11_0_arm64.whl
Size 415.7 kB
Tags CPython 3.11 abi3 macOS 11.0+ ARM64
SHA-256 checksum
How to use checksums
1f9bcb4c917bb44a73f0586d34763b2348187d0a78ff18f908acda9bbae3127a
BLAKE2b-256 checksum
How to use checksums
50188b166d3cf6c79fc1a65147c55a2c3aaf244f73495c0ae318d430554add5e
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 6, 2026.

Transparency log

Release files / zlib_rust-0.6.8.post2-cp311-abi3-macosx_10_12_x86_64.whl

Download URL zlib_rust-0.6.8.post2-cp311-abi3-macosx_10_12_x86_64.whl
Size 423.5 kB
Tags CPython 3.11 abi3 macOS 10.12+ x86-64
SHA-256 checksum
How to use checksums
788f12d25ef1e8acd92358135cb268b7ec9994fd7b4b852c754210f49e960839
BLAKE2b-256 checksum
How to use checksums
84e85b5434b5dfc7d66d5090ee960835aaf3a714cd5887442627153d30a5d6f5
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 6, 2026.

Transparency log

Security for zlib-rust 0.6.8.post2

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.

Select from 9 files

Attestation for zlib_rust-0.6.8.post2.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 6, 2026.

Transparency log

A 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.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page