{"id":24433157,"url":"https://github.com/ap--/concatenated-zlib","last_synced_at":"2026-02-19T15:02:36.802Z","repository":{"id":175382654,"uuid":"653808474","full_name":"ap--/concatenated-zlib","owner":"ap--","description":"playground to test decompression of concatenated zlib chunks","archived":false,"fork":false,"pushed_at":"2023-06-15T12:39:10.000Z","size":43,"stargazers_count":2,"open_issues_count":1,"forks_count":1,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-10-23T09:51:33.146Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Cython","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/ap--.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2023-06-14T19:30:32.000Z","updated_at":"2024-05-12T00:08:04.000Z","dependencies_parsed_at":"2023-07-08T14:00:23.686Z","dependency_job_id":null,"html_url":"https://github.com/ap--/concatenated-zlib","commit_stats":null,"previous_names":["ap--/concatenated-zlib"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/ap--/concatenated-zlib","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ap--%2Fconcatenated-zlib","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ap--%2Fconcatenated-zlib/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ap--%2Fconcatenated-zlib/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ap--%2Fconcatenated-zlib/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ap--","download_url":"https://codeload.github.com/ap--/concatenated-zlib/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ap--%2Fconcatenated-zlib/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29619143,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-19T13:04:20.082Z","status":"ssl_error","status_checked_at":"2026-02-19T13:03:33.775Z","response_time":117,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2025-01-20T16:04:30.066Z","updated_at":"2026-02-19T15:02:36.790Z","avatar_url":"https://github.com/ap--.png","language":"Cython","funding_links":[],"categories":[],"sub_categories":[],"readme":"# concatenated_zlib\n\nthis is a playground repository to experiment with an zlib and zlibng\ndecompressor that can handle zlib compressed concatenated chunks.\n\nThe code here is basically copied from the excellent `imagecodecs` package:\nhttps://github.com/cgohlke/imagecodecs/\nand modified to support concatenated input.\n\n### description\n\nThe below fails to decompress concatenated zlib compressed blocks:\n```python\nimport zlib\nc0 = zlib.compress(b\"abc\")\nc1 = zlib.compress(b\"efg\")\n\nprint(zlib.decompress(c0 + c1))  # returns b\"abc\"\n```\n\nThis repo provides a zlib and zlibng based decompressor that supports concatenated\ninput:\n\n```python\nimport zlib\nfrom concatenated_zlib import zlib_concat_decode\nfrom concatenated_zlib import zlibng_concat_decode\nc0 = zlib.compress(b\"abc\")\nc1 = zlib.compress(b\"efg\")\n\nprint(zlib_concat_decode(c0 + c1))  # returns b\"abcefg\"\nprint(zlibng_concat_decode(c0 + c1))  # returns b\"abcefg\"\n```\n\n### benchmarks\n\nTo reproduce:\n```shell\n# ON A MAC YOU CAN INSTALL THE DEPENDECIES VIA homebrew\nbrew install zlib zlib-ng libdeflate\n# ^^^ install the corresponding *-dev packages on your OS accordingly\n\ngit clone --recursive https://github.com/ap--/concatenated-zlib.git\ncd concatenated-zlib/\npython3 -m venv venv\nsource venv/bin/activate\npython3 -m pip install .\ncd bench; python time_load_chunks.py\n```\n\nRun `cd bench; python time_load_chunks.py` to get some crude timing for the different\napproaches... Weirdly enough the cython implementation doesn't currently beat\nthe plain python stdlib decompression of individual chunks. Needs more\ninvestigation...\n\n\n### related info\n\n- https://stackoverflow.com/a/60208718 decompress concatenated zlib chunks\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fap--%2Fconcatenated-zlib","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fap--%2Fconcatenated-zlib","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fap--%2Fconcatenated-zlib/lists"}