sdesk.api.client module¶
-
class
sdesk.api.client.BaseUrlSession(base_url=None)¶ Bases:
requests_toolbelt.sessions.BaseUrlSessionChange sessions.BaseUrlSession default behavior.
Meta private: -
create_url(url)¶ Create the URL based off this partial path.
-
-
class
sdesk.api.client.SdeskClient(sdesk_host, schema='https', verify=False, disable_warning=False)¶ Bases:
object-
__init__(sdesk_host, schema='https', verify=False, disable_warning=False)¶ Science Desk Client class
The client will aims to be a implement several functions to make it easier to interact with Science Desk API.
Parameters: - sdesk_host (str) – ScienceDesk host name (e.g sciencedesk.mydomain.com)
- schema (str, optional) – URL Schema, defaults to “https”
- verify (bool, optional) – Verify SSL certificate, defaults to False
- disable_warning (bool, optional) – Disable Insegure Request Warning, defaults to False
-
auth_required()¶
-
authenticate(username, password)¶ Authenticate the client
Parameters: - username (str) – Username
- password (str) – Password
-
create_entry(notebook_id, description, title, datetime=None, submited=True, saved=True, task_id=None, sample_id=None)¶ Create a new entry on a Notebook
Parameters: - notebook_id (int) – Notebook Id
- description (str) – Description
- title (str) – Title
- datetime (datetime, optional) – Entry’s datetime, defaults to now()
- submited (bool, optional) – defaults to True
- saved (bool, optional) – defaults to True
- task_id (int, optional) – defaults to None
- sample_id (int, optional) – defaults to None
Return type:
-
list_entries(notebook_id, limit=9999, offset=0)¶ List Notebook’s Entries
Parameters: - notebook_id (int) – Notebook id
- limit (int, optional) – Results Limit, defaults to 9999
- offset (int, optional) – Results Offset, defaults to 0
Return type: Entrylist
-
list_entry_files(entry, limit=9999, offset=0)¶ List Files
Parameters: - entry (int) – Entry Id
- limit (int, optional) – Results Limit, defaults to 9999
- offset (int, optional) – Results Offset, defaults to 0
Return type: Filelist
-
list_files(limit=9999, offset=0)¶ List Files
Parameters: - limit (int, optional) – Results Limit, defaults to 9999
- offset (int, optional) – Results Offset, defaults to 0
Return type: Filelist
-
-
exception
sdesk.api.client.SdeskClientAutheticationError¶ Bases:
ExceptionRaised on authentication errors.