{"id":21834215,"url":"https://github.com/codeclysm/extract","last_synced_at":"2025-09-23T09:49:41.878Z","repository":{"id":10687430,"uuid":"66632505","full_name":"codeclysm/extract","owner":"codeclysm","description":"A Go library to extract archives in zip, tar.gz or tar.bz2 formats","archived":false,"fork":false,"pushed_at":"2024-08-08T14:55:51.000Z","size":191,"stargazers_count":49,"open_issues_count":6,"forks_count":20,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-09-20T13:38:58.691Z","etag":null,"topics":["archive","bz2","extract","golang-library","tar","zip"],"latest_commit_sha":null,"homepage":null,"language":"Go","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/codeclysm.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":"2016-08-26T08:51:43.000Z","updated_at":"2025-08-17T13:28:14.000Z","dependencies_parsed_at":"2024-06-18T15:29:56.637Z","dependency_job_id":"357c68d9-df74-4aa5-8b5d-e536f4940ce2","html_url":"https://github.com/codeclysm/extract","commit_stats":null,"previous_names":[],"tags_count":14,"template":false,"template_full_name":null,"purl":"pkg:github/codeclysm/extract","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/codeclysm%2Fextract","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/codeclysm%2Fextract/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/codeclysm%2Fextract/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/codeclysm%2Fextract/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/codeclysm","download_url":"https://codeload.github.com/codeclysm/extract/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/codeclysm%2Fextract/sbom","scorecard":{"id":296108,"data":{"date":"2025-08-11","repo":{"name":"github.com/codeclysm/extract","commit":"eaeff3236ebe82039553f39bc285ee5c79caae3c"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":3.9,"checks":[{"name":"Code-Review","score":5,"reason":"Found 7/14 approved changesets -- score normalized to 5","details":null,"documentation":{"short":"Determines if the project requires human code review before pull requests (aka merge requests) are merged.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#code-review"}},{"name":"Dangerous-Workflow","score":10,"reason":"no dangerous workflow patterns detected","details":null,"documentation":{"short":"Determines if the project's GitHub Action workflows avoid dangerous patterns.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#dangerous-workflow"}},{"name":"Maintained","score":0,"reason":"0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project is \"actively maintained\".","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#maintained"}},{"name":"Binary-Artifacts","score":10,"reason":"no binaries found in the repo","details":null,"documentation":{"short":"Determines if the project has generated executable (binary) artifacts in the source repository.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#binary-artifacts"}},{"name":"Packaging","score":-1,"reason":"packaging workflow not detected","details":["Warn: no GitHub/GitLab publishing workflow detected."],"documentation":{"short":"Determines if the project is published as a package that others can easily download, install, easily update, and uninstall.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#packaging"}},{"name":"Pinned-Dependencies","score":0,"reason":"dependency not pinned by hash detected -- score normalized to 0","details":["Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/test.yaml:16: update your workflow using https://app.stepsecurity.io/secureworkflow/codeclysm/extract/test.yaml/master?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/test.yaml:17: update your workflow using https://app.stepsecurity.io/secureworkflow/codeclysm/extract/test.yaml/master?enable=pin","Info:   0 out of   2 GitHub-owned GitHubAction dependencies pinned"],"documentation":{"short":"Determines if the project has declared and pinned the dependencies of its build process.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#pinned-dependencies"}},{"name":"Token-Permissions","score":0,"reason":"detected GitHub workflow tokens with excessive permissions","details":["Warn: no topLevel permission defined: .github/workflows/test.yaml:1","Info: no jobLevel write permissions found"],"documentation":{"short":"Determines if the project's workflows follow the principle of least privilege.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#token-permissions"}},{"name":"CII-Best-Practices","score":0,"reason":"no effort to earn an OpenSSF best practices badge detected","details":null,"documentation":{"short":"Determines if the project has an OpenSSF (formerly CII) Best Practices Badge.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#cii-best-practices"}},{"name":"Security-Policy","score":0,"reason":"security policy file not detected","details":["Warn: no security policy file detected","Warn: no security file to analyze","Warn: no security file to analyze","Warn: no security file to analyze"],"documentation":{"short":"Determines if the project has published a security policy.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#security-policy"}},{"name":"Fuzzing","score":0,"reason":"project is not fuzzed","details":["Warn: no fuzzer integrations found"],"documentation":{"short":"Determines if the project uses fuzzing.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#fuzzing"}},{"name":"License","score":10,"reason":"license file detected","details":["Info: project has a license file: LICENSE:0","Info: FSF or OSI recognized license: MIT License: LICENSE:0"],"documentation":{"short":"Determines if the project has defined a license.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#license"}},{"name":"Signed-Releases","score":-1,"reason":"no releases found","details":null,"documentation":{"short":"Determines if the project cryptographically signs release artifacts.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#signed-releases"}},{"name":"Branch-Protection","score":0,"reason":"branch protection not enabled on development/release branches","details":["Warn: branch protection not enabled for branch 'master'"],"documentation":{"short":"Determines if the default and release branches are protected with GitHub's branch protection settings.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#branch-protection"}},{"name":"Vulnerabilities","score":10,"reason":"0 existing vulnerabilities detected","details":null,"documentation":{"short":"Determines if the project has open, known unfixed vulnerabilities.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#vulnerabilities"}},{"name":"SAST","score":0,"reason":"SAST tool is not run on all commits -- score normalized to 0","details":["Warn: 0 commits out of 24 are checked with a SAST tool"],"documentation":{"short":"Determines if the project uses static code analysis.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#sast"}}]},"last_synced_at":"2025-08-17T19:32:47.171Z","repository_id":10687430,"created_at":"2025-08-17T19:32:47.171Z","updated_at":"2025-08-17T19:32:47.171Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":276554027,"owners_count":25662960,"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","status":"online","status_checked_at":"2025-09-23T02:00:09.130Z","response_time":73,"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":["archive","bz2","extract","golang-library","tar","zip"],"created_at":"2024-11-27T20:01:41.752Z","updated_at":"2025-09-23T09:49:41.848Z","avatar_url":"https://github.com/codeclysm.png","language":"Go","funding_links":[],"categories":["Go"],"sub_categories":[],"readme":"# Extract\n\n[![Build Status](https://github.com/codeclysm/extract/actions/workflows/test.yaml/badge.svg?branch=master)](https://github.com/codeclysm/extract/actions/workflows/test.yaml)\n[![GitHub license](https://img.shields.io/badge/license-MIT-blue.svg)](https://raw.githubusercontent.com/codeclysm/extract/master/LICENSE)\n[![Godoc Reference](https://img.shields.io/badge/Godoc-Reference-blue.svg)](https://godoc.org/github.com/codeclysm/extract)\n\n    import \"github.com/codeclysm/extract/v4\"\n\nPackage extract allows to extract archives in zip, tar.gz or tar.bz2 formats\neasily.\n\nMost of the time you'll just need to call the proper function with a Reader and\na destination:\n\n```go\nfile, _ := os.Open(\"path/to/file.tar.bz2\")\nextract.Bz2(context.TODO, file, \"/path/where/to/extract\", nil)\n```\n\nor also:\n\n```go\ndata, _ := ioutil.ReadFile(\"path/to/file.tar.bz2\")\nbuffer := bytes.NewBuffer(data)\nextract.Bz2(context.TODO, buffer, \"/path/where/to/extract\", nil)\n```\n\nSometimes you'll want a bit more control over the files, such as extracting a\nsubfolder of the archive. In this cases you can specify a renamer func that will\nchange the path for every file:\n\n```go\nvar shift = func(path string) string {\n    parts := strings.Split(path, string(filepath.Separator))\n    parts = parts[1:]\n    return strings.Join(parts, string(filepath.Separator))\n}\nextract.Bz2(context.TODO, file, \"/path/where/to/extract\", shift)\n```\n\nIf you don't know which archive you're dealing with (life really is always a surprise) you can use Archive, which will infer the type of archive from the first bytes\n\n```go\nextract.Archive(context.TODO, file, \"/path/where/to/extract\", nil)\n```\n\nIf you need more control over how your files will be extracted you can use an Extractor.\n\nIt Needs a FS object that implements the FS interface:\n\n```go\ntype FS interface {\n    Link(string, string) error\n    MkdirAll(string, os.FileMode) error\n    OpenFile(name string, flag int, perm os.FileMode) (*os.File, error)\n    Symlink(string, string) error\n    Remove(path string) error\n    Stat(name string) (os.FileInfo, error)\n    Chmod(name string, mode os.FileMode) error\n}\n```\n\nwhich contains only the required function to perform an extraction. This way it's easy to wrap os functions to\nchroot the path, or scramble the files, or send an event for each operation or even reimplementing them for an in-memory store, I don't know.\n\n```go\nextractor := extract.Extractor{\n    FS: fs,\n}\n\nextractor.Archive(context.TODO, file, \"/path/where/to/extract\", nil)\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcodeclysm%2Fextract","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcodeclysm%2Fextract","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcodeclysm%2Fextract/lists"}