[PYTHON] Jupyter process management

Task

In order to access the started Jupyter with a browser, you need the port number to which the Jupyter is connected and the access token. These are described in the log output to the standard error of the Jupyter process. Since it is troublesome to find this information from the terminal or log file every time I access Jupyter, I created a command jmanager to manage them.

Installation

pip install jmanager

How to use

In the directory where you want to use jupyter

$ jmanager

To execute. At this time, if there is a jupyter server already started from the current directory, connect to it, otherwise start a new jupyter server.

How it works

Save the port token process ID in the local jupyter.pid file the first time it runs. At this time, not only simply start the jupyter server, but also create a process that waits for the server process to end, and delete the jupyter.pid file when the server process ends.

Source

https://github.com/hotoku/jmanager

Command line options

If COMMAND is omitted, run is selected.

$ jmanager --help
Usage: jmanager [OPTIONS] COMMAND [ARGS]...

Options:
  --help  Show this message and exit.

Commands:
  ignore  Print lines for .gitignore
  kill    Terminate jupyter process
  run     Launch new jupyter or connect to existing one.

Recommended Posts

Jupyter process management
Server management with Jupyter (1) import
Jupyter begins
Jupyter Tips 4
Execute a script from Jupyter to process
Jupyter nbextensions
Gaussian process
Jupyter Tips 5
Jupyter Tips 3
Jupyter Tips 2
Linux process
Jupyter installation
Jupyter tricks