API Reference¶
tattl
¶
- tattl.unpack_dict(data: dict[str, Any], structure: type[S]) S ¶
Validates that the type of each
Field
instructure
matches the type of the value it is given indata
.- Parameters:
data – A
dict
generated bytomllib.load
ortomllib.loads
.
- Raises:
ValidationException – Raised when a value in
data
has a type that differs from that of theField
with the same name instructure
.- Returns:
An instance of
structure
, with attributes corresponding to the contents ofdata
.
tattl.exceptions
¶
- exception tattl.exceptions.ValidationException¶
Raised when the data given does not conform to the
dataclass
.Indicates that the type of a field in the data differs from the type of the
dataclass
field with the same name.