Transfer Analysis table data from Celonis to Python using CelonisConnector()

Hi All,

I am trying to connect the Python with Celonis and importing data from Celonis Analysis directly (not from datamodels).

I went through documentations of Python API but could not get any class or method to get data of Celonis analysis.

I read somewhere about CelonisConnector() but couldn’t get any PIP install link for that.

Please suggest any resource or any way to proceed further.

Best regards,
Pushpendra Sharma

Hi Pushpendra,

You need to get the component you want to export first (change the analysis ID, sheet_name and component_name accordingly):

a = Analysis(1)
sheet_name = "New App 7"
sheet = a.document.sheets.filter(lambda x: x.name == sheet_name).first()
component_name = "my component"
c = sheet.components.filter(lambda x: x.get("title") == component_name).first()

If you are using celonis_tools 1.0.0, you can directly call
df = c.get_data()

to get the dataframe for this component.

Hope that helps!

Best
David

1 Like

Hi David,

when I am trying your code to pull an OLAP table, I get following error:

AttributeError Traceback (most recent call last)
in ()
4 component_name = “Bestellpositionen”
5 c = sheet.components.filter(lambda x: x.get(“title”) == component_name).first()
----> 6 df2 = c.get_data()
7 c

AttributeError: ‘NoneType’ object has no attribute ‘get_data’

Can you maybe help me in this issue?

Kind regards,

Konstantin

Hi @konstantinle,

I also faced the same error a while ago.

It turns out that the Celonis saves the component title in a specific format as below:

component = sheet.components.filter(lambda x: x.get(“title”) == “”"#{""" + component_name + “}”).first()

Try this format and let me know the result.

Best regards,
Pushpendra Sharma