zipstream-ng
A modern and easy to use streamable zip file generator
What it is and what it does
zipstream-ng is a Python library for generating zip files on-the-fly as a stream, rather than building the entire archive in memory or writing to disk first. It reads files and data iteratively, yielding compressed chunks as they are requested, which makes it ideal for web backends that need to serve zipped downloads without consuming significant memory or disk space. The library supports adding files from filesystem paths, raw bytes, strings, and any iterable object, and can optionally calculate the total size of the resulting zip before generation begins—useful for setting HTTP Content-Length headers.
The package has no external dependencies and is threadsafe, meaning multiple threads can safely add data to the same stream concurrently. It automatically uses Zip64 extensions only when needed, tracks the modification date of the most recent file for Last-Modified headers, and includes a built-in HTTP server module that can serve directories as downloadable zips. The library is performant and memory-efficient: typical peak memory usage stays below 20MB even when zipping terabytes of files.
Use it for:
- Web backend serving user-requested file collections as a single zip download without temporary disk files or high memory overhead
- Streaming large directory archives over HTTP with Content-Length and Last-Modified headers for client progress bars and cache validation
- Generating zip files on-demand from database records, API responses, or other non-filesystem iterables without buffering to disk
- Building archive responses in Flask, FastAPI, or other web frameworks where memory and latency are constraints
- Creating zip manifests with embedded metadata by generating the stream, pausing to add a manifest file, then finalizing
Worth the install?
AI-flagged interpretation of the facts on this page — verify before relying
Generates zip files on-the-fly by streaming data without temporary files or excessive memory, supporting files, bytes, strings, and iterables with optional pre-calculation of final size.
Yes. Low install friction, no dependencies, active maintenance, copyleft license (acceptable for most use cases), and zero known vulnerabilities. Install if you need to stream zips efficiently in a web backend or generate archives on-the-fly from iterables. Verify license compatibility if distributing in closed-source software.
Install
zipstream-ng on PyPI
pip
pip install zipstream-nguv
uv add zipstream-ngpoetry
poetry add zipstream-ngInstalling zipstream-ng
Before you install
Low friction: pure Python wheel with no runtime dependencies and active maintenance (last release 89 days ago, last commit 2026-05-29). Supports Python 3.5 through 3.15.
License in practice
LGPL-3.0-only (copyleft): derivative works and distributions must be licensed under LGPL-3.0 and source made available; acceptable for internal tools and open-source projects, but requires careful review before use in proprietary closed-source software.
Quickstart
from zipstream import ZipStream
zs = ZipStream.from_path("/path/to/files/")
with open("files.zip", "wb") as f:
f.writelines(zs)
Verify before relying
- Whether the pre-calculated size feature works with all compression types or only uncompressed streams
- Performance characteristics on very large file counts or total sizes beyond typical use
Package facts
| License | LGPL-3.0-only (copyleft) |
| Python support | supports the current Python release (>=3.5) |
| Install friction | low — pure-Python wheel |
| Runtime dependencies | none |
| Maintenance | actively maintained — 89 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 1,083,846/month — #4,391 on PyPI (30-day window, as of 2026-08-14) |
| Known vulnerabilities | none known (OSV.dev, checked 2026-08-14) |
Evidence: zipstream_ng-1.9.2-py3-none-any.whl
Tags
More Utilities packages
Converts domain names between Unicode and…
permissive · top 100 on PyPI
charset-normalizerDetects and normalizes text encoding from…
permissive · top 100 on PyPI
setuptoolsSetuptools is a Python build backend and…
permissive · top 100 on PyPI
pluggyPluggy provides a plugin system that lets you…
permissive · top 100 on PyPI
PygmentsPygments is a syntax highlighter that colorizes…
permissive · top 100 on PyPI
sixSix provides utility functions to write Python…
permissive · top 100 on PyPI
iterable-ioWraps iterables (generators, lists, etc.) as…
copyleft · top 15,000 on PyPI
zipstreamGenerates zip archives as an iterator of byte…
unclear · top 15,000 on PyPI
zipstream-newGenerates zip archives as iterators of byte…
copyleft · top 15,000 on PyPI
stream-zipConstructs ZIP archives on-the-fly without…
permissive · top 15,000 on PyPI
stream-unzipStreams unzip operations on ZIP archives…
permissive · top 5,000 on PyPI
remotezipDownload individual files from remote zip…
permissive · top 15,000 on PyPI
seekablehttpfileProvides a file-like object that fetches remote…
permissive · top 15,000 on PyPI
gzip-streamWraps streams to compress data on-the-fly using…
permissive · top 15,000 on PyPI
remotezip2Reads and extracts files from ZIP archives…
permissive · top 15,000 on PyPI
pyzipperpyzipper replaces Python's standard zipfile…
permissive · top 5,000 on PyPI