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.

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

Uploaded Source

Built Distribution

sozipfile-0.1.0-py3-none-any.whl (30.8 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: sozipfile-0.1.0.tar.gz
  • Upload date:
  • Size: 30.7 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.0.tar.gz
Algorithm Hash digest
SHA256 86a6081fe258c223222f2826476357843753419237ce01c3c8d4aa0e596d16be
MD5 3bf9bc08c534831df37c46c6567800b9
BLAKE2b-256 c62c5f8fa4730308003519075398be016f0800704bc197eb007b1543ebbbfde6

See more details on using hashes here.

File details

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

File metadata

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

Hashes for sozipfile-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 e6c712b663a04cc1b7c32e8e94d52c8e70cd8981c904b264bde0ab4a5a1fad58
MD5 a3eacb8aa02782e66f8a9d7c27ed01d6
BLAKE2b-256 0f9c62191b1b46e75d88ba9dd54d64151f4542acf3bbdcc23cf533b0c282cc3b

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