how to run a python jupyter notebook daily automatically

后端 未结 7 896
无人共我
无人共我 2020-12-14 08:35

I have a code in a python jupyter notebook but i need to run this every day so I would like to know if there\'s a way to set this, I really appreciate it

7条回答
  •  天命终不由人
    2020-12-14 09:05

    Executing Jupyter notebooks with parameters is conveniently done with Papermill. I also find convenient to share/version control the notebook either as a Markdown file or a Python script with Jupytext. Then I convert the notebook to an HTML file with nbconvert. Typically my workflow looks like this:

    cat world_facts.md \
    | jupytext --from md --to ipynb --set-kernel - \
    | papermill -p year 2017 \
    | jupyter nbconvert --no-input --stdin --output world_facts_2017_report.html
    

    Learn more about the above, including how to specify the Python environment in which the notebook is expected to run, and how to use continuous integration on notebooks, have a look at my article Automated reports with Jupyter Notebooks (using Jupytext and Papermill) which you can read either on Medium, GitHub, or on Binder. Use the Binder link if you want to test interactively the outcome of the commands in the article.

提交回复
热议问题