Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/vericast/kernda
Add conda activation to an IPython kernel spec
https://github.com/vericast/kernda
conda ipython jupyter kernel team-platform
Last synced: 3 months ago
JSON representation
Add conda activation to an IPython kernel spec
- Host: GitHub
- URL: https://github.com/vericast/kernda
- Owner: vericast
- License: bsd-3-clause
- Created: 2016-10-15T04:10:42.000Z (about 8 years ago)
- Default Branch: master
- Last Pushed: 2019-03-12T00:05:02.000Z (almost 6 years ago)
- Last Synced: 2024-09-28T18:40:57.690Z (3 months ago)
- Topics: conda, ipython, jupyter, kernel, team-platform
- Language: Python
- Homepage:
- Size: 58.6 KB
- Stars: 10
- Watchers: 5
- Forks: 4
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# kernda
[![Project Status: Active – The project has reached a stable, usable state and is being actively developed.](https://www.repostatus.org/badges/latest/active.svg)](https://www.repostatus.org/#active)
[![Build Status](https://travis-ci.org/Valassis-Digital-Media/kernda.svg?branch=master)](https://travis-ci.org/Valassis-Digital-Media/kernda)
[![PyPI version](https://badge.fury.io/py/kernda.svg)](https://badge.fury.io/py/kernda)
[![codecov](https://codecov.io/gh/maxpoint/Valassis-Digital-Media/branch/master/graph/badge.svg)](https://codecov.io/gh/Valassis-Digital-Media/kernda)Updates an IPython or IRKernel kernel spec (i.e., kernel.json file) to activate a conda environment before launching the kernel process.
## Requirements
* bash (i.e., does not yet work for kernels on Windows)
## Install
`pip install kernda`
## Usage
```
usage: kernda [-h] [--display-name DISPLAY_NAME] [--overwrite]
[--env-dir ENV_DIR]
kernel.jsonpositional arguments:
kernel.json Path to a kernel specoptional arguments:
-h, --help show this help message and exit
--display-name DISPLAY_NAME
New display name for the kernel (default: keep the
original)
--overwrite, -o Overwrite the existing kernel spec (default: False,
print to stdout
--env-dir ENV_DIR Path to the conda environment that should activate
(default: prefix path to the kernel in the existing
kernel spec file)
```### Examples
```
# modify the kernel spec in place so that it activates the conda
# environment containing the kernel binary
kernda ~/.local/share/jupyter/kernels/my_kernel/kernel.json -o# print the modified kernel spec to stdout and redirect it
# to a new file
kernda /usr/local/share/jupyter/kernels/my_kernel/kernel.json > other_kernel.json# modify the kernel spec in place so that it activates the
# specified conda environment
kernda ~/some_kernel.json -o --env-dir ~/envs/my_env
```