skillfed

licenseheaders

Add or change license headers for all files in a directory

licenseheaders v0.8.8 82.8K downloads/30d#14,134 on PyPI138
Permissive license MIT DORMANT released

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 licenseheaders

uv

uv add licenseheaders

poetry

poetry add licenseheaders

Installing 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

Development Status :: 5 - Production/StableEnvironment :: ConsoleIntended Audience :: DevelopersLicense :: OSI Approved :: MIT LicenseNatural Language :: EnglishProgramming Language :: Python :: 3Topic :: Software DevelopmentTopic :: Software Development :: Code Generators

Tags

add license headers to source filesbatch update copyright headerslicense header management toolbulk add license text to codecopyright header automationlicense header generatormulti-language license headers
license-automationmulti-languagecli-tool

More Software Development packages