Skip to main content

Extract Deflate64 ZIP archives with Python's zipfile API.

Project description

zipfile-deflate64

PyPI

Extract Deflate64 ZIP archives with Python's zipfile API.

Installation

pip install zipfile-deflate64

Python 3.6, 3.7, 3.8, and 3.9 are supported, with manylinux2014, macOS and Windows wheels published to PyPI.

Usage

Anywhere in a Python codebase:

import zipfile_deflate64  # This has the side effect of patching the zipfile module to support Deflate64

Alternatively, zipfile_deflate64 re-exports the zipfile API, as a convenience:

import zipfile_deflate64 as zipfile

zipfile.ZipFile(...)
...

Design Rationale

The Problem

Recent versions of Microsoft Windows Explorer use Deflate64 compression when creating ZIP files larger than 2GB. With the ubiquity of Windows and the ease of using "Sent to compressed folder", a majority of newly-created large ZIP files use Deflate64 compression.

However, support for Deflate64 in the open-source ecosystem is very poor! Most ZIP libraries have declined to implement Deflate64, citing its proprietary nature.

In the .NET ecosystem, the ZipArchive API supports decompression only. In Java, the Apache Commons Compress APIs support both compression and decompression.

The 7-Zip project probably provides the best general-purpose support for compressing and decompressing Deflate64, but there are several obstacles to general usability:

In the Python ecosystem in particular, there have been several unfulfilled requests ( [1] [2] [3] ) for Deflate64 decompression support.

A Solution

The best hope seems to be the infback9 extension to zlib. This was developed in 2003 by Mark Adler, an original author of zlib, and is kept in the source repository of zlib, but it is not officially supported and contains no build tooling and is not distributed with zlib packages. Additionally, infback9 provides only low-level support for working with Deflate64 bitstreams, with no support for the ZIP archive format (which is out of scope for zlib).

infback9's C-language API is relatively simple, but requires a non-trivial struct and function pointers for initialization and some explicit memory management operations (resizing allocated buffers and proving a Python-friendly malloc) to operate efficiently, so wrapping it with only ctypes seems to be inadequate.

To manage ZIP archive extraction operations, the Python standard library zipfile module provides the essential features and is already ubiquitous in availability and usage. However, zipfile is difficult to extend, as it hardcodes many conditionals for compression formats and does not provide capabilities for easily augmenting or replacing parts of it. Monkey-patching can overcome some of these problems, and the promise of a drop-in, API-compatible patch to a standard library module outweighed the engineering benefits of basing a solution off a more naturally extensible third-party ZIP manipulation package.

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

zipfile-deflate64-0.1.6.tar.gz (58.9 kB view details)

Uploaded Source

Built Distributions

zipfile_deflate64-0.1.6-cp39-cp39-win_amd64.whl (20.1 kB view details)

Uploaded CPython 3.9 Windows x86-64

zipfile_deflate64-0.1.6-cp39-cp39-macosx_10_14_x86_64.whl (18.7 kB view details)

Uploaded CPython 3.9 macOS 10.14+ x86-64

zipfile_deflate64-0.1.6-cp38-cp38-win_amd64.whl (20.2 kB view details)

Uploaded CPython 3.8 Windows x86-64

zipfile_deflate64-0.1.6-cp38-cp38-macosx_10_14_x86_64.whl (18.7 kB view details)

Uploaded CPython 3.8 macOS 10.14+ x86-64

zipfile_deflate64-0.1.6-cp37-cp37m-win_amd64.whl (20.1 kB view details)

Uploaded CPython 3.7m Windows x86-64

zipfile_deflate64-0.1.6-cp37-cp37m-macosx_10_14_x86_64.whl (18.7 kB view details)

Uploaded CPython 3.7m macOS 10.14+ x86-64

zipfile_deflate64-0.1.6-cp36-cp36m-win_amd64.whl (20.2 kB view details)

Uploaded CPython 3.6m Windows x86-64

zipfile_deflate64-0.1.6-cp36-cp36m-macosx_10_14_x86_64.whl (18.7 kB view details)

Uploaded CPython 3.6m macOS 10.14+ x86-64

File details

Details for the file zipfile-deflate64-0.1.6.tar.gz.

File metadata

  • Download URL: zipfile-deflate64-0.1.6.tar.gz
  • Upload date:
  • Size: 58.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.3.0 pkginfo/1.7.0 requests/2.25.1 setuptools/52.0.0 requests-toolbelt/0.9.1 tqdm/4.58.0 CPython/3.9.1

File hashes

Hashes for zipfile-deflate64-0.1.6.tar.gz
Algorithm Hash digest
SHA256 792c7fc904740be3197b70afdd82a931f8dbec6db38d7b5be74c3ffbbed75a96
MD5 2e80c80faecab266b586d1b226b8112f
BLAKE2b-256 a7d2c3c347760322b57f62d8cf99d3acbf1063be26f56ed4b3c29a7fd1c8b1b8

See more details on using hashes here.

File details

Details for the file zipfile_deflate64-0.1.6-cp39-cp39-win_amd64.whl.

File metadata

  • Download URL: zipfile_deflate64-0.1.6-cp39-cp39-win_amd64.whl
  • Upload date:
  • Size: 20.1 kB
  • Tags: CPython 3.9, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.3.0 pkginfo/1.7.0 requests/2.25.1 setuptools/52.0.0 requests-toolbelt/0.9.1 tqdm/4.58.0 CPython/3.9.1

File hashes

Hashes for zipfile_deflate64-0.1.6-cp39-cp39-win_amd64.whl
Algorithm Hash digest
SHA256 eb5a88be75c42c1670f353e2342a9751d7392ac438612ac037b939397838b473
MD5 877226ea5f5bf72869661ddf03110625
BLAKE2b-256 66fa25faeb492b9f437ca8619cc67cd6c9a8ad0b02d7e2ee4b56c763151c8e22

See more details on using hashes here.

File details

Details for the file zipfile_deflate64-0.1.6-cp39-cp39-manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for zipfile_deflate64-0.1.6-cp39-cp39-manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 99b40ddccb17f87909702ebbfe6ba1e1b0309ff318844a776cd70339c2a56a45
MD5 330fcfdb6f343010c0a233d949eea3a2
BLAKE2b-256 bf297fb5f376e1dd39c969fdfb9a92df78b3e7aff2e7466855cb2566a9a36729

See more details on using hashes here.

File details

Details for the file zipfile_deflate64-0.1.6-cp39-cp39-macosx_10_14_x86_64.whl.

File metadata

  • Download URL: zipfile_deflate64-0.1.6-cp39-cp39-macosx_10_14_x86_64.whl
  • Upload date:
  • Size: 18.7 kB
  • Tags: CPython 3.9, macOS 10.14+ x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.3.0 pkginfo/1.7.0 requests/2.25.1 setuptools/52.0.0 requests-toolbelt/0.9.1 tqdm/4.58.0 CPython/3.9.2

File hashes

Hashes for zipfile_deflate64-0.1.6-cp39-cp39-macosx_10_14_x86_64.whl
Algorithm Hash digest
SHA256 a79c3a96b5dca80edf34f5c6e850bdb7eb5c803efbd6d79d117ccee9a4c7bb02
MD5 7ca6c4763e5c4b9f296739762299e001
BLAKE2b-256 8cd126c9f6088d91a88a2a7d52c2065e3eba064b3768882985ffd11a367667c7

See more details on using hashes here.

File details

Details for the file zipfile_deflate64-0.1.6-cp38-cp38-win_amd64.whl.

File metadata

  • Download URL: zipfile_deflate64-0.1.6-cp38-cp38-win_amd64.whl
  • Upload date:
  • Size: 20.2 kB
  • Tags: CPython 3.8, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.3.0 pkginfo/1.7.0 requests/2.25.1 setuptools/52.0.0 requests-toolbelt/0.9.1 tqdm/4.58.0 CPython/3.8.7

File hashes

Hashes for zipfile_deflate64-0.1.6-cp38-cp38-win_amd64.whl
Algorithm Hash digest
SHA256 daeb5ac98f3ad2c227662be557be63aada5bfa4da09714bdcaa8d194f0345b1f
MD5 fe92417a269f8b05f37f7d7ad3cd8a7e
BLAKE2b-256 5fc1aeadb29b1d8c9fcc02e3bd1cc6378b44296f4c5bed7439fda69cca5e5f84

See more details on using hashes here.

File details

Details for the file zipfile_deflate64-0.1.6-cp38-cp38-manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for zipfile_deflate64-0.1.6-cp38-cp38-manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 61b2d6657a5a4cf64e9122205aa4bf977e57730cb5d7f41dc94b4a31460539b9
MD5 a9d32b26fe2337a95a676e3a13f4fa7a
BLAKE2b-256 6fc403e104c80cb0f4f6b01b1fc1a05c42237e4812c2d81ac8f47c9e2700fc50

See more details on using hashes here.

File details

Details for the file zipfile_deflate64-0.1.6-cp38-cp38-macosx_10_14_x86_64.whl.

File metadata

  • Download URL: zipfile_deflate64-0.1.6-cp38-cp38-macosx_10_14_x86_64.whl
  • Upload date:
  • Size: 18.7 kB
  • Tags: CPython 3.8, macOS 10.14+ x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.3.0 pkginfo/1.7.0 requests/2.25.1 setuptools/52.0.0 requests-toolbelt/0.9.1 tqdm/4.58.0 CPython/3.8.8

File hashes

Hashes for zipfile_deflate64-0.1.6-cp38-cp38-macosx_10_14_x86_64.whl
Algorithm Hash digest
SHA256 447f634be69779118dbe716a2c465e44bae0eb8b8e9a386c41975fde523fe4a4
MD5 c2943f6224989796c4c2bb79b1171b26
BLAKE2b-256 e6ae09eded5f06665484dd33b31fa9932f7c5c912e57e904848e3dea52a390a2

See more details on using hashes here.

File details

Details for the file zipfile_deflate64-0.1.6-cp37-cp37m-win_amd64.whl.

File metadata

  • Download URL: zipfile_deflate64-0.1.6-cp37-cp37m-win_amd64.whl
  • Upload date:
  • Size: 20.1 kB
  • Tags: CPython 3.7m, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.3.0 pkginfo/1.7.0 requests/2.25.1 setuptools/52.0.0 requests-toolbelt/0.9.1 tqdm/4.58.0 CPython/3.7.9

File hashes

Hashes for zipfile_deflate64-0.1.6-cp37-cp37m-win_amd64.whl
Algorithm Hash digest
SHA256 5ad2f5f1344cb41aa022c8aa9f8578561909bd80985dcded1e648d3c7a4c25dc
MD5 9dc01a6c2de13b3e6e13dd56b0bb816a
BLAKE2b-256 e5865b804252c4640bf515ac7a5fd67d4cf30ee226e8cfdef1d34323c9091523

See more details on using hashes here.

File details

Details for the file zipfile_deflate64-0.1.6-cp37-cp37m-manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for zipfile_deflate64-0.1.6-cp37-cp37m-manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 8b7bed9f6bc94359fefc953379292baf1130ccd67994446f1b7d53a6e912bf39
MD5 17a55b73cb58cd18c265d6259fd94782
BLAKE2b-256 b2e743bffe0b7b35dd56445d55b931372adbcce5868af763721e38643fe125de

See more details on using hashes here.

File details

Details for the file zipfile_deflate64-0.1.6-cp37-cp37m-macosx_10_14_x86_64.whl.

File metadata

  • Download URL: zipfile_deflate64-0.1.6-cp37-cp37m-macosx_10_14_x86_64.whl
  • Upload date:
  • Size: 18.7 kB
  • Tags: CPython 3.7m, macOS 10.14+ x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.3.0 pkginfo/1.7.0 requests/2.25.1 setuptools/52.0.0 requests-toolbelt/0.9.1 tqdm/4.58.0 CPython/3.7.10

File hashes

Hashes for zipfile_deflate64-0.1.6-cp37-cp37m-macosx_10_14_x86_64.whl
Algorithm Hash digest
SHA256 9d3069cf791539d5cad4574550c9f15080d657d58a815abd082327a005c53f98
MD5 f0427100994b6dfaa29b3f921e9eff1b
BLAKE2b-256 c5a172f3ca7180658e70afb3626459c8b055cbba60465fd99650b4ccadf47317

See more details on using hashes here.

File details

Details for the file zipfile_deflate64-0.1.6-cp36-cp36m-win_amd64.whl.

File metadata

  • Download URL: zipfile_deflate64-0.1.6-cp36-cp36m-win_amd64.whl
  • Upload date:
  • Size: 20.2 kB
  • Tags: CPython 3.6m, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.3.0 pkginfo/1.7.0 requests/2.25.1 setuptools/52.0.0 requests-toolbelt/0.9.1 tqdm/4.58.0 CPython/3.6.8

File hashes

Hashes for zipfile_deflate64-0.1.6-cp36-cp36m-win_amd64.whl
Algorithm Hash digest
SHA256 488809fa6068adf08d4028f3df12106aa8ece4dacb5f9bdb2427161fc8f03661
MD5 b876cf50018905692058edb0b02b97e0
BLAKE2b-256 b3797d05a03c0c2a2e851cffa782de31f607d8cecdce8f557580daf791918687

See more details on using hashes here.

File details

Details for the file zipfile_deflate64-0.1.6-cp36-cp36m-manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for zipfile_deflate64-0.1.6-cp36-cp36m-manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 b0468237f5ec00ce50c7d73f258da7fab04870b65c46daa65c29b779980db84c
MD5 f79997246a686515266c34f7bca234df
BLAKE2b-256 33243ab917d5c48764dab762939d5dd635f71af6b69d5b55773d861d89add49b

See more details on using hashes here.

File details

Details for the file zipfile_deflate64-0.1.6-cp36-cp36m-macosx_10_14_x86_64.whl.

File metadata

  • Download URL: zipfile_deflate64-0.1.6-cp36-cp36m-macosx_10_14_x86_64.whl
  • Upload date:
  • Size: 18.7 kB
  • Tags: CPython 3.6m, macOS 10.14+ x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.3.0 pkginfo/1.7.0 requests/2.25.1 setuptools/52.0.0 requests-toolbelt/0.9.1 tqdm/4.58.0 CPython/3.6.13

File hashes

Hashes for zipfile_deflate64-0.1.6-cp36-cp36m-macosx_10_14_x86_64.whl
Algorithm Hash digest
SHA256 8f95386a1f9c80280896e22549a07cd62383ac9c793f90e9f3de534edc49b2c8
MD5 4efc68c9d1bc91f360209735f2032ed8
BLAKE2b-256 8c3d49bbae43280c30ef46e02be9210a1dfab1975eb00e969feba21b89b632cb

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