partis.schema_meta.struct module#
- class SchemaStructDeclared(name, bases, namespace, tag, tag_key=None)[source]#
Bases:
SchemaDeclaredMeta-class for all schema declareds
A schema declared acts as a forward declaration of a schema class if a reference to the schema is needed before the schema class has actually been defined. The eventual schema definition must have the exact same tag_key and tag as the declared that it defines. Once it has been defined, the actual schema definition may be retrieved from the schema property. A declared may only be defined by a single eventual schema class.
- Parameters:
See also
SchemaDeclaredSchemaStruct
- class SchemaStruct(name, bases, namespace, tag_key=None, tag=None, declared=None, struct=None, struct_proxy=None, evaluated=None, default_val=None, default_eval=None, init_val=None, preset_vals=None, valued_type=None, doc=None, loc=None)[source]#
Bases:
SchemaMeta-class for all defined schemas
- Parameters:
tag_key¶ (NoneType | str) – The key for the tag defining this schema
declared¶ (NoneType |
SchemaDeclared) – The schema declared for which this is the definition. If given, the tag_key, tag are not required.struct¶ (NoneType | dict[ str,
SchemaStruct|SchemaPrim]) – Structure of the defined schema Mapping. Keys must be valid attribute names, not be “private” names starting with ‘__’ (double-underscore) or ‘_p’, or names of any Mapping attributes ‘keys’, ‘values’, ‘items’, or ‘get’.struct_proxy¶ (NoneType |
RequiredType| str) – Key of primary structure value that may be set, using defaults for all other values. If any other values are required, specifying this will raise an error.
- Raises:
SchemaDefinitionError – If the schema definition is not valid
See also
SchemaDeclaredSchemaStruct- property struct#
Structure of the defined schema
- Type:
dict[ str,
SchemaStruct|SchemaPrim]
- default_val#
- default_eval#
- init_val#
- property evaluated#
Evaluation class
- Type:
Evaluated
- hints#
- class SchemaStructProxy(name, bases, namespace, tag_key=None, tag=None, declared=None, struct=None, struct_proxy=None, evaluated=None, default_val=None, default_eval=None, init_val=None, preset_vals=None, doc=None, loc=None)[source]#
Bases:
SchemaProxy