I have an Jupyter notebook which generates the plots for some work. I would like to be able to run the notebook as part of a Makefile. So is there a way to instruct Jupyter to
1) Start a K=kernel
2) Open a specific notebook
3) Execute "Run All"
4) Shutdown the kernel
I imagine there will be issues with the security, but I can mark the notebook as trusted?
I have searched for help, but even getting the notebook to automatically Run All seems to be an issue.
For me, this is an important feature since once the exploratory part of work is over (for which the notebook is fantastic) it would be nice to quickly transition to the reproducible part!
Step 1: Run Jupyter Notebook from remote machine Log-in to your remote machine the usual way you do. In most cases, this is simply done via an ssh command. Once the console shows, type the following: remoteuser@remotehost: jupyter notebook --no-browser --port=XXXX # Note: Change XXXX to the port of your choice.
You can run the whole notebook in a single step by clicking on the menu Cell -> Run All. To restart the kernel (i.e. the computational engine), click on the menu Kernel -> Restart.
I think you're looking for the jupyter nbconvert
command.
Read an input notebook and produce a static HTML result:
jupyter nbconvert --to=html --ExecutePreprocessor.enabled=True notebook.ipynb
Read an input notebook and save the output back to the original:
jupyter nbconvert --to=notebook --inplace --ExecutePreprocessor.enabled=True notebook.ipynb
For more help, take a look at the help page:
jupyter nbconvert --help
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With