analysis.py
Analysis (Node)
¶
Analysis object to interact with Celonis Studio API.
url: str
inherited
property
readonly
¶
API
/package-manager/api/nodes/{node_id}
attachment_url: str
inherited
property
readonly
¶
API
/package-manager/api/attachments
viewer_attachments: CelonisCollection[Attachment]
inherited
property
readonly
¶
Get all Attachments of the Node with mode VIEWER
.
Returns:
Type | Description |
---|---|
CelonisCollection[Attachment] |
A Collection of Attachments. |
datamodel: Datamodel
property
readonly
¶
Get the Datamodel connected to the Analysis.
creator_attachments: CelonisCollection[Attachment]
inherited
property
readonly
¶
Get all Attachments of the Node with mode CREATOR
.
Returns:
Type | Description |
---|---|
CelonisCollection[Attachment] |
A Collection of Attachments. |
attachments: CelonisCollection[Attachment]
inherited
property
readonly
¶
Get all Attachments of the Node.
Returns:
Type | Description |
---|---|
CelonisCollection[Attachment] |
A Collection of Attachments. |
name: str
inherited
property
writable
¶
Name of the object via data['name']
if available.
data
inherited
property
writable
¶
Response data from the Celonis API.
If static
is set to False
, every time you set the data
property will execute a POST
request to
the resource API endpoint to update the remote resource in Celonis EMS.
Examples:
o = celonis.<api-service>.find("<name or ID")
# This will execute a `POST` request to '<celonis_url>/<api-service>/api/...'
o.data["name"] = "New Name"
key: str
inherited
property
writable
¶
Key of the object via data['key']
if available.
draft: BaseDraftDocument
property
writable
¶
Get/Set the Base Draft Document of the Analysis. Uses Analysis.draft.
published: BasePublishedDocument
property
writable
¶
Get/Set the Base Published Document of the Analysis. Uses Analysis.published.
saved_formulas: CelonisCollection[BaseAnalysisSavedFormula]
property
readonly
¶
Get all saved formulas of the Analysis. Uses Analysis.saved_formulas.
images: CelonisCollection[BaseAnalysisImage]
property
readonly
¶
Get all images of the Analysis. Uses Analysis.images.
get_data_frame(self, pql_query, **kwargs)
¶
Exports the results of a PQL query as pyarrow.parquet.ParquetFile and converts it to a pandas.DataFrame. Uses Analysis.get_data_frame.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
pql_query |
PQL |
The table query to be executed. |
required |
kwargs |
Optional keyword arguments passed to |
{} |
Returns:
Type | Description |
---|---|
DataFrame |
Dataframe containing the results of the query. |
get_data_file(self, pql_query, file_path=None, export_type='PARQUET', variables=None)
¶
Exports the results of a PQL query as pyarrow.parquet.ParquetFile and returns the path to the exported file. Uses Analysis.get_data_file.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
pql_query |
PQL |
The table query to be executed. |
required |
file_path |
Union[str, pathlib.Path] |
The output path for the export. Defaults to |
None |
export_type |
str |
Export filetype. One of [ |
'PARQUET' |
variables |
List[Dict] |
Only needed when PQL query contains saved formulas that contain variables. |
None |
Returns:
Type | Description |
---|---|
Path |
Path to downloaded file containing the results of the query. |
create_attachment(self, name, configuration, shareable=True, mode='CREATOR')
inherited
¶
Creates a new Attachment in the Node.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
name |
str |
Name of attachment |
required |
configuration |
str |
Dictionary with content of attachment |
required |
shareable |
bool |
Whether attachment is shareable or not |
True |
mode |
str |
Attachment mode. One of [ |
'CREATOR' |
Returns:
Type | Description |
---|---|
Attachment |
The newly created Attachment. |
reset_state(self)
inherited
¶
Resets data = None
.
This will force a reload of the remote resource from Celonis EMS on the next property access.
delete(self)
inherited
¶
Executes a DELETE
request to the resource API endpoint to delete the remote resource in Celonis EMS.
create_saved_formula(self, name, description='', template='', parameters=None, **kwargs)
¶
Creates a new Saved Formula. Uses Analysis.create_saved_formula.