Liscopelens
A graph-driven license compatibility analyzer for software projects. Liscopelens detects license conflicts by propagating obligations through dependency graphs and checking compatibility using a knowledge base of license rules.
Features
- Graph-driven analysis: Models software dependencies as graphs for accurate obligation propagation
- Scope-aware compatibility: Handles conditional compatibility based on usage context (static/dynamic linking, etc.)
- Configuration-driven: Customize propagation rules for your build system and legal interpretation
- Library API: Integrate license analysis into your toolchain programmatically
- 150+ licenses: Built-in knowledge base covering common open-source licenses
Installation
pip install liscopelens
Quick Start
CLI Usage
The CLI entrypoint is liscopelens and expects a project_path first:
Basic analysis (GN + ScanCode):
liscopelens /path/to/project clang \
--gn-file /path/to/gn.json \
--scancode-file /path/to/scancode.json \
--output out
With custom configuration (.toml):
liscopelens /path/to/project clang \
--gn-file /path/to/gn.json \
--scancode-file /path/to/scancode.json \
--output out \
-c custom.toml
Inspect results (TUI):
# "project_path" is required by the CLI but not used by `inspect`; "." is fine.
liscopelens . inspect out
Rebuild the license compatibility knowledge base:
liscopelens kb --rebuild
Use liscopelens --help for all available options.
Library API Usage
Check compatibility between two licenses:
from liscopelens.api import check_license_compatibility
result = check_license_compatibility("MIT", "GPL-3.0-only")
print(result["compatibility"]) # 0 = UNCONDITIONAL_COMPATIBLE
print(result["message"])
Analyze a project's license compatibility:
from liscopelens.api import check_compatibility
from liscopelens.utils import GraphManager
license_map = {
"//src/main.c": "GPL-3.0-only",
"//lib/helper.c": "MIT",
}
graph = GraphManager()
graph.add_node(graph.create_vertex("//src/main.c", type="code"))
graph.add_node(graph.create_vertex("//lib/helper.c", type="code"))
graph.add_edge(graph.create_edge("//src/main.c", "//lib/helper.c", label="deps"))
context, results = check_compatibility(license_map, graph)
Override license detection and ignore specific conflicts:
context, results = check_compatibility(
license_map,
graph,
file_shadow={"//lib/crypto.c": "Apache-2.0"}, # Override detected license
license_shadow={"GPL-3.0-only": ["OpenSSL"]} # Ignore specific conflicts
)
Prerequisites (CLI)
For CLI usage with C/C++ projects, generate input files first:
-
GN Dependency Graph:
gn gen out/Default --ide=json
-
Scancode License Report:
scancode -l -c --json-pp scancode.json /path/to/project
Documentation
| Document | Description |
|---|---|
| Design Philosophy | System design, graph-driven propagation, and configuration philosophy |
| Library API Reference | Public Python API, input formats, and end-to-end examples |
| Configuration Guide | Full config reference, enums, and precise behavioral semantics |
| Reproduction | Dataset and reproduction steps for the case study |
Output
With --output out, the clang pipeline writes:
out/propagated.json: graph after obligation propagationout/compatible_checked.json: graph after compatibility checkingout/results.json: conflict groups and involved nodes/licenses
License
Apache License, Version 2.0. See LICENSE for details.
Metadata
Release files for liscopelens 0.2.18
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| liscopelens-0.2.18.tar.gz | 94.2 kB | Without provenance | Details for liscopelens-0.2.18.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| liscopelens-0.2.18-py3-none-any.whl | Python 3 | none | any | Details for liscopelens-0.2.18-py3-none-any.whl |
Total release size: 273.0 kB
Release files / liscopelens-0.2.18.tar.gz
| Download URL | liscopelens-0.2.18.tar.gz |
|---|---|
| Size | 94.2 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
412474890359492b2cac37fae4b8e6703dcdf6cf241bc2e543824884db0e0eed
|
|
BLAKE2b-256 checksum How to use checksums |
753bb1e039fc03627c5c2f9b2b43d20c15e4d7221c6a684deb39078ca56d0ab7
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
poetry/2.1.4 CPython/3.13.7 Windows/11
|
Release files / liscopelens-0.2.18-py3-none-any.whl
| Download URL | liscopelens-0.2.18-py3-none-any.whl |
|---|---|
| Size | 178.8 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
8945d080319dfe8f9557f8d38a0a791848b7103d91ecc1d1d1fb39f8ecf2a252
|
|
BLAKE2b-256 checksum How to use checksums |
19735479491331bbef7c8d6bbf2e2ecb1797b15321e7666bce410c9cc991b0bc
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
poetry/2.1.4 CPython/3.13.7 Windows/11
|
Security for liscopelens 0.2.18
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.