Registry / http-networking / aiohttp-zlib-ng

aiohttp-zlib-ng

JSON →
library0.3.2pypypi✓ verified 80d ago

A library to enable zlib_ng (and optionally isal) for aiohttp, providing faster compression/decompression. Current version 0.3.2, requires Python >=3.8, <4.0. Maintained by bdraco, release cadence is sporadic.

pip install aiohttp-zlib-ng
INSTALL
IMPORT
SIG · AIOHTTP-ZLIB-NG
A
aiohttp-zlib-ng
http-networkingpythonv0.3.2
Install
4.1s avg
Import
Disk
27MB
Pass rate
10/ 10
Env Coverage10 / 10
glibc
3.93.13
musl
3.93.13
Install & Compatibility
Where this runs
tested against v0.3.2 · 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 · 27.4MB
glibc
py 3.103.95 runs
installs and imports cleanly · install 4.1s · import 0.000s · 30MB
27MB installed
● package 27MB
Code
Verified usage

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

enable_zlib_ng
from aiohttp_zlib_ng import enable_zlib_ng
from aiohttp_zlib_ng import install_zlib_ng
disable_zlib_ng
from aiohttp_zlib_ng import disable_zlib_ng
best_zlib
from aiohttp_zlib_ng import best_zlib

Import and call install_zlib_ng() to enable zlib_ng support in aiohttp. Ensure aiohttp is installed.

import aiohttp from aiohttp_zlib_ng import install_zlib_ng install_zlib_ng() async def main(): async with aiohttp.ClientSession() as session: async with session.get('https://httpbin.org/get') as resp: print(resp.status)
Debug
Known issues
breakingv0.3.0 made isal optional; previously isal was required. To use isal, install with aiohttp-zlib-ng[isal].
fix
Install extra: pip install aiohttp-zlib-ng[isal]
affects: >=0.3.0
gotchainstall_zlib_ng() must be called before creating any aiohttp session; otherwise compression will not be patched.
fix
Call install_zlib_ng() at import time or at the very beginning of your application.
affects: all
gotchazlib_ng may not be available on all platforms (e.g., missing AVX instructions). The library silently falls back to standard zlib; check logs for warnings.
fix
Verify installation: try installing with pip install aiohttp-zlib-ng and test on target platform.
affects: all
Upgrade
Version history
0.3.2latest on PyPI · released Jun 24, 2024
Audit
Dependencies
aiohttprequiredaiohttp-zlib-ng is a monkey-patch for aiohttp's compression
isaloptionaloptional extra for even faster compression (install aiohttp-zlib-ng[isal])
Agent activity
47 hits · last 30 days
node
38
OpenAI (training)
1
Resources