Skip to main content

Python API documentation tool supporting the modern PEPs and typing features.

Project description

nb-autodoc

nb-autodoc

python version pypi version

简体中文 · English

简介

nb-autodoc 是一个从 Python 源码的 类型注解Docstring 自动生成 API 文档的工具。

本工具从包里查找所有的模块并导入,解析各模块的抽象语法树、运行时类型,链接内部对象,解析函数签名和 docstring 语法树,最终生成完整、可靠、带有链接的 API 文档。

主要特性

  • 基于 AST 的类型分析系统

  • 现代的类型展示,如 X | Ylist[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


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.3.tar.gz (62.7 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

nb_autodoc-1.0.3-py3-none-any.whl (53.0 kB view details)

Uploaded Python 3

File details

Details for the file nb_autodoc-1.0.3.tar.gz.

File metadata

  • Download URL: nb_autodoc-1.0.3.tar.gz
  • Upload date:
  • Size: 62.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: pdm/2.26.2 CPython/3.12.11 Linux/5.10.16.3-microsoft-standard-WSL2

File hashes

Hashes for nb_autodoc-1.0.3.tar.gz
Algorithm Hash digest
SHA256 8bb90a20820280adf12a0aad1b94603e9f0c65750d81af8378c6dd6cfb0be400
MD5 6a1950a00230415cffe82ec1e96f46e6
BLAKE2b-256 0ab746978e3423b8311e1599967c4b91a6c5233b9e2d853aa99a8aef4de4b8fa

See more details on using hashes here.

File details

Details for the file nb_autodoc-1.0.3-py3-none-any.whl.

File metadata

  • Download URL: nb_autodoc-1.0.3-py3-none-any.whl
  • Upload date:
  • Size: 53.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: pdm/2.26.2 CPython/3.12.11 Linux/5.10.16.3-microsoft-standard-WSL2

File hashes

Hashes for nb_autodoc-1.0.3-py3-none-any.whl
Algorithm Hash digest
SHA256 6b5d1d244ee5c5ae896e0c6683193df64e47497986beceaeed2a76ae7235c06b
MD5 ebba02dc562b1c71264c902ad99c131f
BLAKE2b-256 dc70ce9c943da109599649efed7ca1d8e549515f60de9c8a046e93fe17b10ad4

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page