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.template_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-0.2.1.tar.gz (15.6 kB view details)

Uploaded Source

Built Distribution

File details

Details for the file sphinx-autosummary-accessors-0.2.1.tar.gz.

File metadata

  • Download URL: sphinx-autosummary-accessors-0.2.1.tar.gz
  • Upload date:
  • Size: 15.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.1 importlib_metadata/4.5.0 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.61.0 CPython/3.9.5

File hashes

Hashes for sphinx-autosummary-accessors-0.2.1.tar.gz
Algorithm Hash digest
SHA256 17eec08247c61bc0ab8994016e15f1ccc195a7e8b59c57014c45801aaa8d9673
MD5 8e3c9b6dcf493a1f21d34f88368987b3
BLAKE2b-256 c574200171676a62a8fe9a047e20f305c648afa3831aff7e1bd228921a311f7b

See more details on using hashes here.

File details

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

File metadata

  • Download URL: sphinx_autosummary_accessors-0.2.1-py3-none-any.whl
  • Upload date:
  • Size: 7.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.1 importlib_metadata/4.5.0 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.61.0 CPython/3.9.5

File hashes

Hashes for sphinx_autosummary_accessors-0.2.1-py3-none-any.whl
Algorithm Hash digest
SHA256 fda83cfd916a9adfe98db36a637ee7062532bf1845810c7bda799ce1fb4ea93b
MD5 0d8a763ba5538d3b41c9b3387f6b72d3
BLAKE2b-256 a0d4eaa430ccf5cde70a341689ebf22b5a32270f7dbe24fe6d5e65befde190cf

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page