antimatter.handlers.scalar#

Module Contents#

Classes#

ScalarHandler

The Scalar DataHandler supports a scalar value.

class antimatter.handlers.scalar.ScalarHandler#

Bases: antimatter.handlers.base.DataHandler

The Scalar DataHandler supports a scalar value.

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

from_generic expects a single value in a list of lists and extracts this value if it can be found.

Parameters:
  • cols – ignored when converting from generic as the column is a static name.

  • generic_data – the generic data holder wrapping a single value.

  • extra – extra data for the DataHandler. Ignored when converting.

Returns:

the value held in the generic data format

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

to_generic converts a scalar value into the generic data format.

Parameters:

data – the scalar value to wrap into a generic format

Returns:

the data in its generic form