CLI tool
aboutcode-org/scancode-toolkit avatar
aboutcode-org/scancode-toolkit

ScanCode Toolkit: license, copyright and dependency scanning from the command line

:mag: ScanCode detects licenses, copyrights, dependencies by "scanning code" ... to discover and inventory open source and third-party packages used in your code. Sponsored by NLnet, the Google Summer of Code, Azure credits, nexB and other generous sponsors!

2,678 stars875 forksPythonNOASSERTION

At a glance

What is it?
ScanCode Toolkit is a Python command line tool and library that detects licenses, copyrights and package manifests in source and binary files. It is thorough and slow, and the install is heavier than a pip install suggests.
Who is it for?
Adopt ScanCode Toolkit when you need a defensible file-by-file record of licenses and copyrights, not just a package list, and when you can pay the scan time. Do not adopt it as a fast dependency-only SCA scanner; for that, a lockfile reader such as OSS Review Toolkit or the ScanCode.io web app on top of the same engine fits better.
Can I use it commercially?
Check first. The repository uses a licence we do not classify automatically, so read its LICENSE file before any commercial use.
Is it still maintained?
Yes. The repository last received commits 2 days ago.
What is it written in?
Mainly Python, according to GitHub's language statistics.

Answers come from the project's GitHub data, last synced on November 22, 2026, and from our analysis. They are not legal advice.

From daily snapshots

Star history

  • aboutcode-org/scancode-toolkit2,678 ★ · +45
Star history
Repository2026-09-292026-11-22
aboutcode-org/scancode-toolkit2.6k2.7k

45 Stars in the last 54 days, measured from the daily GitHub snapshot. Compare with other projects

Editorial analysis

What ScanCode Toolkit is for, and who actually needs it

ScanCode Toolkit scans a codebase and reports the origin of each file: the license detected in it, the copyright statements found in it, the package manifests and lockfiles it contains, and the dependencies those manifests document. The README puts it plainly: it detects the "origin (copyrights), license and vulnerabilities of code, packages and dependencies in a codebase." The unit of output is the file, not the package. That distinction matters. A dependency scanner tells you that you pulled in a library at some version. ScanCode tells you what is written inside the files you ship, including vendored copies that no manifest mentions and headers that survived a copy-paste.

That makes it a fit for legal and compliance review of a release, for due diligence on acquired code, and for anyone producing an SBOM who cannot rely on the build system alone. It is a poor fit for a developer who wants a fast answer about whether a transitive dependency has a known CVE. The README lists vulnerabilities among what it detects, but the emphasis throughout is license and copyright detection, and the companion ScanCode.io web app is where the project points for organizing multiple scan projects and scripted pipelines.

How the license detection engine works, and why it is slow

The README describes the core method directly: ScanCode performs "a full comparison (also known as diff or red line comparison) between a database of license texts and your code instead of relying only on approximate regex patterns or probabilistic search, edit distance or machine learning." In practice this means the tool carries a license text database, indexes it, and compares candidate regions of each scanned file against that index. It is a matching problem, not a classification problem, which is why the project can claim accuracy rather than probability and why a scan costs real time on a large tree.

The repository layout shows the moving parts. There is an extractcode entry point for unpacking archives, a licensedcode data and index set of packages (pyproject-licensedcode-data.toml, pyproject-licensedcode-index.toml), and a separate pyproject-scancode-toolkit-mini.toml, which corresponds to the smaller variant people search for as "scancode toolkit mini." The Dockerfile makes the setup steps explicit: after ./configure it runs scancode-reindex-licenses to build the license index, scancode-reindex-package-patterns to build the package patterns cache, and scancode-train-gibberish-model to train a Markov chain model used for gibberish detection. Those three commands are the shape of the engine: a license index, a package pattern cache, and a text-quality model that keeps binary noise and generated blobs from being reported as license matches.

Installing ScanCode Toolkit and running a first scan

The README does not spell out install commands; it points to the Getting Started page in the documentation for prerequisites and instructions. What the repository does show is the configure script at the top level and a Makefile that wraps it. The Makefile sets VENV=venv and defines conf as running ./configure, and dev as ./configure --dev, with PYTHON_EXE defaulting to python3 and overridable. So the supported path from a clone is the configure script, which builds a virtual environment in venv/.

bash
./configure

After that finishes, the scancode launcher at the repository root is the entry point. The samples/ directory ships small trees (samples/zlib/, samples/JGroups/, samples/arch/) that are useful for a first run because they are small enough to finish quickly. The README lists JSON, YAML, HTML, CycloneDX and SPDX as supported outputs. For a container-based run, the repository has a Dockerfile whose entrypoint is the scancode command, so arguments are passed straight through to the image. The Dockerfile performs the index build like this:

dockerfile
RUN ./configure \
 && ./venv/bin/scancode-reindex-licenses \
 && ./venv/bin/scancode-reindex-package-patterns \
 && ./venv/bin/scancode-train-gibberish-model

The Dockerfile pins python:3.12-slim-bookworm and installs OS packages including bzip2, xz-utils, libxml2-dev, libxslt1-dev and libgomp1 before running configure and the three index-building commands. Expect the image build to take a while, since it trains the gibberish model and builds the license index at build time rather than on first scan.

Where ScanCode Toolkit is the wrong tool

The engine's accuracy comes from comparing text, and that comparison has a cost that scales with the number of files and their size. A monorepo with vendored dependencies, generated bundles, minified JavaScript and committed binaries is the worst case: every one of those files is a candidate for extraction and matching. The gibberish model exists precisely because this is a known problem, but a model that suppresses false license matches does not make the scan faster.

A second limit is scope. ScanCode reports what a manifest documents. If a project's dependencies are resolved at build time and no lockfile is committed, there is nothing for the package parsers to read, and the dependency graph will be incomplete no matter how good the license detection is. The README's claim is that it "can process packages, build manifest and lockfile formats to collect Package URLs and extract metadata," which is conditional on those files being present.

A third is operational. Running ScanCode per commit in CI is a different proposition from running it per release. The Makefile shows the project's own test target as pytest -vvs, and the README describes an automated test suite of over 30,000 tests run on each commit across Windows, Linux and macOS. That is the project's own CI, not a template for yours; a full scan of a large tree is not a pre-commit hook.

ScanCode Toolkit compared with OSS Review Toolkit and ScanCode.io

OSS Review Toolkit is named in the README as one of the projects that uses ScanCode, which tells you the relationship: ORT orchestrates a compliance workflow and can call ScanCode as its license scanner rather than reimplementing license text matching. The difference in approach is where the work happens. ORT starts from the package manager and builds a dependency graph, then resolves metadata from curated sources; ScanCode starts from the files on disk and reports what is in them. If your question is "which declared dependencies do we have and what are their declared licenses," ORT answers it faster. If your question is "what is actually written in the files in this tarball," ORT has to delegate that to something like ScanCode.

ScanCode.io is the same organization's server-side application, described in the README as a companion for organizing and storing multiple scan projects with scripted scanning pipelines. The difference is again architectural: the toolkit is a command line tool and library that you embed, while ScanCode.io wraps it with storage, a pipeline model and a web interface. Teams that want a shared, queryable record of many scans should look at ScanCode.io; teams that want to call the scanner from their own script should use the toolkit directly.

Maintenance, releases and licensing

The repository is not archived, and the last push was on 2026-09-18, which puts it within recent activity rather than dormant. The release list in the repository metadata is dominated by commoncode-v32.5.x entries from June and August 2026, and pyproject.toml declares version 33.0.0rc1 for the development package, so the toolkit and its shared commoncode library are versioned separately. That split matters for upgrades: requirements.txt pins exact versions across roughly ninety packages, including container-inspector, extractcode, license-expression, packageurl-python and typecode, so an upgrade is a coordinated bump rather than a single dependency change.

Licensing is not a single identifier. The README states that Apache-2.0 is the overall license, CC-BY-4.0 applies to reference datasets, and multiple secondary permissive or copyleft licenses (LGPL, MIT, BSD, GPL 2/3) cover third-party components and test suite code and data. The GitHub license field reports NOASSERTION, and pyproject.toml expresses the combination as a compound expression. The practical consequence is that redistributing the toolkit, or the license and package datasets it ships, is not the same as redistributing an Apache-2.0 library. The NOTICE file and the per-file .ABOUT files are where the project documents the origin and license of third-party code; that is the material to hand to whoever reviews redistribution, not the README's one-line summary.

Editorial conclusion

Adopt ScanCode Toolkit when you need a defensible file-by-file record of licenses and copyrights, not just a package list, and when you can pay the scan time. Do not adopt it as a fast dependency-only SCA scanner; for that, a lockfile reader such as OSS Review Toolkit or the ScanCode.io web app on top of the same engine fits better. Before rolling it out, run one scan on a representative repository, check the file count and runtime, and confirm that the SPDX or CycloneDX output your downstream consumer expects is actually produced by the version you installed.

Frequently asked questions

What is ScanCode Toolkit?

It is a set of code scanning tools from the AboutCode project that detect the origin (copyrights), license and vulnerabilities of code, packages and dependencies in a codebase. It can be used as a command line tool or as a library.

What is scancode?

ScanCode Toolkit is a code scanning tool that detects licenses, copyrights, package manifests and direct dependencies in source code and binary files. The README describes it as the core data collection tool reused by several open source compliance tools.

How do I install ScanCode Toolkit?

The README points to the Getting Started page in the documentation for prerequisites and install instructions. The repository itself provides a configure script and a Makefile whose conf target runs ./configure, which builds a virtual environment in venv/.

Can I run ScanCode Toolkit in Docker?

Yes. The repository includes a Dockerfile based on python:3.12-slim-bookworm that runs configure, scancode-reindex-licenses, scancode-reindex-package-patterns and scancode-train-gibberish-model at build time, and sets the entrypoint to the scancode command so arguments pass straight through.

What output formats does ScanCode Toolkit support?

The README lists JSON, YAML, HTML, CycloneDX and SPDX, and notes that custom formats can be produced with Jinja templates. A scan selects the format with a flag such as --json followed by a filename.

What license is ScanCode Toolkit under?

Apache-2.0 is the overall license, CC-BY-4.0 applies to reference datasets, and multiple secondary permissive or copyleft licenses cover third-party components and test suite code and data. The NOTICE file and the per-file .ABOUT files document the origin and license of third-party code.

Official sources

  1. aboutcode-org/scancode-toolkit on GitHub
  2. Issues
  3. Project website
  4. README
  5. Releases
Add this badge to your README

If you maintain this project, the badge below links readers to this analysis and shows its maintenance status from the daily GitHub snapshot. Paste the markdown into your README; add ?metric=license or ?metric=stars to the image URL for a different field.

Add this badge to your README

markdown
[![Hysen Labs](https://hysenlabs.com/badge/aboutcode-org-scancode-toolkit.svg)](https://hysenlabs.com/projects/aboutcode-org-scancode-toolkit)

Star history chart for your README

markdown
[![Star history](https://hysenlabs.com/chart/aboutcode-org-scancode-toolkit.svg)](https://hysenlabs.com/projects/aboutcode-org-scancode-toolkit)

Was this useful?