Skip to content

Monkey patch the standard zipfile module to enable Zstandard support (Required by 'taisei')

License

Notifications You must be signed in to change notification settings

sysfce2/python-zipfile-zstd

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

zipfile-zstd

PyPI

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.

About

Monkey patch the standard zipfile module to enable Zstandard support (Required by 'taisei')

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Python 100.0%