reuse.report module

Module that contains reports about files and projects for linting.

class reuse.report.FileReport(name, path)[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)[source]

Generate a FileReport from a path in a Project.

Return type:FileReportInfo
to_dict()[source]

Turn the report into a json-like dictionary.

class reuse.report.FileReportInfo(file_report, bad_licenses, missing_licenses)

Bases: tuple

bad_licenses

Alias for field number 1

file_report

Alias for field number 0

missing_licenses

Alias for field number 2

class reuse.report.ProjectReport[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]
files_without_licenses

Iterable of paths that have no license information.

Return type:Iterable[PathLike]
classmethod generate(project, paths=None)[source]

Generate a ProjectReport from a Project.

Return type:ProjectReport
to_dict()[source]

Turn the report into a json-like dictionary.

unused_licenses

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

Return type:Set[str]
used_licenses

Set of license identifiers that are found in file reports.

Return type:Set[str]