griffe-fieldz
Griffe extension adding support for dataclass-like things (pydantic, attrs, etc...). This extension will inject the fields of the data-class into the documentation, preventing you from duplicating field metadata in your docstrings.
It supports anything that fieldz supports, which is currently:
Installation
With pip:
pip install griffe-fieldz
To use the extension in a MkDocs project, use this configuration:
# mkdocs.yml
plugins:
- mkdocstrings:
handlers:
python:
options:
extensions:
- griffe_fieldz
You may use any of the following options, provided as a dictionary under the
griffe_fieldz key.
| Option | Description | Default |
|---|---|---|
include_inherited |
Include inherited fields in class parameters. | False |
include_private |
Include private fields in the documentation. | False |
add_fields_to |
Where in the documentation to add the detected fields. Must be one of: - docstring-parameters: add fields to the Parameters section of the docstring- docstring-attributes: add fields to the Attributes section of the docstring- class-attributes: add fields as class attributes |
docstring-parameters |
remove_fields_from_members |
If True, fields are removed as class members. This is not encouraged (since fields are indeed class attributes), but will prevent duplication of the name in the docstring as well as the class. This value is ignored if add_fields_to is class-attributes. |
False |
strip_annotated |
If True, strip the Annotated wrapper from type hints, showing only the inner type. For example, Annotated[int, Gt(0)] will be displayed simply as int. |
False |
For example:
options:
extensions:
- griffe_fieldz:
include_inherited: false
include_private: false
add_fields_to: docstring-attributes
remove_fields_from_members: false
strip_annotated: false
Example
As an example playground for using this plugin to document pydantic, attrs, and other dataclass-like objects, see: https://github.com/tlambert03/fieldz-docs-example
Metadata
Release files for griffe-fieldz 0.5.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| griffe_fieldz-0.5.0.tar.gz | 14.2 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| griffe_fieldz-0.5.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 23.9 kB
Release files / griffe_fieldz-0.5.0.tar.gz
| Download URL | griffe_fieldz-0.5.0.tar.gz |
|---|---|
| Size | 14.2 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
dcf237a0def9f5c15e15aa5cf07b3d0a4edf4f7d6a2d713a45afe29c8af9bc8e
|
|
BLAKE2b-256 checksum How to use checksums |
1c7fb57a27807536590f0cabdd2e6c0faac78c7d6a740e096684c51c503b7003
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.7
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Feb 24, 2026.
Transparency logRelease files / griffe_fieldz-0.5.0-py3-none-any.whl
| Download URL | griffe_fieldz-0.5.0-py3-none-any.whl |
|---|---|
| Size | 9.6 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
d363e56a7468019a7184ea3995277a1f20507bb9a345408c1f7014ae06878ebf
|
|
BLAKE2b-256 checksum How to use checksums |
ce669daa3118d9bf4443778d6ee31b024c79766eeb116b275eca71597adae43a
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.7
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Feb 24, 2026.
Transparency log