Run .ipynb programmatically

We use Enterprise Gateway with Jupyterlab in our setup. There is a use case, wherein we want to run .ipynb against the jupyter server programmatically (via an api or any other way). I came across papermill doing exactly the same, but its not an jupyterlab extension and also it doesnt support Enterprise gateway.
Whats the best way to achieve this functionality? Not sure if such a functionality can be achieved via an extension? Any help is greatly appreciated.


Is this a viable approach?

You can write an extension that will run all the cells in a notebook. Is that what you are looking for?

Here is an example of iterating over cells and running them: etc-jupyterlab-cell-iterate-run/index.ts at cfa483b168c04ce3f10e0b8d0f7d1ced7074048b · educational-technology-collective/etc-jupyterlab-cell-iterate-run · GitHub

The functions in the NotebookActions namespace may also be relevant: NotebookActions | @jupyterlab

1 Like

Thanks a lot @adpatter for your reply. I looked at nbcovert, but wasnt sure how it works with enterprise gateway, but got some good leads from gitter chat, let me explore more.

1 Like


I was able to run this using nbclient here

1 Like