Visualization¶
- class deepint.core.Visualization(workspace_id: str, organization_id: str, info: VisualizationInfo, credentials: Credentials)¶
A Deep Intelligence Visualization
Note: this class should not be instanced directly, and it’s recommended to use the :obj:’deepint.core.visualization.Visualization.build()’ or :obj:’deepint.core.visualization.Visualization.from_url’ methods
- organization_id¶
organization where visualization is located
- workspace_id¶
workspace where visualization is located
- info¶
:obj:’deepint.core.visualization.VisualizationInfo’ to operate with visualization’s information.
- credentials¶
credentials to authenticate with Deep Intelligence API and be allowed to perform operation over the source. if not provided, the credentials are generated with the :obj:’deepint.auth.credentials.Credentials.build’.
- classmethod build(workspace_id: str, organization_id: str, visualization_id: str, credentials: Optional[Credentials] = None) Visualization ¶
Builds a visualization.
Note: when visualization is created, the visualization’s information is retrieved from API
- Parameters:
organization_id – organization where visualization is located
workspace_id – workspace where the visualization is located
visualization_id – visualziation’s id
credentials – credentials to authenticate with Deep Intelligence API and be allowed to perform operations
provided (over the visualization. If not) – obj:’deepint.auth.credentials.Credentials.build’.
the (the credentials are generated with) – obj:’deepint.auth.credentials.Credentials.build’.
- Returns:
the visualization with the given parameters and credentials.
- clone(name: Optional[str] = None) Visualization ¶
Clones a visualization.
- Parameters:
name – name for the new visualization. If not providen the name will be Copy of <current visualization’s name>
- Returns:
the cloned visualization instance.
- delete() None ¶
Deletes a visualization.
- fetch_iframe_token(filters: Optional[List[Dict[str, Any]]] = None) Tuple[str, str] ¶
Creates iframe token for the visualization. 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 visualization token
- classmethod from_url(url: str, organization_id: Optional[str] = None, credentials: Optional[Credentials] = None) Visualization ¶
Builds a visualization from its API or web associated URL.
The url must contain the workspace’s id and the visualization’s id as in the following example.
- Example
Note: when the visualization is created, the visualization’s information is retrieved from API
- Parameters:
url – the visualization’s API or web associated URL
organization_id – the id of the organization. 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 visualization with the url and credentials
- load() None ¶
Load th visualization’s information.
If the visualization’s information is already loaded, it’s replaced by the new one after retrieval.
- to_dict() Dict[str, Any] ¶
Builds a dictionary containing the information stored in the current object.
- Returns:
dictionaty containing the information stored in the current object.
- update(name: Optional[str] = None, description: Optional[str] = None, privacy: str = 'public', source: Optional[str] = None, configuration: Dict[str, Any] = {})¶
Updates a visualization’s name and description.
- Parameters:
name – visualization’s name. If not provided the visualziation’s name stored in the :obj:’deepint.core.visualization.Visualization.visualization_info’ attribute is taken.
description – visualization’s description. If not provided de visualization’s description stored in the :obj:’deepint.core.visualization.Visualization.visualization_info’ attribute is taken.
privacy – Determine if the visualization is public or private
source – id from the source to use in the visualization
configuration – Dictionary
- class deepint.core.visualization.VisualizationInfo(visualization_id: str, created: datetime, last_modified: datetime, last_access: datetime, name: str, description: str, visualization_type: str, public: bool, source_id: str, configuration: str)¶
Stores the information of a Deep Intelligence visualization
- visualization_id¶
visualization’s id in format uuid4.
- created¶
Creation date
- last_modified¶
last modified date
- last_access¶
last access date
- name¶
visualization’s name
- description¶
visualization’s description
- visualization_type¶
visualization’s type
- public¶
if false, visualization only accesible for Organization’s users
- source_id¶
source’s id with the info for the visualization
- configuration¶
advanced configuration
- static from_dict(obj: Any) VisualizationInfo ¶
Builds a ‘VisualizationInfo’ with a dictionary.
- Parameters:
obj – :obj:’object’ or :obj:’dict’ containing the a serialized VisualizationInfo.
- Returns:
VisualizationInfo containing the information stored in the given dictionary.
- to_dict() Dict[str, Any] ¶
Builds a dictionary containing de information stored in the current object.
- Returns:
dictionary containing the information stored in the current object.