{"id":26207347,"url":"https://github.com/oelin/coco","last_synced_at":"2026-04-19T16:02:30.396Z","repository":{"id":89778605,"uuid":"603009379","full_name":"oelin/coco","owner":"oelin","description":"A library for creating self-extracting archives in Python.","archived":false,"fork":false,"pushed_at":"2023-06-18T09:03:33.000Z","size":34,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-12-27T01:59:08.639Z","etag":null,"topics":["data-compression","data-science","self-extracting-archive","serialization"],"latest_commit_sha":null,"homepage":"","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/oelin.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-02-17T12:29:55.000Z","updated_at":"2023-02-17T12:52:51.000Z","dependencies_parsed_at":"2025-03-12T05:32:11.365Z","dependency_job_id":"b4914dd2-fecd-46b0-ad2f-cdcaa59f84b0","html_url":"https://github.com/oelin/coco","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/oelin/coco","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/oelin%2Fcoco","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/oelin%2Fcoco/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/oelin%2Fcoco/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/oelin%2Fcoco/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/oelin","download_url":"https://codeload.github.com/oelin/coco/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/oelin%2Fcoco/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32012787,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-18T20:23:30.271Z","status":"online","status_checked_at":"2026-04-19T02:00:07.110Z","response_time":55,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"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":["data-compression","data-science","self-extracting-archive","serialization"],"created_at":"2025-03-12T05:32:04.236Z","updated_at":"2026-04-19T16:02:30.387Z","avatar_url":"https://github.com/oelin.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003cdiv align=center\u003e\n  \u003cimg src='https://github.com/oelin/coco/blob/main/images/snake.svg' width=60%\u003e\n\u003c/div\u003e\n\n# Coco\n\nA library for creating self-extracting archives in Python.\n\n\n## Overview\n\nCoco is a data serialization library specialized for creating self-extracting archives (SEAs), i.e. a compressed stream which includes the decoder. SEAs are useful for distributing highly compressed files with uncommon, bespoke or proprietary codecs. The library currently utilized pickle as the outermost serialization format, however this is subject to change.\n\n\n### Self-extracting Archives\n\nA self-extracting archive is type of compressed file which also include the decompression program. A simple example would be an image compressed using LZW with an LZW decoder appended to the end of the file. The primary advantage of SEAs is that they allow for highly optimized domain specific compression while maintaining portability. \n\n\n### Security\n\nOne risk of SEAs is that they can essentially execute arbitrary code. The risk associated with decompressing an SEA is similar to the risk associated with running third party executables. For this reason, it's good practice to extract the data in a sandboxed environment.\n\n\n## Usage\n\nCreate a decoder/extractor.\n\n```py\nimport coco\n\n@coco.decoder\ndef decode(data):\n  # Decompression logic...\n```\n\nCreate a self-extracting archive.\n\n```py\narchive = coco.encode(data, decoder)\n```\n\nExtract the original data.\n\n```py\ndata = coco.decode(archive)\n```\n\n## Installation\n\n```sh\npip install coco\n```\n\n\n## API\n\n#### `coco.encode(data: Data, decoder: Decoder) -\u003e Data`\n\nTakes a compressed data stream and a decoder, returns a self-extracting archive.\n\n#### `coco.decode(data: Data) -\u003e Data`\n\nTakes a self-extracting archive and returns an uncompressed data stream.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Foelin%2Fcoco","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Foelin%2Fcoco","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Foelin%2Fcoco/lists"}