Skip to content
Advertisement

How to automate running of Jupyter Notebook cells periodically

I want to integrate my jupyter notebook with my website, where I have written the code to fetch real-time data from MySQL server and do real-time visualisation using plotly. But every time I’m having to run all the cells of my Kernel. Is there a way I can automate the running of the Jupyter notebook cells periodically say everyday 1 hour?

Advertisement

Answer

My suggestion would be to

  • Setup a cron job with the periodicity you want.
  • Use runipy to run all the cells in the notebook. It has a lot of functionality like saving the run as html report. This will particularly be useful in your case as you want to visualise plotly plots.

I can provide the commands here, but they are pretty straight forward and can easily be followed from the links.

User contributions licensed under: CC BY-SA
9 People found this is helpful
Advertisement