{"id":13561874,"url":"https://github.com/google/licenseclassifier","last_synced_at":"2026-01-11T22:49:51.044Z","repository":{"id":37692721,"uuid":"87763861","full_name":"google/licenseclassifier","owner":"google","description":"A License Classifier","archived":false,"fork":false,"pushed_at":"2025-02-13T17:59:39.000Z","size":89462,"stargazers_count":323,"open_issues_count":18,"forks_count":79,"subscribers_count":12,"default_branch":"main","last_synced_at":"2025-03-22T00:42:07.002Z","etag":null,"topics":["classifier","google","license-management"],"latest_commit_sha":null,"homepage":"","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/google.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG","contributing":"CONTRIBUTING.md","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":"2017-04-10T03:45:47.000Z","updated_at":"2025-03-05T05:15:38.000Z","dependencies_parsed_at":"2024-01-13T17:10:43.054Z","dependency_job_id":"50ef2f57-b438-4a1f-b51a-1d060346310f","html_url":"https://github.com/google/licenseclassifier","commit_stats":{"total_commits":237,"total_committers":25,"mean_commits":9.48,"dds":0.6582278481012658,"last_synced_commit":"c1ed8fcf4babdf7c37d872cf6da5b1c32907d34c"},"previous_names":[],"tags_count":11,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/google%2Flicenseclassifier","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/google%2Flicenseclassifier/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/google%2Flicenseclassifier/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/google%2Flicenseclassifier/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/google","download_url":"https://codeload.github.com/google/licenseclassifier/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247047060,"owners_count":20874764,"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":["classifier","google","license-management"],"created_at":"2024-08-01T13:01:02.155Z","updated_at":"2026-01-11T22:49:51.037Z","avatar_url":"https://github.com/google.png","language":"Go","readme":"# License Classifier\n\n[![Build status](https://travis-ci.org/google/licenseclassifier.svg?branch=master)](https://travis-ci.org/google/licenseclassifier)\n\n## Introduction\n\nThe license classifier is a library and set of tools that can analyze text to\ndetermine what type of license it contains. It searches for license texts in a\nfile and compares them to an archive of known licenses. These files could be,\ne.g., `LICENSE` files with a single or multiple licenses in it, or source code\nfiles with the license text in a comment.\n\nA \"confidence level\" is associated with each result indicating how close the\nmatch was. A confidence level of `1.0` indicates an exact match, while a\nconfidence level of `0.0` indicates that no license was able to match the text.\n\n## Usage\n\n### One-time setup\n\nUse the `license_serializer` tool to regenerate the `licenses.db` archive.\nThe archive contains preprocessed license texts for quicker comparisons against\nunknown texts.\n\n```shell\n$ go run tools/license_serializer/license_serializer.go -output licenses\n```\n\n### Identifying licenses\n\nUse the `identify_license` command line tool to identify the license(s)\nwithin a file.\n\n```shell\n$ go run tools/identify_license/identify_license.go /path/to/LICENSE\nLICENSE: GPL-2.0 (confidence: 1, offset: 0, extent: 14794)\nLICENSE: LGPL-2.1 (confidence: 1, offset: 18366, extent: 23829)\nLICENSE: MIT (confidence: 1, offset: 17255, extent: 1059)\n```\n\n## Adding a new license\n\nAdding a new license is straight-forward:\n\n1.  Create a file in `licenses/`.\n\n    *   The filename should be the name of the license or its abbreviation. If\n        the license is an Open Source license, use the appropriate identifier\n        specified at https://spdx.org/licenses/.\n    *   If the license is the \"header\" version of the license, append the suffix\n        \"`.header`\" to it. See `licenses/README.md` for more details.\n\n2.  Add the license name to the list in `license_type.go`.\n\n3.  Regenerate the `licenses.db` file by running the license serializer:\n\n    ```shell\n    $ license_serializer -output licenseclassifier/licenses\n    ```\n\n4.  Create and run appropriate tests to verify that the license is indeed\n    present.\n\n----\nThis is not an official Google product (experimental or otherwise), it is just\ncode that happens to be owned by Google.\n","funding_links":[],"categories":["开源类库","Open source library","Static Application Security Testing","Licensing"],"sub_categories":["未归类","Not Categorized"],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgoogle%2Flicenseclassifier","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fgoogle%2Flicenseclassifier","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgoogle%2Flicenseclassifier/lists"}