Skip to main content

Griffe Sphinx

ci documentation pypi version gitter

Parse Sphinx-comments about attributes as docstrings.

Installation

pip install griffe-sphinx

Usage

Griffe Sphinx allows reading Sphinx doc comments related to attributes as docstrings.

# your_module.py

#: Summary of your attribute.
#:
#: This is a longer description of your attribute.
#: You can use any markup in here (Markdown, AsciiDoc, rST, etc.).
#:
#: Be careful with indented blocks: they need 4 spaces plus the initial 1-space indent, so 5.
#:
#:     print("hello!")
your_attribute = "Hello Sphinx!"

This works for module attributes as well as class and instance attributes.

class Hello:
    #: Summary of attribute.
    attr1 = "hello"

    def __init__(self):
        #: Summary of attribute.
        self.attr2 = "sphinx"
        self.attr3: str  #: Summary of attribute.

Trailing comments (appearing at the end of a line) are not supported for assignments spanning multiple lines.

You can now enable the extension when loading data with Griffe on the command-line, in Python code or with MkDocs.

On the command-line:

griffe dump your_package -e griffe_sphinx

In Python code:

import griffe

data = griffe.load("your_package", extensions=griffe.load_extensions("griffe_sphinx"))

With MkDocs:

plugins:
- mkdocstrings:
    handlers:
      python:
        options:
          extensions:
          - griffe_sphinx

Sponsors

Silver sponsors

FastAPI

Bronze sponsors

Nixtla


ofek samuelcolvin tlambert03 ssbarnea femtomc cmarqu kolenaIO ramnes machow BenHammersley trevorWieland MarcoGorelli analog-cbarber OdinManiac rstudio-sponsorship schlich butterlyn livingbio NemetschekAllplan EricJayHartman 15r10nk activeloopai roboflow cmclaughlin RapidataAI rodolphebarbanneau theSymbolSyndicate blakeNaccarato ChargeStorm Cusp-AI

And 4 more private sponsor(s).

Metadata

Release files for griffe-sphinx 0.3.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for griffe-sphinx 0.3.1
File Size Uploaded
griffe_sphinx-0.3.1.tar.gz 31.7 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for griffe-sphinx 0.3.1
File Interpreter ABI Platform
griffe_sphinx-0.3.1-py3-none-any.whl Python 3 none any Details

Total release size: 41.6 kB

Release files / griffe_sphinx-0.3.1.tar.gz

Download URL griffe_sphinx-0.3.1.tar.gz
Size 31.7 kB
Tags Source
SHA-256 checksum
How to use checksums
104894a665ad47a79c68179ae1d90f54d892991cd39011107382d03846c7a99f
BLAKE2b-256 checksum
How to use checksums
2d718c60e8b2351080ca6d71ad268c28ad6cc41e7bd6ce602220c852745ad162
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.14.8

Release files / griffe_sphinx-0.3.1-py3-none-any.whl

Download URL griffe_sphinx-0.3.1-py3-none-any.whl
Size 9.9 kB
Tags Python 3
SHA-256 checksum
How to use checksums
c1483e94ba85b9f6afce8a5083e80497a341f4aee2d370ec28fb4d0a63a3e243
BLAKE2b-256 checksum
How to use checksums
0cf440c9611a99a7740c71677126129b75fd4febdd0e5df87df7e5088f8f1c9e
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.14.8

Release history Release notifications | RSS feed

This release

0.3.1 This release

2 release files

0.3.0

2 release files

0.2.1

2 release files

0.2.0

2 release files

0.1.0

2 release files

0.0.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page