pylic – Python license checker
Reads pylic configuration in pyproject.toml
and checks licenses of installed packages recursively.
Principles:
- Every license has to be allowed explicitly (case-insensitive comparison).
- All installed packages without a license are considered unsafe and have to be listed as such.
Only installed packages are checked for licenses. Packages/dependencies listed in
pyproject.toml
are ignored.
Installation
pip install pylic
Configuration
pylic
needs be run in the directory where your pyproject.toml
file is located. You can configure
safe_licenses
: All licenses you concider safe for usage. The string comparison is case-insensitive.
unsafe_packages
: If you rely on a package that does not come with a license you have to explicitly list it as such.
[tool.pylic]
safe_licenses = [
“Apache Software License”,
“Apache License 2.0”,
“MIT License”,
“Python Software Foundation License”,
“Mozilla Public License 2.0 (MPL 2.0)”,
]
unsafe_packages = [
“unlicensedPackage”,
]
Commands
pylic
provides the following commands (also see pylic help
):
check
: Checks all installed