yaw.core.abc.DictRepresentation#

class yaw.core.abc.DictRepresentation[source]#

Bases: ABC

Base class for an object that can be serialised into a dictionary.

Methods

__init__()

from_dict(the_dict, **kwargs)

Create a class instance from a dictionary representation of the minimally required data.

to_dict()

Serialise the class instance to a dictionary containing a minimal set of required data.

classmethod from_dict(the_dict: dict[str, Any], **kwargs: dict[str, Any]) _Tdict[source]#

Create a class instance from a dictionary representation of the minimally required data.

Parameters:
  • the_dict (dict) – Dictionary containing the data.

  • **kwargs – Additional data needed to construct the class instance.

to_dict() dict[str, Any][source]#

Serialise the class instance to a dictionary containing a minimal set of required data.

Returns:

dict