license-audit
Analyze dependency licenses for Python projects.
license-audit tells you what license your project can use, flags incompatible combinations, and generates compliance documents suitable for CI gating.
Features
- License detection across the full transitive tree, from PEP 639 metadata, the legacy
Licensefield, trove classifiers, and user overrides. - Pairwise compatibility checking against the OSADL compatibility matrix (~120 licenses).
- Outbound license recommendations ranked by permissiveness.
- Compliance reports as Markdown, JSON, or third-party-notices.
- CI exit codes that distinguish policy violations from undetected licenses.
- Reads the licenses straight from your installed environment: provision it however you like (
uv, Poetry, pip), then point license-audit at it.
Installation
pip install license-audit
Or with uv:
uv add license-audit --dev
Quickstart
Provision your dependencies first, then run license-audit inside that environment:
uv sync
uv run license-audit analyze
Or point it at an existing virtualenv:
license-audit --target .venv analyze
───────────────────── License Analysis: my-project ─────────────────────
Source: /path/to/my-project/.venv
Dependency Licenses
┏━━━━━━━━━━┳━━━━━━━━━┳━━━━━━━━━━━━━━┳━━━━━━━━━━━━┳━━━━━━━━┳━━━━━━━━━━┓
┃ Package ┃ Version ┃ License ┃ Category ┃ Source ┃ Parent ┃
┡━━━━━━━━━━╇━━━━━━━━━╇━━━━━━━━━━━━━━╇━━━━━━━━━━━━╇━━━━━━━━╇━━━━━━━━━━┩
│ click │ 8.3.1 │ BSD-3-Clause │ permissive │ pep639 │ (direct) │
│ pydantic │ 2.12.5 │ MIT │ permissive │ pep639 │ (direct) │
│ rich │ 14.3.0 │ MIT │ permissive │ pep639 │ (direct) │
└──────────┴─────────┴──────────────┴────────────┴────────┴──────────┘
Recommended Outbound Licenses (most -> least permissive):
-> MIT
Apache-2.0
BSD-2-Clause
BSD-3-Clause
ISC
... and 111 more
──────────────────────────────── Summary ───────────────────────────────
Total dependencies: 3
Unknown licenses: 0
Copyleft licenses: 0
Policy check: PASSED
Commands
| Command | Purpose |
|---|---|
analyze |
Per-package analysis in the terminal, or as JSON with --format json |
check |
CI policy gate with distinct exit codes |
report |
Compliance documents: Markdown, JSON, or third-party notices |
recommend |
Outbound license recommendation with guidance |
refresh |
Re-download the OSADL compatibility data |
See the commands reference for details.
CI quickstart
Add to your pipeline to gate on license policy:
jobs:
license-check:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: astral-sh/setup-uv@v5
- run: uv sync --locked
- run: uv run license-audit check
Exit codes:
| Code | Meaning |
|---|---|
0 |
All dependencies pass the policy |
1 |
Policy violation (incompatible pairs, denied licenses, or category exceeded), or the check could not run |
2 |
Unknown licenses detected and no other violation (when fail-on-unknown = true) |
For GitLab, pre-commit, handling unknowns, and the new-dependency workflow, see the CI integration guide.
Configuration
[tool.license-audit]
fail-on-unknown = true
policy = "permissive" # permissive | weak-copyleft | strong-copyleft | network-copyleft
allowed-licenses = ["MIT", "Apache-2.0", "BSD-3-Clause"]
denied-licenses = ["GPL-3.0-only"]
target = ".venv" # optional; defaults to ./.venv, else the active environment
[tool.license-audit.overrides]
some-internal-package = "MIT"
dual-licensed-pkg = "Apache-2.0 OR MIT"
[tool.license-audit.license-classifications]
"CNRI-Python" = "permissive" # your judgement for licenses OSADL doesn't cover
[tool.license-audit.ignored-packages]
pandas-stubs = "Stubs only, not redistributed"
Full reference: user guide -> configuration.
Documentation
Full documentation lives at https://dgeragh.github.io/license-audit:
License
MIT. See LICENSE.
This project bundles data from the OSADL Open Source License Obligations Checklists project, licensed under CC-BY-4.0. See THIRD_PARTY_NOTICES.md for full attribution.
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 license_audit-0.14.0.tar.gz.
File metadata
- Download URL: license_audit-0.14.0.tar.gz
- Upload date:
- Size: 177.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via:
twine/7.0.0 CPython/3.13.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
972cab807315f0544cf9bd9a959a01ebe5688df89de7467fbe91b6c366e6c85d
|
|
| MD5 |
9361a1f30e304678c05fec4162e2598d
|
|
| BLAKE2b-256 |
e324d04f0941e532154cd89e1d198646c030144b36d355457aff680e9378cc9c
|
Provenance
The following attestation bundles were made for license_audit-0.14.0.tar.gz:
Publisher:
release.yml on dgeragh/license-audit
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
license_audit-0.14.0.tar.gz -
Subject digest:
972cab807315f0544cf9bd9a959a01ebe5688df89de7467fbe91b6c366e6c85d - Sigstore transparency entry: 2727596292
- Sigstore integration time:
-
Permalink:
dgeragh/license-audit@3d3d10de3f6228a0646e0c447c5572f012c069d6 -
Branch / Tag:
refs/tags/v0.14.0 - Owner: https://github.com/dgeragh
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@3d3d10de3f6228a0646e0c447c5572f012c069d6 -
Trigger Event:
push
-
Statement type:
File details
Details for the file license_audit-0.14.0-py3-none-any.whl.
File metadata
- Download URL: license_audit-0.14.0-py3-none-any.whl
- Upload date:
- Size: 61.4 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via:
twine/7.0.0 CPython/3.13.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
ec3c037b7452c08535f7d3260e7a365289383dd5297e093c52eac19ceaed1028
|
|
| MD5 |
aa296d693f6030f847508040a7460a6f
|
|
| BLAKE2b-256 |
ade7f2000fd67ca21ff357f680a3c6187de6af645bc02460159e2d61e7255d48
|
Provenance
The following attestation bundles were made for license_audit-0.14.0-py3-none-any.whl:
Publisher:
release.yml on dgeragh/license-audit
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
license_audit-0.14.0-py3-none-any.whl -
Subject digest:
ec3c037b7452c08535f7d3260e7a365289383dd5297e093c52eac19ceaed1028 - Sigstore transparency entry: 2727596379
- Sigstore integration time:
-
Permalink:
dgeragh/license-audit@3d3d10de3f6228a0646e0c447c5572f012c069d6 -
Branch / Tag:
refs/tags/v0.14.0 - Owner: https://github.com/dgeragh
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@3d3d10de3f6228a0646e0c447c5572f012c069d6 -
Trigger Event:
push
-
Statement type: