{"id":49365776,"url":"https://github.com/git-pkgs/reuse","last_synced_at":"2026-04-27T19:04:42.252Z","repository":{"id":347854794,"uuid":"1158708208","full_name":"git-pkgs/reuse","owner":"git-pkgs","description":"Go library for parsing REUSE-compliant projects (spec v3.3). Extracts SPDX license and copyright information from file headers, .license sidecars, REUSE.toml annotations, and .reuse/dep5 files.","archived":false,"fork":false,"pushed_at":"2026-03-29T18:56:23.000Z","size":31,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2026-03-29T20:47:09.732Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","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/git-pkgs.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,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2026-02-15T19:50:36.000Z","updated_at":"2026-03-29T18:44:35.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/git-pkgs/reuse","commit_stats":null,"previous_names":["git-pkgs/reuse"],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/git-pkgs/reuse","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/git-pkgs%2Freuse","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/git-pkgs%2Freuse/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/git-pkgs%2Freuse/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/git-pkgs%2Freuse/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/git-pkgs","download_url":"https://codeload.github.com/git-pkgs/reuse/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/git-pkgs%2Freuse/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32350276,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-27T17:12:42.749Z","status":"ssl_error","status_checked_at":"2026-04-27T17:12:41.658Z","response_time":128,"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":"2026-04-27T19:04:40.672Z","updated_at":"2026-04-27T19:04:42.248Z","avatar_url":"https://github.com/git-pkgs.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# reuse\n\nGo library for parsing REUSE-compliant projects (spec v3.3). Extracts SPDX license and copyright information from file headers, .license sidecars, REUSE.toml annotations, and .reuse/dep5 files.\n\nSPDX expressions are stored as raw strings. Validation is left to consumers (see [github.com/git-pkgs/spdx](https://github.com/git-pkgs/spdx) if you need it).\n\n## Installation\n\n```bash\ngo get github.com/git-pkgs/reuse\n```\n\n## Usage\n\n### Parse a project\n\n```go\nimport \"github.com/git-pkgs/reuse\"\n\np, err := reuse.OpenProject(\"/path/to/repo\")\n\n// Get licensing info for a single file.\ninfo, err := p.ReuseInfoOf(\"src/main.go\")\nfmt.Println(info.LicenseExpressions) // [\"MIT\"]\nfmt.Println(info.CopyrightNotices)   // [\"2024 Jane Doe \u003cjane@example.com\u003e\"]\n\n// Walk all covered files.\nall, err := p.AllReuseInfo()\nfor path, info := range all {\n    fmt.Printf(\"%s: %v\\n\", path, info.LicenseExpressions)\n}\n```\n\n### Extract SPDX tags from text\n\n```go\ninfo := reuse.ExtractReuseInfo(`// SPDX-License-Identifier: MIT OR Apache-2.0\n// SPDX-FileCopyrightText: 2024 Alice`)\n\nfmt.Println(info.LicenseExpressions) // [\"MIT OR Apache-2.0\"]\nfmt.Println(info.CopyrightNotices)   // [\"2024 Alice\"]\n```\n\n### Parse REUSE.toml\n\n```go\nrt, err := reuse.ParseReuseTOMLFile(\"REUSE.toml\")\n\ninfo, precedence, ok := rt.ReuseInfoOf(\"src/main.go\")\nif ok {\n    fmt.Println(info.LicenseExpressions)\n    fmt.Println(precedence) // \"closest\", \"aggregate\", or \"override\"\n}\n```\n\n### Parse .reuse/dep5\n\n```go\nd, err := reuse.ParseDep5File(\".reuse/dep5\")\n\ninfo, ok := d.ReuseInfoOf(\"docs/guide.md\")\nif ok {\n    fmt.Println(info.LicenseExpressions)\n}\n```\n\n## Development\n\n```bash\ngit clone --recurse-submodules https://github.com/git-pkgs/reuse\ngo test -v -race ./...\n```\n\n## License\n\nMIT\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgit-pkgs%2Freuse","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fgit-pkgs%2Freuse","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgit-pkgs%2Freuse/lists"}