Fork of Python zipfile module, adding generation of sozip optimization
Project description
sozipfile
sozipfile is a fork of Python zipfile module, from its implementation in CPython 3.11, which implements the SOZip optimization, when writing deflate compressed files whose size exceeds the chunk size (defaults to 32768 bytes). It also implements efficient seeking within a SOZip file.
Example to generate a SOZip-optimized file:
import sozipfile.sozipfile as zipfile
with zipfile.ZipFile('my.zip', 'w',
compression=zipfile.ZIP_DEFLATED,
chunk_size=zipfile.SOZIP_DEFAULT_CHUNK_SIZE) as myzip:
myzip.write('my.file')
Example to check if a file within a ZIP is SOZip-optimized:
import sozipfile.sozipfile as zipfile
with zipfile.ZipFile('my.zip', 'r') as myzip:
if myzip.getinfo('my.gpkg').is_sozip_optimized(myzip):
print('SOZip optimized!')
Available on pypi:
pip install sozipfile
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
sozipfile-0.3.2.tar.gz
(32.3 kB
view hashes)
Built Distribution
sozipfile-0.3.2-py3-none-any.whl
(31.1 kB
view hashes)
Close
Hashes for sozipfile-0.3.2-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | ee7f7e7ddd0ff49543084883958961620d313fb91aac3e021d756c576d5c3825 |
|
MD5 | e5bb9d463c68ee992de5dd1dfa90fc62 |
|
BLAKE2b-256 | ab8d2ce407e9bc51969bb122e9cfa5f8199cb055951135608275d30deea3b02b |