Skip to content

Install jupyter kernels for different languages in the user space

License

Notifications You must be signed in to change notification settings

FREVA-CLINT/install-kernelspec

Repository files navigation

Install Kernel Specifications into userspace

PyPI version Pipeline codecov BSD

This code installs jupyter kernels for different languages into the user space. Once the kernel has been installed it can be used on the jupyter-hub server of DKRZ.

Installation

python3 -m pip install jupyter-kernel-install

Usage

Using the command line interface (cli):

jupyter-kernel-install --help
Usage: jupyter-kernel-install [-h] [--name NAME] [--display-name DISPLAY_NAME] [--version] language

Install jupyter kernel specs of different languages.

Positional Arguments:
  language              The programming language

Options:
  -h, --help            show this help message and exit
  --name, -n NAME       The name of the kernel (default: None)
  --display-name, -d DISPLAY_NAME
                        The display name of the kernel (default: None)
  --version, -V         Display version and exit

Alternatively you can use:

python -m jupyter_kernel_install --help

The following kernel specifications are supported:

  • python3
  • gnuR
  • bash

Example for installing a gnuR kernel:

jupyter-kernel-install r --name r-regiklim --display-name "R for Regiklim"

Using the python library

Example for programmatically installing a bash kernel:

import jupyter_kernel_install as ki
kernel_path = ki.bash(name="bash-regiklim", display_name="bash kernel")

Contributing

Any contributions are welcome. To start developing we recommend creating a new mini conda environment.

conda env create -f environment.yml; conda activate install-kernelspec

Unit tests, building the documentation, type annotations and code style tests are done with tox. To run all tests, linting in parallel simply execute the following command:

tox -p 3

You can also run the each part alone, for example to only check the code style:

tox -e lint

available options are lint, types and test.

Tox runs in a separate python environment to run the tests in the current environment use:

pytest

About

Install jupyter kernels for different languages in the user space

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages