stream-unzip
Python function to stream unzip all the files in a ZIP archive, without loading the entire ZIP file into memory or any of its uncompressed files
What it is and what it does
stream-unzip is a Python library that extracts ZIP archives by streaming their contents without holding the entire archive or any uncompressed file in memory at once. It handles modern and legacy ZIP formats including Deflate, Deflate64, Zip64 (files far beyond the approximate 4GiB limit), WinZip AES encryption, ZipCrypto password protection, and BZip2 compression—formats that Python's standard zipfile module cannot always open. The library depends on pycryptodome for encryption and stream-inflate for decompression.
The package is designed for scenarios where ZIP files are too large to fit in memory or where you need to process files as they are extracted. It offers both synchronous and asynchronous interfaces (supporting asyncio and trio), making it suitable for streaming workflows in web services, data pipelines, and batch processing. Decryption of legacy ZipCrypto files is reported to be significantly faster than the standard library alternative.
Use it for:
- Extract large ZIP archives in web services without buffering the entire file to disk or memory.
- Process password-protected or AES-encrypted ZIPs in data pipelines where the standard library cannot open them.
- Stream unzip operations in async applications using asyncio or trio without blocking.
- Handle Deflate64-compressed ZIPs created by Windows Explorer when standard zipfile fails.
- Decrypt legacy ZipCrypto-protected archives with better performance than Python's zipfile module.
Worth the install?
AI-flagged interpretation of the facts on this page — verify before relying
Streams unzip operations on ZIP archives without loading entire files into memory, supporting Deflate, Deflate64, Zip64, AES encryption, ZipCrypto, and BZip2 compression.
Yes. stream-unzip fills a genuine gap in Python's standard library by supporting encryption formats and compression methods the zipfile module cannot handle, while offering memory-efficient streaming for large archives. Active maintenance, no known vulnerabilities, permissive MIT license, and top-5000 PyPI popularity indicate a stable, trusted tool. Medium install friction is acceptable given the prebuilt wheels and lightweight runtime dependencies.
Install
stream-unzip on PyPI
pip
pip install stream-unzipuv
uv add stream-unzippoetry
poetry add stream-unzipInstalling stream-unzip
Before you install
Medium install friction with prebuilt wheels for Python 3.10–3.12 across common platforms (macOS, Linux, Windows, musl). Depends on pycryptodome and stream-inflate, both widely available. Active maintenance with last commit 2026-08-10.
License in practice
MIT license (permissive) allows use in commercial and private projects with minimal restrictions; attribution required.
Quickstart
pip install stream-unzip
from stream_unzip import stream_unzip
for file_name, file_size, unzipped_chunks in stream_unzip(zip_file_bytes):
for chunk in unzipped_chunks:
# Process chunk without loading entire file
Requires Python >=3.7.7; pycryptodome and stream-inflate must be installed as runtime dependencies.
Verify before relying
- Performance benchmarks comparing ZipCrypto decryption speed claim ('approximately 10 times faster') against Python's zipfile module.
- Specific async interface details and which asyncio/trio patterns are supported beyond the mention of thread-based trio support.
- Memory usage characteristics for very large ZIP files to quantify the streaming advantage in practice.
Package facts
| License | not declared (permissive) |
| Python support | supports the current Python release (>=3.7.7) |
| Install friction | medium — platform-specific wheel |
| Runtime dependencies | 2 — pycryptodome, stream-inflate |
| Maintenance | actively maintained — 164 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 876,464/month — #4,831 on PyPI (30-day window, as of 2026-08-14) |
| Known vulnerabilities | none known (OSV.dev, checked 2026-08-14) |
Evidence: stream_unzip-0.0.101-cp310-cp310-macosx_11_0_arm64.whl; stream_unzip-0.0.101-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl; stream_unzip-0.0.101-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl; stream_unzip-0.0.101-cp310-cp310-musllinux_1_1_aarch64.whl; stream_unzip-0.0.101-cp310-cp310-musllinux_1_1_x86_64.whl; stream_unzip-0.0.101-cp310-cp310-musllinux_1_2_aarch64.whl; stream_unzip-0.0.101-cp310-cp310-musllinux_1_2_armv7l.whl; stream_unzip-0.0.101-cp310-cp310-musllinux_1_2_x86_64.whl; stream_unzip-0.0.101-cp310-cp310-win_amd64.whl; stream_unzip-0.0.101-cp311-cp311-macosx_11_0_arm64.whl; stream_unzip-0.0.101-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.whl; stream_unzip-0.0.101-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl; stream_unzip-0.0.101-cp311-cp311-musllinux_1_1_aarch64.whl; stream_unzip-0.0.101-cp311-cp311-musllinux_1_1_x86_64.whl; stream_unzip-0.0.101-cp311-cp311-musllinux_1_2_aarch64.whl; stream_unzip-0.0.101-cp311-cp311-musllinux_1_2_armv7l.whl; stream_unzip-0.0.101-cp311-cp311-musllinux_1_2_x86_64.whl; stream_unzip-0.0.101-cp311-cp311-win_amd64.whl; stream_unzip-0.0.101-cp312-cp312-macosx_11_0_arm64.whl; stream_unzip-0.0.101-cp312-cp312-manylinux_2_17_aarch64.manylinux2014_aarch64.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-inflateDecompresses DEFLATE and DEFLATE64 streams in…
permissive · top 5,000 on PyPI
stream-zipConstructs ZIP archives on-the-fly without…
permissive · top 15,000 on PyPI
zipfile-deflate64Enables extraction of Deflate64-compressed ZIP…
permissive · top 5,000 on PyPI
remotezip2Reads and extracts files from ZIP archives…
permissive · top 15,000 on PyPI
zipstream-ngGenerates zip files on-the-fly by streaming…
copyleft · top 5,000 on PyPI
remotezipDownload individual files from remote zip…
permissive · top 15,000 on PyPI
zipstream-newGenerates zip archives as iterators of byte…
copyleft · top 15,000 on PyPI
zipstreamGenerates zip archives as an iterator of byte…
unclear · top 15,000 on PyPI
python-multipartParses multipart form data from HTTP requests…
permissive · top 1,000 on PyPI