Skip to content

griffe_pydantic ¤

griffe-pydantic package.

Griffe extension for Pydantic.

Modules:

  • common

    Griffe extension for Pydantic.

  • debug

    Debugging utilities.

  • dynamic

    Griffe extension for Pydantic.

  • extension

    Griffe extension for Pydantic.

  • static

    Griffe extension for Pydantic.

Classes:

Functions:

PydanticExtension ¤

PydanticExtension(*, schema: bool = False)

Bases: Extension

Griffe extension for Pydantic.

Parameters:

  • schema (bool, default: False ) –

    Whether to compute and store the JSON schema of models.

Methods:

on_attribute_instance ¤

on_attribute_instance(
    *,
    node: AST | ObjectNode,
    attr: Attribute,
    **kwargs: Any
) -> None

Handle Pydantic fields.

on_class_instance ¤

on_class_instance(
    *, node: AST | ObjectNode, cls: Class, **kwargs: Any
) -> None

Detect and prepare Pydantic models.

on_class_members ¤

on_class_members(
    *, node: AST | ObjectNode, cls: Class, **kwargs: Any
) -> None

Finalize the Pydantic model data.

on_function_instance ¤

on_function_instance(
    *, node: AST | ObjectNode, func: Function, **kwargs: Any
) -> None

Handle Pydantic field validators.

on_package_loaded ¤

on_package_loaded(*, pkg: Module, **kwargs: Any) -> None

Detect models once the whole package is loaded.

get_templates_path ¤

get_templates_path() -> Path

Return the templates directory path.