partis.schema_meta.base module#
- exception SchemaError(msg, loc=None, level=None, ignore_frame=None, *args, **kwargs)[source]#
Bases:
ModelErrorBase of all schema related errors
- exception SchemaNameError(msg, loc=None, level=None, ignore_frame=None, *args, **kwargs)[source]#
Bases:
SchemaErrorRaised when a name error occurs
- exception SchemaParseError(msg, loc=None, level=None, ignore_frame=None, *args, **kwargs)[source]#
Bases:
SchemaErrorRaised when a schema cannot be detected
- exception SchemaDetectionError(msg, loc=None, level=None, ignore_frame=None, *args, **kwargs)[source]#
Bases:
SchemaErrorRaised when a schema cannot be detected
- exception SchemaDeclaredError(msg, loc=None, level=None, ignore_frame=None, *args, **kwargs)[source]#
Bases:
SchemaErrorRaised when a schema’s declared is used before the schema has been defined
- exception SchemaDefinitionError(msg, loc=None, level=None, ignore_frame=None, *args, **kwargs)[source]#
Bases:
SchemaErrorRaised when a schema’s definition is not correctly specified
- exception SchemaValidationError(msg, loc=None, level=None, ignore_frame=None, *args, **kwargs)[source]#
Bases:
SchemaErrorRaised when data could not be validated (encoded/decoded) using schema definition
- exception SchemaEvaluationError(msg, loc=None, level=None, ignore_frame=None, *args, **kwargs)[source]#
Bases:
SchemaErrorRaised when evaluated expression failed to result in a decoded value
- class SchemaHint(msg=None, data=None, format=None, loc=None, level=None, hints=None)[source]#
Bases:
ModelHintBase of all schema hints
- class Bias(val=None, const=None)[source]#
Bases:
objectA metric of how biased (selective) a value is to a schema
This may be interpreted as the number of needed independent binary decisions (questions, or conditional statements) to determine that the value satisfied the schema.
- class PresetValue(val, label=None, doc=None)[source]#
Bases:
objectA preset value associated with a schema
- is_required(val)[source]#
- Returns:
bool – True if the value corresponds to being required, likely resulting in an error if no value is supplied.
- is_optional(val)[source]#
- Returns:
bool – True if the value corresponds to being optional, resulting in a default of None
- is_derived(val)[source]#
- Returns:
bool – True if the value is to be derived from some other value(s)
- is_notset(val)[source]#
- Returns:
bool – True if the value corresponds to being not set, or otherwise undefined, including not even
None.
- is_similar_value_type(a, b)[source]#
- Returns:
is_similar_value_type (bool) – True if all type_tests return the same for both values
- is_valued_type(val)[source]#
- Returns:
is_valued_type (bool) – True if is an instance value of any schema type