mkdocstrings-python


Namemkdocstrings-python JSON
Version 1.9.2 PyPI version JSON
download
home_pageNone
SummaryA Python handler for mkdocstrings.
upload_time2024-04-02 19:28:10
maintainerNone
docs_urlNone
authorNone
requires_python>=3.8
licenseISC
keywords
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            <h1 align="center">mkdocstrings-python</h1>

<p align="center">A Python handler for <a href="https://github.com/mkdocstrings/mkdocstrings"><i>mkdocstrings</i></a>.</p>

[![ci](https://github.com/mkdocstrings/python/workflows/ci/badge.svg)](https://github.com/mkdocstrings/python/actions?query=workflow%3Aci)
[![documentation](https://img.shields.io/badge/docs-mkdocs%20material-blue.svg?style=flat)](https://mkdocstrings.github.io/python/)
[![pypi version](https://img.shields.io/pypi/v/mkdocstrings-python.svg)](https://pypi.org/project/mkdocstrings-python/)
[![gitpod](https://img.shields.io/badge/gitpod-workspace-blue.svg?style=flat)](https://gitpod.io/#https://github.com/mkdocstrings/python)
[![gitter](https://badges.gitter.im/join%20chat.svg)](https://app.gitter.im/#/room/#python:gitter.im)

---

<p align="center"><img src="logo.png"></p>

The Python handler uses [Griffe](https://mkdocstrings.github.io/griffe)
to collect documentation from Python source code.
The word "griffe" can sometimes be used instead of "signature" in French.
Griffe is able to visit the Abstract Syntax Tree (AST) of the source code to extract useful information.
It is also able to execute the code (by importing it) and introspect objects in memory
when source code is not available. Finally, it can parse docstrings following different styles.

## Installation

You can install this handler as a *mkdocstrings* extra:

```toml title="pyproject.toml"
# PEP 621 dependencies declaration
# adapt to your dependencies manager
[project]
dependencies = [
    "mkdocstrings[python]>=0.18",
]
```

You can also explicitly depend on the handler:

```toml title="pyproject.toml"
# PEP 621 dependencies declaration
# adapt to your dependencies manager
[project]
dependencies = [
    "mkdocstrings-python",
]
```

## Preview

<!-- TODO: update the GIF with a more recent screen capture. Maybe use mp4 instead -->
![mkdocstrings_python_gif](https://user-images.githubusercontent.com/3999221/77157838-7184db80-6aa2-11ea-9f9a-fe77405202de.gif)

## Features

- **Data collection from source code**: collection of the object-tree and the docstrings is done thanks to
  [Griffe](https://github.com/mkdocstrings/griffe).

- **Support for type annotations:** Griffe collects your type annotations and *mkdocstrings* uses them
  to display parameter types or return types. It is even able to automatically add cross-references
  to other objects from your API, from the standard library or third-party libraries!
  See [how to load inventories](https://mkdocstrings.github.io/usage/#cross-references-to-other-projects-inventories) to enable it.

- **Recursive documentation of Python objects:** just use the module dotted-path as an identifier, and you get the full
  module docs. You don't need to inject documentation for each class, function, etc.

- **Support for documented attributes:** attributes (variables) followed by a docstring (triple-quoted string) will
  be recognized by Griffe in modules, classes and even in `__init__` methods.

- **Multiple docstring-styles support:** common support for Google-style, Numpydoc-style,
  and Sphinx-style docstrings. See [Griffe's documentation](https://mkdocstrings.github.io/griffe/docstrings/) on docstrings support.

- **Admonition support in Google docstrings:** blocks like `Note:` or `Warning:` will be transformed
  to their [admonition](https://squidfunk.github.io/mkdocs-material/reference/admonitions/) equivalent.
  *We do not support nested admonitions in docstrings!*

- **Every object has a TOC entry:** we render a heading for each object, meaning *MkDocs* picks them into the Table
  of Contents, which is nicely displayed by the Material theme. Thanks to *mkdocstrings* cross-reference ability,
  you can reference other objects within your docstrings, with the classic Markdown syntax:
  `[this object][package.module.object]` or directly with `[package.module.object][]`

- **Source code display:** *mkdocstrings* can add a collapsible div containing the highlighted source code
  of the Python object.

            

Raw data

            {
    "_id": null,
    "home_page": null,
    "name": "mkdocstrings-python",
    "maintainer": null,
    "docs_url": null,
    "requires_python": ">=3.8",
    "maintainer_email": null,
    "keywords": null,
    "author": null,
    "author_email": "Timoth\u00e9e Mazzucotelli <dev@pawamoy.fr>",
    "download_url": "https://files.pythonhosted.org/packages/b1/48/f085a737da288ff09a2444e8826b2ec76d76a9e890527162aa0e0bf7ffbd/mkdocstrings_python-1.9.2.tar.gz",
    "platform": null,
    "description": "<h1 align=\"center\">mkdocstrings-python</h1>\n\n<p align=\"center\">A Python handler for <a href=\"https://github.com/mkdocstrings/mkdocstrings\"><i>mkdocstrings</i></a>.</p>\n\n[![ci](https://github.com/mkdocstrings/python/workflows/ci/badge.svg)](https://github.com/mkdocstrings/python/actions?query=workflow%3Aci)\n[![documentation](https://img.shields.io/badge/docs-mkdocs%20material-blue.svg?style=flat)](https://mkdocstrings.github.io/python/)\n[![pypi version](https://img.shields.io/pypi/v/mkdocstrings-python.svg)](https://pypi.org/project/mkdocstrings-python/)\n[![gitpod](https://img.shields.io/badge/gitpod-workspace-blue.svg?style=flat)](https://gitpod.io/#https://github.com/mkdocstrings/python)\n[![gitter](https://badges.gitter.im/join%20chat.svg)](https://app.gitter.im/#/room/#python:gitter.im)\n\n---\n\n<p align=\"center\"><img src=\"logo.png\"></p>\n\nThe Python handler uses [Griffe](https://mkdocstrings.github.io/griffe)\nto collect documentation from Python source code.\nThe word \"griffe\" can sometimes be used instead of \"signature\" in French.\nGriffe is able to visit the Abstract Syntax Tree (AST) of the source code to extract useful information.\nIt is also able to execute the code (by importing it) and introspect objects in memory\nwhen source code is not available. Finally, it can parse docstrings following different styles.\n\n## Installation\n\nYou can install this handler as a *mkdocstrings* extra:\n\n```toml title=\"pyproject.toml\"\n# PEP 621 dependencies declaration\n# adapt to your dependencies manager\n[project]\ndependencies = [\n    \"mkdocstrings[python]>=0.18\",\n]\n```\n\nYou can also explicitly depend on the handler:\n\n```toml title=\"pyproject.toml\"\n# PEP 621 dependencies declaration\n# adapt to your dependencies manager\n[project]\ndependencies = [\n    \"mkdocstrings-python\",\n]\n```\n\n## Preview\n\n<!-- TODO: update the GIF with a more recent screen capture. Maybe use mp4 instead -->\n![mkdocstrings_python_gif](https://user-images.githubusercontent.com/3999221/77157838-7184db80-6aa2-11ea-9f9a-fe77405202de.gif)\n\n## Features\n\n- **Data collection from source code**: collection of the object-tree and the docstrings is done thanks to\n  [Griffe](https://github.com/mkdocstrings/griffe).\n\n- **Support for type annotations:** Griffe collects your type annotations and *mkdocstrings* uses them\n  to display parameter types or return types. It is even able to automatically add cross-references\n  to other objects from your API, from the standard library or third-party libraries!\n  See [how to load inventories](https://mkdocstrings.github.io/usage/#cross-references-to-other-projects-inventories) to enable it.\n\n- **Recursive documentation of Python objects:** just use the module dotted-path as an identifier, and you get the full\n  module docs. You don't need to inject documentation for each class, function, etc.\n\n- **Support for documented attributes:** attributes (variables) followed by a docstring (triple-quoted string) will\n  be recognized by Griffe in modules, classes and even in `__init__` methods.\n\n- **Multiple docstring-styles support:** common support for Google-style, Numpydoc-style,\n  and Sphinx-style docstrings. See [Griffe's documentation](https://mkdocstrings.github.io/griffe/docstrings/) on docstrings support.\n\n- **Admonition support in Google docstrings:** blocks like `Note:` or `Warning:` will be transformed\n  to their [admonition](https://squidfunk.github.io/mkdocs-material/reference/admonitions/) equivalent.\n  *We do not support nested admonitions in docstrings!*\n\n- **Every object has a TOC entry:** we render a heading for each object, meaning *MkDocs* picks them into the Table\n  of Contents, which is nicely displayed by the Material theme. Thanks to *mkdocstrings* cross-reference ability,\n  you can reference other objects within your docstrings, with the classic Markdown syntax:\n  `[this object][package.module.object]` or directly with `[package.module.object][]`\n\n- **Source code display:** *mkdocstrings* can add a collapsible div containing the highlighted source code\n  of the Python object.\n",
    "bugtrack_url": null,
    "license": "ISC",
    "summary": "A Python handler for mkdocstrings.",
    "version": "1.9.2",
    "project_urls": {
        "Changelog": "https://mkdocstrings.github.io/python/changelog",
        "Discussions": "https://github.com/mkdocstrings/python/discussions",
        "Documentation": "https://mkdocstrings.github.io/python",
        "Funding": "https://github.com/sponsors/pawamoy",
        "Gitter": "https://gitter.im/mkdocstrings/python",
        "Homepage": "https://mkdocstrings.github.io/python",
        "Issues": "https://github.com/mkdocstrings/python/issues",
        "Repository": "https://github.com/mkdocstrings/python"
    },
    "split_keywords": [],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "548efb4d184f916ad3a6e5155b5e478aa0dd30ca5c25f588374fbaa7dae4957e",
                "md5": "1007fdb2176b536a7d32ff2b9dbbfe6b",
                "sha256": "96d82f6424e08db6245e4a15ca95619f4ecd0ddd254c0aa590d4181814e16ee5"
            },
            "downloads": -1,
            "filename": "mkdocstrings_python-1.9.2-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "1007fdb2176b536a7d32ff2b9dbbfe6b",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.8",
            "size": 58541,
            "upload_time": "2024-04-02T19:28:08",
            "upload_time_iso_8601": "2024-04-02T19:28:08.554998Z",
            "url": "https://files.pythonhosted.org/packages/54/8e/fb4d184f916ad3a6e5155b5e478aa0dd30ca5c25f588374fbaa7dae4957e/mkdocstrings_python-1.9.2-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "b148f085a737da288ff09a2444e8826b2ec76d76a9e890527162aa0e0bf7ffbd",
                "md5": "aed0c5c85ce2ac2584c88c3b52be5607",
                "sha256": "8546a103c9b22e1778c72c887696acc39a6635fedde3c912ce00f967518a8847"
            },
            "downloads": -1,
            "filename": "mkdocstrings_python-1.9.2.tar.gz",
            "has_sig": false,
            "md5_digest": "aed0c5c85ce2ac2584c88c3b52be5607",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.8",
            "size": 34002,
            "upload_time": "2024-04-02T19:28:10",
            "upload_time_iso_8601": "2024-04-02T19:28:10.962522Z",
            "url": "https://files.pythonhosted.org/packages/b1/48/f085a737da288ff09a2444e8826b2ec76d76a9e890527162aa0e0bf7ffbd/mkdocstrings_python-1.9.2.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-04-02 19:28:10",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "mkdocstrings",
    "github_project": "python",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": true,
    "lcname": "mkdocstrings-python"
}
        
Elapsed time: 0.24124s