API Reference¶
tattl¶
- tattl.unpack_dict(data: dict[str, Any], structure: type[S]) S¶
- Validates that the type of each - Fieldin- structurematches the type of the value it is given in- data.- Parameters:
- data – A - dictgenerated by- tomllib.loador- tomllib.loads.
 
- Raises:
- ValidationException – Raised when a value in - datahas a type that differs from that of the- Fieldwith the same name in- structure.
- MissingFieldException – Raised when a - Fieldin- structurewithout a default initialisation or factory is missing from- data.
 
- Returns:
- An instance of - structure, with attributes corresponding to the contents of- data.
 
tattl.exceptions¶
- exception tattl.exceptions.MissingFieldException¶
- Indicates that the data is missing a required field in the - dataclass.
- exception tattl.exceptions.TATTLException¶
- Raised when the data given does not conform to the - dataclass.- This is the base exception for all TATTL exceptions. 
- exception tattl.exceptions.ValidationException¶
- Indicates that the type of a field in the data differs from the type of the - dataclassfield with the same name.