6
61
Fork
You've already forked reuse-tool
23
reuse is a tool for compliance with the REUSE recommendations. https://reuse.software
  • Python 99.2%
  • Makefile 0.5%
  • Dockerfile 0.2%
Tino Tempesta f1222014e8
Some checks failed
Test compliance with latest release / reuse (push) Successful in 23s
Test suites / test (nikolaik/python-nodejs:python3.10-nodejs24-slim) (push) Successful in 1m24s
Test suites / test (nikolaik/python-nodejs:python3.14-nodejs24-slim) (push) Successful in 1m31s
Test suites / pylint-mypy (push) Successful in 59s
Test suites / black-prettier-isort-reuse (push) Failing after 41s
Test suites / docs (push) Successful in 46s
Lint 3rd party repositories / third-party-lint (https://github.com/curl/curl) (push) Successful in 57s
Lint 3rd party repositories / third-party-lint (https://github.com/fsfe/reuse-example) (push) Successful in 35s
Lint 3rd party repositories / third-party-lint-expect-failure (https://github.com/spdx/license-list-XML) (push) Successful in 54s
Translated using Weblate (French)
Currently translated at 100.0% (236 of 236 strings)
Translation: Free Software Foundation Europe/reuse-tool
Translate-URL: https://hosted.weblate.org/projects/fsfe/reuse-tool/fr/ 
2026年07月02日 07:01:19 +02:00
.forgejo Fix third_party_lint workflow 2025年11月30日 16:51:12 +01:00
.github Merge pull request 'Add test for Windows and macOS' ( #1287 ) from carmenbianca/reuse-tool:macos-windows-ci into main 2025年11月25日 14:33:31 +01:00
changelog.d Merge pull request 'feat: Add .python-version file support' ( #1334 ) from sorairolake/reuse-tool:feature/python-version-file into main 2026年05月25日 21:40:41 +02:00
docs Comply with CONTRIBUTING.MD :) 2026年03月19日 15:51:42 +01:00
LICENSES Do a massive refactoring 2019年04月16日 22:44:18 +02:00
po Translated using Weblate (French) 2026年07月02日 07:01:19 +02:00
src/reuse Merge pull request 'feat: Add .python-version file support' ( #1334 ) from sorairolake/reuse-tool:feature/python-version-file into main 2026年05月25日 21:40:41 +02:00
tests address feedback 2026年04月15日 14:25:23 +02:00
.editorconfig Adjust indent sizes for .md, ,yaml, .json 2021年02月02日 17:31:21 +01:00
.gitignore Use click for pot file generation 2024年10月10日 13:56:12 +02:00
.pre-commit-config.yaml Regenerate poetry.lock 2025年10月27日 15:35:04 +01:00
.pre-commit-hooks.yaml Bundle all extras in pre-commit and Dockerfile 2025年10月07日 12:34:01 +02:00
.prettierignore extend list of ignored paths for prettier 2022年01月28日 14:18:37 +01:00
.prettierrc.yaml Add prettier configuration 2022年01月23日 00:02:43 +01:00
.pylintrc Satisfy pylint 2024年09月27日 20:12:51 +02:00
.readthedocs.yaml Move .github to .forgejo 2025年10月28日 10:06:28 +01:00
_build.py Remove setuptools dependency in _build.py and build time 2023年04月08日 23:14:06 +02:00
AUTHORS.rst Merge remote-tracking branch 'origin/pr/1340' 2026年05月25日 21:39:13 +02:00
CHANGELOG.md Change more URLs to Codeberg 2025年11月27日 14:53:42 +01:00
CODE_OF_CONDUCT.md Add contact address to all FSFE copyright statements 2020年04月21日 16:02:04 +01:00
CONTRIBUTING.md Add instruction to release checklist 2025年11月26日 03:24:02 +01:00
Dockerfile Bump Alpine and Debian in Dockerfile 2025年10月07日 18:09:48 +02:00
Dockerfile-debian Bump Alpine and Debian in Dockerfile 2025年10月07日 18:09:48 +02:00
Makefile Move .github to .forgejo 2025年10月28日 10:06:28 +01:00
poetry.lock Add new pytest-lazy-fixtures dependency 2025年11月26日 00:26:52 +01:00
pyproject.toml Add new pytest-lazy-fixtures dependency 2025年11月26日 00:26:52 +01:00
README.md Remove repeated sentiment from README 2025年11月29日 10:32:49 +01:00
REUSE.toml Don't parse REUSE info inside change log fragments 2025年11月27日 14:47:03 +01:00

reuse

The latest version of reuse can be found on PyPI. Information on what versions of Python reuse supports can be found on PyPI. REUSE status standard-readme compliant Packaging status Translation status

reuse is a tool for compliance with the REUSE recommendations.

Table of contents

Background

Copyright and licensing is difficult, especially when reusing software from different projects that are released under various different licenses. REUSE was started by the Free Software Foundation Europe (FSFE) to provide a set of recommendations to make licensing your Free Software projects easier. Not only do these recommendations make it easier for you to declare the licenses under which your works are released, but they also make it easier for a computer to understand how your project is licensed.

As a short summary, the recommendations are threefold:

  1. Choose and provide licenses
  2. Add copyright and licensing information to each file
  3. Confirm REUSE compliance

You are recommended to read our tutorial for a step-by-step guide through these three steps. The FAQ covers basic questions about licensing, copyright, and more complex use cases. Advanced users and integrators will find the full specification helpful.

There are other tools that have a lot more features and functionality surrounding the analysis and inspection of copyright and licenses in software projects. The REUSE tool, on the other hand, is solely designed to be a simple tool to assist in compliance with the REUSE recommendations.

Install

Dependencies

Unless you install via a package manager, it may be helpful to be aware of the following system dependencies of reuse:

  • Python 3.10+
  • libmagic
  • Version control systems
    • Git
    • Mercurial 4.3+
    • Pijul
    • Jujutsu
    • Fossil

Excepting Python, these dependencies are all optional. reuse will still work if they are not installed.

If a version control system (VCS) is not installed, then reuse will not correctly ignore files which are ignored by the VCS, for example via .gitignore.

If libmagic is not installed, then a slower mechanism will be used to detect the encodings of files. You may need to explicitly install the fall-back. When installing reuse as Python package, install reuse[charset-normalizer] instead. For example: pipx install reuse[charset-normalizer].

There are packages available for easy install on many operating systems. You are welcome to help us package this tool for more distributions!

For Debian and derivatives:

apt install reuse

For Fedora and derivatives:

dnf install reuse

An automatically generated list of available packages can be found at repology.org, without any guarantee for completeness.

The following one-liner both installs and runs this tool from PyPI via pipx:

pipx run reuse lint

pipx automatically isolates reuse into its own Python virtualenv, which means that it won't interfere with other Python packages, and other Python packages won't interfere with it.

If you want to be able to use reuse without prepending it with pipx run every time, install it globally like so:

pipx install reuse

reuse will then be available in ~/.local/bin, which must be added to your $PATH.

After this, make sure that ~/.local/bin is in your $PATH. On Windows, the required path for your environment may look like %USERPROFILE%\AppData\Roaming\Python\Python310\Scripts, depending on the Python version you have installed.

To upgrade reuse, run this command:

pipx upgrade reuse

Installation via pip

To install reuse into ~/.local/bin, run:

pip3 install --user reuse

Subsequently, make sure that ~/.local/bin is in your $PATH like described in the previous section.

To upgrade reuse, run this command:

pip3 install --user --upgrade reuse

Installation from source

You can also install this tool from the source code, but we recommend the methods above for easier and more stable updates. Please make sure the requirements for the installation via pip are present on your machine.

pip install .

Usage

First, read the REUSE tutorial. In a nutshell:

  1. Put your licenses in the LICENSES/ directory.
  2. Add a comment header to each file that says SPDX-License-Identifier: GPL-3.0-or-later, and SPDX-FileCopyrightText: $YEAR $NAME. You can be flexible with the format, just make sure that the line starts with SPDX-FileCopyrightText:.
  3. Verify your work using this tool.

Example of header:

# SPDX-FileCopyrightText: 2017 Free Software Foundation Europe e.V. <https://fsfe.org>
#
# SPDX-License-Identifier: CC-BY-SA-4.0

CLI

To check against the recommendations, use reuse lint:

~/Projects/reuse-tool $ reuse lint
[...]
Congratulations! Your project is compliant with version 3.3 of the REUSE Specification :-)

This tool can do various more things, detailed in the documentation. Here a short summary:

  • annotate --- Add copyright and/or licensing information to the header of a file.
  • download --- Download the specified license into the LICENSES/ directory.
  • lint --- Verify the project for REUSE compliance.
  • lint-file --- Verify REUSE compliance of individual files.
  • spdx --- Generate an SPDX Document of all files in the project.
  • supported-licenses --- Prints all licenses supported by REUSE.
  • convert-dep5 --- Convert .reuse/dep5 to REUSE.toml.

Example demo

In this screencast, we are going to follow the tutorial, making the REUSE example repository compliant.

Demo of some basic REUSE tool commands

Run in Docker

The fsfe/reuse Docker image is available on Docker Hub. With it, you can easily include REUSE in CI/CD processes. This way, you can check for REUSE compliance for each build. In our resources for developers you can learn how to integrate the REUSE tool in Drone, Travis, GitHub, or GitLab CI.

You can run the helper tool simply by providing the command you want to run (e.g., lint, spdx). The image's working directory is /data by default. So if you want to lint a project that is in your current working directory, you can mount it on the container's /data directory, and tell the tool to lint. That looks a little like this:

docker run --rm --volume $(pwd):/data fsfe/reuse lint

You can also provide additional arguments, like so:

docker run --rm --volume $(pwd):/data fsfe/reuse --include-submodules spdx -o out.spdx

The available tags are:

  • latest --- the most recent release of reuse.
  • {major} --- the latest major release.
  • {major}.{minor} --- the latest minor release.
  • {major}.{minor}.{patch} --- a precise release.

You can add -debian to any of the tags to get a Debian-based instead of an Alpine-based image, which is larger, but may be better suited for license compliance.

Run as pre-commit hook

You can automatically run reuse lint on every commit as a pre-commit hook for Git. This uses pre-commit. Once you have it installed, add this to the .pre-commit-config.yaml in your repository:

repos:- repo:https://codeberg.org/fsfe/reuse-toolrev:v6.2.0hooks:- id:reuse

Then run pre-commit install. Now, every time you commit, reuse lint is run in the background, and will prevent your commit from going through if there was an error.

If you instead want to only lint files that were changed in your commit, you can use the following configuration:

repos:- repo:https://codeberg.org/fsfe/reuse-toolrev:v6.2.0hooks:- id:reuse-lint-file

Shell completion

In order to enable shell completion, you need to generate the shell completion script. You do this with _REUSE_COMPLETE=bash_source reuse. Replace bash with zsh or fish as needed, or any other shells supported by the Python click library. You can then source the output in your shell rc file, like so (e.g.~/.bashrc):

eval "$(_REUSE_COMPLETE=bash_source reuse)"

Alternatively, you can place the generated completion script in ${XDG_DATA_HOME}/bash-completion/completions/reuse.

Maintainers

Former maintainers

Contributing

If you're interested in contributing to the reuse project, there are several ways to get involved. Development of the project takes place on Codeberg at https://codeberg.org/fsfe/reuse-tool. There, you can submit bug reports, feature requests, and pull requests. Even and especially when in doubt, feel free to open an issue with a question. Contributions of all types are welcome, and the development team is happy to provide guidance and support for new contributors.

You should exercise some caution when opening a pull request to make changes which were not (yet) acknowledged by the team as pertinent. Such pull requests may be closed, leading to disappointment. To avoid this, please open an issue first.

Additionally, the reuse@lists.fsfe.org mailing list is available for discussion and support related to the project.

You can find the full contribution guidelines at https://reuse.readthedocs.io/en/latest/contribute.html.

Licensing

This repository is itself REUSE-compliant. The licensing of each file can be divined with reuse spdx or reuse lint --json, but here is a best-effort summary:

  • All original source code is licensed under GPL-3.0-or-later.
  • All documentation is licensed under CC-BY-SA-4.0.
  • Some configuration and data files are licensed under CC0-1.0.
  • Some code borrowed from spdx/tools-python is licensed under Apache-2.0.