2

Our team has developed python script to process data in 10 separated but functionally related jupyter notebooks, i.e. output of notebook 1 will be used as input for notebook 2 and so on.

Our next step is to automate the data processing process. Are there any ways to sequentially invoke jupyter notebooks?

cyberwalk
  • 33
  • 4

2 Answers2

1

nbconvert allows you to run notebooks. To run a notebook and replace the existing output with the new one, you can use.

jupyter nbconvert --execute --to notebook --inplace <notebook>

For more options and different approaches, you can have a look at this You can create a script with the above commands for each notebook and this should be able to execute the notebooks in the sequential order.

Script:
jupyter nbconvert --execute --to notebook --inplace <notebook1>
jupyter nbconvert --execute --to notebook --inplace <notebook2>

Run script.
skillsmuggler
  • 1,862
  • 1
  • 11
  • 16
0

Alternative way would be to arrange file names in alphabetical order, and then in the terminal, you can use

jupyter nbconvert --inplace --execute *.ipynb

Note that, --inplace overwrites the notebook in itself (same file) after execution.

hbstha123
  • 1,260
  • 11
  • 23