Monkey patch the standard
zipfile module to enable Zstandard support.
zipfile-deflate64, which provides similar functionality but for the
deflate64 algorithm. Unlike
zipfile-deflate64, this package supports both compression and decompression.
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
zipfile_zstd re-exports the
zipfile API, as a convenience:
import zipfile_zstd as zipfile zipfile.ZipFile(...)
import zipfile_zstd as zipfile zf = zipfile.ZipFile('/tmp/test.zip', 'w', zipfile.ZIP_ZSTANDARD, compresslevel=19) zf.write('large_file.img')
Dictionaries and advanced compression parameters are not supported, sorry.