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)
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!')
Note: use of the SOZip index is not currently implemented in the read side, for now.
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.2.0.tar.gz
(30.8 kB
view details)
Built Distribution
sozipfile-0.2.0-py3-none-any.whl
(30.8 kB
view details)
File details
Details for the file sozipfile-0.2.0.tar.gz
.
File metadata
- Download URL: sozipfile-0.2.0.tar.gz
- Upload date:
- Size: 30.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.1.1 pkginfo/1.8.1 requests/2.25.1 setuptools/60.0.0 requests-toolbelt/0.8.0 tqdm/4.30.0 CPython/3.8.10
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | efa65a1a2872c03858a0df8a6694b1862803f99e09c4a4fe7f9284b2f6685623 |
|
MD5 | eff20446b17e960cd0b1c20f2a0c94b0 |
|
BLAKE2b-256 | 08d77c6f3a3af9452bf394f6eba962ede8580652b1ba865bddc0da8411b8a4ae |
File details
Details for the file sozipfile-0.2.0-py3-none-any.whl
.
File metadata
- Download URL: sozipfile-0.2.0-py3-none-any.whl
- Upload date:
- Size: 30.8 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.1.1 pkginfo/1.8.1 requests/2.25.1 setuptools/60.0.0 requests-toolbelt/0.8.0 tqdm/4.30.0 CPython/3.8.10
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | c6e30d88175773fb62883ee1078fb132eadd9aa1b417ec8e5d3f38bc969ca2c9 |
|
MD5 | e5bc3b0d3481a20e9a2f76adb7a693c5 |
|
BLAKE2b-256 | 3ef001a9da56971a4a078c75b7f58f8b088c38e7ac292ab5c2d50ea257ac5b39 |