Analyze dependency licenses and get actionable licensing guidance for Python projects
Project description
license-audit
Analyze dependency licenses and get actionable licensing guidance for Python projects.
license-audit goes beyond listing dependency licenses. It tells you what license your project can use, flags incompatible combinations, and generates compliance documents suitable for CI gating.
Features
- License detection from PEP 639 metadata, trove classifiers, and user overrides across the full transitive dependency tree.
- Compatibility analysis using the OSADL compatibility matrix (covers ~120 well-known licenses).
- Outbound license recommendations ranked by permissiveness.
- Compliance reports in Markdown, JSON, or third-party-notices form.
- CI-ready with distinct exit codes for policy violations and undetected licenses.
- First-class support for uv,
pyproject.toml, and PEP 639.
Installation
pip install license-audit
Or with uv:
uv add license-audit --dev
Quickstart
Run against the current project directory:
license-audit --target . analyze
──────────────────── License Analysis: my-project ────────────────────
Dependency Licenses
┏━━━━━━━━━━┳━━━━━━━━━┳━━━━━━━━━━━━━━┳━━━━━━━━━━━━┳━━━━━━━━┳━━━━━━━━━━┓
┃ Package ┃ Version ┃ License ┃ Category ┃ Source ┃ Parent ┃
┡━━━━━━━━━━╇━━━━━━━━━╇━━━━━━━━━━━━━━╇━━━━━━━━━━━━╇━━━━━━━━╇━━━━━━━━━━┩
│ click │ 8.1.7 │ BSD-3-Clause │ permissive │ pep639 │ (direct) │
│ pydantic │ 2.9.2 │ MIT │ permissive │ pep639 │ (direct) │
│ rich │ 13.9.4 │ MIT │ permissive │ pep639 │ (direct) │
└──────────┴─────────┴──────────────┴────────────┴────────┴──────────┘
Recommended Outbound Licenses (most -> least permissive):
-> MIT
BSD-3-Clause
Apache-2.0
...
──────────────────────────── Summary ────────────────────────────
Total dependencies: 3
Policy check: PASSED
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 or denied licenses) |
2 |
Unknown licenses detected (when fail-on-unknown = true) |
For GitLab CI, pre-commit hooks, handling unknowns, and the "adding a 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"]
[tool.license-audit.overrides]
some-internal-package = "MIT"
dual-licensed-pkg = "Apache-2.0 OR MIT"
Full configuration reference: user guide -> configuration.
Documentation
Full documentation lives at https://dgeragh.github.io/license-audit:
- Configuration reference - all options, target resolution, dependency group selectors.
- CI integration guide - GitHub Actions, GitLab, pre-commit, new-dependency workflow.
- How it works - the detection and analysis pipeline.
- Comparison with other tools - ScanCode, pip-licenses, liccheck.
- Limitations - what the tool does and doesn't cover.
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.
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 license_audit-0.2.0.tar.gz.
File metadata
- Download URL: license_audit-0.2.0.tar.gz
- Upload date:
- Size: 135.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
e09503fabb53983723a436b6249fec6c1f386f0caee0c3cff2b83392cfb18f50
|
|
| MD5 |
6e74134032af19352cb4b7a35681b87a
|
|
| BLAKE2b-256 |
198e176ee3967fe3b9f89d14f53446bfcfd505b2a8909a939d5fe3a81a6cc087
|
Provenance
The following attestation bundles were made for license_audit-0.2.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.2.0.tar.gz -
Subject digest:
e09503fabb53983723a436b6249fec6c1f386f0caee0c3cff2b83392cfb18f50 - Sigstore transparency entry: 1334435905
- Sigstore integration time:
-
Permalink:
dgeragh/license-audit@80cc15583861179807e63ac30d0da46563a8fe3d -
Branch / Tag:
refs/tags/v0.2.0 - Owner: https://github.com/dgeragh
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@80cc15583861179807e63ac30d0da46563a8fe3d -
Trigger Event:
push
-
Statement type:
File details
Details for the file license_audit-0.2.0-py3-none-any.whl.
File metadata
- Download URL: license_audit-0.2.0-py3-none-any.whl
- Upload date:
- Size: 55.7 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 |
7a2bb69748f68d6726ab5ed7e4e7d74717794da63ed3e15a98ff2a7a53705d83
|
|
| MD5 |
b9b41454d8a8eb3c4cb0c60041f252d1
|
|
| BLAKE2b-256 |
83dca0a4c393969d74f155161a78cb4d83dac5567498459ebca7cb900eaa98b0
|
Provenance
The following attestation bundles were made for license_audit-0.2.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.2.0-py3-none-any.whl -
Subject digest:
7a2bb69748f68d6726ab5ed7e4e7d74717794da63ed3e15a98ff2a7a53705d83 - Sigstore transparency entry: 1334436013
- Sigstore integration time:
-
Permalink:
dgeragh/license-audit@80cc15583861179807e63ac30d0da46563a8fe3d -
Branch / Tag:
refs/tags/v0.2.0 - Owner: https://github.com/dgeragh
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@80cc15583861179807e63ac30d0da46563a8fe3d -
Trigger Event:
push
-
Statement type: