Skip to main content

LicenseID

PyPI - Version

A portable license ID matcher. Get the SPDX License ID from license text.

licenseid takes license text as input and identifies the closest matched SPDX License ID using a hybrid search strategy (trigram + token ratio ranking).

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-java if 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

Advanced update options:

  • --version <version>: Download a specific SPDX License List version (e.g., 3.26.0).
  • --force: Force update even if the local database is already at the target version.
  • --no-cache: Bypass the local cache for downloads.

2. Match a license

Identify license text from a file:

licenseid match LICENSE.txt

Or match from a string:

licenseid match --text "MIT License"

Common options:

  • --java: Enable Tier 3 Java validation (requires SPDX_TOOLS_JAR and jpype1).
  • --pop: Enable popularity weighting as a tie-breaker.
  • --json: Output results in JSON format.
  • --db <path>: Use a custom database path (global option).

The popularity tie-breaker is triggered when candidate similarity scores differ by less than 0.2%.

3. Cache management

licenseid maintains a local cache of remote data to save bandwidth.

  • licenses.json: Cached for 45 days.
  • popularity.csv: Cached for 75 days.
  • SPDX data tarballs are versioned and never expire.

To clear the cache manually:

licenseid --clear-cache

4. 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 the tools-java jar for Tier 3 validation.

License

Apache-2.0

Metadata

Release files for LicenseID 0.1.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for LicenseID 0.1.1
File Size Uploaded Provenance Actions
licenseid-0.1.1.tar.gz 21.2 kB With provenance Details for licenseid-0.1.1.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for LicenseID 0.1.1
File Interpreter ABI Platform Actions
licenseid-0.1.1-py3-none-any.whl Python 3 none any Details for licenseid-0.1.1-py3-none-any.whl

Total release size: 38.9 kB

Release files / licenseid-0.1.1.tar.gz

Download URL licenseid-0.1.1.tar.gz
Size 21.2 kB
Tags Source
SHA-256 checksum
How to use checksums
bdebd3bf7bc9da63551b993771bf547e4fc1789895b536a884d774e426a72615
BLAKE2b-256 checksum
How to use checksums
c7cf593cc527b818f89ff5fcc6fbc974ac1d63d74c6d2e2d86c057c3b22553c5
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.12

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Apr 28, 2026.

Transparency log

Release files / licenseid-0.1.1-py3-none-any.whl

Download URL licenseid-0.1.1-py3-none-any.whl
Size 17.6 kB
Tags Python 3
SHA-256 checksum
How to use checksums
133182f71c6cefea85eedbdb71171e39a89f3ce308fd20c3d0d512037b32030e
BLAKE2b-256 checksum
How to use checksums
098503e75eb8a3123e89a8ba689ef2290d58e51725d437aa92770cfe9f704f4d
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.12

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Apr 28, 2026.

Transparency log

Security for LicenseID 0.1.1

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

Full provenance

Both files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for licenseid-0.1.1.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Apr 28, 2026.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

0.1.1 This release

2 release files Full provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page