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 wheels and macOS 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.2.tar.gz (372.1 kB view details)

Uploaded Source

Built Distributions

zipfile_deflate64-0.1.2-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.2-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.2-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.2-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.2.tar.gz.

File metadata

  • Download URL: zipfile-deflate64-0.1.2.tar.gz
  • Upload date:
  • Size: 372.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.2.tar.gz
Algorithm Hash digest
SHA256 fa811c0618e2b037ee9bab272bac3a763a621cebdf79ff2e2b90bad6443ceeae
MD5 700abd52d05f627856f40860af389df8
BLAKE2b-256 9e9b6bb04392d1f13fed30dc3ed8c6bef424199d04ae376ede4fafac701a65d5

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for zipfile_deflate64-0.1.2-cp39-cp39-manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 011fccee9991f1ebc52bbb0415d600951b6876db6185d0c48a09d161a6deb100
MD5 2d8fe28fcb12ec695902f78eaa01b6a2
BLAKE2b-256 e587ad109c885902a83d638c9e2e7670f40c5b8e797ee55cfaee2235704b4a75

See more details on using hashes here.

File details

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

File metadata

  • Download URL: zipfile_deflate64-0.1.2-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.2-cp39-cp39-macosx_10_14_x86_64.whl
Algorithm Hash digest
SHA256 099b3bdbb886d0b74db1f396347b8142c44ccced8aa2340de13425a445bfb634
MD5 019b0e6e2469b7aa05fe626e2c15014c
BLAKE2b-256 7f37aedfac19228f9f63a3a0a1e2994adfbf403ad4d946f806a3ec9c2e60d3e1

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for zipfile_deflate64-0.1.2-cp38-cp38-manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 1145523e85c9b923aadb2f4dbb273dcea2ce752f391288c40cf0d552c34964f9
MD5 88df184ae6dd80c20584a4560cd9dbd9
BLAKE2b-256 768d3835e319ff0d95411c0c570b988e9a72ae7c40346917c75c6a3622ecf966

See more details on using hashes here.

File details

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

File metadata

  • Download URL: zipfile_deflate64-0.1.2-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.2-cp38-cp38-macosx_10_14_x86_64.whl
Algorithm Hash digest
SHA256 d161ebfa534afd6ad90ecf3337c5e10a0bd27d06dbc19b22c099255a2e7dd0b9
MD5 29dbc73fa09549b86d2e6591a795f881
BLAKE2b-256 dfa82ba0ef568b8566a454012790d02a1f8d86354aa3123bee3674cf46abd8d1

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for zipfile_deflate64-0.1.2-cp37-cp37m-manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 58107dd88ca4c004aa052676550da5cd7a88b976a079bd11af5b5272c22a9874
MD5 57fb9febda679e4f74abe838889e9ca2
BLAKE2b-256 19a759ffe694154f07f172222a95b76e3add44efac5a619bde5e69f9b0402a43

See more details on using hashes here.

File details

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

File metadata

  • Download URL: zipfile_deflate64-0.1.2-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.2-cp37-cp37m-macosx_10_14_x86_64.whl
Algorithm Hash digest
SHA256 ee6704d0fecf9acdc8f1ab090a26aec8a0e3d8c7347c5d170d606ae73759af00
MD5 464cb85295664572cfae40a1a74df097
BLAKE2b-256 ad43ab7c6f9bea43a560d9c22bb78f14a9b6dcba7dae9f9b39b8de7481ec137c

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for zipfile_deflate64-0.1.2-cp36-cp36m-manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 1546ff77191f26457b69edef6d09fbd8faf953c1817c5477ca847e379dfaa957
MD5 bd03afceb75252955676510a0c996ca4
BLAKE2b-256 5d65f7d613667b502c19c3a63cae21a75df14cdf427a892492e4f9e29ff33e7e

See more details on using hashes here.

File details

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

File metadata

  • Download URL: zipfile_deflate64-0.1.2-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.2-cp36-cp36m-macosx_10_14_x86_64.whl
Algorithm Hash digest
SHA256 1276247c95ad1eedf9706bd3dd51d96f779882fabd765dbc850a447aaeb27858
MD5 c8c6443b0143abf128af637da1faf93e
BLAKE2b-256 eb852a18477b084037d229d1c70bb60b17cd426737c89725e4dbc4f6175a6056

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