commoncode
Set of common utilities, originally split from ScanCode
What it is and what it does
CommonCode is a utility library that originated as part of ScanCode Toolkit and was extracted into a standalone package. It provides common functions for working with file paths, dates, file operations, and hash computations—tasks that appear frequently in file scanning and analysis workflows. The package depends on a small set of well-established libraries: attrs, Beautifulsoup4, click, requests, saneyaml, and text_unidecode, which suggests it handles structured data parsing, command-line interaction, and text normalization alongside its core utilities.
The package is actively maintained, with a recent release and no known security vulnerabilities. It targets modern Python (3.10+) and is classified as production-stable. It is moderately popular in the PyPI ecosystem, suggesting it is used by projects that need reliable, reusable utility functions rather than implementing these operations from scratch.
Use it for:
- Extracting common file and path handling logic into a shared library for multiple projects.
- Building file scanning or analysis tools that need consistent date, hash, and file utilities.
- Integrating with ScanCode Toolkit workflows that rely on these utility functions.
- Normalizing text and handling structured data formats in data processing pipelines.
- Reducing code duplication across projects by centralizing utility implementations.
Worth the install?
AI-flagged interpretation of the facts on this page — verify before relying
CommonCode provides utility functions for handling paths, dates, files, hashes, and other common operations, originally extracted from ScanCode Toolkit as a reusable library.
Yes, if you need common file, path, date, or hash utilities and want to avoid reimplementing them. The package is actively maintained, has low install friction, and carries no known vulnerabilities. However, verify the formal license terms before use in proprietary contexts, as the license treatment is marked unclear despite the Apache-2.0 claim in the description.
Install
commoncode on PyPI
pip
pip install commoncodeuv
uv add commoncodepoetry
poetry add commoncodeInstalling commoncode
Before you install
Low install friction with six straightforward runtime dependencies. The package is actively maintained with a recent release and no known vulnerabilities.
License in practice
License treatment is unclear—the description states Apache-2.0, but the metadata does not confirm this formally. Verify the actual license terms before using in proprietary or restricted contexts.
Quickstart
pip install commoncode
import commoncode
# Use utility functions from the library for path, date, file, or hash operations
Requires Python 3.10 or later.
Verify before relying
- Specific utility functions and API surface—the fact sheet does not detail what operations are available.
- Whether the package is actively used by ScanCode Toolkit or maintained independently.
- Formal license confirmation—description claims Apache-2.0 but metadata shows unclear treatment.
Package facts
| License | not declared (unclear) |
| Python support | supports the current Python release (>=3.10) |
| Install friction | low — pure-Python wheel |
| Runtime dependencies | 6 — attrs, Beautifulsoup4, click, requests, saneyaml, text_unidecode |
| Maintenance | actively maintained — 64 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 168,969/month — #10,432 on PyPI (30-day window, as of 2026-08-14) |
| Known vulnerabilities | none known (OSV.dev, checked 2026-08-14) |
Evidence: commoncode-32.5.2-py3-none-any.whl
Keywords: utilities, scancode-toolkit
Tags
More Software Development packages
Provides backported and experimental type hints…
permissive · top 100 on PyPI
numpyNumPy provides an N-dimensional array object…
permissive · top 100 on PyPI
fastapiFastAPI is a Python web framework for building…
permissive · top 100 on PyPI
annotated-docProvides a way to document function parameters,…
permissive · top 100 on PyPI
typerTyper builds command-line applications from…
permissive · top 1,000 on PyPI
distlibDistlib provides low-level packaging utilities…
permissive · top 1,000 on PyPI
extractcodeExtracts a wide range of archive formats (tar,…
permissive · top 15,000 on PyPI
filehashCalculates and verifies file checksums and…
permissive · top 15,000 on PyPI
utilsProvides a collection of utility functions and…
copyleft · top 15,000 on PyPI
oslo.utilsoslo.utils provides common utility functions…
permissive · top 5,000 on PyPI
ubiquergUbiquerg provides a collection of low-level…
permissive · top 15,000 on PyPI
scancode-toolkitScanCode Toolkit detects licenses, copyrights,…
permissive · top 15,000 on PyPI
bx-py-utilsA collection of utility functions covering…
permissive · top 15,000 on PyPI
extractcode-libarchiveProvides a prebuilt native libarchive binary as…
permissive · top 15,000 on PyPI
probableparsingProvides common utility methods for building…
permissive · top 5,000 on PyPI
typecodeDetects file types and MIME types using…
permissive · top 15,000 on PyPI