package
Module to interact with Packages.
This module contains class to interact with Packages in Studio.
Typical usage example
Package ¶
Bases: ContentNode
Package object to interact with package specific studio endpoints.
publish ¶
Publishes package with given version.
Parameters:
-
version
(
typing.Optional[str]
) –Version to publish package with. Has to be of format
X.X.X
. By default gets next package version. -
node_ids_to_exclude
(
typing.Optional[typing.List[str]]
) –Nodes to exclude from publishing.
Examples:
Publish new version of package:
Publish new version of package with set version and exclude certain nodes from publishing:get_history ¶
Returns package history of all published versions.
Returns:
-
CelonisCollection[typing.Optional[PackageHistoryTransport]]
–Package history.
load_version ¶
Loads previously published package version.
Parameters:
-
version
(
str
) –Version to load.
-
root_draft_id
(
str
) –Draft id of version to load (can be found in package history).
create_variable ¶
Creates new variable for given package.
Parameters:
-
key
(
str
) –Key of variable.
-
value
(
str
) –Value to be set for variable.
-
type_
(
str
) –Type of variable, e.g. 'DATA_MODEL'.
-
**kwargs
(
typing.Any
) –Additional parameters set for VariableDefinitionWithValue object.
Returns:
-
Variable
–A variable object for newly created variable.
Examples:
Create data model variable:
get_variables ¶
Returns variables located in given package.
Parameters:
-
type_
(
typing.Optional[str]
) –If set, only variables of given type are returned.
Returns:
-
CelonisCollection[Variable]
–List of variables.
get_variable ¶
Gets variable located in package with given key.
Parameters:
-
key
(
str
) –Key of variable.
Returns:
-
Variable
–A Variable object for variable with given key.
Raises:
-
PyCelonisNotFoundError
–Raised if no variable with key exists in given package.
get_content_node ¶
Gets content node located in package with given id.
Parameters:
-
id_
(
str
) –Id of content node.
Returns:
-
ContentNode
–A ContentNode object for content node with given id.
Raises:
-
PyCelonisNotFoundError
–No content node with given id located in package
get_content_nodes ¶
Gets all content nodes of given package.
Returns:
-
CelonisCollection[ContentNode]
–A list containing all content nodes.
get_action_flow ¶
Gets action flow of given package.
Parameters:
-
id_
(
str
) –Id of action flow.
Returns:
-
ActionFlow
–Action flow with given id.
get_action_flows ¶
Gets all action flows of given package.
Returns:
-
CelonisCollection[ActionFlow]
–A list containing all action flows.
create_analysis ¶
Creates new analysis with name in given package.
Parameters:
-
name
(
str
) –Name of new analysis.
-
key
(
typing.Optional[str]
) –Key of new analysis. Defaults to name.
-
data_model_id
(
typing.Optional[str]
) –Id of data model to use.
-
change_default_event_log
(
bool
) –Whether to change default event log or not.
Returns:
-
Analysis
–An analysis object for newly created analysis.
Examples:
Create empty analysis with reference to data model:
get_analysis ¶
Gets analysis of given package.
Parameters:
-
id_
(
str
) –Id of analysis.
Returns:
-
Analysis
–Analysis with given id.
get_analyses ¶
Gets all analyses of given package.
Returns:
-
CelonisCollection[Analysis]
–A list containing all analyses.
create_folder ¶
Create new folder with name in given package.
Parameters:
-
name
(
str
) –Name of new folder.
-
key
(
typing.Optional[str]
) –Key of new folder. Defaults to name.
-
**kwargs
(
typing.Any
) –Additional parameters set for SaveContentNodeTransport object.
Returns:
-
Folder
–A Folder object for newly created folder.
Examples:
Create empty folder:
get_folder ¶
Get folder of given package.
Parameters:
-
id_
(
str
) –Id of folder.
Returns:
-
Folder
–Folder with given id.
get_folders ¶
Get all folders of given package.
Returns:
-
CelonisCollection[Folder]
–A list containing all folders.
create_knowledge_model ¶
create_knowledge_model(
content,
with_autogenerated_data_model_data=True,
with_variable_replacement=True,
)
Creates new knowledge model in given package.
Parameters:
-
content
(
typing.Dict
) –Content of new knowledge model.
-
with_autogenerated_data_model_data
(
bool
) –Defines whether automatically generated records and kpis are added.
-
with_variable_replacement
(
bool
) –Defines whether used variables are replaced automatically.
Returns:
-
KnowledgeModel
–A KnowledgeModel object for newly created knowledge model.
Examples:
Create empty knowledge model with new data model variable:
data_model_variable = package.create_variable(
key="data_model_variable",
value=data_model.id,
type_="DATA_MODEL"
)
content = {
"kind" : "BASE",
"metadata" : {"key":"knowledge_model_key", "displayName":"Test Knowledge Model"},
"dataModelId" : f"${{{{{data_model_variable.key}}}}}"
}
knowledge_model = package.create_knowledge_model(content)
get_knowledge_model ¶
Gets knowledge_model of given package.
Parameters:
-
id_
(
str
) –Id of knowledge_model.
Returns:
-
KnowledgeModel
–Knowledge model with given id.
get_knowledge_models ¶
Gets all knowledge models of given package.
Returns:
-
CelonisCollection[KnowledgeModel]
–A list containing all knowledge models.
get_simulation ¶
Gets simulation of given package.
Parameters:
-
id_
(
str
) –Id of simulation.
Returns:
-
Simulation
–Simulation with given id.
get_simulations ¶
Gets all simulations of given package.
Returns:
-
CelonisCollection[Simulation]
–A list containing all simulations.
get_skill ¶
Gets skill of given package.
Parameters:
-
id_
(
str
) –Id of skill.
Returns:
-
Skill
–Skill with given id.