{"id":16299697,"url":"https://github.com/dcwatson/deflate","last_synced_at":"2025-04-05T23:07:28.576Z","repository":{"id":43211207,"uuid":"273051602","full_name":"dcwatson/deflate","owner":"dcwatson","description":"Python extension wrapper for libdeflate.","archived":false,"fork":false,"pushed_at":"2025-03-30T01:09:54.000Z","size":107,"stargazers_count":26,"open_issues_count":3,"forks_count":6,"subscribers_count":4,"default_branch":"main","last_synced_at":"2025-04-01T14:13:44.289Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"C","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/dcwatson.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","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}},"created_at":"2020-06-17T18:36:06.000Z","updated_at":"2025-03-30T01:09:57.000Z","dependencies_parsed_at":"2024-04-19T17:43:43.389Z","dependency_job_id":"af6e75cf-22b9-4427-bc6e-9d9cef77d301","html_url":"https://github.com/dcwatson/deflate","commit_stats":{"total_commits":42,"total_committers":5,"mean_commits":8.4,"dds":0.5,"last_synced_commit":"d0c134610fb4f50978395fb40ae1e2d529779755"},"previous_names":[],"tags_count":4,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dcwatson%2Fdeflate","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dcwatson%2Fdeflate/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dcwatson%2Fdeflate/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dcwatson%2Fdeflate/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/dcwatson","download_url":"https://codeload.github.com/dcwatson/deflate/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247411232,"owners_count":20934653,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","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":"2024-10-10T20:49:11.144Z","updated_at":"2025-04-05T23:07:28.553Z","avatar_url":"https://github.com/dcwatson.png","language":"C","funding_links":[],"categories":[],"sub_categories":[],"readme":"# deflate API\n\nThis is a very thin Python wrapper Eric Biggers' excellent\n[libdeflate](https://github.com/ebiggers/libdeflate).\n\nCurrently, it handles:\n\n## Compression and decompression of gzip data, with a very basic API\n\n```python\nimport deflate\nlevel = 6  # The default; may be 1-12 for libdeflate.\ncompressed = deflate.gzip_compress(b\"hello world!\" * 1000, level)\noriginal = deflate.gzip_decompress(compressed)\n```\n\n## Compression and decompression of raw DEFLATE or zlib data\n\nThe original size of the decompressed data needs to be kept through additional logic.\n\n```python\nimport deflate\nlevel = 6  # The default; may be 1-12 for libdeflate.\ndata = b\"hello world!\" * 1000\n# DEFLATE\ncompressed = deflate.deflate_compress(data, level)\noriginal = deflate.deflate_decompress(compressed, len(data))\n# zlib\ncompressed = deflate.zlib_compress(data, level)\noriginal = deflate.zlib_decompress(compressed, len(data))\n```\n\n## CRC32 computation\n\n```python\nimport deflate\ncrc32 = deflate.crc32(b\"hello world! \")  # initial\ncrc32 = deflate.crc32(b\"hello universe!\", crc32)  # continued\n```\n\n## Adler-32 computation\n\n```python\nimport deflate\nadler32 = deflate.adler32(b\"hello world! \")  # initial\nadler32 = deflate.adler32(b\"hello universe!\", adler32)  # continued\n```\n\n# Installation\n\n```bash\npip install deflate\n```\n\nBy default, `deflate` will compile and statically link the bundled `libdeflate` when you\nbuild from source (or use the pre-compiled wheels). To link to a system-installed `libdeflate`, set the\n`LIBDEFLATE_PREFIX` environment variable and build from source:\n\n```\nLIBDEFLATE_PREFIX=/opt/homebrew/Cellar/libdeflate/1.20 pip install deflate --no-binary=deflate\n```\n\nBe warned: you can't use this wheel on a system without the referenced libdeflate.\n\n# Testing\n\n```bash\npip install -r requirements-dev.lock\npython -m pytest\n```\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdcwatson%2Fdeflate","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdcwatson%2Fdeflate","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdcwatson%2Fdeflate/lists"}