Skip to main content

serp-zlib

Compression for Serpentine: zlib-format, raw-DEFLATE and gzip streams, plus crc32/adler32 checksums. Runtime-backed ([R]): native builds use a self-contained DEFLATE implementation in the Serpentine runtime; under CPython the same imports delegate to the stdlib zlib/gzip modules.

from serp_zlib import compress, decompress, crc32

data: bytes = b"hello hello hello"
z: bytes = compress(data, 6)
print(decompress(z) == data)   # True
print(crc32(data))

API

  • crc32(data, value=0) / adler32(data, value=1) — running-checksum value like stdlib zlib.
  • compress(data, level=-1) (zlib format; -1 = default level 6) / decompress(data, wbits=15) — wbits routes the container: 15 zlib, -15 raw DEFLATE, 31 gzip.
  • deflate(data, level=-1) / inflate(data) — raw DEFLATE extras (used by serp-zipfile).
  • gzip_compress(data, level=-1) / gzip_decompress(data).
  • Constants: MAX_WBITS, DEFLATED, Z_DEFAULT_COMPRESSION, Z_BEST_COMPRESSION, Z_BEST_SPEED, Z_NO_COMPRESSION.

Levels are 0 (stored) through 9. Bad levels raise ValueError("Bad compression level"); corrupt streams raise ValueError("invalid compressed data") (CPython raises zlib.error). compressobj/decompressobj are not provided.

Divergence

Compressed output is a valid stream in both worlds and fully interoperable (each world decompresses the other's output), but the exact compressed bytes differ between CPython's zlib and the native runtime's encoder. Only roundtrips, decompressed content and checksums are world-identical.

Metadata

Release files for serp-zlib 0.1.1

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

Source distribution (sdist)

Source distribution for serp-zlib 0.1.1
File Size Uploaded Provenance Actions
serp_zlib-0.1.1.tar.gz 5.2 kB With provenance Details for serp_zlib-0.1.1.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for serp-zlib 0.1.1
File Interpreter ABI Platform Actions
serp_zlib-0.1.1-py3-none-any.whl Python 3 none any Details for serp_zlib-0.1.1-py3-none-any.whl

Total release size: 9.6 kB

Release files / serp_zlib-0.1.1.tar.gz

Download URL serp_zlib-0.1.1.tar.gz
Size 5.2 kB
Tags Source
SHA-256 checksum
How to use checksums
8937001cbe2b75240ff58f76edd78ba55de9bf22b652caf45ff08bdc06023279
BLAKE2b-256 checksum
How to use checksums
99a3671b882aceb3b2813e3603164dd9cdfa1b9b465f9ce6f658eda8ffaf2275
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 Oct 27, 2026.

Transparency log

Release files / serp_zlib-0.1.1-py3-none-any.whl

Download URL serp_zlib-0.1.1-py3-none-any.whl
Size 4.4 kB
Tags Python 3
SHA-256 checksum
How to use checksums
9bd0012c519413b799fdd514f6f3f1985c377939dca94138fb7759bb7b6f8a67
BLAKE2b-256 checksum
How to use checksums
a5f1ef32fe5567534fe5ccceee497f1912c5abce124c5b8666503f73224aac1f
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 Oct 27, 2026.

Transparency log

Security for serp-zlib 0.1.1

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

Both files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for serp_zlib-0.1.1.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 Oct 27, 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.

Release history Release notifications | RSS feed

This release

0.1.1 This release

2 release files Full provenance

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