license-expression
license-expression is a comprehensive utility library to parse, compare, simplify and normalize license expressions (such as SPDX license expressions) using boolean logic.
Install
license-expression on PyPI
pip
pip install license-expressionuv
uv add license-expressionpoetry
poetry add license-expressionPackage facts
| License | Apache-2.0 (permissive) |
| Python support | supports the current Python release (>=3.9) |
| Install friction | low — pure-Python wheel |
| Runtime dependencies | 1 — boolean.py |
| Maintenance | actively maintained — 387 days since the last release |
| Last repo commit | |
| First released | |
| Popularity | one of the top 1,000 most-downloaded packages on PyPI (30-day window, as of 2026-08-13) |
| Known vulnerabilities | none known (OSV.dev, checked 2026-08-13) |
Evidence: license_expression-30.4.4-py3-none-any.whl
Keywords: open source, license expression, license, spdx, boolean, parse expression, normalize expression, compare expression, licence
About license-expression
from the package's own PyPI description — quoted content, verbatim
================== license-expression ==================
license-expression is a comprehensive utility library to parse, compare,
simplify and normalize license expressions (such as SPDX license expressions)
using boolean logic.
- License: Apache-2.0
- Python: 3.9+
- Homepage: https://github.com/aboutcode-org/license-expression/
- Install:
pip install license-expressionalso available in most Linux distro.
Software project licenses are often a combination of several free and open source software licenses. License expressions -- as specified by SPDX -- provide a concise and human readable way to express these licenses without having to read long license texts, while still being machine-readable.
License expressions are used by key FOSS projects such as Linux; several packages ecosystem use them to document package licensing metadata such as npm and Rubygems; they are important when exchanging software data (such as with SPDX and SBOM in general) as a way to express licensing precisely.
license-expression is a comprehensive utility library to parse, compare,
simplify and normalize these license expressions (such as SPDX license expressions)
using boolean logic like...
Read as markdown · JSON record · Source repository · Homepage
AI interpretation — verify before relying
AI-generated interpretation of the package facts above; every digit, version, license, or vulnerability id it cites is grounded in the facts already shown on this page
Parses, validates, compares, and normalizes license expressions (including SPDX format) using boolean logic to handle complex multi-license combinations.
Low friction: pure Python wheel with a single runtime dependency (boolean.py). Active maintenance with last commit on 2026-05-26 and a stable production release cycle.
Apache-2.0 is permissive; you may use, modify, and distribute this package freely in commercial or proprietary projects provided you include a copy of the license and note any material changes.
Usage
pip install license-expression
from license_expression import get_spdx_licensing
licensing = get_spdx_licensing()
parsed = licensing.parse('GPL-2.0-or-later WITH Classpath-exception-2.0 AND MIT')
print(parsed.pretty())
Requires Python 3.9 or later.
Verdict: Production-ready library for parsing and normalizing SPDX and custom license expressions. No known vulnerabilities, permissive Apache-2.0 license, minimal dependencies, and active maintenance make it a solid choice for license metadata handling in compliance and SBOM workflows.
Needs verification
- Whether the package's boolean.py dependency has its own maintenance status and security record.
- Performance characteristics when parsing very large or deeply nested license expressions.
- Whether the bundled SPDX 3.26 and ScanCode LicenseDB data can be updated independently or requires a new release.
Similar packages
permissive · top 1,000 on PyPI
identifypermissive · top 1,000 on PyPI
pyphencopyleft · top 1,000 on PyPI
pytimeparsepermissive · top 1,000 on PyPI
shapelypermissive · top 1,000 on PyPI
cssselectpermissive · top 1,000 on PyPI
jsonpath-pythonpermissive · top 1,000 on PyPI
cron-descriptorpermissive · top 1,000 on PyPI
jmespathpermissive · top 100 on PyPI
omegaconfpermissive · top 1,000 on PyPI