Minimal notebook launcher

2019

If you use Jupyter notebooks a lot, you are right to be annoyed with the poor support for running multiple notebooks at the same time. Often times, if you're working on different projects, you'll be running a bunch of notebooks in different terminal sessions, because it's just more convenient to go jupyter notebook mynotebook.ipynb for every launch, than navigating the Jupyter file explorer.

Github user takluyver offers a solution for this called nbopen. It's a small program that you install on your computer, and then you launch notebooks like nbopen mynotebook.ipynb. The program then looks for the nearest running notebook server and opens the notebook on that instance. Unfortunately, maintainance for this stopped about two years ago, and the number of issues keeps growing. nbopen broke on my computer last time I upgraded my OS, so I set about creating my own solution to the problem of overflowing notebook servers.

Here is my solution.

It's not a program, it's actually just a bash script. It runs out of the box on OSX but needs a small modification (descriped in repo) to run on Linux. Windows is not supported (because it's a bash script). Since it is so minimal, you may have to change the default port or default server directory, but once it works it works. It functions like the original nbopen. Launch a notebook like nbopen mynotebook.ipynb and it looks for a running instance to attach the notebook to. If it doesn't find one it creates one.

The thing that makes it minimal is that it really is just a bash script that you reference by alias. The notebook server address is hardcoded to be / (easily changed) and so is the port (8888).