Skip to main content

to_object

No overview available.

def to_object(
data: dict|list,
target_class: type
) - > object|list

Converts a dictionary or a list of dictionaries into a single object or a list of objects by mapping keys to attributes.

Parameters

NameTypeDescription
data`dictlist`
target_classtypeThe class type that the data should be instantiated into.

Returns

TypeDescription
`objectlist`