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 by Mark Adler, the 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.5.tar.gz (402.1 kB view details)

Uploaded Source

Built Distributions

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

Uploaded CPython 3.9 Windows x86-64

zipfile_deflate64-0.1.5-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.5-cp38-cp38-win_amd64.whl (20.1 kB view details)

Uploaded CPython 3.8 Windows x86-64

zipfile_deflate64-0.1.5-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.5-cp37-cp37m-win_amd64.whl (20.1 kB view details)

Uploaded CPython 3.7m Windows x86-64

zipfile_deflate64-0.1.5-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.5-cp36-cp36m-win_amd64.whl (20.1 kB view details)

Uploaded CPython 3.6m Windows x86-64

zipfile_deflate64-0.1.5-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.5.tar.gz.

File metadata

  • Download URL: zipfile-deflate64-0.1.5.tar.gz
  • Upload date:
  • Size: 402.1 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.5.tar.gz
Algorithm Hash digest
SHA256 e0ca0c94292c9d03ecf87802ce00fe505f9c9a70085f9a5c3a0d2daf6ff0e329
MD5 70ed9fe1e7e7f9aa434ee0dc0b8702ab
BLAKE2b-256 5cf781ba697be15071071c410ffd46cf8919d7fc0f2c5498570f1f82e870faf1

See more details on using hashes here.

File details

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

File metadata

  • Download URL: zipfile_deflate64-0.1.5-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.5-cp39-cp39-win_amd64.whl
Algorithm Hash digest
SHA256 725618ede588f49fe7021c568d80a1793c57a2ce39bd2a389bc7866988c6adb0
MD5 97f812805da56ca9e2426b6f1071af15
BLAKE2b-256 a93aa6c9a7fbe4f21993502a685a8ab62e3deca6e3764bc84cb93ab56d0d5e20

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for zipfile_deflate64-0.1.5-cp39-cp39-manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 b5a619767213688f8c6cc5268da6f37f210b1096f0ef7b067344e309923c231f
MD5 c2088fa1178014cc89078b122586b993
BLAKE2b-256 4b8fd24240b48382701b02c7e81a247c94211b13c25f5ef9f87e5b852856acf8

See more details on using hashes here.

File details

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

File metadata

  • Download URL: zipfile_deflate64-0.1.5-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.5-cp39-cp39-macosx_10_14_x86_64.whl
Algorithm Hash digest
SHA256 023b7e596aed5a999b0121ca3f655b27813b4dd56f29fc6f90275b584f4f9d84
MD5 8e00847c309655b46ddaa27566f5ca6d
BLAKE2b-256 43d90bc91eda297665bd01e292e36c3fa849cecbb75e9227d470aefcda0dd5ba

See more details on using hashes here.

File details

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

File metadata

  • Download URL: zipfile_deflate64-0.1.5-cp38-cp38-win_amd64.whl
  • Upload date:
  • Size: 20.1 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.5-cp38-cp38-win_amd64.whl
Algorithm Hash digest
SHA256 d847ff03c507fd25655dd2457a43442b74c5b46645d11c2d4d7cc838c5eee96c
MD5 bebcc934b71cbd371cb2dfe71fb66055
BLAKE2b-256 f56036d654769a16af90e3eaaac059fe9bd29b1d959958ad8ee9dd64f33f95a2

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for zipfile_deflate64-0.1.5-cp38-cp38-manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 5f6683bdd7b5ff25ffb656a453612cc8f36b74bfaf002b429c3d0b822b885493
MD5 61c5052cf1ba5afa4181f72b1ba22fa8
BLAKE2b-256 98006454a430d2e36ccec47707fa171eb6e0806255b15428a71ec4668be646f5

See more details on using hashes here.

File details

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

File metadata

  • Download URL: zipfile_deflate64-0.1.5-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.5-cp38-cp38-macosx_10_14_x86_64.whl
Algorithm Hash digest
SHA256 ec73ab1c4433cd5786d638a27ee0cfa05be5dea95296b2a7c48f1c7c6fd4e4ed
MD5 d2999ef65a09086e2a80ac959ed2369b
BLAKE2b-256 68290397be1bb73f31334cdb4a04690f70a2ee062d1f9b05a178a03515c90115

See more details on using hashes here.

File details

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

File metadata

  • Download URL: zipfile_deflate64-0.1.5-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.5-cp37-cp37m-win_amd64.whl
Algorithm Hash digest
SHA256 59dd158687caecc8dcb5a906a960d72538891c0a7247b1555d20a8179123c2d9
MD5 810db71fea95975fc68d852412394eab
BLAKE2b-256 3d4e298f194f2ca02d0d9ebc0f1557ab1d5b43828c8aaeb3de3dc5aad093ce92

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for zipfile_deflate64-0.1.5-cp37-cp37m-manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 fd1a124209c66a554d263ca6f5544b0a95b39078bbfd2fc369d47b34d654b235
MD5 cdf90fa81dc7c7d6d4565abbffca5a6e
BLAKE2b-256 8f5618f60381d3f189cc4967d6a34c370410ffaa1f8df9b7f65991d6059ed37a

See more details on using hashes here.

File details

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

File metadata

  • Download URL: zipfile_deflate64-0.1.5-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.5-cp37-cp37m-macosx_10_14_x86_64.whl
Algorithm Hash digest
SHA256 504672658787c40688e366fe2d0bfc10f1595e10a7dec78166e3ef6ae8b4f637
MD5 b37a43902b2d49d84bde4cd6f9f50031
BLAKE2b-256 d4dc07522f5bcade796d75906b04ed93eb4a9a80ff371e512e3bed23c1b4f767

See more details on using hashes here.

File details

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

File metadata

  • Download URL: zipfile_deflate64-0.1.5-cp36-cp36m-win_amd64.whl
  • Upload date:
  • Size: 20.1 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.5-cp36-cp36m-win_amd64.whl
Algorithm Hash digest
SHA256 eb4faebf89eb6fd2954e7b8b2bcc7be5644c211150bb85194d0dacc8a55d04b1
MD5 5335e962e00a77b1638b14736c8f28e3
BLAKE2b-256 bcfd56a3ead8d0391b57a5debbdfd446362e65cdd172e07f8534a9dfe7022f06

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for zipfile_deflate64-0.1.5-cp36-cp36m-manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 3b0d891f6aac045a70b137635410b4a3edcaf97140d357c94790d420b9bd90a7
MD5 2483c96afba639ec1b7f897f7fb78dd8
BLAKE2b-256 bd0b496240a2b7bc3290842456ddda19dd7808eb59770b7954e79adae834ccd5

See more details on using hashes here.

File details

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

File metadata

  • Download URL: zipfile_deflate64-0.1.5-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.5-cp36-cp36m-macosx_10_14_x86_64.whl
Algorithm Hash digest
SHA256 84d2f468c9b926eee32c352ed1c7e6dcbc3f181ee83e470a102d740e67dee15c
MD5 51be83204a70593cb5be29c12f547c9c
BLAKE2b-256 bcff861ae3a60ec608a01b7f15f05645680928da23fe10ee9f53f749cf9ea242

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