简体   繁体   中英

Jupyter notebook schedule automatically

Does anybody knows how to schedule a jupyter notebook every hour or 30 minutes?

I tried to use seekwell ( https://app.seekwell.io/ ) but it did not work for me.

Does anybody have another solution

thanks,

Save your jupyter notebook as.py file

I would like to give credit to @Vincent Stevenson

Go to Control Panel --> Administrative Tools --> Task Scheduler--> Create Task

  1. Task Scheduler, Create Task

  2. Give the Task a title

  3. Go to Actions

  4. Go to CMD to find the path,

    Python, import sys, sys.executable

    (this tells you what the Program/script field should be populated with: "some path with Appdata mostly")

    like:C:\Users\admin\AppData\Local\Programs\Python\Python38-32\python.exe

  5. Arguments : name of the python script (like run.py)

  6. Start in : dir location of python script (like:C:\Users\admin\Documents\my_python_project)

  7. Go to Triggers, schedule for every 30 minutes

  8. Test the script by running it

If you are Linux user, then simply create a python script and add it to your crontab to run every few hours.

If you are windows, then also you need to create python script and instead of crontab use scheduled tasks:

Setting up a cron job in Windows

If you want, you can use [Deepnote] ( http://deepnote.com/ ). You can run your Jupyter notebooks using the free cloud platform Deepnote. You can simply set Deepnote to run at a given interval and close the window. This will ensure that no added actions are needed for you to execute the notebook at the given time.

Furthermore, you can select to be notified by email if your notebook stops working in Deepnote.

You can use the Mercury framework for scheduling. You need to add the YAML header in the notebook, below is the example:

title: My notebook
description: My notebook executed automatically
schedule: '0 * * * *'
notify:
    on_success: email1@example.com
    attachment: pdf

What is more, you can set list of emails that will receive the notebook in PDF format by email after successful execution. Here is a notebook scheduling documentation .

Below is the example of notebook scheduled in the Mercury . You can see that there is a green box in the sidebar with information about scheduling. The notebook can be also easily accessed as a web app and downloaded as PDF.

计划的笔记本网络应用程序

You can read more about scheduling notebooks to make automated PDF reports and making dashboards in Python with automatic updates on MLJAR blog.

You can use www.nbfire.io to schedule your notebook in the cloud - just follow the documentation at www.nbfire.io/documentation

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM