简体   繁体   中英

Automatically running a Jupyter notebook

I have a Jupyter notebook that scrapes web data and saves a dataframe to a csv. I would like to run this every day automatically. I am using a mac for this project.

I have looked around a lot (including here: how to run a python jupyter notebook daily automatically ), but as of yet I have not found a clear enough answer. I am quite new to all this, so I am looking for a step-by-step: like how you'd explain it to someone with no knowledge on cron etc.

Any advice would be much appreciated! Thank you!

Why don't you just convert the jupyter notebook into a raw python file? You can use this command: jupyter nbconvert --to script "[YOUR_NOTEBOOK].ipynb" (replace [YOUR_NOTEBOOK] with your notebook name)

EDIT: You could also use Juptext , as pointed out by @Wayne in the comments below.

If you need a jupyter notebook:

  1. Use datalab or papermill
  2. Use the SeekWall Chrome Extenstion
  3. Create a custom python script to launch jupyter notebook, and run that python script using the Automator app in your Mac

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