Get the SPDX License ID from license text
Project description
LicenseID
A portable SPDX License ID matcher.
licenseid takes license text as input and identifies the closest matched SPDX License ID using a hybrid search strategy (SQLite FTS5 trigram + RapidFuzz ranking + optional Java validation).
Features
- Hybrid strategy:
- Tier 1: Broad recall using SQLite FTS5 with trigram tokenization.
- Tier 2: Precision ranking using RapidFuzz (token set ratio) + Popularity weighting.
- Tier 3: Optional final validation via
tools-javaif available.
- Unix philosophy: Parseable CLI output.
Installation
Install with pipx:
pipx install licenseid
Or using uv:
uv tool install licenseid
Usage
1. Update the license database
Before matching, you need to build the local license index:
licenseid update
2. Match a license
Match text from a file:
licenseid match LICENSE.txt
Match with Java validation enabled:
licenseid match LICENSE.txt --java
Match with popularity tie-breaker enabled:
licenseid match LICENSE.txt --pop
The tie-breaker is triggered only when candidate similarity scores differ by less than 0.02%.
3. Output formats
Default (Unix-friendly):
LICENSE_ID=Apache-2.0 SCORE=0.9850
JSON:
licenseid match LICENSE.txt --json
Configuration
SPDX_TOOLS_JAR: Path to thetools-javajar for Tier 3 validation.
License
Apache-2.0
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file licenseid-0.1.0.tar.gz.
File metadata
- Download URL: licenseid-0.1.0.tar.gz
- Upload date:
- Size: 15.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
29889235d3acc6510531573c46bf292e07d6d18856e1f31c8346e698710660ee
|
|
| MD5 |
9aa1b223d2e433c85ad556e76c4b1c80
|
|
| BLAKE2b-256 |
0e92506a936de17c9acc1cf28537ac3583512feb2503941bc2ae35ca582d7ec9
|
Provenance
The following attestation bundles were made for licenseid-0.1.0.tar.gz:
Publisher:
pypi-publish.yml on bact/licenseid
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
licenseid-0.1.0.tar.gz -
Subject digest:
29889235d3acc6510531573c46bf292e07d6d18856e1f31c8346e698710660ee - Sigstore transparency entry: 1396543776
- Sigstore integration time:
-
Permalink:
bact/licenseid@16d38fef7a5a4fa0202e95f0832f4663daea424b -
Branch / Tag:
refs/tags/v0.1.0 - Owner: https://github.com/bact
-
Access:
private
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
pypi-publish.yml@16d38fef7a5a4fa0202e95f0832f4663daea424b -
Trigger Event:
release
-
Statement type:
File details
Details for the file licenseid-0.1.0-py3-none-any.whl.
File metadata
- Download URL: licenseid-0.1.0-py3-none-any.whl
- Upload date:
- Size: 12.5 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
8a0b584a31c41bbe47b76d6a6c482679b2fb15ed9944781b1ad5ca7ccef543f3
|
|
| MD5 |
210cfee05ba6f8710fc9ddaf28191dac
|
|
| BLAKE2b-256 |
087ff9ca3f223ec06b0924f034e0c4e5115c806fee77c2ba1768cac5614f53a6
|
Provenance
The following attestation bundles were made for licenseid-0.1.0-py3-none-any.whl:
Publisher:
pypi-publish.yml on bact/licenseid
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
licenseid-0.1.0-py3-none-any.whl -
Subject digest:
8a0b584a31c41bbe47b76d6a6c482679b2fb15ed9944781b1ad5ca7ccef543f3 - Sigstore transparency entry: 1396543780
- Sigstore integration time:
-
Permalink:
bact/licenseid@16d38fef7a5a4fa0202e95f0832f4663daea424b -
Branch / Tag:
refs/tags/v0.1.0 - Owner: https://github.com/bact
-
Access:
private
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
pypi-publish.yml@16d38fef7a5a4fa0202e95f0832f4663daea424b -
Trigger Event:
release
-
Statement type: