bayesline.api.equity.AsyncDataTypeUploaderApi#

class bayesline.api.equity.AsyncDataTypeUploaderApi#

Expose different datasets of an uploader.

Datasets are completely isolated spaces to upload data of the same type.

__init__()#

Methods

__init__()

create_dataset(dataset)

Create a new dataset.

create_or_replace_dataset(dataset)

Create a new dataset and delete the old one if it exists.

get_dataset(dataset)

Get a specific dataset uploader.

get_datasets()

Get the list of available datasets.

get_or_create_dataset(dataset)

Get the dataset if it exists, otherwise create it.

abstract async get_datasets() list[str]#

Get the list of available datasets.

Returns#

list[str]

A sorted list of available datasets.

abstract async get_dataset(dataset: str) AsyncUploaderApi#

Get a specific dataset uploader.

Parameters#

datasetstr

The dataset of the uploader to obtain. Must be one of the datasets returned by get_datasets.

Raises#

KeyError

If the given dataset does not exist.

Returns#

AsyncUploaderApi

The uploader for the specified dataset.

abstract async create_dataset(dataset: str) AsyncUploaderApi#

Create a new dataset.

Parameters#

datasetstr

The dataset to create.

Raises#

ValueError

If the given dataset already exists.

Returns#

AsyncUploaderApi

The uploader for the new dataset.

async get_or_create_dataset(dataset: str) AsyncUploaderApi#

Get the dataset if it exists, otherwise create it.

Parameters#

datasetstr

The dataset to get or create.

Returns#

AsyncUploaderApi

The uploader for the dataset.

async create_or_replace_dataset(dataset: str) AsyncUploaderApi#

Create a new dataset and delete the old one if it exists.

Parameters#

datasetstr

The dataset to create.

Returns#

AsyncUploaderApi

The uploader for the dataset.