Skip to main content

easyfabric.data.dataclass_utils

reset_rename_warnings​

def reset_rename_warnings() -> None

Vergeet welke hernoemde sleutels al gemeld zijn. Voor tests.

report_renamed_keys​

def report_renamed_keys() -> None

Emit the renamed-key notices that parsing held back.

DataClassFromDictMixin Objects​

class DataClassFromDictMixin()

Enhanced mixin: Converts dataclasses to/from dictionaries with recursive support for nested dataclasses/lists. Supports flexible YAMLA simple way to write configurations. It's basically a list that computers can read easily. keys (any casing → lowercase snake_case) and unwraps Optional/Union types.

dict​

def dict()

Convert the dataclass instance to a dictionary

from_dict​

@classmethod
def from_dict(cls, data: Union[dict, str])

Create a dataclass instance from a dictionary or JSON string.

Arguments:

  • data - A dictionary or JSON string to convert to a dataclass instance.

Returns:

An instance of the dataclass.

Raises:

  • ValueError - If the input string is not valid JSON.
  • TypeError - If the input is not a dictionary or JSON string.

__post_init__​

def __post_init__()

Auto-apply overrides from global dict for None fields, with fallbacks.