Skip to main content

zipwire

Extract individual files from remote ZIP archives over HTTP - without downloading the whole thing.

A zip wire gets you straight to your destination. This library does the same: it uses HTTP range requests to fetch only the central directory and the specific entries you ask for, skipping everything else. A 10 KB file inside a 2 GB archive? zipwire downloads roughly 10 KB (plus a small overhead for the central directory), not 2 GB.

How it works

ZIP archives store a central directory at the end of the file that lists every entry with its offset and size. zipwire fetches that directory first (a single range request), then makes one additional range request per file you extract. The server must support Range requests (Accept-Ranges: bytes), which most CDNs, object stores, and static file servers do.

Key features

  • Selective extraction - download only the files you need, not the entire archive.
  • Streaming decompression - read_into decompresses in chunks, keeping memory usage low even for large entries.
  • Sync and async - SyncRemoteZip for synchronous code, AsyncRemoteZip with await/async with for asyncio.
  • ZIP64 - supports archives and entries larger than 4 GiB.
  • Pluggable backends - bring your own HTTP library (see below).

Installation and backends

The default installation includes the urllib3 backend. To use a different HTTP library, install the matching extra - for example httpx2 gives you both sync and async:

pip install zipwire[httpx2]
Backend Class Mode HTTP Install extra
urllib3 Urllib3Reader sync 1.1 (included)
httpx2 Httpx2SyncReader sync 1.1, 2 httpx2
httpx2 Httpx2AsyncReader async 1.1, 2 httpx2
requests RequestsReader sync 1.1 requests
aiohttp AiohttpReader async 1.1 aiohttp

Every backend accepts an optional pre-configured client or session so you can share connection pools, authentication, and retry configuration.

Examples

Sync - list files and read one

from zipwire import SyncRemoteZip
from zipwire.backends import Urllib3Reader

reader = Urllib3Reader("https://archive.example/data.zip")
with SyncRemoteZip(reader) as rz:
    for info in rz.infolist():
        print(f"{info.filename}  {info.file_size} bytes")

    data = rz.read("path/to/file.txt")

Sync - stream a large file to disk

read_into decompresses in chunks so peak memory stays low:

from zipwire import SyncRemoteZip
from zipwire.backends import Urllib3Reader

reader = Urllib3Reader("https://archive.example/large.zip")
with SyncRemoteZip(reader) as rz:
    with open("output.bin", "wb") as f:
        rz.read_into("big-file.bin", f)

Async

import asyncio
from zipwire import AsyncRemoteZip
from zipwire.backends import AiohttpReader

async def main():
    reader = AiohttpReader("https://archive.example/data.zip")
    async with AsyncRemoteZip(reader) as rz:
        data = await rz.read("path/to/file.txt")
        print(data.decode())

asyncio.run(main())

License

Apache-2.0

Release files for zipwire 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 zipwire 0.2.0
File Size Uploaded
zipwire-0.2.0.tar.gz 158.3 kB Details

Built distribution (wheel)

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

Total release size: 187.6 kB

Release files / zipwire-0.2.0.tar.gz

Download URL zipwire-0.2.0.tar.gz
Size 158.3 kB
Tags Source
SHA-256 checksum
How to use checksums
9e2cfa16904da80c243c7f7a25bce6fafc484ce09285dd8fb213f8d6049e8eae
BLAKE2b-256 checksum
How to use checksums
43962ac4cdc01c86a8d1a41867aa9e983bf78817697d9b84127bdabf679defd0
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.13

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 Jul 20, 2026.

Transparency log

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

Download URL zipwire-0.2.0-py3-none-any.whl
Size 29.2 kB
Tags Python 3
SHA-256 checksum
How to use checksums
cd5ac3d0c107334c0ce6636cb609f4059d3462c73fba55194fb466e2151455f2
BLAKE2b-256 checksum
How to use checksums
3a10c559d8baf90c54ef711c7f44e56d221c8396c93f2544fd47f7d66d114d6b
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.13

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 Jul 20, 2026.

Transparency log

Release history Release notifications | RSS feed

0.4.0

2 release files

0.3.0

2 release files

This release

0.2.0 This release

2 release files

0.1.0

2 release files

0.0.1

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