{"id":17526971,"url":"https://github.com/karlicoss/kompress","last_synced_at":"2025-04-03T02:30:46.862Z","repository":{"id":197883595,"uuid":"699578342","full_name":"karlicoss/kompress","owner":"karlicoss","description":"Helper to allow accessing compressed files/directories via pathlib.Path","archived":false,"fork":false,"pushed_at":"2025-02-05T23:50:01.000Z","size":49,"stargazers_count":4,"open_issues_count":1,"forks_count":1,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-04-02T20:05:08.680Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Python","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/karlicoss.png","metadata":{"files":{"readme":"README.md","changelog":null,"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":"2023-10-02T22:58:53.000Z","updated_at":"2025-02-05T23:50:03.000Z","dependencies_parsed_at":"2024-10-20T18:18:51.172Z","dependency_job_id":null,"html_url":"https://github.com/karlicoss/kompress","commit_stats":null,"previous_names":["karlicoss/kompress"],"tags_count":6,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/karlicoss%2Fkompress","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/karlicoss%2Fkompress/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/karlicoss%2Fkompress/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/karlicoss%2Fkompress/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/karlicoss","download_url":"https://codeload.github.com/karlicoss/kompress/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":246925196,"owners_count":20855853,"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-20T15:02:40.392Z","updated_at":"2025-04-03T02:30:46.571Z","avatar_url":"https://github.com/karlicoss.png","language":"Python","funding_links":[],"categories":["Python"],"sub_categories":[],"readme":"`kompress` lets you transparently decompress common archive formats while using `pathlib.Path` objects.\n\nIt attempts to keep the API as close to pathlib, but things may not be perfect yet\n\nThe common case for this is:\n\n- You have a compressed file that when decompressed contains some text\n- You have a function (perhaps from another library, that you don't control), that knows how to take a `pathlib.Path` object and call `.read()` or `.read_text()` on it\n\nWithout wrapping the function or adding logic to let it read from compressed files, this lets you do the following:\n\n```python\nfrom pathlib import Path\nfrom kompress import CPath, is_compressed\n\ndef char_count(path: Path) -\u003e int:\n    # here, if a CPath is passed, it decompresses and returns a string\n    return len(path.read_text())\n\ninp = input(\"Enter a file to process: \")  # file came from user\nchar_count(CPath(inp))\n```\n\nThis currently supports these archive formats:\n\n- `.xz`\n- `.zip`\n- `.lz4` (`pip install 'kompress[lz4]'`)\n- `.zstd` (`pip install 'kompress[zstd]'`)\n- `.zst`\n- `.tar.gz`\n- `.gz`\n\nIf it doesn't recognize the filetype, it will just call `pathlib.Path.open` like normal\n\nOriginally discussed in this [HPI issue](https://github.com/karlicoss/HPI/issues/20)\n\n## Installing\n\n`pip install kompress`\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkarlicoss%2Fkompress","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fkarlicoss%2Fkompress","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkarlicoss%2Fkompress/lists"}