minos.common.model.fields module¶
- class minos.common.model.fields.Field(name, type_, value=<class 'minos.common.model.types.constants.MissingSentinel'>, parser=None, validator=None)[source]¶
Bases:
objectRepresents a model field.
- __init__(name, type_, value=<class 'minos.common.model.types.constants.MissingSentinel'>, parser=None, validator=None)[source]¶
- property avro_data: Any¶
Compute the avro data of the model.
- Return type
typing.Any- Returns
A dictionary object.
- property avro_schema: dict¶
Compute the avro schema of the field.
- Return type
dict[str,typing.Any]- Returns
A dictionary object.
- classmethod from_avro(schema, value)[source]¶
Build a
Fieldinstance from the avro information.- Parameters
schema (
dict) – Field’s schema.value (
typing.Any) – Field’s value.
- Return type
- Returns
A
Fieldinstance.
- property name: str¶
Name getter.
- Return type
str
- property parser: Optional[Callable[[Any], Any]]¶
Parser getter.
- Return type
typing.Optional[typing.Callable[[Any],Any]]
- property validator: Optional[Callable[[Any], Any]]¶
Parser getter.
- Return type
typing.Optional[typing.Callable[[Any],Any]]
- property value: Any¶
Value getter.
- Return type
typing.Any
- minos.common.model.fields.ModelField¶
alias of
minos.common.model.fields.