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:
-
PydanticExtension
–Griffe extension for Pydantic.
Functions:
-
get_templates_path
–Return the templates directory path.
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
–Handle Pydantic fields.
-
on_class_instance
–Detect and prepare Pydantic models.
-
on_class_members
–Finalize the Pydantic model data.
-
on_function_instance
–Handle Pydantic field validators.
-
on_package_loaded
–Detect models once the whole package is loaded.
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.