stream-zip
Python function to construct a ZIP archive with stream processing - without having to store the entire ZIP in memory or disk
What it is and what it does
stream-zip is a Python library for generating ZIP archives incrementally without buffering the entire file in memory or on disk. Instead of constructing a complete ZIP in advance, it yields compressed chunks as they are ready, making it ideal for web servers that need to start sending compressed data before all source files have been read. It supports both the legacy Zip32 format and the modern Zip64 format for files larger than 4 GiB, and can encrypt archives with AES-256 passwords following the WinZip AE-2 specification.
The library handles symbolic links, directories (including empty ones), file permissions, and extended timestamps. It depends only on pycryptodome for encryption operations and is designed for memory-constrained environments where traditional ZIP libraries would require staging the entire archive. The package is actively maintained, has no known vulnerabilities, and provides both synchronous and asynchronous (thread-based) interfaces.
Use it for:
- Generate downloadable ZIP files in web applications without buffering the entire archive to disk or memory.
- Stream large Zip64 archives (>4 GiB) from a server to clients in real-time as data becomes available.
- Create password-protected, AES-256-encrypted ZIP files on-demand for secure file distribution.
- Build ZIP archives containing symbolic links and directory structures in resource-constrained environments.
- Implement on-demand compression pipelines where source data is fetched incrementally and streamed directly into the ZIP.
Worth the install?
AI-flagged interpretation of the facts on this page — verify before relying
Constructs ZIP archives on-the-fly without storing the entire file in memory or disk, supporting both Zip32 and Zip64 formats, password protection with AES-256 encryption, and streaming output.
Yes. stream-zip is actively maintained, has no security vulnerabilities, low install friction (single pure-Python dependency), and solves a genuine problem for streaming ZIP generation in memory-constrained or real-time scenarios. The permissive MIT license poses no restrictions. Install it if you need to generate ZIPs on-the-fly in a web server or similar streaming context.
Install
stream-zip on PyPI
pip
pip install stream-zipuv
uv add stream-zippoetry
poetry add stream-zipInstalling stream-zip
Before you install
Low install friction: pure Python wheel with a single runtime dependency (pycryptodome). Active maintenance with recent commits; last release 191 days ago suggests stable, infrequent updates rather than abandonment.
License in practice
MIT license (permissive) means you can use, modify, and distribute stream-zip freely in commercial and private projects with minimal restrictions.
Quickstart
pip install stream-zip
from stream_zip import stream_zip
for chunk in stream_zip(files):
# yield or write chunk to response
Requires Python 3.6.7 or later; pycryptodome is required at runtime for encryption features.
Verify before relying
- Whether the async interface (which uses threads) is suitable for high-concurrency web servers or if there are known performance bottlenecks.
- Compatibility with specific ZIP clients when using extended timestamps or symbolic links in generated archives.
- Memory overhead characteristics when streaming very large files (multi-gigabyte Zip64 archives).
Package facts
| License | not declared (permissive) |
| Python support | supports the current Python release (>=3.6.7) |
| Install friction | low — pure-Python wheel |
| Runtime dependencies | 1 — pycryptodome |
| Maintenance | actively maintained — 191 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 604,403/month — #5,805 on PyPI (30-day window, as of 2026-08-14) |
| Known vulnerabilities | none known (OSV.dev, checked 2026-08-14) |
Evidence: stream_zip-0.0.84-py3-none-any.whl
Tags
More Compression packages
Provides Python bindings to the Brotli…
permissive · top 1,000 on PyPI
backports.zstdProvides Zstandard compression support for…
permissive · top 1,000 on PyPI
zopfliZopfli is a Python binding for Google's Zopfli…
permissive · top 1,000 on PyPI
python-snappyPython binding for Google's Snappy compression…
permissive · top 5,000 on PyPI
pyzipperpyzipper replaces Python's standard zipfile…
permissive · top 5,000 on PyPI
pyzstdProvides Python bindings to the Zstandard…
permissive · top 5,000 on PyPI
stream-unzipStreams unzip operations on ZIP archives…
permissive · top 5,000 on PyPI
zipstream-newGenerates zip archives as iterators of byte…
copyleft · top 15,000 on PyPI
zipstream-ngGenerates zip files on-the-fly by streaming…
copyleft · top 5,000 on PyPI
remotezip2Reads and extracts files from ZIP archives…
permissive · top 15,000 on PyPI
zipstreamGenerates zip archives as an iterator of byte…
unclear · top 15,000 on PyPI
remotezipDownload individual files from remote zip…
permissive · top 15,000 on PyPI
conda-package-streamingReads conda package metadata and contents from…
permissive · top 15,000 on PyPI
nominal-streamingStreams time-series data to Nominal Core with…
permissive · top 15,000 on PyPI
nbzipnbzip adds a button to Jupyter that zips and…
permissive · top 15,000 on PyPI