Registry / serialization / inflate64

inflate64

JSON →
library1.0.4pypypi✓ verified 25d ago

A Python library providing deflate64 compression and decompression functionality. It leverages the zlib-ng library for efficient performance and natively supports the larger dictionary sizes (up to 64KB) characteristic of deflate64, which can be beneficial for highly repetitive large files. The current version is 1.0.4. Releases are infrequent, typically for minor fixes or updates.

pip install inflate64
INSTALL
IMPORT
SIG · INFLATE64
I
inflate64
serializationpythonv1.0.4
Install
1.7s avg
Import
107ms
Disk
16MB
Pass rate
10/ 10
Env Coverage10 / 10
glibc
3.93.13
musl
3.93.13
Install & Compatibility
Where this runs
tested against v1.0.4 · 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.112s · 18MB
glibc
py 3.103.95 runs
installs and imports cleanly · install 1.7s · import 0.102s · 19MB
16MB installed
● package 16MB
Code
Verified usage

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

Deflater
from inflate64 import Deflater
import inflate64; inflate64.inflate
Inflater
from inflate64 import Inflater
metadata
from inflate64 import metadata

Demonstrates basic compression and decompression of a byte string using `inflate64.deflate` and `inflate64.inflate`. The `max_buffer_size` parameter in `inflate` is highlighted as a critical consideration for robust decompression.

import inflate64 original_data = b"This is some data to be compressed using deflate64. It's important to remember that deflate64 allows for larger dictionary sizes, which can be beneficial for highly repetitive large files. " * 100 # Compress data using deflate64 compressed_data = inflate64.deflate(original_data, level=9) print(f"Original size: {len(original_data)} bytes") print(f"Compressed size: {len(compressed_data)} bytes") # Decompress data using inflate64 # The max_buffer_size is crucial for inflate to prevent errors on large inputs. # Setting it to 0 attempts auto-sizing, but providing a safe upper bound is often better. # Here we give some headroom (e.g., original size * 2). decompressed_data = inflate64.inflate(compressed_data, max_buffer_size=len(original_data) * 2) assert original_data == decompressed_data print("Decompression successful!")
Debug
Known issues
gotchaThe `inflate64.inflate` function requires a `max_buffer_size` argument. If the actual decompressed data size exceeds this value, an `inflate64.error` will be raised. A value of 0 attempts to auto-size but may not be suitable for all scenarios, especially with potentially malicious or malformed compressed data.
fix
Always provide a `max_buffer_size` to `inflate64.inflate` that is at least as large as the expected decompressed data. For unknown sizes, use a generous estimate or set to 0 and implement robust error handling to catch `inflate64.error`.
affects: >=1.0.0
gotchaWhile `inflate64` implements the deflate64 standard (with larger dictionary sizes), the `wbits` parameter for both `deflate` and `inflate` functions behaves similarly to standard `zlib`. This parameter primarily controls the presence and type of header/footer (raw deflate, zlib, or gzip), rather than directly configuring the deflate64 window size.
fix
Understand that the library handles the deflate64-specific dictionary size implicitly. Use `wbits=15` for standard zlib streams, `-15` for raw deflate streams, or `31` for gzip streams, as you would with a standard `zlib` library.
affects: >=1.0.0
gotchaThis library is a C extension and may require C build tools (like `gcc` on Linux/macOS or MSVC on Windows) for installation if a pre-built wheel is not available for your specific Python version and operating system. This is a common requirement for Python packages wrapping native libraries.
fix
If `pip install inflate64` fails with compilation errors, ensure you have the necessary C compiler tools installed on your system. For Windows, install 'Build Tools for Visual Studio'; for Debian/Ubuntu, `sudo apt-get install build-essential`.
affects: >=1.0.0
breakingThe `inflate64` library is primarily designed for decompression (inflation) and does not directly expose a `deflate` function for compression. Attempting to call `inflate64.deflate` will result in an `AttributeError`.
fix
For deflate (compression) functionality, use Python's standard `zlib` library, or another dedicated compression library. The `inflate64` library focuses solely on `inflate` (decompression) with deflate64 support.
affects: >=1.0.0
breakingThe `inflate64` module does not expose a top-level `deflate` function directly. Instead, compression is managed through the `inflate64.Deflater` class, which needs to be instantiated. Attempting to call `inflate64.deflate()` will result in an `AttributeError`.
fix
Replace calls to `inflate64.deflate()` with an instantiation of the `inflate64.Deflater` class. For example, use `compressor = inflate64.Deflater(level=9)` and then use its methods like `compressed_data = compressor.compress(data) + compressor.flush()` for compression.
affects: >=1.0.0
Upgrade
Version history
1.0.4latest on PyPI · released Nov 28, 2025
Audit
Dependencies

No dependency data recorded yet.

Agent activity
9 hits · last 30 days
node
8
Resources
inflate64 — pip install inflate64 · libregistry