antimatter.handlers.dict_list#

Module Contents#

Classes#

DictList

The DictList DataHandler supports a list of dictionaries.

class antimatter.handlers.dict_list.DictList#

Bases: antimatter.handlers.base.DataHandler

The DictList DataHandler supports a list of dictionaries.

from_generic(cols: List[str], generic_data: List[List[bytes]], extra: dict) List[Dict[str, Any]]#

from_generic takes the generic data and passes it on as a list of dictionaries

Parameters:
  • cols – the column names

  • generic_data – the capsule’s generic data format holding the row values

  • extra – extra data for the DataHandler

Returns:

the data in a dictionary list format

to_generic(data: List[Dict[str, Any]]) Tuple[List[str], List[List[bytes]], Dict[str, Any]]#

to_generic converts a list of dictionaries into the generic data format, which is essentially a no-op as DictList has the same format as generic

Parameters:

data – the list of dictionaries to pass across as generic format

Returns:

the data in its generic form