Registry / devops / scancode-toolkit

scancode-toolkit

JSON →
library32.5.0pypypi✓ verified 84d ago

ScanCode is a tool to scan code for license, copyright, package and their documented dependencies and other interesting facts. Current version: 32.5.0. Releases are frequent (every few weeks to months). Requires Python >=3.10.

pip install scancode-toolkit
INSTALL
IMPORT
SIG · SCANCODE-TOOLKIT
S
scancode-toolkit
devopspythonv32.5.0
Install
20.1s avg
Import
Disk
726MB
Pass rate
4/ 10
Env Coverage4 / 10
glibc
3.93.13
musl
3.93.13
Install & Compatibility
Where this runs
tested against v32.5.0 · pip install
no network on importno background threads
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
musl
glibc
py 3.10
✕ timeout
✓ 21.4s
py 3.11
✕ build_error
✓ 20.9s
py 3.12
✕ build_error
✓ 19.4s
py 3.13
✕ timeout
✓ 18.8s
py 3.9
✕ timeout
✕ build_error
726MB installed
● package 726MB
Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

Scanner
from scancode.cli import Scanner
Scanner is the main CLI class; direct import from scancode.cli
JsonResults
from scancode.output import JsonResults
Used to generate JSON output

Basic scan for licenses and copyrights on a directory. The scanner returns a results object; call as_json() to get JSON output.

import os from scancode.cli import Scanner scanner = Scanner() results = scanner.scan('path/to/scan', options={'--license': True, '--copyright': True}) print(results.as_json())
scancode --version
Debug
Known issues
breakingOutput format version bumped to 4.0.0 in v32.3.0. Attribute renames: 'is_resolved' -> 'is_pinned' in dependencies, 'spdx_license_expression' -> 'license_expression_spdx' in license matches.
fix
Update code and scripts to use new attribute names.
affects: >=32.3.0
gotchaBinary package detection is now skipped by default. Use '--package-in-compiled' to scan packages in compiled binaries (rust/go). Previously these were detected under '--package'.
fix
Add '--package-in-compiled' flag to your CLI options if you need to detect packages in compiled binaries.
affects: >=32.5.0
deprecatedPython 3.9 wheels removed in v32.5.0; Python 3.7 dropped in v32.1.0.
fix
Upgrade Python to 3.10 or later.
affects: >=32.5.0
Errors
Common errors & fixes
ModuleNotFoundError: No module named 'scancode'
Installing the wrong package or missing installed scancode-toolkit.
fix
Run: pip install scancode-toolkit
AttributeError: 'NoneType' object has no attribute 'as_json'
scan() returned None because of invalid path or missing options.
fix
Ensure the path exists and you pass valid options like '--license' and '--copyright' as a dictionary.
ValueError: Unknown option: --package-in-compiled
Using an older version of scancode that doesn't have that option.
fix
Upgrade scancode-toolkit to >=32.5.0
Upgrade
Version history
32.5.0latest on PyPI · released Jan 15, 2026
Audit
Dependencies
pluggyrequiredPlugin system core
license-expressionrequiredSPDX license expression parsing
Agent activity
19 hits · last 30 days
node
18
OpenAI (training)
1
Resources
scancode-toolkit — pip install scancode-toolkit · libregistry