reuse.report module

Module that contains reports about files and projects for linting.

class reuse.report.FileReport(name: os.PathLike, path: os.PathLike, do_checksum: bool = 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: reuse.project.Project, path: os.PathLike, do_checksum: bool = True) → reuse.report.FileReportInfo[source]

Generate a FileReport from a path in a Project.

to_dict()[source]

Turn the report into a json-like dictionary.

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

Bases: tuple

property bad_licenses

Alias for field number 1

property file_report

Alias for field number 0

property missing_licenses

Alias for field number 2

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

Bases: object

Object that holds linting report about the project.

bill_of_materials() → str[source]

Generate a bill of materials from the project.

See https://spdx.org/specifications.

Iterable of paths that have no copyright information.

property files_without_licenses

Iterable of paths that have no license information.

classmethod generate(project: reuse.project.Project, paths: Iterable[os.PathLike] = None, do_checksum: bool = True) → reuse.report.ProjectReport[source]

Generate a ProjectReport from a Project.

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.

property used_licenses

Set of license identifiers that are found in file reports.