InMemoryKeyValueStorage

class InMemoryKeyValueStorage(BaseKeyValueStorage):

A concrete implementation of the :obj:BaseKeyValueStorage using in-memory list. Ideal for temporary storage purposes, as data will be lost when the program ends.

init

def __init__(self):

save

def save(self, records: List[Dict[str, Any]]):

Saves a batch of records to the key-value storage system.

Parameters:

  • records (List[Dict[str, Any]]): A list of dictionaries, where each dictionary represents a unique record to be stored.

load

def load(self):

Returns:

List[Dict[str, Any]]: A list of dictionaries, where each dictionary represents a stored record.

clear

def clear(self):

Removes all records from the key-value storage system.