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.

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

Generate a FileReport from a path in a Project.

Return type:

FileReport

to_dict_lint()[source]#

Turn the report into a json-like dictionary with exclusively information relevant for linting.

Return type:

Dict[str, Any]

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

Bases: object

Object that holds linting report about the project.

bill_of_materials(creator_person=None, creator_organization=None)[source]#

Generate a bill of materials from the project.

See https://spdx.org/specifications.

Return type:

str

Set of paths that have no copyright information.

property files_without_licenses: Set[Path]#

Set of paths that have no license information.

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

Generate a ProjectReport from a Project.

Return type:

ProjectReport

property is_compliant: bool#

Whether the report is compliant with the REUSE Spec.

to_dict_lint()[source]#

Collects and formats data relevant to linting from report and returns it as a dictionary.

Return type:

Dict[str, Any]

Returns:

Dictionary containing data from the ProjectReport object

property unused_licenses: Set[str]#

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

property used_licenses: Set[str]#

Set of license identifiers that are found in file reports.

reuse.report.format_creator(creator)[source]#

Render the creator field based on the provided flag

Return type:

str