Skip to main content

Monkey patch the standard zipfile module to enable Zstandard support

Project description



Monkey patch the standard zipfile module to enable Zstandard support.

Based on zipfile-deflate64, which provides similar functionality but for the deflate64 algorithm. Unlike zipfile-deflate64, this package supports both compression and decompression.

Requires python-zstandard for libzstd bindings.


pip install zipfile-zstd


Anywhere in a Python codebase:

import zipfile_zstd  # This has the side effect of patching the zipfile module to support Zstandard

Alternatively, zipfile_zstd re-exports the zipfile API, as a convenience:

import zipfile_zstd as zipfile


Compression example:

import zipfile_zstd as zipfile

zf = zipfile.ZipFile('/tmp/', 'w', zipfile.ZIP_ZSTANDARD, compresslevel=19)

Dictionaries and advanced compression parameters are not supported, sorry.

Project details

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

zipfile-zstd-0.0.4.tar.gz (4.6 kB view hashes)

Uploaded source

Built Distribution

zipfile_zstd-0.0.4-py3-none-any.whl (4.1 kB view hashes)

Uploaded py3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page