Auto-generate Jupyter kernels from project directories. Loosely inspired by repo2docker.
The purpose of this is project is to provide a simple CLI tool that provides a unified interface for three related tasks:
- Fetch code projects from a variety of repositories (including scientific data repositories).
- Analyze the fetched project and determine:
- What dependency ecosystem (
pypi,conda,julia...) it uses. - What version of the detected language interpreter is used.
- What dependency ecosystem (
- Create a Juypyter kernel for the project
repo2kernel is built on top of repo2docker, which powers Binder. This means any Binder project that contains any of the supported project types should also work with repo2kernel!
The following kinds of projects are currently supported:
- Python projects, with any of the following dependency files:
pyproject.toml(also for specifying the Python version)setup.pyPipfileorPipfile.lockrequirements.txtruntime.txt(for specifying the Python version, see repo2docker)
- R projects, with any of the following dependency files:
DESCRIPTIONinstall.R(see repo2docker)runtime.txt(for specifying the R version, see repo2docker)
- Julia projects, with
Project.toml condaprojects, withenvironment.yml
- if an
environment.ymlis detected in the project, then any additional R and Python dependencies (as described above) will be installed into the created conda environment.
uvto resolve Pythoncondato resolve R projects andcondaprojectsjuliaupto resolve Julia projects
These tools must be available on PATH when executing repo2kernel.
You can install this project locally, or use uvx to run it directly from github (prerequisite: install uv).
Like Binder, repo2kernel supports fetching URLs (e.g. to a git repo), and even DOIs:
uvx git+https://github.com/UtrechtUniversity/repo2kernel fetch doi:10.7910/DVN/6ZXAGT/3YRRYJ /where/to/download
uvx git+https://github.com/UtrechtUniversity/repo2kernel create /path/to/my/downloaded/project --base-env-dir /tmp/path/to/envs --env-name testproject
Then, when starting Jupyter, you should see kernels named "testproject" for each detected language (e.g. Python Kernel testproject).
If you want to create a kernel for a specific language and version without installing any additional dependencies, use the new command:
uvx git+https://github.com/UtrechtUniversity/repo2kernel new julia --version 1.11.7 --base-env-dir /tmp/path/to/envs