Workspace¶
- class deepint.core.Workspace(organization_id: str, credentials: Credentials, info: WorkspaceInfo, sources: List[Source], models: List[Model], tasks: List[Task], alerts: List[Alert], visualizations: List[Visualization], dashboards: List[Dashboard], emails: List[Dict[str, str]])¶
A Deep Intelligence workspace.
Note: This class should not be instanced directly, and it’s recommended to use the
deepint.core.workspace.Workspace.build
ordeepint.core.workspace.Workspace.from_url
methods.- organization_id¶
the organziation where workspace is located.
- info¶
deepint.core.workspace.WorkspaceInfo
to operate with workspace’s information.
- tasks¶
deepint.core.workspace.WorkspaceTasks
to operate with workspace’s tasks.
- models¶
deepint.core.workspace.WorkspaceModels
to operate with workspace’s models.
- alerts¶
deepint.core.workspace.WorkspaceAlerts
to operate with workspace’s alerts.
- sources¶
deepint.core.workspace.WorkspaceSources
to operate with workspace’s sources.
- dashboards¶
deepint.core.workspace.WorkspaceDashboards
to operate with workspace’s dashboards.
- visualizations¶
deepint.core.workspace.WorkspaceVisualizations
to operate with workspace’s visualizations.
- emails¶
deepint.core.workspace.WorkspaceEmails
to operate with workspace’s emails.
- credentials¶
credentials to authenticate with Deep Intelligence API and be allowed to perform operations over the workspace. If not provided, the credentials are generated with the
deepint.auth.credentials.Credentials.build
.
- classmethod build(organization_id: str, workspace_id: str, credentials: Optional[Credentials] = None) Workspace ¶
Builds a workspace.
Note: when workspace is created, the workspace’s information and list of it’s associated objects (tasks, models, sources, etc.) are loaded.
- Parameters:
organization_id – organization where workspace is located.
workspace_id – workspace’s id.
credentials – credentials to authenticate with Deep Intelligence API and be allowed to perform operations over the workspace. If not provided, the credentials are generated with the
deepint.auth.credentials.Credentials.build
.
- Returns:
the workspace build with the given parameters and credentials.
- clone(name: Optional[str] = None) Workspace ¶
Clones a workspace.
- Parameters:
name – name for the new workspace. If not providen the name will be Copy of <current workspace’s name>
- Returns:
the cloned workspace instance.
- delete()¶
Deletes a workspace.
- export(folder_path: str = '.', wait_for_download: bool = True, task: Optional[Task] = None) Union[str, Task] ¶
Exports a workspace to ZIP into the selected path.
- Parameters:
folder_path – the path where the zip should be located. This parameter must contain the name of the file. By default is the current folder.
wait_for_download – if set to true the file is located automatically into the selected path. In other case, the method returns a
deepint.core.task.Task
, that can be used later to get the ZIP with this metod, providing it into the task parameter.task –
deepint.core.task.Task
used to obtain the URL to download the ZIP in a delayed download (when the wait_for_download parameter is set to false).
- Returns:
The path to downloaded ZIP in the case of wait_for_download is set to True. In other case the task generated to build the ZIP.
- classmethod from_url(url: str, organization_id: Optional[str] = None, credentials: Optional[Credentials] = None) Workspace ¶
Builds a workspace from it’s API or web associated URL.
The url must contain the workspace’s id as in the following examples:
Example
- Note: when workspace is created, the workspace’s information and list of it’s associated objects (tasks, models, sources, etc.) are loaded.
Also it is remmarkable that if the API URL is providen, the organization_id must be provided in the optional parameter, otherwise this ID won’t be found on the URL and the Organization will not be created, raising a value error.
- Parameters:
url – the workspace’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 over the workspace. If not provided, the credentials are generated with the
deepint.auth.credentials.Credentials.build
.
- Returns:
the workspace build with the URL and credentials.
- load()¶
Loads the workspace’s information.
If the workspace’s information is already loaded, is replace by the new one after retrieval.
- to_dict() Dict[str, Any] ¶
Builds a dictionary containing the information stored in current object.
- Returns:
dictionary contining the information stored in the current object.
- update(name: Optional[str] = None, description: Optional[str] = None)¶
Updates a workspace’s name and description.
- Parameters:
name – workspace’s name. If not provided the workspace’s name stored in the
deepint.core.workspace.Workspace.workspace_info
attribute is taken.description – workspace’s description. If not provided the workspace’s description stored in the
deepint.core.workspace.Workspace.workspace_info
attribute is taken.
- class deepint.core.workspace.WorkspaceSources(workspace: Workspace, sources: List[Source])¶
Operates over the sources of a concrete workspace.
Note: This class should not be instanced, and only be used within an
deepint.core.workspace.Workspace
.- workspace¶
the workspace with which to operate with its sources.
- create(name: str, description: str, features: List[SourceFeature]) Source ¶
Creates a source in current workspace.
Before creation, the source is loaded and stored locally in the internal list of sources in the current instance.
- Parameters:
name – new source’s name.
description – new source’s description.
features – list of source’s features.
- Returns:
the created source
- create_and_initialize(name: str, description: str, data: DataFrame, date_formats: Optional[Dict[str, str]] = None, wait_for_initialization: bool = True) Source ¶
Creates a source in current workspace, then initializes it.
Before creation, the source is loaded and stored locally in the internal list of sources in the current instance.
- Parameters:
name – new source’s name.
description – new source’s description.
data – data to in initialize the source. The source’s feature names and data types are extracted from the given DataFrame.
date_formats – dicionary contianing the association between feature (column name) and date format like the ones specified in [#/date_formats]. Is optional to provide value for any column, but if not provided will be considered as null and the date format (in case of being a date type) will be the default one assigned by Deep Intelligence.
wait_for_initialization – if set to True, before the source creation, it waits for the source to update it’s instances. In other case, only the source is created, and then is returned without any guarantee that the instances have been inserted into the source.
- Returns:
the created and initialized (if wait_for_initialization is set to True) source.
- create_autoupdated(name: str, description: str, source_type: SourceType, is_json_content: bool = False, is_csv_content: bool = False, is_encrypted: bool = False, is_shuffled: bool = False, is_indexed: bool = True, auto_update: bool = True, auto_update_period: int = 3600000, replace_on_update: bool = True, pk_for_update: Optional[str] = None, update_duplicates: bool = True, separator: str = ',', quotes: str = '"', has_csv_header: bool = True, json_fields: Optional[List[str]] = None, json_prefix: Optional[str] = None, is_single_json_obj: bool = False, date_format: Optional[str] = None, url: Optional[str] = None, http_headers: Optional[Dict[str, str]] = None, ignore_security_certificates: bool = True, enable_store_data_parameters: bool = False, stored_data_parameters_name: Optional[str] = None, stored_data_parameters_sorting_desc: bool = True, database_name: Optional[str] = None, database_user: Optional[str] = None, database_password: Optional[str] = None, database_table: Optional[str] = None, database_query: Optional[str] = None, mongodb_sort: Optional[Dict[str, Any]] = None, mongodb_project: Optional[str] = None, database_query_limit: Optional[int] = None, database_host: Optional[str] = None, database_port: Optional[str] = None, mqtt_topics: Optional[List[str]] = None, mqtt_fields: Optional[List[Dict[str, str]]] = None, wait_for_creation: bool = True) Source ¶
Creates an Autoupdated source in current workspace.
Before creation, the source is loaded and stored locally in the internal list of sources in the current instance.
- Parameters:
name – new source’s name.
description – new source’s description.
source_type – type of source to create.
is_json_content – set to true if the data to ingest is in JSON format.
is_csv_content – set to true if the data to ingest is in CSV format.
is_encrypted – true to encrypt the data source
is_shuffled – true to shuffle instances
is_indexed – True to index the fields
auto_update – set to true to enable auto update
auto_update_period – auto update delay in milliseconds. Minimum is 5 minutes.
replace_on_update – set to true to replace the entire data set with each update. False to append the data.
pk_for_update – Name of the primary key field. In order to check for duplicates when appending.
update_duplicates – Set to true to update existing rows (by primary key). Set to false to skip duplicate rows. If you set dyn_replace to true. This option does not have any effect.
separator – separator character for csv files
quotes – quotes character for csv files.
has_csv_header – Set to false if the csv files does not have a header.
json_fields – List of fileds to get, in order, for json files or mongo databases.
json_prefix – Prefix to tell the engine where the data is in the JSON file. Use dots to split levels.
is_single_json_obj – Set to true in case there is a single instance in the JSON.
date_format – Date format in the CSV of JSON file. By default is the ISO format. This uses the Moment.js formats.
url – URL for url/any and ckan source types. In case of S3. This is the URI of the object inside the bucket. For mongo and influx, this is the connection URL.
is_csv_content – Set to True to indicate that is a CSV content. Otherwise the content will be considered as JSON.
http_headers – Custom headers to send by Deep Intelligence for requesting the data. example: “example: Header1: Value1 Header2: Value2”
ignore_security_certificates – Set to true to ignore invalid certificates for HTTPs
enable_store_data_parameters – Set to true to enable stored data parameter in the Query. Any instances of ${SDP} will be replaced.
stored_data_parameters_name – Name of the field to use for SDP.
stored_data_parameters_sorting – Sorting direction to calc the SDP. Must be asc or desc.
database_name – Name of the database or the S3 bucket.
database_user – User / Access key ID
database_password – Password / Secret key
database_table – Name of the table / collection
database_query – Database Query. For mongo, this is a JSON.
mongodb_sort – For MongoDB. Sorting
mongodb_project – MongoDB project.
database_query_limit – Limit of results per Deep Intelligent data retrieval query against source.
host – Database host
port – Port number
mqtt_topics – For MQTT, list of topics split by commas.
mqtt_fields – List of expected fields for MQTT. Read Deep Intelligence advanced documentation for more information.
wait_for_creation – if set to true, it waits until the source is created and a Source is returned. Otherwise it returns a
deepint.core.Task
, that when resolved, the new source id will be returned and the source will not be added to the local state, beign neccesary to update it manually with the methoddeepint.core.WorkspaceSources.load
.
- Returns:
the created source if wait_for_creation set to True, otherwise the
deepint.core.Task
- create_derived(name: str, description: str, derived_type: DerivedSourceType, origin_source_id: str, origin_source_b_id: Optional[str] = None, query: Optional[Dict[str, Any]] = None, features: Optional[List[SourceFeature]] = None, feature_a: Optional[SourceFeature] = None, feature_b: Optional[SourceFeature] = None, is_encrypted: bool = False, is_shuffled: bool = False, wait_for_creation: bool = True) Source ¶
Creates a source in current workspace.
Before creation, the source is loaded and stored locally in the internal list of sources in the current instance.
- Parameters:
name – new source’s name.
description – new source’s description.
derived_type – Derived type.
origin_source_id – id of the origin source.
origin_source_b_id – id of the second origin source. For join and merge.
query – query to perform filtering
features – List of features indexes, split by commas. For filter, this selects the list of features to keep in the derived source. For extend, this selects the features to melt.
feature_a – Match feature for join in first origin source (origin_source). For merge, this sets the source name filed if the first source is already a merge source. For aggregate, this is the field to group by, set to None for no grouping.
feature_b – Match feature for join in the second origin source (origin_source_b).
is_encrypted – true to encrypt the data source
is_shuffled – true to shuffle instances
wait_for_creation – if set to true, it waits until the source is created and a Source is returned. Otherwise it returns a
deepint.core.Task
, that when resolved, the new source id will be returned and the source will not be added to the local state, beign neccesary to update it manually with the methoddeepint.core.WorkspaceSources.load
.
- Returns:
the created source if wait_for_creation set to True, otherwise the
deepint.core.Task
- create_else_update(name: str, data: DataFrame, delete_instances_on_feature_update: bool = True, **kwargs) Source ¶
Creates a source and initializes it, if it doesn’t exist any source with same name. Else updates the source’s instances.
The source is created with the
deepint.core.worksapce.WorkspaceSources.create_and_initialize
, so it’s reccomended to read the documentation of that method to learn more about the possible arguments of creation (that can be providen in kwargs). Before creation, the source is loaded and stored locally in the internal list of sources in the current instance. Also it’s remmarkable that the source instance’s are updated with thedeepint.core.source.SourceInstances.update
method, so it’s reccomended to read the documentation of that method to learn more about the possible arguments of update (that can be providen in the kwargs).Note: if features change, then the source instances are deleted
- Parameters:
name – source’s name.
data – data to in initialize the source. The source’s feature names and data types are extracted from the given DataFrame. It the source also created, is updated with the given data.
delete_instances_on_feature_update – if set to False the instances are not deleted on features change.
- Returns:
the affected source, updated if it was existing and created and initialized (if wait_for_initialization is providen and set to True) in other case.
- create_external(name: str, description: str, url: str, features: List[SourceFeature]) ExternalSource ¶
Creates an External source in current workspace.
Before creation, the source is loadedand stored locally in the internal list of sources in the current instance.
To learn more about external sources, please check the (External Sources documentation)[https://deepintdev.github.io/deepint-documentation/EXTERNAL-SOURCES.html].
- Parameters:
name – new source’s name.
description – new source’s description.
url – external connection URL.
features – list of source’s features.
- Returns:
the created source
- create_if_not_exists(name: str) Source ¶
Creates a source and initializes it, if it doesn’t exist any source with same name.
The source is created with the
deepint.core.worksapce.WorkspaceSources.create
, so it’s reccomended to read the documentation of that method to learn more about the possible artguments of creation. Before creation, the source is loaded and stored locally in the internal list of sources in the current instance.- Parameters:
name – new source’s name.
- Returns:
the created source.
- create_real_time(name: str, description: str, features: List[SourceFeature], max_age: int = 0) RealTimeSource ¶
Creates a Real Time source in current workspace.
Before creation, the source is loaded and stored locally in the internal list of sources in the current instance.
- Parameters:
name – new source’s name.
description – new source’s description.
max_age – maximum age of registers in milliseconds. Set to 0 or negative for unlimited age. By default is 0.
features – list of source’s features.
- Returns:
the created source
- fetch(source_id: Optional[str] = None, name: Optional[str] = None, force_reload: bool = False) Optional[Source] ¶
Search for a source in the workspace.
The first time is invoked, builds a generator to retrieve sources directly from deepint.net API. However, if there is stored sources and the force_reload option is not specified, only iterates in local sources. In other case, it request the sources to deepint.net API and iterates over it.
Note: if no name or id is provided, the returned value is None.
- Parameters:
source_id – source’s id to search by.
name – source’s name to search by.
force_reload – if set to True, sources are reloaded before the search with the
deepint.core.workspace.WorkspaceSources.load
method.
- Returns:
retrieved source if found, and in other case None.
- fetch_all(force_reload: bool = False) Generator[Source, None, None] ¶
Retrieves all workspace’s sources.
The first time is invoked, builds a generator to retrieve sources directly from deepint.net API. However, if there is stored sources and the force_reload option is not specified, only iterates in local sources. In other case, it request the sources to deepint.net API and iterates over it.
- Parameters:
force_reload – if set to True, sources are reloaded before the search with the
deepint.core.workspace.WorkspaceSource.load
method.- Yields:
deepint.core.workspace.Source
– The next source returned by deeepint.net API.- Returns:
the workspace’s sources.
- load()¶
Loads a workspace’s sources.
If the sources were already loaded, this ones are replace by the new ones after retrieval.
- class deepint.core.workspace.WorkspaceTasks(workspace: Workspace, tasks: List[Task])¶
Operates over the tasks of a concrete workspace.
Note: This class should not be instanced, and only be used within an
deepint.core.workspace.Workspace
.- workspace¶
the workspace with which to operate with its tasks.
- fetch(task_id: Optional[str] = None, name: Optional[str] = None, force_reload: bool = False) Optional[Task] ¶
Search for a task in the workspace.
The first time is invoked, builds a generator to retrieve tasks directly from deepint.net API. However, if there is stored tasks and the force_reload option is not specified, only iterates in local tasks. In other case, it request the tasks to deepint.net API and iterates over it.
Note: if no name or id is provided, the returned value is None.
- Parameters:
task_id – task’s id to search by.
name – task’s name to search by.
force_reload – if set to True, tasks are reloaded before the search with the
deepint.core.workspace.WorkspaceTasks.load
method.
- Returns:
retrieved task if found, and in other case None.
- fetch_all(force_reload: bool = False) Generator[Task, None, None] ¶
Retrieves all workspace’s tasks.
The first time is invoked, builds a generator to retrieve tasks directly from deepint.net API. However, if there is stored tasks and the force_reload option is not specified, only iterates in local tasks. In other case, it request the tasks to deepint.net API and iterates over it.
- Parameters:
force_reload – if set to True, tasks are reloaded before the search with the
deepint.core.workspace.WorkspaceTask.load
method.- Yields:
deepint.core.workspace.Task
– The next task returned by deeepint.net API.- Returns:
the workspace’s tasks.
- fetch_by_status(status: TaskStatus, force_reload: bool = False) Generator[Task, None, None] ¶
Search for a task in the workspace by status.
The first time is invoked, builds a generator to retrieve tasks directly from deepint.net API. However, if there is stored tasks and the force_reload option is not specified, only iterates in local tasks. In other case, it request the tasks to deepint.net API and iterates over it.
- Parameters:
status – task’s status to search by.
force_reload – if set to True, tasks are reloaded before the search with the
deepint.core.workspace.WorkspaceTasks.load
method.
- Returns:
list of tasks in the given status if found, and in other case an empty list.
- load()¶
Loads a workspace’s tasks.
If the tasks were already loaded, this ones are replace by the new ones after retrieval.
- class deepint.core.workspace.WorkspaceAlerts(workspace: Workspace, alerts: List[Alert])¶
Operates over the alerts of a concrete workspace.
Note: This class should not be instanced, and only be used within an
deepint.core.workspace.Workspace
.- workspace¶
the workspace with which to operate with its alerts.
- create(name: str, description: str, subscriptions: List[str], color: str, alert_type: AlertType, source_id: str, condition: Optional[dict] = None, time_stall: Optional[int] = None) Alert ¶
Creates an alert in current workspace.
Before creation, the alert is loaded and stored locally in the internal list of alerts in the current instance.
- Parameters:
name – alert’s name.
description – alert’s description.
subscriptions – List of emails subscribed to the alert.
color – Color for the alert
alert_type – type of alert (update, stall). Set to ‘update’ if you want to trigger when a source updated on certain conditions. Set to ‘stall’ if you want to trigger when a source do not update for a long time.
source_id – Identifier of associated source.
condition – condition to trigger the alert.
time_stall – Time in seconds when the alert should trigger (for stall). Must be at least 60.
- Returns:
the created alert
- fetch(alert_id: Optional[str] = None, name: Optional[str] = None, force_reload: bool = False) Optional[Alert] ¶
Search for a alert in the workspace.
The first time is invoked, buidls a generator to retrieve alerts directly from deepint.net API. However, if there is stored alerts and the force_reload option is not specified, only iterates in local alerts. In other case, it request the alerts to deepint.net API and iterates over it.
Note: if no name or id is provided, the returned value is None.
- Parameters:
alert_id – alert’s id to search by.
name – alert’s name to search by.
force_reload – if set to True, alerts are reloaded before the search with the
deepint.core.workspace.WorkspaceAlerts.load
method.
- Returns:
retrieved alert if found, and in other case None.
- fetch_all(force_reload: bool = False) Generator[Alert, None, None] ¶
Retrieves all workspace’s alerts.
The first time is invoked, buidls a generator to retrieve alerts directly from deepint.net API. However, if there is stored alerts and the force_reload option is not specified, only iterates in local alerts. In other case, it request the alerts to deepint.net API and iterates over it.
- Parameters:
force_reload – if set to True, alerts are reloaded before the search with the
deepint.core.workspace.WorkspaceAlert.load
method.- Yields:
deepint.core.workspace.Alert
– The next alert returned by deeepint.net API.- Returns:
the workspace’s alerts.
- load()¶
Loads a workspace’s alerts.
If the alerts were already loaded, this ones are replace by the new ones after retrieval.
- class deepint.core.workspace.WorkspaceModels(workspace: Workspace, models: List[Model])¶
Operates over the models of a concrete workspace.
Note: This class should not be instanced, and only be used within an
deepint.core.workspace.Workspace
.- workspace¶
the workspace with which to operate with its models.
- create(name: str, description: str, model_type: ModelType, method: ModelMethod, source: Source, target_feature_name: str, configuration: Optional[dict] = None, test_split_size: float = 0.3, shuffle_test_split: bool = False, initial_model_state: float = 0, hyper_parameters: Optional[dict] = None, wait_for_model_creation: bool = True) Optional[Model] ¶
Creates an alert in current workspace.
Before creation, the alert is loaded and stored locally in the internal list of alerts in the current instance.
- Parameters:
name – model’s name.
description – model’s description.
model_type – type of model (classifier or regressor).
method – method for prediction (bayes, logistic, forest, etc.).
source – source used to train the model.
target_feature_name – the feature that will be predicted. Within the
deepint.core.model.Model
is called output_feature.configuration – advanced model configuration.
test_split_size – proportion of dataset to use for testing (between 0 and 1).
shuffle_test_split – If set to True, it suffles the instances, else it follows the given order.
initial_model_state – custom seed for rng method.
hyper_parameters – Hyper-parametter search configfuration (Advanced).
wait_for_model_creation – if set to True, before the model creation request, it waits for the model to be created (it can last several minutes). In other case, only the model creation is requested, and then None is returned.
- Returns:
the created model (if wait_for_model_creation is set to True) else None.
- fetch(model_id: Optional[str] = None, name: Optional[str] = None, force_reload: bool = False) Optional[Model] ¶
Search for a model in the workspace.
The first time is invoked, buidls a generator to retrieve models directly from deepint.net API. However, if there is stored models and the force_reload option is not specified, only iterates in local models. In other case, it request the models to deepint.net API and iterates over it.
Note: if no name or id is provided, the returned value is None.
- Parameters:
model_id – model’s id to search by.
name – model’s name to search by.
force_reload – if set to True, models are reloaded before the search with the
deepint.core.workspace.WorkspaceModels.load
method.
- Returns:
retrieved model if found, and in other case None.
- fetch_all(force_reload: bool = False) Generator[Model, None, None] ¶
Retrieves all workspace’s models.
The first time is invoked, buidls a generator to retrieve models directly from deepint.net API. However, if there is stored models and the force_reload option is not specified, only iterates in local models. In other case, it request the models to deepint.net API and iterates over it.
- Parameters:
force_reload – if set to True, models are reloaded before the search with the
deepint.core.workspace.WorkspaceModel.load
method.- Yields:
deepint.core.workspace.Model
– The next model returned by deeepint.net API.- Returns:
the workspace’s models.
- load()¶
Loads a workspace’s models.
If the models were already loaded, this ones are replace by the new ones after retrieval.
- class deepint.core.workspace.WorkspaceInfo(workspace_id: str, name: str, description: str, created: datetime, last_modified: datetime, last_access: datetime, sources_count: int, dashboards_count: int, visualizations_count: int, models_count: int, size_bytes: int)¶
Stores the information of a Deep Intelligence workspace.
- workspace_id¶
workspace’s id in format uuid4.
- created¶
Creation date.
- last_modified¶
Last modified date.
- last_access¶
Last access date.
- name¶
source’s name.
- description¶
source’s description.
- size_bytes¶
workspace size in bytes.
- sources_count¶
number of sources in the workspace.
- dashboards_count¶
number of dashboard in the workspace.
- visualizations_count¶
number of visualizations in the workspace.
- models_count¶
number of models in the workspace.
- static from_dict(obj: Any) WorkspaceInfo ¶
Builds a WorkspaceInfo with a dictionary.
- Parameters:
obj –
object
ordict
containing the a serialized WorkspaceInfo.- Returns:
WorkspaceInfo containing the information stored in the given dictionary.
- to_dict() Dict[str, Any] ¶
Builds a dictionary containing the information stored in current object.
- Returns:
dictionary containing the information stored in the current object.
- class deepint.core.workspace.WorkspaceDashboards(workspace: Workspace, dashboards: List[Dashboard])¶
Operates over the dashboards of a concrete workspace.
Note: This class should not be instanced, and only be used within an
deepint.core.workspace.Workspace
.- workspace¶
the workspace with which to operate with its dashboards.
- create(name: str, description: str, privacy: str, share_opt: str, restricted: bool, ga_id: Optional[str] = None, configuration: Dict[str, Any] = {}) Dashboard ¶
Creates a dashboard in the current workspace.
- Args
name: new dashboard’s name description: new dashboard’s description privacy: new dashboard’s privacy 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: advanced option.
- Returns:
The created dashboard
- fetch(dashboard_id: Optional[str] = None, name: Optional[str] = None, force_reload: bool = False) Optional[Dashboard] ¶
Search for a dashboard in the workspace.
The first time is invoked, builds a generator to retrieve dashboards directly from deepint.net API. However, if there is stored dashboards and the force_reload option is not specified, only iterates in local dashboards. In other case, it request the dashboards to deepint.net API and iterates over it.
Note: if no name or id is provided, the returned value is None.
- Parameters:
dashboard_id – dashboard’s id to search by.
name – dashboard’s name to search by.
force_reload – if set to True, dashboards are reloaded before the search with the
deepint.core.workspace.WorkspaceDashboards.load
method.
- Returns:
Retrieved dashboard if found, and in other case None.
- fetch_all(force_reload: bool = False) Generator[Dashboard, None, None] ¶
Retrieves all workspace’s dashboards.
The first time is invoked, builds a generator to retrieve dashboards directly from deepint.net API. However, if there is stored dashboards and the force_reload option is not specified, only iterates in local dashboards. In other case, it request the dashboards to deepint.net API and iterates over it.
- Parameters:
force_reload – if set to True, dashboards are reloaded before the search with the
deepint.core.workspace.WorkspaceDashboard.load
method.- Yields:
deepint.core.workspace.Dashboard
– The next dashboard returned by deeepint.net API.- Returns:
the workspace’s dashboards.
- load()¶
Loads a workspace’s dashboards.
If the dashboards were already loaded, this ones are replace by the new ones after retrieval.
- class deepint.core.workspace.WorkspaceVisualizations(workspace: Workspace, visualizations: List[Visualization])¶
Operates over the visualizations of a concrete workspace.
Note: This class should not be instanced, and only be used within an
deepint.core.workspace.Workspace
.- workspace¶
the workspace with which to operate with its visualizations.
- create(name: str, description: str, privacy: str, source: str, configuration: Dict[str, Any] = {}) Visualization ¶
Creates a visualization in current workspace.
- Parameters:
name – new visualization’s name.
description – new visualization’s description.
- Returns:
The created visualization
- fetch(visualization_id: Optional[str] = None, name: Optional[str] = None, force_reload: bool = False) Optional[Visualization] ¶
Search for a visualization in the workspace.
The first time is invoked, builds a generator to retrieve visualizations directly from deepint.net API. However, if there is stored visualizations and the force_reload option is not specified, only iterates in local visualizations. In other case, it request the visualizations to deepint.net API and iterates over it.
Note: if no name or id is provided, the returned value is None.
- Parameters:
visualization_id – visualization’s id to search by.
name – visualization’s name to search by.
force_reload – if set to True, visualizations are reloaded before the search with the
deepint.core.workspace.WorkspaceVisualizations.load
method.
- Returns:
retrieved visualization if found, and in other case None.
- fetch_all(force_reload: bool = False) Generator[Visualization, None, None] ¶
Retrieves all workspace’s visualizations.
The first time is invoked, builds a generator to retrieve visualizations directly from deepint.net API. However, if there is stored visualizations and the force_reload option is not specified, only iterates in local visualizations. In other case, it request the visualizations to deepint.net API and iterates over it.
- Parameters:
force_reload – if set to True, visualizations are reloaded before the search with the
deepint.core.workspace.WorkspaceVisualization.load
method.- Yields:
deepint.core.workspace.Visualization
– The next visualization returned by deeepint.net API.- Returns:
the workspace’s visualizations.
- load() None ¶
Loads a workspace’s visualizations.
If the visualizations were already loaded, this ones are replace by the new ones after retrieval.