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 blaisep RapidataAI rodolphebarbanneau theSymbolSyndicate blakeNaccarato ChargeStorm Alphadelta14 Cusp-AI

And 7 more private sponsor(s).

Metadata

Release files for griffe-sphinx 0.3.0

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.0
File Size Uploaded
griffe_sphinx-0.3.0.tar.gz 31.6 kB Details

Built distribution (wheel)

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

Total release size: 41.6 kB

Release files / griffe_sphinx-0.3.0.tar.gz

Download URL griffe_sphinx-0.3.0.tar.gz
Size 31.6 kB
Tags Source
SHA-256 checksum
How to use checksums
8fec469cd17aa970bb8df8af1bd405be12423c03578932b22eb636fce23927c3
BLAKE2b-256 checksum
How to use checksums
c90e9503ddc07889905273223d9a1f1227459b0a62dc7c886443a265e3bf0f26
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.14.7

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

Download URL griffe_sphinx-0.3.0-py3-none-any.whl
Size 10.0 kB
Tags Python 3
SHA-256 checksum
How to use checksums
9a56d17e28b4affd9f1993d5411d3d5b143d5125a90e8bd0ffd51cb57f12057a
BLAKE2b-256 checksum
How to use checksums
628d8d92bf303bfeb76c0ddb0db6613bf9bf2e647f77935a46e0f2eb6c1b7e77
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.14.7

Release history Release notifications | RSS feed

0.3.1

2 release files

This release

0.3.0 This release

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