Skip to content

static ¤

Griffe extension for Pydantic.

Modules:

  • common

    Griffe extension for Pydantic.

Functions:

inherits_pydantic ¤

inherits_pydantic(cls: Class) -> bool

Tell whether a class inherits from a Pydantic model.

Parameters:

  • cls (Class) –

    A Griffe class.

Returns:

  • bool

    True/False.

process_attribute ¤

process_attribute(
    attr: Attribute, cls: Class, *, processed: set[str]
) -> None

Handle Pydantic fields.

process_class ¤

process_class(
    cls: Class, *, processed: set[str], schema: bool = False
) -> None

Finalize the Pydantic model data.

process_function ¤

process_function(
    func: Function, cls: Class, *, processed: set[str]
) -> None

Handle Pydantic field validators.

process_module ¤

process_module(
    mod: Module,
    *,
    processed: set[str],
    schema: bool = False
) -> None

Handle Pydantic models in a module.

pydantic_validator ¤

pydantic_validator(func: Function) -> ExprCall | None

Return a function's pydantic.field_validator decorator if it exists.

Parameters:

  • func (Function) –

    A Griffe function.

Returns:

  • ExprCall | None

    A decorator value (Griffe expression).