bayesline.api.equity.AsyncDataTypeUploaderApi#
- class bayesline.api.equity.AsyncDataTypeUploaderApi#
Bases:
ABC
Exposes different datasets of an uploader.
Datasets are completely isolated spaces to upload data of the same type.
Methods
__init__
()create_dataset
(dataset)Creates a new dataset.
create_or_replace_dataset
(dataset)Creates a new dataset and deletes the old one if it exists.
get_dataset
(dataset)Parameters dataset: str The dataset of the uploader to obtain. Must be one of the datasets returned by get_datasets.
Returns list[str]: A sorted list of available datasets.
get_or_create_dataset
(dataset)Gets the dataset if it exists, otherwise creates it.
- abstract async get_dataset(dataset: str) AsyncUploaderApi #
Parameters#
- dataset: str
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:
- abstract async create_dataset(dataset: str) AsyncUploaderApi #
Creates a new dataset.
Parameters#
- dataset: str
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 #
Gets the dataset if it exists, otherwise creates it.
Parameters#
- dataset: str
The dataset to get or create.
Returns#
- AsyncUploaderApi:
The uploader for the dataset.
- async create_or_replace_dataset(dataset: str) AsyncUploaderApi #
Creates a new dataset and deletes the old one if it exists.
Parameters#
- dataset: str
The dataset to create.
Returns#
- AsyncUploaderApi:
The uploader for the dataset.