LegalLint
LegalLint is a license compliance linter for all programming languages, with current support for Python. It ensures that projects adhere to specified licensing policies, allowing users to enforce allowed licenses and trigger errors for disallowed licenses.
Features
- Detects license types for Python libraries.
- Customizable allowed and disallowed licenses.
- Skips specific libraries from license checking.
- TOML-based configuration for flexible settings.
Installation
To install LegalLint:
pip install legallint
Usage
CLI
$ legallint -l python
Example Configuration (legallint.yaml)
allowed_licenses:
- MIT
- Apache-2.0
- BSD-3-Clause
trigger_error_licenses:
- GPL-3.0
- AGPL-3.0
- Proprietary
- Unknown
skip_libraries:
Example Configuration for python (pyproject.toml)
To configure license settings for LegalLint in the pyproject.toml file, you can follow this structure:
[licenses]
allowed = ["MIT", "Apache-2.0", "BSD-3-Clause"]
trigger_error = ["GPL-3.0", "AGPL-3.0", "Proprietary", "Unknown"]
# Libraries to skip
skip_libraries = ["example-lib1", "example-lib2"]
Example legallint result
% legallint -l python
---------------
PYTHON
---------------
✔ iniconfig MIT
✔ requests Apache; Apache-2.0
✔ tomli MIT
✔ charset-normalizer MIT
✔ idna BSD
✔ exceptiongroup MIT
✔ pytest MIT
✔ pyyaml MIT
✔ pip MIT
‼ certifi MPL; MPL-2.0
✔ toml MIT
✔ pluggy MIT
✔ packaging BSD; Apache
✔ setuptools MIT
✔ urllib3 MIT
LegalLint: License compliance warning.
%
legallint commands
$ legallint -h
usage: legallint [-h] [--verbose] [-v] [-l {python,npm} [{python,npm} ...]] [-u] [--license]
LegalLint is a cross-platform tool designed to ensure license compliance across multiple programming languages by analyzing dependencies and enforcing predefined license policies. LegalLint helps maintain legal standards by scanning the project’s dependencies and ensuring that only approved licenses (e.g., MIT, Apache 2.0) are used.
options:
-h, --help show this help message and exit
--verbose Enable verbose mode
-v, --version show program's version number and exit
-l {python,npm} [{python,npm} ...], --lang {python,npm} [{python,npm} ...]
Select one or more languages from: python
-u, --update Enable update mode
--license Enable license mode
License
LegalLint is distributed under the Apache-2.0 License. See LICENSE for more information.
Metadata
Release files for legallint 1.1.3
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| legallint-1.1.3.tar.gz | 16.0 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| legallint-1.1.3-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 35.3 kB
Release files / legallint-1.1.3.tar.gz
| Download URL | legallint-1.1.3.tar.gz |
|---|---|
| Size | 16.0 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
7cad61c3716aaeb52f52ad531c2b8bbbe482f83d53b8d6755852389e24628914
|
|
BLAKE2b-256 checksum How to use checksums |
f2025653383d24f7a48073d46f07a0bc668e9bf452746b810cd11516726ebaec
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
poetry/2.0.1 CPython/3.11.2 Darwin/24.2.0
|
Release files / legallint-1.1.3-py3-none-any.whl
| Download URL | legallint-1.1.3-py3-none-any.whl |
|---|---|
| Size | 19.3 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
efe9dc5c5b1fe3f42e9fad6a7e14d85777a5289d3a441478271a6004eb5fd141
|
|
BLAKE2b-256 checksum How to use checksums |
b9c194d94f426ebfa0cceabfde37a92092ec5f939eeeee498122251fc1fd0711
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
poetry/2.0.1 CPython/3.11.2 Darwin/24.2.0
|