openclean.engine.store.base module

Generic store for objects handles.

class openclean.engine.store.base.ObjectStore

Bases: object

Interface for repositories that manage handles for objects of different types. Objects are stored internally using their respective serialized form. Object serialization and deserialization is the responsibility of an associated object factory.

abstract delete_object(name: str, namespace: Optional[str] = None)

Remove the object that is identified by the given name and namespace from the repository. Raises a KeyError if the referenced object does not exist.

Parameters
  • name (string) – Unique object name.

  • namespace (string, default=None) – Optional identifier for the object namespace.

Raises

KeyError

get(name: str, namespace: Optional[str] = None) openclean.engine.object.base.ObjectHandle

Shortcut to get the deseralized object handle that is identified by the given name and namespace from the repository. Raises a KeyError if the referenced object does not exist.

Parameters
  • name (string) – Unique object name.

  • namespace (string, default=None) – Optional identifier for the object namespace.

Return type

any

Raises

KeyError

abstract get_object(name: str, namespace: Optional[str] = None) openclean.engine.object.base.ObjectHandle

Get the deseralized object handle that is identified by the given name and namespace from the repository. Raises a KeyError if the referenced object does not exist.

Parameters
  • name (string) – Unique object name.

  • namespace (string, default=None) – Optional identifier for the object namespace.

Return type

any

Raises

KeyError

abstract insert_object(object: openclean.engine.object.base.ObjectHandle)

Store an object in the repository. If an object with the same identifier (i.e., name and namespace) exists it will be replaced by the given object.

Parameters

object (openclean.engine.object.base.ObjectHandle) – Object that is being inserted into the repository.

abstract to_listing() List[Dict]

Get a list of descriptor serializations for the registered objects.

Return type

list of dict