Skip to main content

Automate REUSE license annotation from git history.

Project description

reuseify

PyPi Python version REUSE status

Automate REUSE license annotation from git history.

reuseify inspects which files are missing license headers (via reuse lint), looks up their git commit authors, and applies reuse annotate, all from a single CLI.

Installation

uv pip install .

Usage

The workflow is two steps: collect authors → annotate files.

Step 1: collect authors

reuseify get-authors [OPTIONS]

Runs reuse lint, finds every file missing a license header, looks up its git commit authors, and writes a JSON file:

{
  "src/foo.py": ["Alice", "Bob"],
  "src/bar.c":  ["Alice"],
  "src/new.py": [] #NOT_IN_GIT
}
Option Short Default Description
--output -o reuse_annotate_authors.json Output JSON file
--include-not-in-git -i off Include files with no git history (empty author list)
--exclude PATTERN -e Extra glob pattern to exclude (matched per path component, repeatable)

Files matching built-in patterns are always excluded: __pycache__, .venv, venv, .env, env, .git, .vscode, .idea, *.egg-info, *.pyc, dist, build, node_modules, .tox, .mypy_cache, .pytest_cache, .ruff_cache.

Files ignored by .gitignore are also excluded automatically.

Examples

# defaults
reuseify get-authors

# custom output path + include untracked files
reuseify get-authors --output authors.json --include-not-in-git

# add an extra exclusion pattern
reuseify get-authors --exclude reports --exclude "*.tmp"

Step 2: annotate files

reuseify annotate [OPTIONS] [REUSE ANNOTATE FLAGS...]

Reads the JSON file from Step 1 and calls reuse annotate for every file. --contributor flags are injected automatically from the JSON data. All unrecognised flags are forwarded verbatim to reuse annotate, giving you full control over --copyright, --license, --year, --style, --fallback-dot-license, --force-dot-license, --skip-unrecognised, etc.

Option Short Default Description
--input -i reuse_annotate_authors.json JSON file from get-authors
--default-contributor NAME -d Fallback contributor for NOT_IN_GIT files (repeatable)

Output is grouped: all successes first, then skips, then failures, then finally a summary.

Examples

# basic
reuseify annotate \
    --copyright "2025 X-Men" \
    --license Apache-2.0 \
    --fallback-dot-license

# custom input + fallback contributor for untracked files
reuseify annotate \
    --input authors.json \
    --default-contributor "Charles Xavier" \
    --copyright "2025 X-Men" \
    --license Apache-2.0

# multiple default contributors
reuseify annotate \
    --default-contributor "Professor X" \
    --default-contributor "Cyclops" \
    --copyright "2025 X-Men" \
    --license MIT

Disclaimer

[!CAUTION] Use at your own risk. reuse annotate modifies files in place.

reuse annotate --help

This project is not affiliated with the REUSE project or its maintainers in any way.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

reuseify-0.1.2.tar.gz (19.7 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

reuseify-0.1.2-py3-none-any.whl (19.8 kB view details)

Uploaded Python 3

File details

Details for the file reuseify-0.1.2.tar.gz.

File metadata

  • Download URL: reuseify-0.1.2.tar.gz
  • Upload date:
  • Size: 19.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for reuseify-0.1.2.tar.gz
Algorithm Hash digest
SHA256 05dd68e0fc68e1233504d17cb6812e07cb61bb140973b1a16eb80b0b34691e62
MD5 0c1b26b3bc23a75963f3c6a64968586b
BLAKE2b-256 fdbe3026c79aaa8b0d463bd96362e708b8b424f62bfd9791be7c760028f51059

See more details on using hashes here.

File details

Details for the file reuseify-0.1.2-py3-none-any.whl.

File metadata

  • Download URL: reuseify-0.1.2-py3-none-any.whl
  • Upload date:
  • Size: 19.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for reuseify-0.1.2-py3-none-any.whl
Algorithm Hash digest
SHA256 da0a6b0d8f1d4acac46c9d58d9c0ee1f8fccec0c09f1189fa4152fcffbc495cd
MD5 5864f51a65d3c83afa7cbbeaacd7731b
BLAKE2b-256 a4edd27169e12d81707c537dee2078cb4e8055ed99bf9c294a662ad7f5208105

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page