reuse.report module

Module that contains reports about files and projects for linting.

class reuse.report.FileReport(name, path, do_checksum=True)[source]

Bases: object

Object that holds a linting report about a single file. Importantly, it also contains SPDX File information in spdxfile.

classmethod generate(project, path, do_checksum=True)[source]

Generate a FileReport from a path in a Project.

Return type

FileReport

to_dict()[source]

Turn the report into a json-like dictionary.

class reuse.report.ProjectReport(do_checksum=True)[source]

Bases: object

Object that holds linting report about the project.

bill_of_materials()[source]

Generate a bill of materials from the project.

See https://spdx.org/specifications.

Return type

str

Iterable of paths that have no copyright information.

Return type

Iterable[PathLike]

property files_without_licenses

Iterable of paths that have no license information.

Return type

Iterable[PathLike]

classmethod generate(project, do_checksum=True, multiprocessing=True)[source]

Generate a ProjectReport from a Project.

Return type

ProjectReport

to_dict()[source]

Turn the report into a json-like dictionary.

property unused_licenses

Set of license identifiers that are not found in any file report.

Return type

Set[str]

property used_licenses

Set of license identifiers that are found in file reports.

Return type

Set[str]