Dashboard

class deepint.core.Dashboard(organization_id: str, workspace_id: str, info: DashboardInfo, credentials: Credentials)

“A Deep Intelligence Dashboard.

Note: this class should not be instanced directly, and it´s recommended to use the :obj:’deepint.core.dashboard.Dashboard.build()’ of :obj:’deepint.core.dashboard.Dashboard.from_url()’ methods

organization_id

organization where the dashboard is located

workspace_id

workspace where the dashboard is located

info

:obj:’deepint.core.dashboard.DashboardInfo’ to operate with dashboard’s information

credentials

credentials to authenticate with Deep Intelligence API and be allowed to perform over the source. If not provided, the credentials are generated with :obj:’deepint.auth.credentials.Credentials.build’

classmethod build(organization_id: str, workspace_id: str, dashboard_id: str, credentials: Optional[Credentials] = None) Dashboard

Builds a Dashboard.

Note: when the dashboard is created, the dasboard’s informatio is retrieved from API

Parameters:
  • organization_id – organization whre the dashboard is located

  • workspace_id – workspace where the dashboard is located

  • dashboard_id – dashboard’s id

  • credentials – credentials to authenticate with Deep Intelligence API and be allowed to perform operations

  • provided (over the dashboard. If not) – obj:’deepint.auth.credentials.Credentials.build’.

  • the (the credentials are generated with) – obj:’deepint.auth.credentials.Credentials.build’.

Returns :

The dashboard with the given parameters and credentials

clone(name: Optional[str] = None) Dashboard

Clones a dashboard.

Parameters:

name – name for the new dashboard. If not providen the name will be Copy of <current dashboard’s name>

Returns:

the cloned dashboard instance.

delete()

Deletes a dashboard.

fetch_all(force_reload: bool = False) DashboardInfo

Retrieves all dashboard’s information.

Parameters:

force_reload – if set to True, info is reloaded before the search with the :obj:’depint.core.dashboard.DashboardInfo.load’ method

Returns:

the dashboard’s info

fetch_iframe_token(filters: Optional[List[Dict[str, Any]]] = None) Tuple[str, str]

Creates iframe token for the dashboard. Requires a secret to be set.

Parameters:

filters – list of filters to apply. Please, check the (advanced documentation)[https://app.deepint.net/api/v1/documentation/#/workspaces/post_api_v1_workspace__workspaceId__iframe] to learn more about it.

Returns:

the url and token of the dashboard token

classmethod from_url(url: str, organization_id: Optional[str] = None, credentials: Optional[Credentials] = None) Dashboard

Builds a dashboard from its api or web asspciated URL.

The url must contain the workspace’s id and the dashboard’s id as in the following example

Example

Note: when the dashboard is created, the dashboard’s information is retrieved from API

Parameters:
  • url – the dashboard’s api or web associated URL

  • organization_id – the id of the organziation. Must be providen if the API URL is used

  • credentials – credentials to authenticate with Deep Intelligence API and be allowed to perform operations

  • provided (over the source. If not) – obj:’deepint.auth.credentials.Credentials.build’

  • with (the credentials are generated) – obj:’deepint.auth.credentials.Credentials.build’

Returns:

The dashboard with the URL and credentials

load()

Load the dashboard’s information.

If the dashboard information is already loaded, it’s replaced by the new after retrieval

to_dict() Dict[str, Any]

Builds a dictionary containing the information stored in the current object.

Returns:

dictionary containing the information stored in the current object.

update(name: Optional[str] = None, description: Optional[str] = None, privacy: str = 'public', share_opt: str = '', ga_id: Optional[str] = None, restricted: Optional[bool] = None, configuration: Dict[str, Any] = {})

Updates a dashboard’s information.

Parameters:
  • name – dashboard’s name. If not provided the dashboard’s name the dashboard’s name stored in the :obj:’deepint.core.dashboard.Dashboard.dashboard_info’ attribute is taken

  • description – dashboard’s description. If not provided the dashboard’s name the dashboard’s description stored in the :obj:’deepint.core.dashboard.Dashboard.dashboard_info’ attribute is taken

  • privacy – Determine if the dashboard is public or private

  • share_opt – Option for the shared dashboard GUI

  • gaID – optional Google Analytics ID

  • restricted – True to check for explicit permission for shared dashboard

  • configuration

class deepint.core.dashboard.DashboardInfo(dashboard_id: str, created: datetime, last_modified: datetime, last_access: datetime, name: str, description: str, privacy: str, share_opt: str, ga_id: str, restricted: bool, configuration: Dict[str, Any] = {})

Stores the information of a Deep Intelligence dashboard.

dashboard_id

dashboard’s id in format uuid4.

created

Creation date

last_modified

last modified date

last_access

last access date

name

dashboard’s name

description

dashboard’s description

privacy

if ‘private’, dashboard only accesible for Organization’s users

share_opt

Option for the shared dashboard GUI

ga_id

Opctional Google Analytics ID

restricted

True to check for explicit permission for shared dashboard

configuration

see documentation for advanced options.

static from_dict(obj: Any) DashboardInfo

Builds a ‘DashboardInfo’ with a dictionary.

Parameters:

obj – containing a serialized DashboardInfo.

Returns:

DashboardInfo containing the information stored in the given dictionary.

to_dict() Dict[str, Any]

Builds a dictionary containing information stored in the current object.

Returns:

Dictionary containing the information stored in the current object.