Skip to main content

license-radar

Scan a project's dependency manifests (requirements.txt, pyproject.toml, package.json) for license compliance risk before a GPL/AGPL dependency turns into a legal problem for a closed-source product.

Why

Pulling in a GPL- or AGPL-licensed dependency can obligate a company to open its own source, or expose it to a lawsuit — and it usually happens by accident, several dependency layers deep. Existing SCA/security scanners focus on vulnerabilities; license risk is often an afterthought bolted onto an expensive enterprise product. This is a small, focused tool that does just the license check, fast, in CI.

Install

pip install license-radar

Usage

license-radar scan .                 # scan a directory (auto-detects manifests)
license-radar scan requirements.txt   # scan a single manifest
license-radar scan . --online         # also query PyPI/npm for packages not in the local DB
license-radar scan . --json           # machine-readable output for CI
license-radar scan . --policy policy.json

Exit code is 1 if any dependency violates the policy (useful as a CI gate), 0 otherwise.

Policy

By default, any strong-copyleft (GPL/AGPL/SSPL) or unknown license is a violation. Override with a JSON file:

{
  "fail_at_or_above": "weak-copyleft",
  "treat_unknown_as_violation": false
}

How it classifies

Licenses are normalized to an SPDX id and bucketed into four tiers: permissive < weak-copyleft < strong-copyleft < unknown. See license_radar/classify.py for the exact lists.

Limitations

The offline database (license_radar/license_db.py) is a small, hand-curated table of common packages, not a registry mirror — use --online for full coverage against live PyPI/npm metadata (adds a network dependency and is not covered by the deterministic test suite).

License

MIT

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

license_radar-0.1.1.tar.gz (10.2 kB view details)

Uploaded Source

Built Distribution

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

license_radar-0.1.1-py3-none-any.whl (9.8 kB view details)

Uploaded Python 3

File details

Details for the file license_radar-0.1.1.tar.gz.

File metadata

  • Download URL: license_radar-0.1.1.tar.gz
  • Upload date:
  • Size: 10.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.13

File hashes

Hashes for license_radar-0.1.1.tar.gz
Algorithm Hash digest
SHA256 5e249825ee0c0392e80674cea14e59beb7622d9b51bd26eea8118d7215761eff
MD5 bdf33a563b2b5e70b9ecc774643cf723
BLAKE2b-256 a61f62a996e7e582894a8b42d025afde2976090b2e39838664ac7c275d8b9837

See more details on using hashes here.

File details

Details for the file license_radar-0.1.1-py3-none-any.whl.

File metadata

  • Download URL: license_radar-0.1.1-py3-none-any.whl
  • Upload date:
  • Size: 9.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.13

File hashes

Hashes for license_radar-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 48b92992813329c270c3ae9d607755048a1c377468150256b102b276b5d61760
MD5 0ffdae55f54213d7a5070c971526ef4c
BLAKE2b-256 985820c5db939e0f53824c11f0ac891093b57b5072d65d279d6ecae59d3cbca5

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