如何每天自动运行带有 Python 代码的 Jupyter Notebook? [英] How to run a Jupyter notebook with Python code automatically on a daily basis?

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

问题描述

我在 Jupyter notebook 中有一些 Python 代码,我需要每天自动运行它,所以我想知道是否有办法设置它.我非常感谢您对此的任何建议.

解决方案

如果想要更高的质量,最好结合气流.我将它们打包在一个 docker 镜像中,https://github.com/michaelchanwahyan/datalab.>

它是通过修改一个开源包nbparameterize并集成execution_date等传递参数来完成的.可以动态生成图表 输出可以更新并保存在笔记本内.

什么时候执行

  • 将读取笔记本并注入参数
  • 笔记本被执行,输出将覆盖原始路径

此外还安装配置了spark、keras、tensorflow等常用工具

I have some Python code in a Jupyter notebook and I need to run it automatically every day, so I would like to know if there is a way to set this up. I really appreciate any advice on this.

解决方案

It's better to combine with airflow if you want to have higher quality. I packaged them in a docker image, https://github.com/michaelchanwahyan/datalab.

It is done by modifing an open source package nbparameterize and integrating the passing arguments such as execution_date. Graph can be generated on the fly The output can be updated and saved within inside the notebook.

When it is executed

  • the notebook will be read and inject the parameters
  • the notebook is executed and the output will overwrite the original path

Besides, it also installed and configured common tools such as spark, keras, tensorflow, etc.

这篇关于如何每天自动运行带有 Python 代码的 Jupyter Notebook?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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