Skip to content

Index

Module to interact with Analyses.

This module contains class to interact with Analyses in Apps.

PublishedAnalysis

Bases: PublishedContentNode

Analysis object to interact with analysis specific apps endpoints.

permissions class-attribute instance-attribute

permissions = Field(None, alias='permissions')

tenant_id class-attribute instance-attribute

tenant_id = Field(None, alias='tenantId')

id instance-attribute

id

Id of apps content node.

key instance-attribute

key

Key of apps content node.

name class-attribute instance-attribute

name = Field(None, alias='name')

root_node_key class-attribute instance-attribute

root_node_key = Field(None, alias='rootNodeKey')

base class-attribute instance-attribute

base = Field(None, alias='base')

asset_type class-attribute instance-attribute

asset_type = Field(None, alias='assetType')

node_type class-attribute instance-attribute

node_type = Field(None, alias='nodeType')

parent_node_key class-attribute instance-attribute

parent_node_key = Field(None, alias='parentNodeKey')

parent_node_id class-attribute instance-attribute

parent_node_id = Field(None, alias='parentNodeId')

invalid_content class-attribute instance-attribute

invalid_content = Field(None, alias='invalidContent')

serialized_content instance-attribute

serialized_content

Serialized content of content node.

serialization_type class-attribute instance-attribute

serialization_type = Field(None, alias='serializationType')

draft_id class-attribute instance-attribute

draft_id = Field(None, alias='draftId')

working_draft_id class-attribute instance-attribute

working_draft_id = Field(None, alias='workingDraftId')

activated_draft_id class-attribute instance-attribute

activated_draft_id = Field(None, alias='activatedDraftId')

show_in_viewer_mode class-attribute instance-attribute

show_in_viewer_mode = Field(None, alias='showInViewerMode')

public_available class-attribute instance-attribute

public_available = Field(None, alias='publicAvailable')

embeddable class-attribute instance-attribute

embeddable = Field(None, alias='embeddable')

root_node_id class-attribute instance-attribute

root_node_id = Field(None, alias='rootNodeId')

order class-attribute instance-attribute

order = Field(None, alias='order')

source class-attribute instance-attribute

source = Field(None, alias='source')

asset_metadata_transport class-attribute instance-attribute

asset_metadata_transport = Field(
    None, alias="assetMetadataTransport"
)

space_id instance-attribute

space_id

Id of space where content node is located.

change_date class-attribute instance-attribute

change_date = Field(None, alias='changeDate')

created_by_id class-attribute instance-attribute

created_by_id = Field(None, alias='createdById')

creation_date class-attribute instance-attribute

creation_date = Field(None, alias='creationDate')

created_by_name class-attribute instance-attribute

created_by_name = Field(None, alias='createdByName')

updated_by class-attribute instance-attribute

updated_by = Field(None, alias='updatedBy')

root class-attribute instance-attribute

root = Field(None, alias='root')

asset class-attribute instance-attribute

asset = Field(None, alias='asset')

object_id class-attribute instance-attribute

object_id = Field(None, alias='objectId')

root_with_key class-attribute instance-attribute

root_with_key = Field(None, alias='rootWithKey')

identifier class-attribute instance-attribute

identifier = Field(None, alias='identifier')

client class-attribute instance-attribute

client = Field(..., exclude=True)

from_transport classmethod

from_transport(client, content_node_transport)

Creates high-level published content node object from given ContentNodeTransport.

Parameters:

  • client (Client) –

    Client to use to make API calls for given published content node.

  • content_node_transport (ContentNodeTransport) –

    ContentNodeTransport object containing properties of published content node.

Returns:

  • PublishedContentNode

    A PublishedContentNode object with properties from transport and given client.

sync

sync()

Syncs content node properties with EMS.

get_content

get_content()

Returns content of analysis.

Returns:

Examples:

Extract table from analysis content:

sheet = analysis.get_content().draft.document.sheets[0]
olap_table = sheet.components.find("#{OLAP Table}", search_attribute="title")

resolve_query

resolve_query(query)

Returns Data Query and Query environment for an analysis.

Warning

The method analysis.resolve_query has been deprecated and will be removed in future versions. Please use SaolaPy from now on to export PQL queries:

import pycelonis.pql as pql
from pycelonis.pql.saola_connector import AnalysisSaolaConnector

df = pql.DataFrame.from_pql(query, saola_connector=AnalysisSaolaConnector(data_model, analysis))
df.head()

Use this method to resolve queries that are based on analysis KPIs and Variables. The returned DataQuery and QueryEnvironment can than be used to query data via DataModel.export_data_frame.

Parameters:

  • query (PQL) –

    PQL query to be resolved

Returns:

Examples:

Resolving a query from an analysis component to extract the data from the data model:

sheet = analysis.get_content().draft.document.sheets[0]
olap_table = sheet.components.find("#{OLAP Table}", search_attribute="title")
query = olap_table.get_query()

data_query, query_environment = analysis.resolve_query(query)
df = data_model.export_data_frame(data_query, query_environment)