bayesline.api.AsyncRegistry#

class bayesline.api.AsyncRegistry#

Bases: Generic[T], AsyncReadOnlyRegistry[T]

Methods

__init__()

delete(name)

Parameters name str | int The unique name or int identifier of the settings to delete.

get(name)

Parameters name str | int The unique name or int identifier of the item to retrieve.

get_all()

Returns A dictionary of all valid available settings.

get_all_metadata()

Returns A dictionary of all available settings metadata, valid or invalid.

get_all_with_metadata()

Returns A dictionary of all valid available settings with metadata.

get_metadata(name)

Parameters name str | int The unique name or int identifier of the item to retrieve.

get_raw(name_or_id)

Parameters name_or_id list[str | int] The unique names or int identifiers of the items to retrieve.

ids([mode])

Parameters mode Mode The mode to use when retrieving the ids.

names([mode])

Parameters mode Mode The mode to use when retrieving the ids.

save(name, settings)

Parameters name str The unique name of the item to save. The name cannot be all numbers. settings T The item to save.

update(name, settings)

Parameters name str | int The unique name or int identifier of the item to update. settings T The item to update.

abstract async save(name: str, settings: T) int#

Parameters#

namestr

The unique name of the item to save. The name cannot be all numbers.

settingsT

The item to save.

Raises#

ValueError

If the item name already exists or is all numbers.

Returns#

a unique identifier for the saved item.

abstract async update(name: str | int, settings: T) RawSettings#

Parameters#

namestr | int

The unique name or int identifier of the item to update.

settingsT

The item to update.

Raises#

KeyError

If the item does not exist.

Returns#

The previous raw settings item for the given name.

abstract async delete(name: str | int) RawSettings#

Parameters#

namestr | int

The unique name or int identifier of the settings to delete.

Raises#

KeyError

If the item does not exist.

Returns#

The deleted raw settings item for the given name.