Skip to main content

zipfile-xz

PyPI

Monkey patch the standard zipfile module to enable XZ support.

Based on zipfile-deflate64 and zipfile-zstandard, which provides similar functionality but for the deflate64 algorithm. Unlike zipfile-deflate64, this package supports both compression and decompression.

Note: if you need Python2, use zipfile39 instead (it is also compatible with Python3).

Note: XZ is based on LZMA2, so the compression ratio will be similar to ZIP_LZMA.

Installation

pip install zipfile-xz

Usage

Anywhere in a Python codebase:

import zipfile_xz  # This has the side effect of patching the zipfile module to support XZ

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

import zipfile_xz as zipfile

zipfile.ZipFile(...)

Compression example:

import zipfile_xz as zipfile

zf = zipfile.ZipFile('/tmp/test.zip', 'w', zipfile.ZIP_XZ, compresslevel=6)
zf.write('large_file.img')

Metadata

Release files for zipfile-xz 0.0.3.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for zipfile-xz 0.0.3.1
File Size Uploaded
zipfile-xz-0.0.3.1.tar.gz 3.4 kB Details

Release files / zipfile-xz-0.0.3.1.tar.gz

Download URL zipfile-xz-0.0.3.1.tar.gz
Size 3.4 kB
Tags Source
SHA-256 checksum
How to use checksums
1023a16ab88d91c633cbe8dbb8ba11870d9def7ebeb652fa07016bfd7e8f8135
BLAKE2b-256 checksum
How to use checksums
8c44cd163cc080a5109b8ca55f6bd8c9c6168cf0b7423a3ada4b48046f9fbb2c
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/1.15.0 pkginfo/1.7.0 requests/2.25.1 setuptools/41.4.0 requests-toolbelt/0.9.1 tqdm/4.60.0 CPython/2.7.17

Release history Release notifications | RSS feed

This release

0.0.3.1 This release

1 release file

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page