--- id: zipstream-ng version: "1.9.2" license: LGPL-3.0-only license_treatment: copyleft maintenance: active --- # zipstream-ng — A modern and easy to use streamable zip file generator License: copyleft · Maintenance: active · Downloads: 1.1M/mo ## 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 above — 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 pip install zipstream-ng uv add zipstream-ng poetry add zipstream-ng ## Installing 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_current - Install friction: low - Maintenance: active - Downloads: 1.1M/month (top 5,000 on PyPI) - Known vulnerabilities: none known ## Tags streaming zip file generation, zip without temporary files, low memory zip creation, on-the-fly zip streaming, zip size pre-calculation, web backend zip download, iterable zip packing, streaming, web-backend, compression [View on SkillFed](https://skillfed.io/packages/zipstream-ng) · [View on PyPI](https://pypi.org/project/zipstream-ng/)