indexed-gzip
Fast random access of gzip files in Python
Decision gist · record as of 2026-08-14
Yes, if you regularly read from large gzip files and need random access. The permissive Zlib license and active maintenance make it safe to adopt. Install friction is moderate due to compilation requirements, but pre-built wheels cover common platforms. No security vulnerabilities are known. Not necessary if you only read sequentially or work with small files.AI-flagged interpretation of the facts on this page — verify before relying
Before you install
- Requires Python >= 3.7; C/Cython extension must compile or a pre-built wheel must be available for your platform.
- Medium install friction due to compiled C/Cython components requiring a build step, but pre-built wheels are available for common platforms (macOS, Linux, Windows across multiple architectures).
- Last release was 249 days ago with active repository maintenance.
License · maintenance · safety
Zlib (permissive) — Licensed under Zlib (permissive), allowing free use, modification, and distribution with minimal restrictions—suitable for both open-source and proprietary projects.
last release 2025-12-08 (249 days) · last repo commit 2026-08-01 · 115 stars
0 known vulnerabilities (OSV.dev, 2026-08-14) · 131,889 downloads/mo, #11,571 on PyPI
Alternatives
Verify before relying
import indexed_gzip as igzip
myfile = igzip.IndexedGzipFile('big_file.gz')
myfile.seek(234195)
data = myfile.read(1048576)- Whether the index-building overhead is acceptable for your typical file sizes and access patterns.
- Performance gains compared to standard gzip.GzipFile for your specific use case and seek patterns.
What it is and what it does
indexed_gzip is a Python extension that replaces the standard gzip.GzipFile class with IndexedGzipFile, which enables efficient random access to gzip-compressed files. Instead of decompressing from the start of the file every time you seek to a new location, it builds an index of seek points (mappings between compressed and uncompressed positions) with accompanying decompression state. This allows you to decompress only the data needed to reach your target location, typically requiring far less work than the standard library's approach.
The package is designed for reading large gzip files where random access is needed—particularly NIFTI neuroimaging files, though it works with any gzip file. It integrates seamlessly with nibabel for medical imaging workflows and supports index import/export to pre-compute and cache indexes for frequently accessed files. No runtime dependencies are required beyond Python itself.
Use it for
- Reading specific slices or regions from large compressed neuroimaging (NIFTI) files without decompressing the entire file.
- Accessing arbitrary byte ranges in large gzip archives where seek performance is critical.
- Integrating with nibabel to load compressed medical images with automatic index building on first access.
- Pre-computing and caching indexes for large gzip files to avoid rebuild overhead on repeated access.
- Replacing gzip.GzipFile in existing code that needs faster random access without changing the API.
Worth the install?
AI-flagged interpretation of the facts on this page. Verify before relying on it.
Yes, if you regularly read from large gzip files and need random access.
The permissive Zlib license and active maintenance make it safe to adopt. Install friction is moderate due to compilation requirements, but pre-built wheels cover common platforms. No security vulnerabilities are known. Not necessary if you only read sequentially or work with small files.
Install
indexed-gzip on PyPI
Before you install
Medium install friction due to compiled C/Cython components requiring a build step, but pre-built wheels are available for common platforms (macOS, Linux, Windows across multiple architectures). Last release was 249 days ago with active repository maintenance.
Requires Python >= 3.7; C/Cython extension must compile or a pre-built wheel must be available for your platform.
License in practice
Licensed under Zlib (permissive), allowing free use, modification, and distribution with minimal restrictions—suitable for both open-source and proprietary projects.
Quickstart
import indexed_gzip as igzip
myfile = igzip.IndexedGzipFile('big_file.gz')
myfile.seek(234195)
data = myfile.read(1048576)
Verify before relying
- Whether the index-building overhead is acceptable for your typical file sizes and access patterns.
- Performance gains compared to standard gzip.GzipFile for your specific use case and seek patterns.
Package facts
| License | Zlib permissive |
| Python support | Supports the current Python release >=3.7 |
| Install friction | Medium. Platform-specific wheel |
| Runtime dependencies | None |
| Maintenance | Actively maintained 249 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 131,889 / month, #11,571 on PyPI 30-day window, as of 2026-08-14 |
| Known vulnerabilities | None known OSV.dev, checked 2026-08-14 |
| Classifiers | Development Status :: 3 - AlphaIntended Audience :: DevelopersProgramming Language :: CProgramming Language :: CythonProgramming Language :: Python :: 2Programming Language :: Python :: 3Topic :: System :: Archiving :: Compression |
Evidence: indexed_gzip-1.10.3-cp310-cp310-macosx_10_9_universal2.whl; indexed_gzip-1.10.3-cp310-cp310-macosx_10_9_x86_64.whl; indexed_gzip-1.10.3-cp310-cp310-macosx_11_0_arm64.whl; indexed_gzip-1.10.3-cp310-cp310-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl; indexed_gzip-1.10.3-cp310-cp310-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl; indexed_gzip-1.10.3-cp310-cp310-manylinux_2_28_i686.whl; indexed_gzip-1.10.3-cp310-cp310-musllinux_1_2_aarch64.whl; indexed_gzip-1.10.3-cp310-cp310-musllinux_1_2_i686.whl; indexed_gzip-1.10.3-cp310-cp310-musllinux_1_2_x86_64.whl; indexed_gzip-1.10.3-cp310-cp310-win32.whl; indexed_gzip-1.10.3-cp310-cp310-win_amd64.whl; indexed_gzip-1.10.3-cp311-abi3-macosx_10_9_universal2.whl; indexed_gzip-1.10.3-cp311-abi3-macosx_10_9_x86_64.whl; indexed_gzip-1.10.3-cp311-abi3-macosx_11_0_arm64.whl; indexed_gzip-1.10.3-cp311-abi3-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl; indexed_gzip-1.10.3-cp311-abi3-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl; indexed_gzip-1.10.3-cp311-abi3-manylinux_2_28_i686.whl; indexed_gzip-1.10.3-cp311-abi3-musllinux_1_2_aarch64.whl; indexed_gzip-1.10.3-cp311-abi3-musllinux_1_2_i686.whl; indexed_gzip-1.10.3-cp311-abi3-musllinux_1_2_x86_64.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 › “random access gzip files”
- indexed-gzipProvides fast random access to gzip-compressed files by building an…
- mrcfilemrcfile reads and writes MRC2014 format files used in structural…
- zlib-stateProvides low-level access to zlib decompression with the ability to…
Give your agent the search over MCP, or paste the wish link into any chat.
More Compression packages
Provides Python bindings to the Brotli compression library, enabling lossless compression and decompression using a modern LZ77 variant with Huffman coding and context modeling.
Install it if you need Brotli compression in Python; the API is straightforward and the library is battle-tested.
Provides Zstandard compression support for Python versions before 3.14, backporting the standard library's zstd module along with zstd-enabled tarfile and zipfile modules.
Zopfli is a Python binding for Google's Zopfli compression library, providing higher-density compression for zlib and gzip formats than standard algorithms, with tunable iteration and block-splitting parameters.
Python binding for Google's Snappy compression library, providing fast compression and decompression of data via the cramjam backend.
However, dormant maintenance (715 days since last release) means security or compatibility issues may not be addressed quickly.
pyzipper replaces Python's standard zipfile module to read and write AES-encrypted zip archives, using the WinZip AES encryption specification.
Provides Python bindings to the Zstandard (zstd) compression library with an API similar to bz2, lzma, and zlib modules.
See also pgzip · mgzip · xopen · zlib-ng · gzip-stream · zlib-state · compress-pickle · bz2file · python-lzf