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 awful! 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.4.tar.gz (402.1 kB view details)

Uploaded Source

Built Distributions

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

Uploaded CPython 3.9 Windows x86-64

zipfile_deflate64-0.1.4-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.4-cp38-cp38-win_amd64.whl (20.2 kB view details)

Uploaded CPython 3.8 Windows x86-64

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

Uploaded CPython 3.7m Windows x86-64

zipfile_deflate64-0.1.4-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.4-cp36-cp36m-win_amd64.whl (20.2 kB view details)

Uploaded CPython 3.6m Windows x86-64

zipfile_deflate64-0.1.4-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.4.tar.gz.

File metadata

  • Download URL: zipfile-deflate64-0.1.4.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.57.0 CPython/3.9.1

File hashes

Hashes for zipfile-deflate64-0.1.4.tar.gz
Algorithm Hash digest
SHA256 f3cdb5034bfa62d9ed7283fa84e42f90169d8142bb6362edceaa5d6e07a1d3cf
MD5 43cf57598f6671d09910b06ef52d9c14
BLAKE2b-256 477853d7150be77217cb5ef6115c1037444529f5a4ca0ac9d827106fd68f63f5

See more details on using hashes here.

File details

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

File metadata

  • Download URL: zipfile_deflate64-0.1.4-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.57.0 CPython/3.9.1

File hashes

Hashes for zipfile_deflate64-0.1.4-cp39-cp39-win_amd64.whl
Algorithm Hash digest
SHA256 e3856758f1c9ea30fe4e25a15d4f730de5dcb592a9a339aa17d3ce018503aac1
MD5 c06be5e4df117e5521a14da388f6c63b
BLAKE2b-256 88425cfd2e0b83ab603a8799cbf59fa7efe3b9de51942037d3f15cc349fd46fe

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for zipfile_deflate64-0.1.4-cp39-cp39-manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 8a848da9696d9e3eed62ad625ab7a264f20edd390896b5895b34b4d3f74401e8
MD5 ce99e49036b5565d02a82dd997e9769b
BLAKE2b-256 10c4095856f5374bb4d144163488c627474fc4de9d9738a5a8f7a162cf41758e

See more details on using hashes here.

File details

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

File metadata

  • Download URL: zipfile_deflate64-0.1.4-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.57.0 CPython/3.9.1

File hashes

Hashes for zipfile_deflate64-0.1.4-cp39-cp39-macosx_10_14_x86_64.whl
Algorithm Hash digest
SHA256 fb897d08f9c1041d2e1f5f6fe7a1fcc0bdf1c7bed9699d31bfdef3b874b91d4b
MD5 bfe108262fd011e3eb87775d0a24c203
BLAKE2b-256 24f427e4310c96410abdeb9eb1f5eeac9e0b8f5d2aabf6b95c670de59706a624

See more details on using hashes here.

File details

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

File metadata

  • Download URL: zipfile_deflate64-0.1.4-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.57.0 CPython/3.8.7

File hashes

Hashes for zipfile_deflate64-0.1.4-cp38-cp38-win_amd64.whl
Algorithm Hash digest
SHA256 497deaad716b1117cf5110a508ae7898dfab268b0286df641ce6348fb4d581d8
MD5 92da29fee8f494f6fb1d802dbd33d3a8
BLAKE2b-256 dc591477749207ee0a0a2293278c0ab862aa103b2fe8fd8fbbd9c6df524f9326

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for zipfile_deflate64-0.1.4-cp38-cp38-manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 ce8188f23b8ca2fdecacecc4b516256595bc37f7e32cefa276d023857424467b
MD5 52ce3dced2021fbc8853cf0fec0bd613
BLAKE2b-256 beaa869dbe996ff9fe0ec7f70d4f6cac00f92fd94bdd40b4e3f7f780ee538587

See more details on using hashes here.

File details

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

File metadata

  • Download URL: zipfile_deflate64-0.1.4-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.57.0 CPython/3.8.7

File hashes

Hashes for zipfile_deflate64-0.1.4-cp38-cp38-macosx_10_14_x86_64.whl
Algorithm Hash digest
SHA256 50db0cb9daaac9ca2a56942c07b0270cc10a95a4293bc4ccf9aacddb25840780
MD5 e58e9ebca5fdb9f93742b593fa579244
BLAKE2b-256 6ea33b19d688416a19dd5cbc9ae77dbf8c86f33f0d5c4f378dc70fa8cd850c87

See more details on using hashes here.

File details

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

File metadata

  • Download URL: zipfile_deflate64-0.1.4-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.57.0 CPython/3.7.9

File hashes

Hashes for zipfile_deflate64-0.1.4-cp37-cp37m-win_amd64.whl
Algorithm Hash digest
SHA256 a67ed7a81be3e64de61a2599d1599c7b8f555e21c346d082c7fbbfd91176ee13
MD5 3e872c478c23aaed1db9e090d88b14ac
BLAKE2b-256 0c810212336d7ae3e33273642af5599ee8a67eb26e51e7993adf6a32e329522a

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for zipfile_deflate64-0.1.4-cp37-cp37m-manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 d22bfc07a6666aaff3fb0901509c5d9056e4cf8bb35f29f2cb53a31ca533affb
MD5 0f573668d744ff0876b4e7f3aa21941d
BLAKE2b-256 adc4e01cae8ee512afcf511f72e21b88ec7c5d0dbd6d10386d28a9e9c56c9a79

See more details on using hashes here.

File details

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

File metadata

  • Download URL: zipfile_deflate64-0.1.4-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.57.0 CPython/3.7.9

File hashes

Hashes for zipfile_deflate64-0.1.4-cp37-cp37m-macosx_10_14_x86_64.whl
Algorithm Hash digest
SHA256 9a9e422dd978fce3c6f03ae953412f73a169e8d477f144974dec8ed23f5b2627
MD5 0d7e2216208540132fad61b658f54ec3
BLAKE2b-256 3f4eaaeeea6a56b7aff32592122309a130b0c13c5efc131763c19ebe1ae93e93

See more details on using hashes here.

File details

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

File metadata

  • Download URL: zipfile_deflate64-0.1.4-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.57.0 CPython/3.6.8

File hashes

Hashes for zipfile_deflate64-0.1.4-cp36-cp36m-win_amd64.whl
Algorithm Hash digest
SHA256 b0afab980627d7e0ab3ab11e96dff4044ddfa2007eb635679ccd9fc51e211856
MD5 bea37876278d1384dd4adb9faa329cae
BLAKE2b-256 bc4f6cd5992b42b9f325c9d29098af92c35dfb3f0f52f715789241715a6af8ca

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for zipfile_deflate64-0.1.4-cp36-cp36m-manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 930bb9ea54846e03bb461c4f8fce661844dde3781762a97c2f62e0169acaec26
MD5 6c4e5f1883bfd594895183c9e6ce8791
BLAKE2b-256 5866a29607102a012b637e4a44ee6d4e28e2dfc150aea876b8ddf7b2d1822bde

See more details on using hashes here.

File details

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

File metadata

  • Download URL: zipfile_deflate64-0.1.4-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.57.0 CPython/3.6.12

File hashes

Hashes for zipfile_deflate64-0.1.4-cp36-cp36m-macosx_10_14_x86_64.whl
Algorithm Hash digest
SHA256 3602cf0f3385875a7795d67ce78a3a455903403d6d182f2c7edbd00c4d4f7c01
MD5 7e1d1ed433fc1b14d88f52a4ce34d841
BLAKE2b-256 7a1db4f4eafb1b550e09fdf25ef8a17e3968e97f54eda6e59518bd83dfe5e0ae

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