Notebook api's

hmjk347
Level 2
Notebook api's

i want to know what api's are present related to the notebook present in out project. an example is how do we read a notebook content and then pass it to a bokeh webapp to take that as input which can execute the cells in the notebook and then finally want to use the output of last cell to show as output in webapp.

i was trying to do this , but was not able to find the correct api's related to notebooks. 

it would also be helpful if we can know the reference where i can find all possible api's.

0 Kudos
3 Replies
SarinaS
Dataiker

Hi @hmjk347,

What is outputted in the last cell of the notebook? Depending on what it is (i.e. a chart, a dataset etc.) your approach will vary. 

Assuming that your final cell outputs data, from your description, I think what you probably want to do is: 
(1) Convert your notebook into a Python recipe 
(2) Create a scenario that builds your flow (i.e. the output dataset of your Python recipe) 
(3) From your Bokeh webapp, trigger your scenario using the scenario API
(4) Once the dataset is built, retrieve the dataset using the dataset API, and display it in your webapp.  

If you provide more details about what you are actually generating at the end of your notebook and what your notebook does, that can help us provide more detailed advice. 

Thanks,
Sarina

0 Kudos
hmjk347
Level 2
Author

Hi Sarina,

 

thanks a lot for your reply and suggestions. Just so you know , the output of final cell of our notebook is a dataframe . So we would like to know more about
1) how do we run a python notebook recipe via api's or visual flow. Also this notebook has some variables which we need to enter through webapp , do you know a way to get this done as well.
2) how to get the output of final cell of our notebook to be displayed on a webapp. I know that the final cell output could be saved in a dataset but then how do we get this dataset to be displayed in a webapp.

so we need to execute above two steps in a webapp so that it looks automated.

As we are new , so these questions might be silly but needed help to get this done.

0 Kudos
SarinaS
Dataiker

Hi @hmjk347,

Thank you for the details! 

Since your end result is a dataframe, using the approach I referenced should work well.  

I created a demo project that you can import into your DSS as an example, and here's a recording of what it does. I hope this is helpful in getting you started. 

One other option that you may want to consider is using Dataiku Applications, as this is another way to allow users to enter in variables and retrieve an output dataset without requiring building a webapp.

I hope that information is helpful, let me know if you have any questions. 

Thanks,
Sarina 

0 Kudos