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

Uploaded Source

Built Distribution

sozipfile-0.1.1-py3-none-any.whl (30.9 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: sozipfile-0.1.1.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

Hashes for sozipfile-0.1.1.tar.gz
Algorithm Hash digest
SHA256 c5d62161661881a2453aefeef6a328e53d05fc11e2ed438f234230c488c8fdad
MD5 7a05dfa1948e1016da3ef8120a6e9790
BLAKE2b-256 ccb500ba798d6edf6e5c2f7a7ab0b506a405146b0e439e93c7a68f57299a5fea

See more details on using hashes here.

File details

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

File metadata

  • Download URL: sozipfile-0.1.1-py3-none-any.whl
  • Upload date:
  • Size: 30.9 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

Hashes for sozipfile-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 60c18d019a10f23b5cb3539914c35768b4bc40b317783413c0a18d7a01674a38
MD5 678b67bd0f8740ad862dd7f92fd417d7
BLAKE2b-256 39ca5c2892e8f4c886a1e9ef2a56e6e7d109e4b85bc736928f1c591c6868ed94

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