DocModuleMetadata
类数据类源码
DocModuleMetadata(
title: str = "", author: str = "", license: str = "", descr: str = ""
)
模块的元数据。提取自模块顶部的 docstring。
字段
| 字段 | 类型 | 必选 | |
|---|---|---|---|
title | str | 模块标题。 | |
author | str | 在 docstring 中的作者章节。 | |
license | str | 在 docstring 中的协议章节。 | |
descr | str | 在 docstring 中的描述文字。 |
方法
from_long_descr
v_1: Self = DocModuleMetadata.from_long_descr(text: str)
将长的描述文字(包含多个正稿)整理为元数据。
输入
| 参数 | 类型 | 必选 | |
|---|---|---|---|
text | str | 较长的模块 docstring 文字。 |
输出
| 参数 | 类型 | |
|---|---|---|
v_1 | Self | 解析后的模块元数据。 |