Monkey patch the standard zipfile module to enable Zstandard support
Project description
zipfile-zstd
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.
Installation
pip install zipfile-zstd
Usage
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
zipfile.ZipFile(...)
Compression example:
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.
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.2.tar.gz
(2.8 kB
view hashes)
Built Distribution
Close
Hashes for zipfile_zstd-0.0.2-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 5c20f4bfc56314dbd4411cd177e80b166abc3372841e7497b91f6958d94e8bbb |
|
MD5 | 8a755c27afdb63f55a6e4c9ef3750413 |
|
BLAKE2b-256 | 950cb8a9cfef71cdfb89e4d1bd12632974fc83d57cbb744607411803b04532d9 |