Python API documentation tool supporting the modern PEPs and typing features.
Project description
简介
nb-autodoc 是一个从 Python 源码的 类型注解 和 Docstring 自动生成 API 文档的工具。
本工具从包里查找所有的模块并导入,解析各模块的抽象语法树、运行时类型,链接内部对象,解析函数签名和 docstring 语法树,最终生成完整、可靠、带有链接的 API 文档。
主要特性
-
基于 AST 的类型分析系统
-
现代的类型展示,如
X | Y
、list[str]
、(*args) -> Any
-
stub (.pyi) 支持
-
TYPE_CHECKING 支持
-
Re-export 支持,从 AST 解析导入引用
-
Overload 重载函数支持
用法
从 pip 安装:
pip install nb-autodoc
运行 nb-autodoc:
nb-autodoc {package_name}
其他命令行选项:
Usage: nb-autodoc [OPTIONS] MODULE
Options:
-o, --output-dir DIRECTORY [default: build]
-s, --skip TEXT skip import modules
-u, --undoc TEXT undocument modules
--markdown-linkmode [heading_id|vuepress]
[default: heading_id]
--help Show this message and exit.
提示: 使用 --undoc
而不是 --skip
,后者会跳过模块的导入和分析。
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
nb-autodoc-1.0.0a7.tar.gz
(62.9 kB
view details)
Built Distribution
File details
Details for the file nb-autodoc-1.0.0a7.tar.gz
.
File metadata
- Download URL: nb-autodoc-1.0.0a7.tar.gz
- Upload date:
- Size: 62.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: pdm/2.4.1 CPython/3.9.2
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 16cf127a3574dcd1e7e495ce992406bb2783245062033fef54b741fdf9b29f7e |
|
MD5 | fc0ef01e7f7d947b650576e3378ae9ba |
|
BLAKE2b-256 | a3d9be84ebb0e7b4b67307e3bc1cf13deb941fed8f30d0d339d4de1d9ae141a6 |
File details
Details for the file nb_autodoc-1.0.0a7-py3-none-any.whl
.
File metadata
- Download URL: nb_autodoc-1.0.0a7-py3-none-any.whl
- Upload date:
- Size: 52.9 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: pdm/2.4.1 CPython/3.9.2
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 789a17c0fa5e4c071cf65402d59444828b56b245aa7ec01c80640ce6bbe347b3 |
|
MD5 | 9571697abae717cb377ad779c32d708e |
|
BLAKE2b-256 | 792b9b1e33c6bd6786d450b0c44b4b52f8829130506a6832c62b18b8bff25a1a |