mgzip
A multi-threading implementation of Python gzip module
Decision gist · record as of 2026-08-14
Yes, if you need faster GZIP compression/decompression on multi-core systems and can work around the missing seek/tell methods. Low install friction, no dependencies, MIT-licensed, and actively maintained. Not suitable if you rely on seek/tell or need production-grade stability—the package is still Beta.AI-flagged interpretation of the facts on this page — verify before relying
Before you install
- Requires Python 3.8 or later; seek() and tell() are not yet supported.
- Low install friction with no runtime dependencies.
- Actively maintained as of 2026-02-28 with recent development activity.
License · maintenance · safety
MIT License (permissive) — MIT License permits commercial and private use with minimal restrictions; suitable for most projects.
last release 2026-02-28 (167 days) · last repo commit 2026-02-28 · 59 stars
0 known vulnerabilities (OSV.dev, 2026-08-14) · 74,775 downloads/mo, #14,795 on PyPI
Alternatives
Verify before relying
import mgzip
with mgzip.open("file.txt.gz", "wt", thread=8, blocksize=200000000) as f:
f.write("data")
with mgzip.open("file.txt.gz", "rt", thread=8) as f:
data = f.read()- Whether seek() and tell() methods will be implemented in future releases
- Real-world performance gains on systems with fewer than 24 CPU cores
- Compatibility with compressed files created by other multi-threaded gzip implementations
What it is and what it does
mgzip is a multi-threaded implementation of Python's gzip module that parallelizes compression and decompression across CPU cores. It uses a block-indexed GZIP format (via the FEXTRA field defined in GZIP spec 4.3) to enable concurrent processing while remaining fully compatible with standard GZIP readers. The module replaces gzip's GzipFile class and open/compress/decompress functions with threaded equivalents.
The package is designed for scenarios where large files need fast compression or decompression on multi-core systems. It trades some compatibility (seek/tell not yet supported) for speed gains. The implementation is in Beta status and actively maintained, though the author notes that real-world performance depends on IO and Python interpreter limitations rather than pure CPU scaling.
Use it for
- Compress large log files or data dumps quickly on multi-core servers before archival or transfer.
- Decompress GZIP archives in parallel to speed up data pipeline initialization on systems with spare CPU capacity.
- Replace standard gzip calls in existing code with minimal changes to gain multi-threaded performance.
- Process block-indexed GZIP files created by mgzip itself for faster random-access decompression.
- Reduce compression time in batch data processing workflows where IO is not the bottleneck.
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 on multi-core systems and can work around the missing seek/tell methods.
Low install friction, no dependencies, MIT-licensed, and actively maintained. Not suitable if you rely on seek/tell or need production-grade stability—the package is still Beta.
Install
mgzip on PyPI
Before you install
Low install friction with no runtime dependencies. Actively maintained as of 2026-02-28 with recent development activity.
Requires Python 3.8 or later; seek() and tell() are not yet supported.
License in practice
MIT License permits commercial and private use with minimal restrictions; suitable for most projects.
Quickstart
import mgzip
with mgzip.open("file.txt.gz", "wt", thread=8, blocksize=200000000) as f:
f.write("data")
with mgzip.open("file.txt.gz", "rt", thread=8) as f:
data = f.read()
Verify before relying
- Whether seek() and tell() methods will be implemented in future releases
- Real-world performance gains on systems with fewer than 24 CPU cores
- Compatibility with compressed files created by other multi-threaded gzip implementations
Package facts
| License | MIT License permissive |
| Python support | Supports the current Python release >=3.8 |
| Install friction | Low. Pure-Python wheel |
| Runtime dependencies | None |
| Maintenance | Actively maintained 167 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 74,775 / month, #14,795 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 :: 3.10Programming Language :: Python :: 3.11Programming Language :: Python :: 3.12Programming Language :: Python :: 3.13Programming Language :: Python :: 3.14Programming Language :: Python :: 3.8Programming Language :: Python :: 3.9Programming Language :: Python :: Implementation :: CPythonTopic :: Software Development :: Libraries :: Python Modules |
Evidence: mgzip-0.2.5-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 › “parallel gzip compression”
- mgzipmgzip provides a drop-in replacement for Python's standard gzip…
- pgzippgzip is a multi-threaded gzip implementation that accelerates…
- xopenxopen provides a drop-in replacement for Python's built-in open()…
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 pgzip · gzip-stream · indexed-gzip · zopfli · zlib-ng · python-neo-lzf · Flask-Compress · xopen · pyzstd