mkdocstrings-python


Namemkdocstrings-python JSON
Version 1.12.2 PyPI version JSON
download
home_pageNone
SummaryA Python handler for mkdocstrings.
upload_time2024-10-19 17:54:41
maintainerNone
docs_urlNone
authorNone
requires_python>=3.9
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-708FCC.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-708FCC.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.9",
    "maintainer_email": null,
    "keywords": null,
    "author": null,
    "author_email": "=?utf-8?q?Timoth=C3=A9e_Mazzucotelli?= <dev@pawamoy.fr>",
    "download_url": "https://files.pythonhosted.org/packages/23/ec/cb6debe2db77f1ef42b25b21d93b5021474de3037cd82385e586aee72545/mkdocstrings_python-1.12.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-708FCC.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-708FCC.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.12.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": "5bc1ac524e1026d9580cbc654b5d19f5843c8b364a66d30f956372cd09fd2f92",
                "md5": "1e008c63031c2733028125edc8cdfffa",
                "sha256": "7f7d40d6db3cb1f5d19dbcd80e3efe4d0ba32b073272c0c0de9de2e604eda62a"
            },
            "downloads": -1,
            "filename": "mkdocstrings_python-1.12.2-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "1e008c63031c2733028125edc8cdfffa",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.9",
            "size": 111759,
            "upload_time": "2024-10-19T17:54:39",
            "upload_time_iso_8601": "2024-10-19T17:54:39.338206Z",
            "url": "https://files.pythonhosted.org/packages/5b/c1/ac524e1026d9580cbc654b5d19f5843c8b364a66d30f956372cd09fd2f92/mkdocstrings_python-1.12.2-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "23eccb6debe2db77f1ef42b25b21d93b5021474de3037cd82385e586aee72545",
                "md5": "29e1bc2ef15bc544cec518cdf9443040",
                "sha256": "7a1760941c0b52a2cd87b960a9e21112ffe52e7df9d0b9583d04d47ed2e186f3"
            },
            "downloads": -1,
            "filename": "mkdocstrings_python-1.12.2.tar.gz",
            "has_sig": false,
            "md5_digest": "29e1bc2ef15bc544cec518cdf9443040",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.9",
            "size": 168207,
            "upload_time": "2024-10-19T17:54:41",
            "upload_time_iso_8601": "2024-10-19T17:54:41.672605Z",
            "url": "https://files.pythonhosted.org/packages/23/ec/cb6debe2db77f1ef42b25b21d93b5021474de3037cd82385e586aee72545/mkdocstrings_python-1.12.2.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-10-19 17:54:41",
    "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.32430s