Skip to main content

serp-zipfile

ZIP archives for Serpentine: read and write archives with stored (method 0) and DEFLATE (method 8) entries, UTF-8 names and CRC-verified extraction. Pure Serpentine ([P]) over serp-zlib — the same source dual-runs under CPython.

from serp_zipfile import ZipEntry, zip_write, zip_read, zip_extract, zip_names
from serpentine import move

entries: list[ZipEntry] = []
e: ZipEntry = ZipEntry("hello.txt", b"hello zip")
entries.append(move(e))
zip_write("out.zip", entries, True)

back: list[ZipEntry] = zip_read("out.zip")
print(zip_names(back))
print(zip_extract(back, "hello.txt"))

API

  • ZipEntry(name: str, data: bytes) — one archive member
  • zip_bytes(entries, compress) -> bytes / zip_parse(data) -> list[ZipEntry] — in-memory
  • zip_write(path, entries, compress) / zip_read(path) -> list[ZipEntry] — on disk
  • zip_names(entries) -> list[str], zip_has(entries, name) -> bool, zip_extract(entries, name) -> bytes

With compress=True each entry is deflated and kept only if smaller than the raw data (CPython zipfile behaves the same way). Written archives use a fixed DOS timestamp (1980-01-01) so output is deterministic.

Limits

No zip64 (4 GiB / 65535-entry caps), no encryption, no multi-disk archives, no on-the-fly streaming. Archives produced here open fine in CPython's zipfile and vice versa; exact archive bytes differ between worlds because the DEFLATE encoders differ.

Metadata

Release files for serp-zipfile 0.2.0

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-zipfile 0.2.0
File Size Uploaded
serp_zipfile-0.2.0.tar.gz 5.4 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for serp-zipfile 0.2.0
File Interpreter ABI Platform
serp_zipfile-0.2.0-py3-none-any.whl Python 3 none any Details

Total release size: 9.9 kB

Release files / serp_zipfile-0.2.0.tar.gz

Download URL serp_zipfile-0.2.0.tar.gz
Size 5.4 kB
Tags Source
SHA-256 checksum
How to use checksums
a128498912106590f023807fc227369bb2003edd1dd6091aa26ce2a7577a26bd
BLAKE2b-256 checksum
How to use checksums
3f34219f2514d3c00e7724c17479b076e9dde41bb4d19b155305c00d6118c692
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

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 Sep 29, 2026.

Transparency log

Release files / serp_zipfile-0.2.0-py3-none-any.whl

Download URL serp_zipfile-0.2.0-py3-none-any.whl
Size 4.5 kB
Tags Python 3
SHA-256 checksum
How to use checksums
b6c05de4ba635e0bb2b4260dc2a82c5c045d196a1ae531a4207025b65b2ee1f9
BLAKE2b-256 checksum
How to use checksums
a7648d789755c317590086aac94760525795d3f8b00cf1582631d65f3f8a1b36
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

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 Sep 29, 2026.

Transparency log

Release history Release notifications | RSS feed

This release

0.2.0 This release

2 release files

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