Skip to main content

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.3.0.tar.gz (32.3 kB view details)

Uploaded Source

Built Distribution

sozipfile-0.3.0-py3-none-any.whl (31.1 kB view details)

Uploaded Python 3

File details

Details for the file sozipfile-0.3.0.tar.gz.

File metadata

  • Download URL: sozipfile-0.3.0.tar.gz
  • Upload date:
  • Size: 32.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.1.1 pkginfo/1.8.1 requests/2.25.1 setuptools/69.0.2 requests-toolbelt/0.8.0 tqdm/4.30.0 CPython/3.8.10

File hashes

Hashes for sozipfile-0.3.0.tar.gz
Algorithm Hash digest
SHA256 a7a64f19a8d2b8e7d80444961d4482dbc8dbcd30f415effe85f89655e4b6a5e7
MD5 dd113db34e126d9b4978e6c61939f2d9
BLAKE2b-256 7c2747e6be7e4c8ac176f5a06193d1d3b83fb7f3511b5c5e3991f0499f35ab50

See more details on using hashes here.

File details

Details for the file sozipfile-0.3.0-py3-none-any.whl.

File metadata

  • Download URL: sozipfile-0.3.0-py3-none-any.whl
  • Upload date:
  • Size: 31.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.1.1 pkginfo/1.8.1 requests/2.25.1 setuptools/69.0.2 requests-toolbelt/0.8.0 tqdm/4.30.0 CPython/3.8.10

File hashes

Hashes for sozipfile-0.3.0-py3-none-any.whl
Algorithm Hash digest
SHA256 9ddf62ee0825ac757cc6fe9ee206bc9a08aca4aedc63706414a7eaccf489bb54
MD5 668f28298984f95c0621989bd4fb9e98
BLAKE2b-256 efd81529f7f96ef3af36709f7f2325307eacdece00e74055ee60cf3e30fb6452

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page