Skip to main content

A guided tool for creating jupyter kernels

Project description

jupyterkernelgen

Generates a jupyter kernel from a given conda environment while ensuring that ipykernel is installed in that environment so that the kernel can be used.

It prompts the user for the necessary inputs as it goes along and will not touch existing jupyter kernels.

Installation

Pypi Installation: https://pypi.org/project/jupyterkernelgen

pip install jupyterkernelgen

How to use:

Command Line:

  • You can use the jupyterkernelgen command.
  • If environment or name is specified in the command line arguments, the user will not be prompted for the specified argument while running
  • --name, --environement, both, or neither can be specified

Examples

jupyterkernelgen --help
jupyterkernelgen
jupyterkernelgen -e ~/path/to/environment-1 -n kernel-name1
jupyterkernelgen -e ../path/to/environment-2 -n kernel-name2 -y
jupyterkernelgen -e ~/path/to/environment-3 -n kernel-name3

Arguments

Name Shortcut Type Example Description
--help -h N/A N/A Show help message.
--version -v N/A N/A The current version of jupyterkernelgen
--environment -e string /path/to/environment The path to a conda environment. May be an absolute or relative path
--name -n string kernel-name The name of the kernel to create
--yes -y N/A N/A Install necessary packages without prompt

In Python:

  • Import jupyterkernelgen and run the install() function

Examples

import jupyterkernelgen

jupyterkernelgen.install() # Install a kernel interactively
jupyterkernelgen.install(environment="/path/to/environment-1", name="kernel-name1") # Install a kernel with a specified path and name
jupyterkernelgen.install(environment="/path/to/environment-2", name="kernel-name2", yes=True) # Install a kernel without prompts

Arguments

Name Type Example Description
environment string "path/to/environment" The path to a conda environment. May be an absolute or relative path
name string "kernel-name" The name of the kernel to create
yes bool True Install necessary packages without prompt

Installing from source code

  1. Clone the repository:
git clone https://github.com/phac-nml/jupyterkernelgen.git
  1. Install the project:
cd jupyterkernelgen
pip install .
  1. Execute the program:
jupyterkernelgen [-h] [-e ENVIRONMENT] [-n NAME] [-y]

Developer Notes

Legal

Copyright Government of Canada 2023

Written by: National Microbiology Laboratory, Public Health Agency of Canada

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this work except in compliance with the License. You may obtain a copy of the License at:

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Contact

Philip Mabon: philip.mabon@phac-aspc.gc.ca

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

jupyterkernelgen-0.1.0.tar.gz (12.7 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

jupyterkernelgen-0.1.0-py3-none-any.whl (12.5 kB view details)

Uploaded Python 3

File details

Details for the file jupyterkernelgen-0.1.0.tar.gz.

File metadata

  • Download URL: jupyterkernelgen-0.1.0.tar.gz
  • Upload date:
  • Size: 12.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.10.10

File hashes

Hashes for jupyterkernelgen-0.1.0.tar.gz
Algorithm Hash digest
SHA256 212358ec97f943f77e880f3481efccece228cf6a650ac265646bcfced04d349f
MD5 89ae793bd6258176ed538facfbf5ebe9
BLAKE2b-256 b0257713bb51a8ffb472dd72116da1170a7a02e15079eae287bcb19ba215f333

See more details on using hashes here.

File details

Details for the file jupyterkernelgen-0.1.0-py3-none-any.whl.

File metadata

File hashes

Hashes for jupyterkernelgen-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 fe0145e00f06a31d3b6510850ad0fa8ba1e003af033ad6cd12bdc7b641bdce3a
MD5 75c425d4112ece3105dc8bee4e0ba23b
BLAKE2b-256 4623e21d0b546b0daf2130cd1e34ba26c3580da5dd3ebde60722de72c37a29d5

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page