Skip to main content

helpers

Helper functions for Spock

to_dict#

def to_dict(objs: Union[_C, List[_C], Tuple[_C, ...]], saver: Optional[AttrSaver] = AttrSaver()) -> Dict[str, Dict]

Converts spock classes from a Spockspace into their dictionary representations

Arguments:

  • objs - single spock class or an iterable of spock classes
  • saver - optional saver class object

Returns:

dictionary where the class names are keys and the values are the dictionary representations