Expand description
License expression parsing and manipulation.
This module provides a parser for ScanCode license expressions, supporting:
- ScanCode license keys (e.g.,
mit,gpl-2.0-plus,apache-2.0) - SPDX operators:
AND,OR,WITH(case-insensitive) - Parenthetical grouping
- The
LicenseRef-scancode-*format for non-SPDX licenses
The parser converts license expression strings into an AST (Abstract Syntax Tree) and provides functions for validation and simplification.
Enums§
- License
Expression - A parsed license expression represented as an AST.
- Parse
Error - Error type for license expression parsing.
Functions§
- combine_
expressions_ and - Combine multiple license expressions with
AND. - expression_
to_ string - Returns
- licensing_
contains - parse_
expression - Parse a license expression string into a structured expression.
- simplify_
expression - Simplify a license expression by deduplicating license keys.