Skip to main content

zlib-rust

zlib-rust logo

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)

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

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.9
File Size Uploaded Provenance Actions
zlib_rust-0.6.9.tar.gz 336.4 kB With provenance Details for zlib_rust-0.6.9.tar.gz

Built distributions (wheels)

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

Total release size: 4.0 MB

Release files / zlib_rust-0.6.9.tar.gz

Download URL zlib_rust-0.6.9.tar.gz
Size 336.4 kB
Tags Source
SHA-256 checksum
How to use checksums
58b4ca9f9f901973e246f88f0511f4c053be0158d37ac3e3b6af1c16a1b96613
BLAKE2b-256 checksum
How to use checksums
ab15407279f2275cebbc8831a59674042275944cebcdec135795158a4d925d35
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 25, 2026.

Transparency log

Release files / zlib_rust-0.6.9-cp311-abi3-win_arm64.whl

Download URL zlib_rust-0.6.9-cp311-abi3-win_arm64.whl
Size 301.8 kB
Tags CPython 3.11 Windows ARM64 abi3
SHA-256 checksum
How to use checksums
ea911d8242a89edf56d7ea9d08fe5f80e29dab08210db08970f7c3e3b36b1b34
BLAKE2b-256 checksum
How to use checksums
22814b0b64ec214a31ad20eda61949d1377df0058445edb3c47bc72714ec1a67
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 25, 2026.

Transparency log

Release files / zlib_rust-0.6.9-cp311-abi3-win_amd64.whl

Download URL zlib_rust-0.6.9-cp311-abi3-win_amd64.whl
Size 312.3 kB
Tags CPython 3.11 Windows x86-64 abi3
SHA-256 checksum
How to use checksums
ed4bb4c524eb4572635c99523ec4d68796692e5c9c36a7bc3aa6d67091910210
BLAKE2b-256 checksum
How to use checksums
a5553a72dbd6dfaddef4f1375fa4d0da281b2a6b762c6d5b02697ee71922a718
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 25, 2026.

Transparency log

Release files / zlib_rust-0.6.9-cp311-abi3-musllinux_1_2_x86_64.whl

Download URL zlib_rust-0.6.9-cp311-abi3-musllinux_1_2_x86_64.whl
Size 669.8 kB
Tags CPython 3.11 Linux musl 1.2+ x86-64 abi3
SHA-256 checksum
How to use checksums
5b1af71193bb41c7e9ff02894ef489f08fcfc2e118901fd9e25cbc46809a2d9f
BLAKE2b-256 checksum
How to use checksums
2cc6eaaad46d720d2959e5f6e4465bbe44bc386317e99e3a8b5c8bb75db9ed29
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 25, 2026.

Transparency log

Release files / zlib_rust-0.6.9-cp311-abi3-musllinux_1_2_aarch64.whl

Download URL zlib_rust-0.6.9-cp311-abi3-musllinux_1_2_aarch64.whl
Size 634.8 kB
Tags CPython 3.11 Linux musl 1.2+ ARM64 abi3
SHA-256 checksum
How to use checksums
c32bc25f7ef5b9ababebeb07aa61d68181cba5223a5743dd010ff340cdad605d
BLAKE2b-256 checksum
How to use checksums
98fc7e352f5d971ae32228a4000b97904a431126f5963a74f2d5678e9b6e4322
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 25, 2026.

Transparency log

Release files / zlib_rust-0.6.9-cp311-abi3-manylinux2014_x86_64.manylinux_2_17_x86_64.whl

Download URL zlib_rust-0.6.9-cp311-abi3-manylinux2014_x86_64.manylinux_2_17_x86_64.whl
Size 459.8 kB
Tags CPython 3.11 Linux glibc 2.17+ x86-64 abi3
SHA-256 checksum
How to use checksums
73b6bd4664757ce4eab670cfd0c01339b604956ac0830e17650efa858dcda3ae
BLAKE2b-256 checksum
How to use checksums
8ccf7fdbe7c2b29ffb232b06b1a2f60c940a5a16f5a9ce97739f34614726e29b
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 25, 2026.

Transparency log

Release files / zlib_rust-0.6.9-cp311-abi3-manylinux2014_aarch64.manylinux_2_17_aarch64.whl

Download URL zlib_rust-0.6.9-cp311-abi3-manylinux2014_aarch64.manylinux_2_17_aarch64.whl
Size 459.5 kB
Tags CPython 3.11 Linux glibc 2.17+ ARM64 abi3
SHA-256 checksum
How to use checksums
cf6d7384f9c2bcda8f2a78695e26b8da996fe3cfb6bda41ab9f3fa691bc85c9b
BLAKE2b-256 checksum
How to use checksums
55c1e74ba19a8ce9aa0b162c7d3924e5faf800dfa1ea8aae9cede7bf605a5f01
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 25, 2026.

Transparency log

Release files / zlib_rust-0.6.9-cp311-abi3-macosx_11_0_arm64.whl

Download URL zlib_rust-0.6.9-cp311-abi3-macosx_11_0_arm64.whl
Size 417.3 kB
Tags CPython 3.11 abi3 macOS 11.0+ ARM64
SHA-256 checksum
How to use checksums
4663bc9d5f76f9059dd4287cbd857092d92db5e46cd15afd6d926e1056380fa5
BLAKE2b-256 checksum
How to use checksums
134c00de7a9c127a742971e6884336974d55b5298f907ac732a29c9d1dcaf75b
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 25, 2026.

Transparency log

Release files / zlib_rust-0.6.9-cp311-abi3-macosx_10_12_x86_64.whl

Download URL zlib_rust-0.6.9-cp311-abi3-macosx_10_12_x86_64.whl
Size 424.4 kB
Tags CPython 3.11 abi3 macOS 10.12+ x86-64
SHA-256 checksum
How to use checksums
3ba065159e5df724492dbf41d933c5b664975b94a459cd593d0dd8dbe5825a9c
BLAKE2b-256 checksum
How to use checksums
53ca582b9fb8ce1b92d06c78716e20d75ee99becdbb092045908dd02e65968c4
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 25, 2026.

Transparency log

Security for zlib-rust 0.6.9

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.9.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 25, 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