Metadata-Version: 2.3
Name: legallint
Version: 1.1.2
Summary: LegalLint: A multi-language license compliance tool
License: Apache-2.0
Author: Kiran Kumar Kotari
Author-email: kirankotari@live.com
Requires-Python: >=3.11
Classifier: License :: OSI Approved :: Apache Software License
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Requires-Dist: pyyaml (>=6.0.2,<7.0.0)
Requires-Dist: requests (>=2.32.3,<3.0.0)
Requires-Dist: toml (>=0.10.2,<0.11.0)
Project-URL: Bug Tracker, https://github.com/kirankotari/LegalLint/issues
Project-URL: Documentation, https://github.com/kirankotari/LegalLint/blob/main/README.md
Project-URL: Homepage, https://github.com/kirankotari/legallint
Project-URL: Repository, https://github.com/kirankotari/legallint
Description-Content-Type: text/markdown

# 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:
```bash
pip install legallint
```

## Usage

### CLI
```bash
$ legallint -l python
```

### Example Configuration (legallint.yaml)
```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:
```toml
[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
```bash
% 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
```bash
$ 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.
