zipfile-zstd
Monkey patch the standard zipfile module to enable Zstandard support
What it is and what it does
zipfile-zstd is a thin wrapper that monkey-patches Python's standard zipfile module to recognize and handle Zstandard (zstd) compression. When imported, it registers ZIP_ZSTANDARD as a valid compression method, allowing you to create and extract ZIP files using the zstd algorithm. The package delegates actual compression to zstandard, which provides bindings to libzstd.
Typical use is a single import statement at the top of your code; after that, the standard zipfile API works transparently with zstd-compressed archives. The package supports both compression with configurable compression levels and decompression, but does not expose advanced zstd features like dictionaries or custom parameters.
Use it for:
- Create smaller, faster-compressing ZIP archives for distribution or backup when zstd's compression ratio is preferable to deflate.
- Read ZIP files created by other tools or systems that use Zstandard compression.
- Integrate zstd compression into existing Python code that already uses zipfile, with minimal refactoring.
- Archive large files where zstd's speed-to-ratio trade-off offers better performance than standard compression methods.
Worth the install?
AI-flagged interpretation of the facts on this page — verify before relying
Extends Python's standard zipfile module to read and write ZIP archives using Zstandard compression, via a monkey patch that registers the algorithm as a supported compression method.
Yes, if you need Zstandard support in ZIP files and are comfortable with dormant maintenance. The package is simple, has no known vulnerabilities, and low install friction. However, do not rely on it for active development or expect updates if Python's zipfile module changes significantly; it is best suited for stable, self-contained use cases where zstd compression is a requirement.
Install
zipfile-zstd on PyPI
pip
pip install zipfile-zstduv
uv add zipfile-zstdpoetry
poetry add zipfile-zstdInstalling zipfile-zstd
Before you install
Low install friction; pure Python wheel with a single runtime dependency on zstandard. Maintenance is dormant—last release was 2021-12-08 and no commits since 2024-11-19—so expect no active support, but the codebase is small and unlikely to break with standard library changes.
License in practice
MIT license (permissive); you may use, modify, and distribute this package freely in commercial and private projects with minimal restrictions.
Quickstart
pip install zipfile-zstd
import zipfile_zstd as zipfile
zf = zipfile.ZipFile('archive.zip', 'w', zipfile.ZIP_ZSTANDARD, compresslevel=19)
zf.write('file.txt')
zf.close()
Requires zstandard package and Python 3.6 or later; dictionaries and advanced compression parameters are not supported.
Verify before relying
- Compatibility with Python versions newer than 3.6 (e.g., 3.11+) is not explicitly tested in the fact sheet.
- Performance characteristics and compression ratio compared to deflate or other algorithms.
- Whether the monkey patch persists across module reloads or in multi-threaded contexts.
Package facts
| License | not declared (permissive) |
| Python support | supports the current Python release (>=3.6) |
| Install friction | low — pure-Python wheel |
| Runtime dependencies | 1 — zstandard |
| Maintenance | dormant — 1,710 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 1,379,846/month — #3,982 on PyPI (30-day window, as of 2026-08-14) |
| Known vulnerabilities | none known (OSV.dev, checked 2026-08-14) |
Evidence: zipfile_zstd-0.0.4-py3-none-any.whl
Keywords: zip, zipfile, zstd, zstandard
Tags
More Archiving packages
Provides Python bindings to the Brotli…
permissive · top 1,000 on PyPI
s3cmds3cmd is a command-line tool for uploading,…
copyleft · top 5,000 on PyPI
zipfile-deflate64Enables extraction of Deflate64-compressed ZIP…
permissive · top 5,000 on PyPI
unix-arReads and writes AR archive files (Unix static…
permissive · top 5,000 on PyPI
handy-archivesProvides utility functions for working with…
permissive · top 15,000 on PyPI
mda-xdrlibProvides the xdrlib module for encoding and…
permissive · top 15,000 on PyPI
backports.zstdProvides Zstandard compression support for…
permissive · top 1,000 on PyPI
zstdProvides Python bindings to the Zstandard…
permissive · top 5,000 on PyPI
tzsttzst creates and extracts tar archives…
permissive · top 15,000 on PyPI
zstandardProvides Python bindings to the Zstandard…
permissive · top 1,000 on PyPI
pyzstdProvides Python bindings to the Zstandard…
permissive · top 5,000 on PyPI
compress-pickleWraps Python's standard pickle serialization…
permissive · top 15,000 on PyPI
pyvista-zstdCompress and decompress VTK datasets using…
permissive · top 15,000 on PyPI
xopenxopen provides a drop-in replacement for…
permissive · top 5,000 on PyPI
pyzipperpyzipper replaces Python's standard zipfile…
permissive · top 5,000 on PyPI