{"id":23214,"library":"aiohttp-zlib-ng","title":"aiohttp-zlib-ng","description":"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.","status":"active","version":"0.3.2","language":"python","source_language":"en","source_url":"https://github.com/bdraco/aiohttp-zlib-ng","tags":["aiohttp","zlib-ng","compression","performance"],"install":[{"cmd":"pip install aiohttp-zlib-ng","lang":"bash","label":"standard install"}],"dependencies":[{"reason":"aiohttp-zlib-ng is a monkey-patch for aiohttp's compression","package":"aiohttp","optional":false},{"reason":"optional extra for even faster compression (install aiohttp-zlib-ng[isal])","package":"isal","optional":true}],"imports":[{"note":"function is named install_zlib_ng","wrong":"from aiohttp_zlib_ng import install","symbol":"install_zlib_ng","correct":"from aiohttp_zlib_ng import install_zlib_ng"}],"quickstart":{"code":"import aiohttp\nfrom aiohttp_zlib_ng import install_zlib_ng\n\ninstall_zlib_ng()\n\nasync def main():\n    async with aiohttp.ClientSession() as session:\n        async with session.get('https://httpbin.org/get') as resp:\n            print(resp.status)","lang":"python","description":"Import and call install_zlib_ng() to enable zlib_ng support in aiohttp. Ensure aiohttp is installed."},"warnings":[{"fix":"Install extra: pip install aiohttp-zlib-ng[isal]","message":"v0.3.0 made isal optional; previously isal was required. To use isal, install with aiohttp-zlib-ng[isal].","severity":"breaking","affected_versions":">=0.3.0"},{"fix":"Call install_zlib_ng() at import time or at the very beginning of your application.","message":"install_zlib_ng() must be called before creating any aiohttp session; otherwise compression will not be patched.","severity":"gotcha","affected_versions":"all"},{"fix":"Verify installation: try installing with pip install aiohttp-zlib-ng and test on target platform.","message":"zlib_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.","severity":"gotcha","affected_versions":"all"}],"env_vars":null,"last_verified":"2026-05-01T00:00:00.000Z","next_check":"2026-07-30T00:00:00.000Z","problems":[{"fix":"Install: pip install aiohttp-zlib-ng, then import: from aiohttp_zlib_ng import install_zlib_ng","cause":"Library not installed or used incorrect import (note underscore not hyphen).","error":"ModuleNotFoundError: No module named 'aiohttp_zlib_ng'"},{"fix":"Use: from aiohttp_zlib_ng import install_zlib_ng","cause":"Wrong function name; correct name is install_zlib_ng.","error":"AttributeError: module 'aiohttp_zlib_ng' has no attribute 'install'"}],"ecosystem":"pypi","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null}