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
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file zipfile-zstd-0.0.4.tar.gz.
File metadata
- Download URL: zipfile-zstd-0.0.4.tar.gz
- Upload date:
- Size: 4.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.7.1 importlib_metadata/4.8.1 pkginfo/1.8.2 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.59.0 CPython/3.8.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
c1498e15b7922a3d1af0ea55df8b11b2af4e8f7e0e80e414e25d66899f7def89
|
|
| MD5 |
486035155b12e134dc9f4f304474c5ca
|
|
| BLAKE2b-256 |
f72a2e0941bc0058d10ab37d8c578b94a19f611f6ae54f124140f2fb451f0932
|
File details
Details for the file zipfile_zstd-0.0.4-py3-none-any.whl.
File metadata
- Download URL: zipfile_zstd-0.0.4-py3-none-any.whl
- Upload date:
- Size: 4.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.7.1 importlib_metadata/4.8.1 pkginfo/1.8.2 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.59.0 CPython/3.8.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
c8e07be35765c072eb7b1be715c89ecb248a1127b014e12a9b8ac7db2600c166
|
|
| MD5 |
9f59305454419b7a947de0764eb02577
|
|
| BLAKE2b-256 |
b13abc3011d26bbb490741f58c28a2df559445c59e8524cbbb71ecf33db23bb7
|