Welcome to dconstruct’s documentation!
- dconstruct.construct(type_map, spec, **default_kwargs)
Construct an object from a dictionary specification. The specification must have a “type” key that maps to a type in the type_map.
- Parameters:
type_map – A dictionary mapping type names to types.
spec – A dictionary specification of the object.
default_kwargs – Default keyword arguments to pass to the constructor. These can be overridden by the spec.
- Returns:
An object of the type specified in the specification.