Skip to main content

license-audit

CI PyPI Python versions License

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 License field, 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

license-audit audits an environment you've already provisioned, so it doesn't need to be one of your project's dependencies. Run it with uv as uvx license-audit, with no install step, or install it as a standalone tool:

uv tool install license-audit   # or: pipx install license-audit

Quickstart

Provision your dependencies first, then run license-audit in the project:

uv sync
uvx license-audit analyze

It audits the project's .venv. Point --target at another virtualenv to audit that instead:

uvx license-audit --target path/to/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 110 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@v7
      - uses: astral-sh/setup-uv@v7
      - run: uv sync --locked
      - run: uvx license-audit check

This audits development tools too; to audit only what you ship, see production dependencies only.

Exit codes:

Code Meaning
0 All dependencies pass the policy
1 Policy violation (incompatible licenses, denied licenses, or category exceeded), a required dependency missing from the environment, 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 the project's .venv, else $VIRTUAL_ENV

[tool.license-audit.overrides]
some-internal-package = "MIT"
dual-licensed-pkg = "Apache-2.0 OR MIT"

[tool.license-audit.license-classifications]
"CC-BY-SA-4.0" = "weak-copyleft"  # 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.

Metadata

Release files for license-audit 1.0.0

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

Source distribution (sdist)

Source distribution for license-audit 1.0.0
File Size Uploaded Provenance Actions
license_audit-1.0.0.tar.gz 224.4 kB With provenance Details for license_audit-1.0.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for license-audit 1.0.0
File Interpreter ABI Platform Actions
license_audit-1.0.0-py3-none-any.whl Python 3 none any Details for license_audit-1.0.0-py3-none-any.whl

Total release size: 299.3 kB

Release files / license_audit-1.0.0.tar.gz

Download URL license_audit-1.0.0.tar.gz
Size 224.4 kB
Tags Source
SHA-256 checksum
How to use checksums
9bc4410818e8dcf55c86efd9d4fa67df1550e6383d23d697247a77b0e9d6209f
BLAKE2b-256 checksum
How to use checksums
d11dfb957d97cf4a103fad794fa9e5c888504066fc02d244a819889f9ee3e315
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

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 Dec 1, 2026.

Transparency log

Release files / license_audit-1.0.0-py3-none-any.whl

Download URL license_audit-1.0.0-py3-none-any.whl
Size 74.9 kB
Tags Python 3
SHA-256 checksum
How to use checksums
602ef7bc526accd0d585319169d2b128cab7fe0f99c1188d7068325ef08e5005
BLAKE2b-256 checksum
How to use checksums
38a7456d532c14363cbbe9bc8ee710ef8f455a73f1655ea2e01be7fe1cd72ed4
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

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 Dec 1, 2026.

Transparency log

Security for license-audit 1.0.0

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 license_audit-1.0.0.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 Dec 1, 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.

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