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.1.tar.gz (19.5 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.1-py3-none-any.whl (19.6 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: reuseify-0.1.1.tar.gz
  • Upload date:
  • Size: 19.5 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.1.tar.gz
Algorithm Hash digest
SHA256 c3437db171e05527028a9947eb5b329f12b94a84a85976af23baa2e3a29de884
MD5 f9eda9f554cb6ea66dadb026cd3387b7
BLAKE2b-256 adfa2bc3c70c147d6f3d61db7429b6e15af7b9c94318527fbc642b8f028cbb6d

See more details on using hashes here.

File details

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

File metadata

  • Download URL: reuseify-0.1.1-py3-none-any.whl
  • Upload date:
  • Size: 19.6 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.1-py3-none-any.whl
Algorithm Hash digest
SHA256 d31d9fc4d8579fe60d168e38678c01abf8035e9fa2d41f92a4c84a738cd679b8
MD5 9122a11a091f99289fb9c7c1a3ef31f5
BLAKE2b-256 fee9d48cf340678633a768d5358d1900da849797443146ab1c81553f859d8da1

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