Skip to main content
Question

Using Python to Update Values in a Knowledge Model

  • October 5, 2023
  • 6 replies
  • 19 views

matt.witty13
Level 10

I'm looking for an easy way to import previously used KPIs, Variables, etc. from analyses and importing them into Knowledge Models.

 

I remember there was a way to do it in PyCelonis 1.7.6 but I seem to have lost the post where I previously asked the question and I cannot find the script I used as well.

 

The idea would be to make it much easier to create knowledge models without having to manually input all the data points. If there's a catalog/repository of all the formulas/variables/etc, should be able to mass insert them into a knowledge model.

6 replies

Hi Matt, thank you for reaching out! Please find bellow the documentation regarding "Pulling Data from a Knowledge Model" https://celonis.github.io/pycelonis/2.4.0/tutorials/executed/03_studio/03_Pulling_Data_From_Knowledge_Model/ Best regards, Rrezarta

matt.witty13
Level 10
  • Author
  • Level 10
  • October 13, 2023

Hi Rrezarta,

 

I'm not looking to pull values from Knowledge Models. I'm looking to insert them into a knowledge model from Python.


  • Celonaut
  • October 30, 2023

Hi Matt, 

 

Thank you for the clarification. 

 

In order to achieve this result, please review the example code (attached) that uses the latest PyCelonis 2.x version.

 


matt.witty13
Level 10
  • Author
  • Level 10
  • October 30, 2023

Oh interesting! Didn't realize YAML had its own Python package. That's good to know. Is there anything on the PyCelonis github/documentation with how PyCelonis can talk to the YAML package?


  • Celonaut
  • October 30, 2023

Could you please clarify the proccess or end result? We are specifically unsure what you mean by "talk to the YAML package"?

 

If you are asking for the various functions and objects you can use within PyCelonis to interact with a package, please reference this link: https://celonis.github.io/pycelonis/2.5.0/reference/pycelonis/ems/studio/content_node/package/#pycelonis.ems.studio.content_node.package.Package.serialized_content


matt.witty13
Level 10
  • Author
  • Level 10
  • October 30, 2023

Could you please clarify the proccess or end result? We are specifically unsure what you mean by "talk to the YAML package"?

 

If you are asking for the various functions and objects you can use within PyCelonis to interact with a package, please reference this link: https://celonis.github.io/pycelonis/2.5.0/reference/pycelonis/ems/studio/content_node/package/#pycelonis.ems.studio.content_node.package.Package.serialized_content

For example, in the script you sent me, you use the YAML Python Package to dump a YAML dictionary into the data model.

 

Are there other examples of the YAML Python Package's functions and how they behave with PyCelonis? I understand a lot of what Studio is designed with is YAML so I was curious if there were other YAML Python Package applications to Celonis outside of the one you sent me.