如何定期自动运行Jupyter Notebook单元 [英] How to automate running of Jupyter Notebook cells periodically

查看:463
本文介绍了如何定期自动运行Jupyter Notebook单元的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想将jupyter笔记本与我的网站集成在一起,在这里我编写了代码以从 MySQL 服务器获取实时数据,并使用密谋。但是每次我必须运行内核的所有单元时。我有办法自动执行定期说每天1小时的Jupyter笔记本单元的运行吗?

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?

推荐答案

我的建议是


  • 设置具有所需周期的cron作业。

  • 使用运行
    以运行笔记本中的所有单元格。它具有很多功能
    ,例如将运行另存为html报告。当您要可视化绘图时,这对于您的情况特别有用。

  • 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.

这篇关于如何定期自动运行Jupyter Notebook单元的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆