reuse package#
Submodules#
- reuse.comment module
AppleScriptCommentStyle
AspxCommentStyle
BatchFileCommentStyle
BibTexCommentStyle
CCommentStyle
CommentCreateError
CommentParseError
CommentStyle
CommentStyle.INDENT_AFTER_MIDDLE
CommentStyle.INDENT_AFTER_SINGLE
CommentStyle.INDENT_BEFORE_END
CommentStyle.INDENT_BEFORE_MIDDLE
CommentStyle.MULTI_LINE
CommentStyle.SHEBANGS
CommentStyle.SHORTHAND
CommentStyle.SINGLE_LINE
CommentStyle.can_handle_multi()
CommentStyle.can_handle_single()
CommentStyle.comment_at_first_character()
CommentStyle.create_comment()
CommentStyle.parse_comment()
CssCommentStyle
EXTENSION_COMMENT_STYLE_MAP
EmptyCommentStyle
FortranCommentStyle
FtlCommentStyle
HandlebarsCommentStyle
HaskellCommentStyle
HtmlCommentStyle
JinjaCommentStyle
LispCommentStyle
M4CommentStyle
MlCommentStyle
MultiLineSegments
NAME_STYLE_MAP
PlantUmlCommentStyle
PythonCommentStyle
ReStructedTextCommentStyle
TexCommentStyle
UncommentableCommentStyle
VelocityCommentStyle
VimCommentStyle
XQueryCommentStyle
- reuse.download module
- reuse.header module
- reuse.init module
- reuse.lint module
- reuse.project module
- reuse.report module
- reuse.spdx module
- reuse.supported_licenses module
- reuse.vcs module
Module contents#
reuse is a tool for compliance with the REUSE recommendations.
Although the API is documented, it is NOT guaranteed stable between minor or even patch releases. The semantic versioning of this program pertains exclusively to the reuse CLI command. If you want to use reuse as a Python library, you should pin reuse to an exact version.
Having given the above disclaimer, the API has been relatively stable nevertheless, and we (the maintainers) do make some efforts to not needlessly change the public API.
- exception reuse.IdentifierNotFound[source]#
Bases:
ReuseException
Could not find SPDX identifier for license file.
- class reuse.ReuseInfo(spdx_expressions=<factory>, copyright_lines=<factory>, contributor_lines=<factory>, path=None, source_path=None, source_type=None)[source]#
Bases:
object
Simple dataclass holding licensing and copyright information
- contains_copyright_or_licensing()[source]#
Either spdx_expressions or copyright_lines is non-empty.
- Return type:
- contains_info()[source]#
Any field except path, source_path and source_type is non-empty.
- Return type:
- copy(**kwargs)[source]#
Return a copy of ReuseInfo, replacing the values of attributes with the values from kwargs.
- Return type:
-
source_type:
Optional
[SourceType
] = None#
- union(value)[source]#
Return a new instance of ReuseInfo where all Set attributes are equal to the union of the set in self and the set in value.
All non-Set attributes are set to their values in self.
>>> one = ReuseInfo(copyright_lines={"Jane Doe"}, source_path="foo.py") >>> two = ReuseInfo(copyright_lines={"John Doe"}, source_path="bar.py") >>> result = one.union(two) >>> print(sorted(result.copyright_lines)) ['Jane Doe', 'John Doe'] :rtype: :py:class:`~reuse.ReuseInfo`
>>> print(result.source_path) foo.py
- class reuse.SourceType(value)[source]#
Bases:
Enum
An enumeration representing the types of sources for license information.
- DEP5 = 'dep5'#
A .reuse/dep5 file containing license information.
- DOT_LICENSE = 'dot-license'#
A .license file containing license information.
- FILE_HEADER = 'file-header'#
A file header containing license information.