pgzip is a Python library that provides a multi-threading implementation of the standard `gzip` module. It aims to be a drop-in replacement, offering significant performance improvements for compression and decompression of large files by leveraging parallel processing. It achieves this by utilizing block indexing within the gzip file's `FEXTRA` field, ensuring compatibility with standard gzip tools. The library is actively maintained, with a recent major release (0.4.0) indicating ongoing development and support for newer Python versions.
pip install pgzipVerified import paths — ran on the pinned version, not inferred.
This quickstart demonstrates how to use `pgzip.open` for compressing and decompressing data to/from a file, as well as `pgzip.compress` and `pgzip.decompress` for in-memory byte manipulation. It utilizes `tempfile` for a runnable, clean example. Note the use of `thread` and `blocksize` parameters for parallelization.
Users on Python < 3.10 must upgrade their Python environment to 3.10 or newer, or downgrade `pgzip` to a compatible version (e.g., `pgzip==0.3.5`).
For very small files, consider using Python's built-in `gzip` module. For larger files, `pgzip` offers significant speedups. Optimize `blocksize` and `thread` parameters for your specific workload and data size.
Review the official `pgzip` documentation for a precise list of supported features. If you rely on advanced `gzip` functionalities, test `pgzip` thoroughly or consider alternative strategies.
Upgrade `pgzip` to version 0.3.5 or newer: `pip install --upgrade pgzip`.
Upgrade your Python environment to version 3.10 or newer. Alternatively, if upgrading Python is not feasible, downgrade `pgzip` to a compatible version, such as `pip install pgzip==0.3.5`.
No dependency data recorded yet.