paidiverpy.frontend.parse#
Parse Pydantic models to a dictionary format for frontend use.
Functions#
|
Define the default value for a Pydantic field. |
|
Parse the default parameters from a Pydantic model. |
|
Parse the origin field of a Pydantic field. |
|
Parse a Pydantic field that is a union type. |
|
Parse fields from a Pydantic model into a dictionary format. |
Module Contents#
- paidiverpy.frontend.parse.define_default_value(field: pydantic.fields.FieldInfo) any[source]#
Define the default value for a Pydantic field.
- Parameters:
field (pydantic.fields.FieldInfo) – The Pydantic field to parse.
- Returns:
The default value of the field, or None if no default is set.
- Return type:
any
- paidiverpy.frontend.parse.parse_default_params(model: pydantic.BaseModel, steps: bool = False) dict[source]#
Parse the default parameters from a Pydantic model.
- paidiverpy.frontend.parse.parse_get_origin_field(field: pydantic.fields.FieldInfo, origin_field: type) dict[source]#
Parse the origin field of a Pydantic field.
- paidiverpy.frontend.parse.parse_union_field(field: pydantic.fields.FieldInfo, output: dict) dict[source]#
Parse a Pydantic field that is a union type.
- paidiverpy.frontend.parse.parse_fields_from_pydantic_model(model: pydantic.BaseModel) dict[source]#
Parse fields from a Pydantic model into a dictionary format.
- Parameters:
model (pydantic.BaseModel) – The Pydantic model to parse.
- Returns:
A dictionary containing the parsed fields with their default values and types.
- Return type: