Registry / serialization / stream-inflate

stream-inflate

JSON →
library0.0.43pypypi✓ verified 21d ago

stream-inflate is a Python library, currently at version 0.0.43, designed to uncompress DEFLATE and DEFLATE64 streams. It is written in pure Python but is compiled with Cython for performance. The library maintains an active development status with frequent, small releases addressing new Python versions and bug fixes.

pip install stream-inflate
INSTALL
IMPORT
SIG · STREAM-INFLATE
S
stream-inflate
serializationpythonv0.0.43
Install
1.6s avg
Import
Disk
18MB
Pass rate
10/ 10
Env Coverage10 / 10
glibc
3.93.13
musl
3.93.13
Install & Compatibility
Where this runs
tested against v0.0.43 · pip install
no network on importno background threads
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
musl
py 3.103.95 runs
installs and imports cleanly · install 0.0s · import 0.000s · 19.5MB
glibc
py 3.103.95 runs
installs and imports cleanly · install 1.6s · import 0.000s · 21MB
18MB installed
● package 18MB
Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

stream_inflate
from stream_inflate import stream_inflate
stream_inflate64
from stream_inflate import stream_inflate64

This quickstart demonstrates how to use `stream_inflate` to decompress a DEFLATE stream. The `stream_inflate` function takes an iterable that yields bytes of the compressed stream and returns a tuple. The first element of the tuple is an iterator yielding uncompressed byte chunks. The second element is a callable that returns the index of the end of the compressed stream, relative to the last data chunk consumed, useful for streams with trailing data.

import os from stream_inflate import stream_inflate def get_compressed_data_example(): # This is a dummy example. In a real scenario, this would yield bytes # from a DEFLATE-compressed source (e.g., network stream, file). # For demonstration, we'll use a pre-compressed string. # 'x\x9c\xcbH\xcd\xc9\xc9W(\xcf/\xcaIQ\x04\x00\x1a\x07\x04\x16' is DEFLATE for 'Hello, world!' yield b'x\x9c\xcbH\xcd\xc9\xc9W(\xcf/\xcaIQ\x04\x00\x1a\x07\x04\x16' # To uncompress a DEFLATE stream uncompressed_chunks_iterator, _ = stream_inflate(get_compressed_data_example()) for chunk in uncompressed_chunks_iterator: print(f"Received uncompressed chunk: {chunk.decode()}") # Example for a real network stream (requires httpx, not a direct dependency of stream-inflate) # import httpx # def compressed_chunks_from_url(): # with httpx.stream('GET', 'https://www.example.com/my_deflate_file') as r: # yield from r.iter_raw(chunk_size=65536) # # For uncompressed_chunk in stream_inflate(compressed_chunks_from_url()): # print(uncompressed_chunk)
Debug
Known issues
breakingPython 3.6 support was officially dropped in version 0.0.42. Users on Python 3.6 or older must upgrade their Python environment or remain on an older version of stream-inflate.
fix
Upgrade Python to 3.7.7 or newer.
affects: <0.0.42
gotchaVersions prior to 0.0.37 contained a bug that could lead to an infinite loop when decompressing certain DEFLATE streams. It is highly recommended to upgrade to version 0.0.37 or newer to avoid this issue.
fix
Upgrade to stream-inflate 0.0.37 or later.
affects: <0.0.37
gotchaThe `stream_inflate` function has two primary usage patterns. The quickstart demonstrates `stream_inflate(iterable_of_chunks)`, which returns a tuple `(uncompressed_iterator, get_end_index)`. An alternative, more advanced pattern shown in PyPI documentation is to call `stream_inflate()` without arguments to get a tuple of functions `(uncompressed_chunks_callable, is_done_callable, num_bytes_unconsumed_callable)` for fine-grained control over stream processing. Ensure you use the correct pattern for your needs.
fix
Refer to the official documentation for the specific usage pattern that fits your streaming requirements, particularly if you need to manage stream state or handle trailing data.
affects: >=0.0.37
Upgrade
Version history
0.0.43latest on PyPI · released Mar 4, 2026
Audit
Dependencies

No dependency data recorded yet.

Agent activity
5 hits · last 30 days
node
4
Resources
stream-inflate — pip install stream-inflate · libregistry