Skip to main content

sphinx autosummary extension to properly format pandas or xarray accessors

Project description

sphinx-autosummary-accessors

https://github.com/xarray-contrib/sphinx-autosummary-accessors/workflows/CI/badge.svg?branch=master https://img.shields.io/badge/code%20style-black-000000.svg Documentation Status

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

sphinx_autosummary_accessors-2025.3.1.tar.gz (17.8 kB view details)

Uploaded Source

Built Distribution

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

File details

Details for the file sphinx_autosummary_accessors-2025.3.1.tar.gz.

File metadata

File hashes

Hashes for sphinx_autosummary_accessors-2025.3.1.tar.gz
Algorithm Hash digest
SHA256 41292dffe742703abe987f66c62e109d832490ff74d273d6512503e6066e456f
MD5 522c8b36f2fea04e2100991cbba9eabc
BLAKE2b-256 f7143f81ab3976f386bdf8ac96fb9c89adeaafa910216fa21b7d6be714e140f7

See more details on using hashes here.

Provenance

The following attestation bundles were made for sphinx_autosummary_accessors-2025.3.1.tar.gz:

Publisher: publish.yaml on xarray-contrib/sphinx-autosummary-accessors

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file sphinx_autosummary_accessors-2025.3.1-py3-none-any.whl.

File metadata

File hashes

Hashes for sphinx_autosummary_accessors-2025.3.1-py3-none-any.whl
Algorithm Hash digest
SHA256 e90d140dce731162f70f2a46215e26dd46c57590e9f08bfff2e17cac45ce3a9f
MD5 418622ddba7b586471f20f5584610a85
BLAKE2b-256 00ac12b1a7b9486dfcfd9c4c20a4ea5e2e4584681af8fe2f8898a716c2c51edb

See more details on using hashes here.

Provenance

The following attestation bundles were made for sphinx_autosummary_accessors-2025.3.1-py3-none-any.whl:

Publisher: publish.yaml on xarray-contrib/sphinx-autosummary-accessors

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

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