sisense.analysis package

Submodules

sisense.analysis.dashboard module

class sisense.analysis.dashboard.Dashboard(api: sisense.api.API, rjson: dict = None)[source]

Bases: sisense.resource.Resource

all(**kwargs) → list[source]

Get all dashboards.

Parameters:kwargs – Keywords optional arguments. - parentFolder: (str) Folder ID. - name: (str) Dashboard’s name. - datasourceTitle: (str) Elasticube title used as datasource. - datasourceAddress: (str) Elasticube address. - fields: (list) List of fields to retrieve for each dashboard. - expand: (list) List of fields to be expanded (convert IDs to the actual object).
Returns:(list) List of Dashboard objects.
delete()[source]

Delete the current dashboard.

do_export(filepath: str, filetype: str = 'dash', **kwargs)[source]

Export the current dashboard.

Parameters:
  • filepath – (str) Where to save the file including file’s name and extension.
  • filetype – (str, default ‘dash’) Type of export. Possible values: dash.

For more details on other parameters, check: <GET /dashboards/{id}/export/*> on https://sisense.dev/reference/rest/v1.html.

PNG and PDF export is currently not supported.

do_import(filepath: str, action: str = 'duplicate', folder: str = None) → sisense.resource.Resource[source]

Import dashboard from file in filepath.

Parameters:
  • filepath – (str) Relative/absolute path to a .dash file.
  • action – (str, default ‘duplicate’) Determines if the existing dashboard should be overwritten. Possible values : skip, overwrite, duplicate.
  • folder – (str, default None) Folder’s ID where the dashboard should be imported.
Returns:

(Dashboard) The new dashboard.

exists(oid: str = None) → bool[source]

Check whether a specific dashboard exists.

Parameters:oid – (str, default self.oid) Dashboard’s ID.
Returns:(bool) True, if dashboard exists.
get(oid: str = None, name: str = None, folder: str = None, expand: list = None) → sisense.resource.Resource[source]

Get the specified dashboard. At least, one of the parameters must be set. If found more than one dashboard with the same name, the first one is returned.

Parameters:
  • oid – (str, default None) Dashboard’s ID.
  • name – (str, default None) Dashboard’s name.
  • folder – (str, default None) Parent folder’s ID. Used when ‘name’ is set.
  • expand – (list, default None) List of fields that should be expanded (replace their IDs with actual objects). May be nested using the resource.subResource format.
Returns:

(Dashboard) Dashboard, if found. None, otherwise.

get_shares() → list[source]

Get shares for the current dashboard.

publish()[source]

Publish the current dashboard.

update(**kwargs)[source]

Update the current dashboard information according to the specified parameters. For more information, check “PATCH /dashboards/{id}” on https://sisense.dev/reference/rest/v1.html.

widgets

Get dashboard’s widgets.

Returns:(list) A list of widgets.

sisense.analysis.folder module

class sisense.analysis.folder.Folder(api: sisense.api.API, rjson: dict = None)[source]

Bases: sisense.resource.Resource

all() → list[source]

Get all folders.

Returns:(list) List of folder objects.
create(name: str, parent: str = None) → sisense.resource.Resource[source]

Create a new folder.

Parameters:
  • name – (str) Folder’s name.
  • parent – (str, default None) Parent folder’s ID.
Returns:

(Folder) The new folder.

delete()[source]

Delete the current folder.

get(oid: str) → sisense.resource.Resource[source]

Get a specific folder.

Parameters:oid – (str) Folder’s ID.
Returns:(Folder)
update(**kwargs)[source]

Update the current folder.

Parameters:
  • name – (str, named parameter) The new folder name.
  • parentId – (str, named parameter) The new parent folder ID.
  • owner – (str, named parameter) The new owner of the folder, a user ID.

sisense.analysis.widget module

class sisense.analysis.widget.Widget(api: sisense.api.API, rjson: dict = None)[source]

Bases: sisense.resource.Resource

to_pdf(filepath: str, **kwargs)[source]

Export the current widget to PDF and save it on filepath.

Parameters:
  • filepath – (str) Path to save the file in, including filename and extension.
  • kwargs

    (named parameters) Example: {

    ’paperFormat’: ‘A4’, ‘paperOrientation’: ‘landscape’, ‘showTitle’: False, ‘showFooter’: True, # to show page number ‘title’: ‘Title’, ‘rowCount’: 8000

    }

update()[source]

Module contents