purplecaffeine.ApiStorage

class ApiStorage(username=None, password=None, host=None)[source]

API storage class.

Creates storage for APIServer.

Example

>>> storage = ApiStorage(
>>>     host="http://localhost:8000/",
>>>     username="admin",
>>>     password="123"
>>> )
Parameters:
  • username (Optional[str]) – username

  • password (Optional[str]) – password

  • host (Optional[str]) – host of api server

__init__(username=None, password=None, host=None)[source]

Creates storage for APIServer.

Example

>>> storage = ApiStorage(
>>>     host="http://localhost:8000/",
>>>     username="admin",
>>>     password="123"
>>> )
Parameters:
  • username (Optional[str]) – username

  • password (Optional[str]) – password

  • host (Optional[str]) – host of api server

Methods

__init__([username, password, host])

Creates storage for APIServer.

get(trial_id)

Returns trial by name.

list([query, limit, offset])

Returns list of trials.

save(trial)

Saves given trial.