Output the licenses used by dependencies and check if these are compatible with the project license
Project description
LicenseCheck
NOTICE: I am not a lawyer (IANAL)
Any output provided by this software is for general informational purposes only and should not be construed as legal advice. I am not a lawyer and there is no guarantee that the information provided here is complete or correct. Any reliance on the information provided by this software is at your own risk.
See also: https://en.wikipedia.org/wiki/IANAL, project license (MIT)
Output the licences used by dependencies and check if these are compatible with the project license
Table of Contents
- Examples from the command-line
- Help
- Configuration Example
- Documentation
- Install With PIP
- Language information
- Working with the repo
- Community Files
Examples from the command-line
See below for the output if you run licensecheck in this directory. More examples are available
here
Using pyproject.toml (default if not piping input)
>> licensecheck
Info
┏━━━━━━━━━━━━━━━━━┳━━━━━━━━━━━━━━┓
┃ Item ┃ Value ┃
┡━━━━━━━━━━━━━━━━━╇━━━━━━━━━━━━━━┩
│ program │ licensecheck │
│ version │ 2025 │
│ license │ MIT LICENSE │
│ project_license │ MIT LICENSE │
└─────────────────┴──────────────┘
List Of Packages
┏━━━━━━━━━━━━┳━━━━━━━━━━━━━━━━━━━━━┳━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┓
┃ Compatible ┃ Package ┃ License(s) ┃
┡━━━━━━━━━━━━╇━━━━━━━━━━━━━━━━━━━━━╇━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┩
│ ✔ │ appdirs │ MIT LICENSE │
│ ✔ │ attrs │ MIT LICENSE │
│ ✔ │ boolean-py │ BSD-2-CLAUSE │
│ ✔ │ cattrs │ MIT LICENSE │
│ ✔ │ certifi │ MOZILLA PUBLIC LICENSE 2.0 _MPL 2.0_ │
│ ✔ │ charset-normalizer │ MIT LICENSE │
│ ✔ │ colorama │ BSD LICENSE │
│ ✔ │ fhconfparser │ MIT LICENSE │
│ ✔ │ idna │ BSD LICENSE │
│ ✔ │ license-expression │ APACHE-2.0 │
│ ✔ │ loguru │ MIT LICENSE │
│ ✔ │ markdown │ BSD LICENSE │
│ ✔ │ markdown-it-py │ MIT LICENSE │
│ ✔ │ mdurl │ MIT LICENSE │
│ ✔ │ packaging │ APACHE SOFTWARE LICENSE;; BSD LICENSE │
│ ✔ │ platformdirs │ MIT LICENSE │
│ ✔ │ pygments │ BSD LICENSE │
│ ✔ │ requests │ APACHE SOFTWARE LICENSE │
│ ✔ │ requests-cache │ BSD LICENSE │
│ ✔ │ requirements-parser │ APACHE SOFTWARE LICENSE │
│ ✔ │ rich │ MIT LICENSE │
│ ✔ │ setuptools │ MIT LICENSE │
│ ✔ │ six │ MIT LICENSE │
│ ✔ │ tomli │ MIT LICENSE │
│ ✔ │ types-setuptools │ APACHE SOFTWARE LICENSE │
│ ✔ │ url-normalize │ MIT LICENSE │
│ ✔ │ urllib3 │ MIT LICENSE │
│ ✔ │ uv │ APACHE SOFTWARE LICENSE;; MIT LICENSE │
│ ✔ │ win32-setctime │ MIT LICENSE │
└────────────┴─────────────────────┴───────────────────────────────────────┘
Use csv format
>>> licensecheck --only-licenses mit apache --show-only-failing -f csv
name,version,size,homePage,author,license,licenseCompat,errorCode,namever
Markdown,3.7,361400,UNKNOWN,"Manfred Stienstra, Yuri Takhteyev",BSD LICENSE,False,0,Markdown-3.7
Pygments,2.19.1,4508396,UNKNOWN,UNKNOWN,BSD LICENSE,False,0,Pygments-2.19.1
boolean.py,4.0,109354,https://github.com/bastikr/boolean.py,Sebastian Kraemer,BSD-2-CLAUSE,False,0,boolean.py-4.0
certifi,2025.1.31,305559,https://github.com/certifi/python-certifi,Kenneth Reitz,MOZILLA PUBLIC LICENSE 2.0 _MPL 2.0_,False,0,certifi-2025.1.31
colorama,0.4.6,76299,UNKNOWN,UNKNOWN,BSD LICENSE,False,0,colorama-0.4.6
idna,3.10,349141,UNKNOWN,UNKNOWN,BSD LICENSE,False,0,idna-3.10
requests-cache,1.2.1,174099,https://github.com/requests-cache/requests-cache,Roman Haritonov,BSD LICENSE,False,0,requests-cache-1.2.1
Groups
uv run licensecheck --only-licenses mit apache --show-only-failing -g dev
...
List Of Packages
┏━━━━━━━━━━━━┳━━━━━━━━━━━━━━━━━━━┳━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┓
┃ Compatible ┃ Package ┃ License(s) ┃
┡━━━━━━━━━━━━╇━━━━━━━━━━━━━━━━━━━╇━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┩
│ ✖ │ authlib │ BSD LICENSE │
│ ✖ │ boolean-py │ BSD-2-CLAUSE │
│ ✖ │ certifi │ MOZILLA PUBLIC LICENSE 2.0 _MPL 2.0_ │
│ ✖ │ click │ BSD LICENSE │
│ ✖ │ colorama │ BSD LICENSE │
│ ✖ │ filelock │ THE UNLICENSE _UNLICENSE_ │
│ ✖ │ idna │ BSD LICENSE │
│ ✖ │ jinja2 │ BSD LICENSE │
│ ✖ │ joblib │ BSD LICENSE │
...
Help
usage: licensecheck [-h] [--license LICENSE] [--format FORMAT] [--requirements-paths REQUIREMENTS_PATHS [REQUIREMENTS_PATHS ...]]
[--groups GROUPS [GROUPS ...]] [--extras EXTRAS [EXTRAS ...]] [--file FILE]
[--ignore-packages IGNORE_PACKAGES [IGNORE_PACKAGES ...]] [--fail-packages FAIL_PACKAGES [FAIL_PACKAGES ...]]
[--ignore-licenses IGNORE_LICENSES [IGNORE_LICENSES ...]] [--fail-licenses FAIL_LICENSES [FAIL_LICENSES ...]]
[--only-licenses ONLY_LICENSES [ONLY_LICENSES ...]]
[--skip-dependencies SKIP_DEPENDENCIES [SKIP_DEPENDENCIES ...]]
[--hide-output-parameters HIDE_OUTPUT_PARAMETERS [HIDE_OUTPUT_PARAMETERS ...]] [--show-only-failing]
[--pypi-api PYPI_API] [--zero]
Output the licenses used by dependencies and check if these are compatible with the project license.
options:
-h, --help show this help message and exit
--license LICENSE, -l LICENSE
Specify the project license explicitly, rather than rely on licensecheck interpreting this from pyproject.toml
--format FORMAT, -f FORMAT
Output format. one of: json, markdown, html, csv, ansi, simple. default=simple
--requirements-paths REQUIREMENTS_PATHS [REQUIREMENTS_PATHS ...], -r REQUIREMENTS_PATHS [REQUIREMENTS_PATHS ...]
Filenames to read from (omit for stdin if piping, else pyproject.toml)
--groups GROUPS [GROUPS ...], -g GROUPS [GROUPS ...]
Select groups from supported files
--extras EXTRAS [EXTRAS ...], -e EXTRAS [EXTRAS ...]
Select extras from supported files
--file FILE, -o FILE Filename to write output to (omit this for stdout)
--ignore-packages IGNORE_PACKAGES [IGNORE_PACKAGES ...]
List of packages/dependencies to ignore (compat=True), globs are supported
--fail-packages FAIL_PACKAGES [FAIL_PACKAGES ...]
List of packages/dependencies to fail (compat=False), globs are supported
--ignore-licenses IGNORE_LICENSES [IGNORE_LICENSES ...]
List of licenses to ignore (skipped, compat may still be False)
--fail-licenses FAIL_LICENSES [FAIL_LICENSES ...]
List of licenses to fail (compat=False)
--only-licenses ONLY_LICENSES [ONLY_LICENSES ...]
List of allowed licenses (packages/dependencies with any other license will fail)
--skip-dependencies SKIP_DEPENDENCIES [SKIP_DEPENDENCIES ...]
List of packages/dependencies to skip (this sets the 'compatability' to True)
--hide-output-parameters HIDE_OUTPUT_PARAMETERS [HIDE_OUTPUT_PARAMETERS ...]
List of parameters to hide from the produced output
--show-only-failing Only output a list of incompatible/ failing packages from this lib
--pypi-api PYPI_API Specify a custom pypi api endpoint, for example if using a custom pypi server
--zero, -0 Return non zero exit code if an incompatible license is found, ideal for CI/CD
More information on using licensecheck from the command line is available here
You can also import this into your own project and use any of the functions in the DOCS
Configuration Example
Configuration files are parsed in the following order: pyproject.toml, setup.cfg,
licensecheck.toml, licensecheck.json, ~/licensecheck.toml, ~/licensecheck.json,
- ⚠ All config files are parsed, however configuration defined in previous files takes precedent
Example 1: pyproject.toml
[tool.licensecheck]
license = "mit" # Specify the project license explicitly
format = "simple" # Output format (e.g., "json", "csv", etc.)
requirements_paths = [] # List of filenames to read from
groups = [] # List of selected groups
extras = [] # List of selected extras
file = "" # Output file (leave empty for stdout)
ignore_packages = [] # Packages/dependencies to ignore
fail_packages = [] # Packages/dependencies that cause failure
ignore_licenses = [] # Licenses to ignore
fail_licenses = [] # Licenses that cause failure
only_licenses = [] # Allowed licenses (all others will fail)
skip_dependencies = [] # Dependencies to skip (compatibility = True)
hide_output_parameters = [] # Parameters to hide from output
show_only_failing = false # Show only incompatible/failing packages
pypi_api = "https://pypi.org" # Custom PyPI API endpoint
zero = false # Return non-zero exit code for incompatible licenses (for CI/CD)
Example 2: licensecheck.json
{
"tool": {
"licensecheck": {
"extras": [],
"fail_licenses": [],
"fail_packages": [],
"file": "",
"format": "simple",
"groups": [],
"hide_output_parameters": [],
"ignore_licenses": [],
"ignore_packages": [],
"license": "mit",
"only_licenses": [],
"pypi_api": "https://pypi.org",
"requirements_paths": [],
"show_only_failing": false,
"skip_dependencies": [],
"zero": false
}
}
}
Documentation
A high-level overview of how the documentation is organized organized will help you know where to look for certain things:
- The Technical Reference documents APIs and other aspects of the machinery. This documentation describes how to use the classes and functions at a lower level and assume that you have a good high-level understanding of the software.
Install With PIP
pip install licensecheck
Head to https://pypi.org/project/licensecheck/ for more info
Language information
Using python 3.12, to 3.14
Working with the repo
Clone, the repo with
git clone https://github.com/FHPythonUtils/DepGather
Format
uv run ruff format
Linting
uv run ruff check
uv run python3 -m basedpyright -p .
Testing
uv run python3 -m pytest
Alternatively use tox to run tests over a range of python versions
tox
Community Files
Licence
MIT License Copyright (c) FredHappyface (See the LICENSE for more information.)
Changelog
See the Changelog for more information.
Code of Conduct
Online communities include people from many backgrounds. The Project contributors are committed to providing a friendly, safe and welcoming environment for all. Please see the Code of Conduct for more information.
Contributing
Contributions are welcome, please see the Contributing Guidelines for more information.
Security
Thank you for improving the security of the project, please see the Security Policy for more information.
Support
Thank you for using this project, I hope it is of use to you. Please be aware that those involved with the project often do so for fun along with other commitments (such as work, family, etc). Please see the Support Policy for more information.
Project details
Release history Release notifications | RSS feed
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 licensecheck-2026.0.0.tar.gz.
File metadata
- Download URL: licensecheck-2026.0.0.tar.gz
- Upload date:
- Size: 63.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
bb8392513382faed9b8b6f7c47fcee9b4c3d9d967190fff4c6ad8255c849c7a2
|
|
| MD5 |
dc687f95c88befb738b83f2a8accf71e
|
|
| BLAKE2b-256 |
820d39139feb669aa686bf66f938dbb93307ddaf5936f8c8dadfaec57684e0c4
|
Provenance
The following attestation bundles were made for licensecheck-2026.0.0.tar.gz:
Publisher:
release.yaml on FHPythonUtils/LicenseCheck
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
licensecheck-2026.0.0.tar.gz -
Subject digest:
bb8392513382faed9b8b6f7c47fcee9b4c3d9d967190fff4c6ad8255c849c7a2 - Sigstore transparency entry: 1805780491
- Sigstore integration time:
-
Permalink:
FHPythonUtils/LicenseCheck@ae3eeb89b38a964c28aee16c0b2fef22eb19bcf0 -
Branch / Tag:
refs/tags/2026.0.0 - Owner: https://github.com/FHPythonUtils
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yaml@ae3eeb89b38a964c28aee16c0b2fef22eb19bcf0 -
Trigger Event:
push
-
Statement type:
File details
Details for the file licensecheck-2026.0.0-py3-none-any.whl.
File metadata
- Download URL: licensecheck-2026.0.0-py3-none-any.whl
- Upload date:
- Size: 22.9 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 |
516e34063cd1a83bd5a56a272169c912c6a22c14010fdffdc993bc7e831955fe
|
|
| MD5 |
89513bbf3a33cf7f4c35e13db381f20e
|
|
| BLAKE2b-256 |
160c4e98d6e74d63602c1aa12853a0ae5dde94d51f8aabcbd6e34cef4841e18f
|
Provenance
The following attestation bundles were made for licensecheck-2026.0.0-py3-none-any.whl:
Publisher:
release.yaml on FHPythonUtils/LicenseCheck
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
licensecheck-2026.0.0-py3-none-any.whl -
Subject digest:
516e34063cd1a83bd5a56a272169c912c6a22c14010fdffdc993bc7e831955fe - Sigstore transparency entry: 1805780519
- Sigstore integration time:
-
Permalink:
FHPythonUtils/LicenseCheck@ae3eeb89b38a964c28aee16c0b2fef22eb19bcf0 -
Branch / Tag:
refs/tags/2026.0.0 - Owner: https://github.com/FHPythonUtils
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yaml@ae3eeb89b38a964c28aee16c0b2fef22eb19bcf0 -
Trigger Event:
push
-
Statement type: