skillfed

zipfile-zstd

Monkey patch the standard zipfile module to enable Zstandard support

zipfile-zstd v0.0.4 1.4M downloads/30d#3,982 on PyPI6
Permissive license DORMANT released

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

uv

uv add zipfile-zstd

poetry

poetry add zipfile-zstd

Installing 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

Intended Audience :: DevelopersLicense :: OSI Approved :: MIT LicenseOperating System :: OS IndependentProgramming Language :: Python :: 3Topic :: System :: ArchivingTopic :: System :: Archiving :: Compression

Tags

zstandard zip compressionzipfile zstd supportzstd compressed archivesmonkey patch zipfilezstandard compression pythonzip with zstd algorithm
compressionzstandard

More Archiving packages