stream-inflate
Uncompress DEFLATE streams in pure Python.
Installation
pip install stream-inflate
Usage
from stream_inflate import stream_inflate
import httpx
def compressed_chunks():
# Iterable that yields the bytes of a DEFLATE-compressed stream
with httpx.stream('GET', 'https://www.example.com/my.txt') as r:
yield from r.iter_raw(chunk_size=65536)
for uncompressed_chunk in stream_inflate(compressed_chunks()):
print(uncompressed_chunk)