Skip to content

Core

stores.core.Store(path, disk_format=DiskFormat.NONE, **kwargs)

Bases: ABC

An abstract interface for handling data stored in memory or on disk.

PARAMETER DESCRIPTION
path

Path where data will be stored.

TYPE: Path | str

disk_format

File format when writing data to disk.

TYPE: DiskFormat DEFAULT: NONE

disk_format = disk_format instance-attribute

kind instance-attribute

path = path instance-attribute

append(path, data, **kwargs) abstractmethod

Append data.

PARAMETER DESCRIPTION
path

Path where data will be stored.

TYPE: Path | str

data

Data to append.

TYPE: Any

available() abstractmethod

List all data names currently stored.

RETURNS DESCRIPTION
list[str]

A list of data names.

dump(**kwargs)

Save all data to disk. Overwrite this method to implement when needed.

read(path, view=None, **kwargs) abstractmethod

Read the entire data structure with the given name.

PARAMETER DESCRIPTION
path

Path where data will be stored.

TYPE: Path | str

RETURNS DESCRIPTION
OptionalPassableData

The requested data.

write(path, data, view=None, **kwargs) abstractmethod

Write data.

PARAMETER DESCRIPTION
path

Path where data will be stored.

TYPE: Path | str

data

Data to write.

TYPE: Any