licenseheaders
Add or change license headers for all files in a directory
What it is and what it does
licenseheaders is a command-line tool that automates the addition, update, or replacement of license headers across a codebase. It scans a directory tree for source files in known languages (Python, JavaScript, C++, Java, Go, Rust, SQL, YAML, and many others) and applies a license header template to each one, substituting variables like project name, owner, and year range. The tool supports dry-run mode to preview changes, file exclusion patterns, custom file extensions, and encoding options.
It's designed for developers who need to maintain consistent copyright and license declarations across large or multi-language projects. You provide a template (either a built-in one or a custom file), specify metadata like copyright owner and project URL, and the tool handles the rest. It can back up modified files and respects your choice of which file types to process.
Use it for:
- Add MIT or GPL headers to all source files in a new open-source project in one command.
- Update copyright years across an entire codebase without manual editing.
- Enforce consistent license headers in a multi-language monorepo (Python, JavaScript, Go, etc.).
- Integrate with pre-commit hooks to ensure new files get license headers before commit.
- Replace an old license header with a new one across thousands of files.
- Add license headers to generated or templated files with custom extensions.
Worth the install?
AI-flagged interpretation of the facts on this page — verify before relying
Batch-updates or adds license headers to source files across a directory tree, supporting dozens of file types from Python and JavaScript to C++, Java, and SQL.
Yes, if you maintain a multi-language codebase and need to add or update license headers at scale. The tool is stable, has no vulnerabilities, and low install friction. However, maintenance is dormant (no updates since 2021); if you need active support or expect breaking changes in newer Python versions, consider whether the risk of stale code matters for your use case.
Install
licenseheaders on PyPI
pip
pip install licenseheadersuv
uv add licenseheaderspoetry
poetry add licenseheadersInstalling licenseheaders
Before you install
Low friction install with a single runtime dependency (regex). Maintenance is dormant—last release was 2021-04-08 and no commits since 2023-10-24—but the package is marked Production/Stable and has no known vulnerabilities.
License in practice
MIT license (permissive) means you can use, modify, and distribute this tool freely with minimal restrictions; include the license text in your distribution.
Quickstart
pip install licenseheaders
licenseheaders -t lgpl-v3 -y 2012-2014 -o "Your Company" -n "ProjectName" -d ./src
Requires Python 3.5 or higher.
Verify before relying
- Whether predefined templates (lgpl-v3, etc.) are included or must be provided separately.
- Whether the tool can be used programmatically as a library or only via CLI.
- Support status for Python versions beyond 3.5.
Package facts
| License | MIT (permissive) |
| Python support | supports the current Python release (>=3.5) |
| Install friction | low — pure-Python wheel |
| Runtime dependencies | 1 — regex |
| Maintenance | dormant — 1,954 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 82,777/month — #14,134 on PyPI (30-day window, as of 2026-08-14) |
| Known vulnerabilities | none known (OSV.dev, checked 2026-08-14) |
Evidence: licenseheaders-0.8.8-py3-none-any.whl
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
ct3Cheetah3 is a template engine and code…
permissive · top 5,000 on PyPI
Cheetah3Cheetah3 is a template engine and code…
permissive · top 15,000 on PyPI
ziglangDistributes the Zig programming language…
permissive · top 5,000 on PyPI
std-uritemplateExpands RFC 6570 URI Templates (Level 4) by…
permissive · top 5,000 on PyPI
aws-lambda-buildersCompiles, builds, and packages AWS Lambda…
permissive · top 5,000 on PyPI
j2clij2cli is a command-line tool that renders…
permissive · top 5,000 on PyPI
django-sass-processorCompiles SASS/SCSS files to CSS on the fly…
permissive · top 15,000 on PyPI
aws-cdk.aws-batchDefines AWS Batch infrastructure (compute…
permissive · top 15,000 on PyPI
django-compressorDjango Compressor combines, minifies, and…
permissive · top 5,000 on PyPI
pickpick provides a Python library to create…
permissive · top 15,000 on PyPI