Jump to content

Report using automated Topic Organiser with Seeq DataLab


Recommended Posts

My goal is to have an automated report using Topic Organiser. This report will contain two figs and one table where the user can enter their comments. Below are some requisites:

  • The Topic Organiser needs to be generated in the beginning of the year containing one document (or worksheet) named as say 'Executive View: January', based on my Organiser Template.
  • For the subsequent months, as the the Organiser is already create, I would like to keep adding document to it. The document will have the name 'Executive View' + <month_name>.
  • One picture will have the results of the KPI for the month (updated every day as a moving average) and the other picture will have the results of the same KPI in the last 3 months.

What I did so far:

  • The Topic Organiser Template is done (with just one document on it)
  • I have create another notebook scheduled to run everyday, that pulls the KPI daily results, make the month moving average, plot the results and then saves the a picture in my jupyter folder.
  • Another notebook is scheduled to run in the first day of each month. This one compiles the results of the same KPI in the last 3 months, plot them and then saves the plot as a picture in my jupyter folder.
  • I have created a third notebook to run every first of January[but after the two previous mentioned ones], which creates the Topic Organiser including the year as the prefix, for instance '2023 Site Results'. The same notebook creates one single document for January and attaches to it the previously saved figures.

Where I am stuck:

  • For the subsequent months, I would like to use the same template, grab the document template and add it as a new document in my already created Topic Organiser, keeping the previous months intact. I could not figure out how to make this yet?

 

How would you recommend to achieve this? Am I in the right path or would you suggest a different way?

Link to comment
Share on other sites

  • Seeq Team

Hi Manoel, 

You can add one step to create a new document to the Organizer Topic you already created. Then, follow the steps suggested by Kristopher and Emilio here to set up the html of the new document. 

#Search for topic
topic_search=spy.workbooks.search({'ID':'your_organizer_topic_id'})

#Pull the topic associated with that ID
topic=spy.workbooks.pull(topic_search)

#Add a new document/page to the topic object
page = topic.document('February 2023')

#Follow the steps suggested by Kristopher and Emilio

 

Link to comment
Share on other sites

Hi @Kin How thank you very much for your help,

The way you suggested I would add a blank document to the already created topic and would have handle the html content to add figures and etc... Instead of this, I was thinking to do it using my template that I've created, grabbing just the document template instead of the entire topic template, so I could handle more elegantly the content content that needs to be add (figures, tables, etc..) as parameters.

If possible, could you please provide me with the steps of how to achieve that?

Edited by Manoel Janio Borralho dos Santos
Link to comment
Share on other sites

  • Seeq Team

Hi Manoel, 

You can refer to this article for instructions on grabbing just the document template. However, pushing the document template to an existing organizer topic is currently not supported in Seeq Data Lab. To generate your report, I suggest adding a blank document to the topic and handle the HTML content. If the Python code is well-structured, spy.jobs will create the report based on your schedule. Let me know if you need help setting up the HTML content.

Link to comment
Share on other sites

I was able to use the template by using the 'copy' function as below. So grabbed the document template (as described in the article you've shared above), made a copy of it and assigned to a new document.

new_document_name = 'Executive View: September'
new_document = template_document.copy(label=new_document_name)
new_document.name = new_document_name

Then defined the parameters:

new_document.parameters = {
    "month": 'September',
    "[Image]My Visualization 1": 'fig1.png',
    "[Image]My Visualization 2": 'fig2.png',
    "First App Impact": None,
    "First App": None
}

Appended it to my existing topic:

topic.documents.append(new_document)

 

And finally, pushed my topic back to seeq:

spy.workbooks.push(topic)

  • Like 1
  • Thanks 1
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...