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.0.tar.gz (10.3 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.0-py3-none-any.whl (9.8 kB view details)

Uploaded Python 3

File details

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

File metadata

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

File hashes

Hashes for license_radar-0.1.0.tar.gz
Algorithm Hash digest
SHA256 d1be59e4a8e52cc4057789bb9da129f8384cede54804f574108eecb8888fa495
MD5 20afc5ed19bcada85eac1813c7ebb539
BLAKE2b-256 869fd2ea1c7599d89b3baca2bad8fafe2de9d47d2d734129b31b6ba6109f48a2

See more details on using hashes here.

File details

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

File metadata

  • Download URL: license_radar-0.1.0-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.13.9

File hashes

Hashes for license_radar-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 8be7219e713d339efdfcbe68b2b1c634297bb7349bbdd7747c3e837efb2a0f2d
MD5 b1d55f5d52c5043b8929fd232eef6c49
BLAKE2b-256 d098cf5f9fddd0a6ec5db59d0f88317e79ecc115f14e7bfc46a4174ee6d02220

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