跳到主要内容

DocModuleMetadata

类数据类源码

DocModuleMetadata(
title: str = "", author: str = "", license: str = "", descr: str = ""
)

模块的元数据。提取自模块顶部的 docstring。

字段​

字段类型必选
说明
titlestr模块标题。
authorstr在 docstring 中的作者章节。
licensestr在 docstring 中的协议章节。
descrstr在 docstring 中的描述文字。

方法​

from_long_descr​

v_1: Self = DocModuleMetadata.from_long_descr(text: str)

将长的描述文字(包含多个正稿)整理为元数据。

输入​

参数类型必选
说明
textstr较长的模块 docstring 文字。

输出​

参数类型
说明
v_1Self解析后的模块元数据。