openclean.engine.object.mapping module

Handle and factory implementations for lookup tables (mappings) that are registered with the object library.

class openclean.engine.object.mapping.MappingFactory

Bases: openclean.engine.object.base.ObjectFactory

Factory for mapping handles.

deserialize(descriptor: Dict, data: List[Dict]) openclean.engine.object.base.ObjectHandle

Convert an object serialization that was generated by the object serializer into a mapping handle.

Parameters
  • descriptor (dict) – Dictionary serialization for the mapping descriptor as created by the serialize method.

  • data (list of dict) – Serialization for the mapping table as created by the serialize method.

Return type

openclean.engine.object.mapping.MappingHandle

serialize(object: openclean.engine.object.mapping.MappingHandle) Tuple[Dict, List[Dict]]

Serialize the given mapping handle. Returns a serialized descriptor and a list of serializations for the mappings of individual terms in the mapping table.

Parameters

object (openclean.engine.object.mapping.MappingHandle) – Object of type that is supported by the serializer.

Return type

tuple of dict and list

class openclean.engine.object.mapping.MappingHandle(mapping: openclean.data.mapping.Mapping, name: str, namespace: Optional[str] = None, label: Optional[str] = None, description: Optional[str] = None)

Bases: openclean.engine.object.base.ObjectHandle

Handle for a mapping of matched terms that is registered with the object library. Extends the base handle with the mapping dictionary.

name: str