object_from_dict¶
-
tollan.utils.namespace.object_from_dict(d, _namespace_from_dict_op=<function copy>, _namespace_from_dict_schema=None, _namespace_type_key='__class__', _namespace_check_type=None, _namespace_default_type=None, **kwargs)[source]¶ Construct a
Namespaceobject from dict.- Parameters
- _namespace_from_dict_opcallable
If set, this is applied to the input dict
dbefore thekwargsget merged to it. Default is “copy”.- _namespace_from_dict_schema
Schemaor None If set, it is used to filter the dict before instantiate the instance.
- _namespace_type_keystr
This is passed to
getobjto get the type of the object to be constructed.NamespaceNotFoundErroris raised if no valid namespace type is found.- _namespace_check_typecallable or None
If set, it is evaluated with the found namespace type for validation.
NamespaceTypeErroris raised if the validation fails.- _namespace_default_type
NamespaceMixinsubclass. If set, this is assumed when the namespace type cannot be inferred from
_namespace_type_key.- **kwargs
Additional keyword arguments that get updated to the dict.