eradiate.data.DataStore#

class eradiate.data.DataStore[source]#

Bases: abc.ABC

Interface class for all data stores.

abstract fetch(filename, **kwargs)[source]#

Fetch a file from the data store.

Parameters

filename (path-like) – File name to fetch from the data store, relative to the storage root.

Returns

Path – Absolute path where the retrieved resource is located.

Raises

DataError – The requested file could not be served.

abstract registry_files(filter=None)[source]#

Get a list of registered files.

Parameters

filter (callable(), optional) – A filter function taking a file path as a single string argument and returning a boolean. Filenames for which the filter returns True will be returned.

Returns

files (list of str) – List of registered files.

abstract property base_url#

Address of the remote storage location.

Type

str

abstract property registry#

Registry contents.

Type

dict