sphinx autosummary extension to properly format pandas or xarray accessors
Project description
sphinx-autosummary-accessors
A sphinx extension to properly document pandas or xarray accessors.
sphinx.ext.autosummary is able to create summary and object pages for objects and their methods, but it doesn’t work well with accessor styled properties and methods (obj.accessor.attribute). pandas has accessor documentation built using sphinx.ext.autosummary templates, which xarray recently adopted by copying the templates and all related code.
To avoid even more duplicated code, and to make it easier for projects to document their custom accessors, this project aims to provide this functionality by way of a sphinx extension.
Most of the code was adapted from pandas.
Usage
Using it should be as simple as adding
import sphinx_autosummary_accessors
extensions = [
...,
"sphinx_autosummary_accessors",
]
templates = ["_templates", ..., sphinx_autosummary_accessors.templates_path]
to your conf.py and using the appropriate template:
.. autosummary::
:template: autosummary/accessor_method.rst
Example.test.multiply
Documentation
For more information and examples, see the documentation.
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
Built Distribution
File details
Details for the file sphinx-autosummary-accessors-2023.4.0.tar.gz
.
File metadata
- Download URL: sphinx-autosummary-accessors-2023.4.0.tar.gz
- Upload date:
- Size: 16.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.1 CPython/3.11.3
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 26f60f44dea2b4b487022921dfba6d773b4529b71afb7069cb97d4ceff0abab9 |
|
MD5 | 46508e80786803f53006d0989ccd16cb |
|
BLAKE2b-256 | 75b9f37b5d3850d535707545d02165a2f34afdb8d51bb54f56d49a0a89a9f499 |
File details
Details for the file sphinx_autosummary_accessors-2023.4.0-py3-none-any.whl
.
File metadata
- Download URL: sphinx_autosummary_accessors-2023.4.0-py3-none-any.whl
- Upload date:
- Size: 7.5 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.1 CPython/3.11.3
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 75ac537ce318e2cb104324f714c0260ee32483f117d8cd376dfaa3c5e949933d |
|
MD5 | 6d0a2109efd68665ae1dd6d2d0779d66 |
|
BLAKE2b-256 | 7355b4a229b08c84ad3d752490b86eb1d5b77010e8991a1d3f5209e1d3c74ad5 |