hoops_ai.storage.datastorage.data_storage_handler_base
Classes
- class hoops_ai.storage.datastorage.data_storage_handler_base.DataStorage
Bases:
ABC- abstract close()
Handles any necessary cleanup or resource deallocation.
- Return type:
None
- abstract get_file_path(data_key)
Retrieves the file path for a given data key.
- get_group_for_array(array_name)
Determines which group an array belongs to based on the schema.
- abstract get_keys()
Retrieves a list of all keys in the storage. :returns: A list of all keys in the storage. :rtype: list
- Return type:
- get_schema()
Retrieves the schema definition for this storage instance.
- Returns:
The schema definition, or empty dict if no schema is set
- Return type:
- abstract load_data(data_key)
Loads data associated with a specific key.
- Parameters:
data_key (str) – The key of the data to load.
- Returns:
The loaded data.
- Return type:
Any
- abstract load_metadata(key)
Loads metadata associated with a specific key.
- Parameters:
key (str) – The metadata key.
- Returns:
The loaded metadata value.
- Return type:
Any
- abstract save_data(data_key, data)
Saves data associated with a specific key.
- Parameters:
data_key (str) – The key under which to store the data.
data (Any) – The data to store.
- Return type:
None
- abstract save_metadata(key, value)
Saves metadata as a key-value pair into the metadata JSON file. If the file doesn’t exist, it will be created.
- Parameters:
key (str) – The metadata key.
value (Any) – The metadata value (bool, int, float, string, list, or array).
- Return type:
None