openclean.data.store.mem module

In-memory implementation for the object store interface.

class openclean.data.store.mem.VolatileDataStore

Bases: openclean.data.store.base.DataStore

The in-memory object store maintains all objects in a dictionary in main memory.

delete_object(object_id: str) bool

Remove the object with the given identifier. Raises a KeyError if the object identifier is unknown.

Parameters

object_id (string) – Unique object identifier.

Raises

KeyError

read_object(object_id: str) Any

Get the serialized object that is identified by the given object id. Raises a KeyError if the referenced object does not exist.

Parameters

object_id (string) – Unique object identifier.

Return type

any

Raises

KeyError

write_object(object: Any, object_id: Optional[str] = None) str

Store an object in the repository. Replaces an eventually existing object if the object identifier is given. Returns the unique object identifier.

Parameters
  • object (any) – Dictionary serialization for an object.

  • object_id (str, default=None) – Optional identifier for the stored object. If not given, a unique identifier will be generated.

Return type

string