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

Uploaded Source

Built Distributions

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

Uploaded CPython 3.9 Windows x86-64

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

Uploaded CPython 3.8 Windows x86-64

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

Uploaded CPython 3.7m Windows x86-64

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

Uploaded CPython 3.6m Windows x86-64

zipfile_deflate64-0.1.3-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.3.tar.gz.

File metadata

  • Download URL: zipfile-deflate64-0.1.3.tar.gz
  • Upload date:
  • Size: 372.2 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.3.tar.gz
Algorithm Hash digest
SHA256 fd2078733bd433c1933e1b6625d4f933db4ef83b36f8be28394154309af35b0d
MD5 69da2c67a837e03637026806f6684135
BLAKE2b-256 95226154b7db4797359f384bb37566dde3f9bb883913850799cfee30200cc2d6

See more details on using hashes here.

File details

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

File metadata

  • Download URL: zipfile_deflate64-0.1.3-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.3-cp39-cp39-win_amd64.whl
Algorithm Hash digest
SHA256 58ac2a5faa7836f8d6aa23c27e2cb75ca725bcc74167585bc9194e9d14736a88
MD5 56d2db6fe26977cfd9402377773258eb
BLAKE2b-256 73f3d4b18377d7d1bf69b797d123ea4efa235054195afb6e76d809a2e9f47f18

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for zipfile_deflate64-0.1.3-cp39-cp39-manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 aef8f0f33218aa11db093b516df435e00230f02c576c4d87f67fa3513c13bd68
MD5 c1f0a1decff8f56aebd2725e08b3caee
BLAKE2b-256 8e28269475fddb085e5e1749c41a3fc4cfcda246d3690461342809ff8538530a

See more details on using hashes here.

File details

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

File metadata

  • Download URL: zipfile_deflate64-0.1.3-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.3-cp39-cp39-macosx_10_14_x86_64.whl
Algorithm Hash digest
SHA256 92cf5b24cddd6828206ed4de541ac5b8c5c91e1b0dcaf83e72c651e387e923ad
MD5 1d35c439a729cba120cae008fa60ef0d
BLAKE2b-256 eb963664ca6b318985afaa39f99487dae199951f2a17c2ef169334dbbe3d7c7b

See more details on using hashes here.

File details

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

File metadata

  • Download URL: zipfile_deflate64-0.1.3-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.3-cp38-cp38-win_amd64.whl
Algorithm Hash digest
SHA256 fe79aec11d4959edd58078be3252d9eefd127849cc6d9092a9b487248466815a
MD5 deb6e3a392abc8d0c7eb7a36fe70c539
BLAKE2b-256 297a2e0a61dd094c0870d9a359edf5893c27579e4b2d9e6c6884fe4e857e317c

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for zipfile_deflate64-0.1.3-cp38-cp38-manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 397bf02f7f86df655b3689f80b2f6c5508bf6712fc6a21f9cc2a98b961a5e4bb
MD5 e3d6d2fe7b5470bd5f58cf6f02396c34
BLAKE2b-256 40b7e373e0975f7b2156fb255aaf01617f44a3d0f47c74736b8e848505038a2e

See more details on using hashes here.

File details

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

File metadata

  • Download URL: zipfile_deflate64-0.1.3-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.3-cp38-cp38-macosx_10_14_x86_64.whl
Algorithm Hash digest
SHA256 a202cd9009e1fe4193019f923436be5aa6342afaeea3577fd9560e30761a01b7
MD5 8d39a45525f76d63a42ac8c8f39374b8
BLAKE2b-256 f0c50a2a68a0ed2b56070e1fb00a1fdbb0949c8a977c2ab426bdd7385001bdba

See more details on using hashes here.

File details

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

File metadata

  • Download URL: zipfile_deflate64-0.1.3-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.3-cp37-cp37m-win_amd64.whl
Algorithm Hash digest
SHA256 9053db2dbaf4a459f3429fe0bc6e6603b425d91b541c86a84af568058e2b29a7
MD5 3a7dd05fe7ca33480f7fd861c5a835ce
BLAKE2b-256 727c673f213a6762a0e25c700898df56689f6c7eec166c3002f77fca2e7b9386

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for zipfile_deflate64-0.1.3-cp37-cp37m-manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 f2ae6dcd6dc2761a9da8c71cee6d2c31887dbe94a4fee0a85695996a7a5d6487
MD5 36f41085e218e297f439cb58f9479a56
BLAKE2b-256 ace9f9b612c1b09c650f791d4e331779622d3de1994d45f28172f10a6134a5c1

See more details on using hashes here.

File details

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

File metadata

  • Download URL: zipfile_deflate64-0.1.3-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.3-cp37-cp37m-macosx_10_14_x86_64.whl
Algorithm Hash digest
SHA256 2154a4d2d85272a93c900ee07a472ab236dfe063cc868ee1b28a7e234bb8b19e
MD5 9641d6b1dde729bc30b8a4c48f5c99c7
BLAKE2b-256 f14288a1d4f41fc14a42294ec84dab42b6bec2d34e282741715ed0887e9b0d2d

See more details on using hashes here.

File details

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

File metadata

  • Download URL: zipfile_deflate64-0.1.3-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.3-cp36-cp36m-win_amd64.whl
Algorithm Hash digest
SHA256 0c89b5cb291d1f2a7b8aaabc63a0ca6b6bac41e4ba9f1e95ecd6aaccf088bdba
MD5 502097d87a227dd1cfe8025bc05d63ca
BLAKE2b-256 29a80282d6bf04ebde875333a3703a40a0b963a45abd840558af58add1128359

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for zipfile_deflate64-0.1.3-cp36-cp36m-manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 a4a59510bc93f97396438f1a2f1b7825099aed8f3800b14189e6b210378b0413
MD5 cf8a833a302470b0da68343ec68ffa1c
BLAKE2b-256 8b47b7fb8aa55fb58c193da75b02f3fae5ccc1fd98a09981c428d5e5028291ac

See more details on using hashes here.

File details

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

File metadata

  • Download URL: zipfile_deflate64-0.1.3-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.3-cp36-cp36m-macosx_10_14_x86_64.whl
Algorithm Hash digest
SHA256 477d92445871608c5465e14a46ba625c89d92afb70c8b8614086696bc439d7b3
MD5 d9bdea08618ff5dd16ef8417f1fc09b5
BLAKE2b-256 27289c60e3fab48890d6e234093eaabc398acb1b2cdf62fb218bf13f83ae6065

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