pgzip
A multi-threading implementation of Python gzip module
Decision gist · record as of 2026-08-14
Yes, if you need faster gzip compression/decompression and can tolerate that seek/tell are not fully tested. The low install friction, permissive license, active maintenance, and zero security vulnerabilities make it safe to adopt. Not necessary if you rarely compress large files or if your bottleneck is not CPU/I/O bound.AI-flagged interpretation of the facts on this page — verify before relying
Before you install
- Requires Python 3.10 or later.
- Low friction: pure Python wheel with no runtime dependencies.
- Active maintenance as of 2026-03-02, though maintainers are actively seeking additional contributors.
License · maintenance · safety
MIT License (permissive) — MIT License (permissive) — you can use, modify, and distribute pgzip freely in commercial and private projects with minimal restrictions.
last release 2025-12-23 (234 days) · last repo commit 2026-03-02 · 63 stars
0 known vulnerabilities (OSV.dev, 2026-08-14) · 225,931 downloads/mo, #9,210 on PyPI
Alternatives
Verify before relying
import pgzip
# Compress with 8 threads
with pgzip.open("file.txt.gz", "wt", thread=8) as f:
f.write("data")
# Decompress
with pgzip.open("file.txt.gz", "rt", thread=8) as f:
data = f.read()- Whether seek() and tell() methods work reliably despite the documented warning about incomplete testing.
- Real-world performance gains on machines with fewer cores or on I/O-constrained systems.
- Stability and compatibility with all gzip file variants and edge cases beyond standard FEXTRA blocks.
What it is and what it does
pgzip replaces Python's built-in gzip module with a multi-threaded alternative that uses block indexing to parallelize compression and decompression. It maintains full compatibility with standard gzip files by leveraging the FEXTRA feature defined in the gzip specification, so compressed files can be read by any standard gzip tool. The package exposes the same API as the standard gzip module (open, compress, decompress), making it a drop-in replacement for I/O-bound compression workloads.
The main trade-off is that only the three core methods (open, compress, decompress) are well-tested; other GzipFile methods like seek() and tell() have not been thoroughly validated. Performance gains depend heavily on available CPU cores and I/O bandwidth. The project is actively maintained but explicitly seeking additional maintainers.
Use it for
- Compressing large text files or datasets where I/O and CPU parallelism can reduce wall-clock time.
- Batch processing pipelines that need to compress or decompress files concurrently using a gzip-compatible format.
- Replacing standard gzip in data workflows where compression throughput is a bottleneck and standard gzip files must remain readable.
- CLI-based compression tasks via the command-line interface with configurable thread count and compression level.
Worth the install?
AI-flagged interpretation of the facts on this page. Verify before relying on it.
Yes, if you need faster gzip compression/decompression and can tolerate that seek/tell are not fully tested.
The low install friction, permissive license, active maintenance, and zero security vulnerabilities make it safe to adopt. Not necessary if you rarely compress large files or if your bottleneck is not CPU/I/O bound.
Install
pgzip on PyPI
Before you install
Low friction: pure Python wheel with no runtime dependencies. Active maintenance as of 2026-03-02, though maintainers are actively seeking additional contributors.
Requires Python 3.10 or later.
License in practice
MIT License (permissive) — you can use, modify, and distribute pgzip freely in commercial and private projects with minimal restrictions.
Quickstart
import pgzip
# Compress with 8 threads
with pgzip.open("file.txt.gz", "wt", thread=8) as f:
f.write("data")
# Decompress
with pgzip.open("file.txt.gz", "rt", thread=8) as f:
data = f.read()
Verify before relying
- Whether seek() and tell() methods work reliably despite the documented warning about incomplete testing.
- Real-world performance gains on machines with fewer cores or on I/O-constrained systems.
- Stability and compatibility with all gzip file variants and edge cases beyond standard FEXTRA blocks.
Package facts
| License | MIT License permissive |
| Python support | Supports the current Python release >=3.10 |
| Install friction | Low. Pure-Python wheel |
| Runtime dependencies | None |
| Maintenance | Actively maintained 234 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 225,931 / month, #9,210 on PyPI 30-day window, as of 2026-08-14 |
| Known vulnerabilities | None known OSV.dev, checked 2026-08-14 |
| Classifiers | Development Status :: 4 - BetaIntended Audience :: DevelopersLicense :: OSI Approved :: MIT LicenseOperating System :: OS IndependentProgramming Language :: Python :: 3Programming Language :: Python :: Implementation :: CPythonTopic :: Software Development :: Libraries :: Python Modules |
Evidence: pgzip-0.4.0-py3-none-any.whl
Tags
Let your AI agent find packages like this
Example. Real query, live index.
You found this page by searching. An agent finds it by wishing: SkillFed indexes 14,416 PyPI packages by what they can do, searchable in plain language.
wish › “multi-threaded gzip”
- pgzippgzip is a multi-threaded gzip implementation that accelerates…
- mgzipmgzip provides a drop-in replacement for Python's standard gzip…
- zlib-ngProvides faster zlib and gzip compression and decompression by…
Give your agent the search over MCP, or paste the wish link into any chat.
More Python Modules packages
Converts domain names between Unicode and ASCII-compatible encoding (Punycode) according to IDNA 2008 and Unicode Technical Standard 46, with security validation and broader script coverage than the standard library.
Install it if you work with internationalized domain names, need to validate domains, or use HTTP clients that depend on it transitively.
Setuptools is a Python build backend and package management tool that handles building, distributing, and installing Python packages, including support for C/C++ extension modules.
PyYAML parses and emits YAML 1.1 data format, enabling serialization and deserialization of configuration files and Python objects to and from human-readable YAML text.
Pydantic validates Python data structures against type hints, coercing and checking input at runtime to ensure it matches a declared schema.
Provides reusable metadata objects for use with PEP-593 `typing.Annotated` to express common constraints like bounds, collection sizes, and predicates on types.
Install it if you use or build libraries that need to express type constraints in a standardized, inspectable way—or if you want to annotate your own types with…
Provides runtime tools to inspect and introspect Python type annotations, enabling programmatic examination of type hints at execution time.
See also mgzip · gzip-stream · indexed-gzip · xopen · zopfli · zlib-state · Flask-Compress · zlib-ng · python-neo-lzf