Skip to main content

LegalLint: A multi-language license compliance tool

Project description

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.

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

legallint-1.1.3.tar.gz (16.0 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

legallint-1.1.3-py3-none-any.whl (19.3 kB view details)

Uploaded Python 3

File details

Details for the file legallint-1.1.3.tar.gz.

File metadata

  • Download URL: legallint-1.1.3.tar.gz
  • Upload date:
  • Size: 16.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/2.0.1 CPython/3.11.2 Darwin/24.2.0

File hashes

Hashes for legallint-1.1.3.tar.gz
Algorithm Hash digest
SHA256 7cad61c3716aaeb52f52ad531c2b8bbbe482f83d53b8d6755852389e24628914
MD5 c71e19ac54b05a6e5b8bf8fad076816e
BLAKE2b-256 f2025653383d24f7a48073d46f07a0bc668e9bf452746b810cd11516726ebaec

See more details on using hashes here.

File details

Details for the file legallint-1.1.3-py3-none-any.whl.

File metadata

  • Download URL: legallint-1.1.3-py3-none-any.whl
  • Upload date:
  • Size: 19.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/2.0.1 CPython/3.11.2 Darwin/24.2.0

File hashes

Hashes for legallint-1.1.3-py3-none-any.whl
Algorithm Hash digest
SHA256 efe9dc5c5b1fe3f42e9fad6a7e14d85777a5289d3a441478271a6004eb5fd141
MD5 5dd03ebb16f88c88b1c148972e16c7fa
BLAKE2b-256 b9c194d94f426ebfa0cceabfde37a92092ec5f939eeeee498122251fc1fd0711

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page