skillfed

stream-zip

Python function to construct a ZIP archive with stream processing - without having to store the entire ZIP in memory or disk

stream-zip v0.0.84 604.4K downloads/30d#5,805 on PyPI20
Permissive license Active released

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-zip

uv

uv add stream-zip

poetry

poetry add stream-zip

Installing 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

License :: OSI Approved :: MIT LicenseProgramming Language :: Python :: 3Topic :: System :: Archiving :: Compression

Tags

stream zip file generationmemory-efficient zip creationon-demand zip archivezip64 streamingweb server zip downloadencrypted zip streamingzip without disk buffering
streamingencryptionzip64

More Compression packages