nb-autodoc


Namenb-autodoc JSON
Version 1.0.0a6 PyPI version JSON
download
home_page
SummaryPython API documentation tool supporting the modern PEPs and typing features.
upload_time2023-06-21 14:21:12
maintainer
docs_urlNone
author
requires_python>=3.8
licenseMIT
keywords nonebot autodoc apidoc documentation-tool markdown
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            <div align="center">

<img src="https://raw.githubusercontent.com/nonebot/nb-autodoc/main/logo/logo.png" width=200, height=200 alt="nb-autodoc"></img>

# nb-autodoc

![python version](https://img.shields.io/badge/python-3.8+-%233eca5d)
![pypi version](https://img.shields.io/pypi/v/nb-autodoc)

[简体中文](https://github.com/nonebot/nb-autodoc/blob/main/README.md)
·
[English](https://github.com/nonebot/nb-autodoc/blob/main/README_en.md)

</div>

## 简介

nb-autodoc 是一个从 Python 源码的 [类型注解](https://docs.python.org/3/library/typing.html) 和 [Docstring](https://peps.python.org/pep-0257/) 自动生成 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`,后者会跳过模块的导入和分析。


            

Raw data

            {
    "_id": null,
    "home_page": "",
    "name": "nb-autodoc",
    "maintainer": "",
    "docs_url": null,
    "requires_python": ">=3.8",
    "maintainer_email": "",
    "keywords": "nonebot,autodoc,apidoc,documentation-tool,markdown",
    "author": "",
    "author_email": "iyume <iyumelive@gmail.com>",
    "download_url": "https://files.pythonhosted.org/packages/2f/89/e29e83756be94ea28abf95a3c67bfeac35f33b6f33de5e0f0b1f0d3c8c98/nb-autodoc-1.0.0a6.tar.gz",
    "platform": null,
    "description": "<div align=\"center\">\n\n<img src=\"https://raw.githubusercontent.com/nonebot/nb-autodoc/main/logo/logo.png\" width=200, height=200 alt=\"nb-autodoc\"></img>\n\n# nb-autodoc\n\n![python version](https://img.shields.io/badge/python-3.8+-%233eca5d)\n![pypi version](https://img.shields.io/pypi/v/nb-autodoc)\n\n[\u7b80\u4f53\u4e2d\u6587](https://github.com/nonebot/nb-autodoc/blob/main/README.md)\n\u00b7\n[English](https://github.com/nonebot/nb-autodoc/blob/main/README_en.md)\n\n</div>\n\n## \u7b80\u4ecb\n\nnb-autodoc \u662f\u4e00\u4e2a\u4ece Python \u6e90\u7801\u7684 [\u7c7b\u578b\u6ce8\u89e3](https://docs.python.org/3/library/typing.html) \u548c [Docstring](https://peps.python.org/pep-0257/) \u81ea\u52a8\u751f\u6210 API \u6587\u6863\u7684\u5de5\u5177\u3002\n\n\u672c\u5de5\u5177\u4ece\u5305\u91cc\u67e5\u627e\u6240\u6709\u7684\u6a21\u5757\u5e76\u5bfc\u5165\uff0c\u89e3\u6790\u5404\u6a21\u5757\u7684\u62bd\u8c61\u8bed\u6cd5\u6811\u3001\u8fd0\u884c\u65f6\u7c7b\u578b\uff0c\u94fe\u63a5\u5185\u90e8\u5bf9\u8c61\uff0c\u89e3\u6790\u51fd\u6570\u7b7e\u540d\u548c docstring \u8bed\u6cd5\u6811\uff0c\u6700\u7ec8\u751f\u6210\u5b8c\u6574\u3001\u53ef\u9760\u3001\u5e26\u6709\u94fe\u63a5\u7684 API \u6587\u6863\u3002\n\n## \u4e3b\u8981\u7279\u6027\n\n- \u57fa\u4e8e AST \u7684\u7c7b\u578b\u5206\u6790\u7cfb\u7edf\n\n- \u73b0\u4ee3\u7684\u7c7b\u578b\u5c55\u793a\uff0c\u5982 `X | Y`\u3001`list[str]`\u3001`(*args) -> Any`\n\n- stub (.pyi) \u652f\u6301\n\n- TYPE_CHECKING \u652f\u6301\n\n- Re-export \u652f\u6301\uff0c\u4ece AST \u89e3\u6790\u5bfc\u5165\u5f15\u7528\n\n- Overload \u91cd\u8f7d\u51fd\u6570\u652f\u6301\n\n## \u7528\u6cd5\n\n\u4ece pip \u5b89\u88c5:\n\n```\npip install nb-autodoc\n```\n\n\u8fd0\u884c nb-autodoc:\n\n```\nnb-autodoc {package_name}\n```\n\n\u5176\u4ed6\u547d\u4ee4\u884c\u9009\u9879:\n\n```\nUsage: nb-autodoc [OPTIONS] MODULE\n\nOptions:\n  -o, --output-dir DIRECTORY      [default: build]\n  -s, --skip TEXT                 skip import modules\n  -u, --undoc TEXT                undocument modules\n  --markdown-linkmode [heading_id|vuepress]\n                                  [default: heading_id]\n  --help                          Show this message and exit.\n```\n\n**\u63d0\u793a:** \u4f7f\u7528 `--undoc` \u800c\u4e0d\u662f `--skip`\uff0c\u540e\u8005\u4f1a\u8df3\u8fc7\u6a21\u5757\u7684\u5bfc\u5165\u548c\u5206\u6790\u3002\n\n",
    "bugtrack_url": null,
    "license": "MIT",
    "summary": "Python API documentation tool supporting the modern PEPs and typing features.",
    "version": "1.0.0a6",
    "project_urls": {
        "homepage": "https://github.com/nonebot/nb-autodoc",
        "repository": "https://github.com/nonebot/nb-autodoc"
    },
    "split_keywords": [
        "nonebot",
        "autodoc",
        "apidoc",
        "documentation-tool",
        "markdown"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "763a09cd027b3ee8ff0cde25c4a167bacbf7d3b0b71a6486a1e33aa5b03033c9",
                "md5": "aede1a7e1da2b29b89b695bfafe23294",
                "sha256": "bd86e906723fa85e8141754458ad0905ecdb7d56e6724dace5cb8131230c87ef"
            },
            "downloads": -1,
            "filename": "nb_autodoc-1.0.0a6-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "aede1a7e1da2b29b89b695bfafe23294",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.8",
            "size": 52813,
            "upload_time": "2023-06-21T14:21:04",
            "upload_time_iso_8601": "2023-06-21T14:21:04.115519Z",
            "url": "https://files.pythonhosted.org/packages/76/3a/09cd027b3ee8ff0cde25c4a167bacbf7d3b0b71a6486a1e33aa5b03033c9/nb_autodoc-1.0.0a6-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "2f89e29e83756be94ea28abf95a3c67bfeac35f33b6f33de5e0f0b1f0d3c8c98",
                "md5": "d1eb281e649cf17c8a5cc7218d4df5f1",
                "sha256": "d0b23748a0369d2d0341a96e41fad2d1b630df369e9baba51c6984f1e3ea1772"
            },
            "downloads": -1,
            "filename": "nb-autodoc-1.0.0a6.tar.gz",
            "has_sig": false,
            "md5_digest": "d1eb281e649cf17c8a5cc7218d4df5f1",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.8",
            "size": 62631,
            "upload_time": "2023-06-21T14:21:12",
            "upload_time_iso_8601": "2023-06-21T14:21:12.098125Z",
            "url": "https://files.pythonhosted.org/packages/2f/89/e29e83756be94ea28abf95a3c67bfeac35f33b6f33de5e0f0b1f0d3c8c98/nb-autodoc-1.0.0a6.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2023-06-21 14:21:12",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "nonebot",
    "github_project": "nb-autodoc",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": true,
    "lcname": "nb-autodoc"
}
        
Elapsed time: 0.16396s