nb-nebi-kernels
A custom Jupyter KernelSpecManager that automatically discovers local and remote Nebi-tracked Pixi workspaces and exposes each environment as a Jupyter kernel.
How it works
- Discovers locally-tracked workspaces via
nebi workspace list --json. - Optionally discovers additional local workspaces from configured roots.
- Optionally discovers remote workspaces from the Nebi API using
NEBI_REMOTE_URLandNEBI_AUTH_TOKEN. - Enumerates environments per workspace (
pixi info --jsonfor local workspaces, remotepixi.tomlparsing for remote-only workspaces). - Classifies each kernel into a structured state (
ready,outdated,remote-not-pulled,local-not-installed,local-missing-deps). - Launches each installed kernelspec's own command via
pixi run --frozenwith environment isolation.
Installation
pip install nb-nebi-kernels
That's it — the kernel spec manager is automatically configured when installed into your JupyterLab environment.
Prerequisites
- Nebi CLI on your PATH
- Pixi on your PATH
- At least one tracked nebi workspace (
nebi initin a pixi project) - For remote discovery:
NEBI_REMOTE_URLandNEBI_AUTH_TOKEN
Usage
Once installed, any nebi-tracked pixi workspace appears as a kernel in JupyterLab or Notebook:
- A workspace
data-sciencewith environmentsdefaultandgpushows as two kernels: data-science (default) and data-science (gpu) - A workspace
web-appwith only the default environment shows as just web-app - A remote-only workspace can still appear as a kernel (state:
remote-not-pulled) before it is pulled locally - Python, R, Julia, xeus, and other kernels work generically through their installed
kernel.json. - If one pixi environment contains multiple kernelspecs, the primary keeps the existing kernel name and additional kernels get deterministic suffixes.
If discovery returns no workspaces, Jupyter falls back to its default kernels. If workspaces are discovered but local tools/dependencies are missing, kernels are surfaced as non-ready instead of crashing.
Configuration
Optional behavior can be configured through environment variables and traitlets.
Environment variables
NEBI_REMOTE_URL: Base Nebi server URL used for remote workspace discovery.NEBI_AUTH_TOKEN: Bearer token used for Nebi API requests.NEBI_WORKSPACE_DISCOVERY_PATHS: Extra local workspace roots, separated by the OS path separator (:on Linux/macOS,;on Windows).
Traitlets
# Example in jupyter_server_config.py
c.NebiKernelSpecManager.workspace_discovery_roots = ["/mnt/shared/nebi-workspaces"]
c.NebiKernelSpecManager.required_launch_dependencies = ["optional-extra-package"]
workspace_discovery_rootsadds local discovery roots (in addition tonebi workspace listresults).required_launch_dependenciesoptionally adds package checks beyond the installed Jupyter kernelspec. Default:[].
Kernel states and metadata
Each generated kernelspec includes state metadata for UI consumers.
nebi_state |
Meaning | Launch |
|---|---|---|
ready |
Local workspace/env is installed and dependencies are satisfied. | Allowed |
outdated |
Local and remote versions differ. | Allowed |
remote-not-pulled |
Workspace exists remotely but has no local path yet. | Blocked |
local-not-installed |
Local environment is not installed/materialized. | Blocked |
local-missing-deps |
Local environment is missing required dependencies or a Jupyter kernelspec. | Blocked |
Important metadata fields:
nebi_state,nebi_not_ready_reason,nebi_missing_dependenciesnebi_local_version,nebi_remote_version,nebi_outdatednebi_discovery_hash,nebi_discovered_at
Stable nebi_not_ready_reason values include:
workspace-not-pulledmissing-dependencieskernel-not-installedlocal-version-behind-remoteenvironment-not-installedworkspace-missingmanifest-missingpixi-missingpixi-timeoutpixi-list-failedpixi-json-parse-failed
Development
# Install dev dependencies
pixi install -e dev
# Run tests
pixi run test
# Run tests with coverage
pixi run test-cov
# Run linting
pixi run lint
# Format code
pixi run format
# Run type checking
pixi run typecheck
Architecture
src/nb_nebi_kernels/
├── __init__.py # Exports NebiKernelSpecManager
├── discovery.py # Local/remote workspace discovery + environment probing
├── launcher.py # Kernel launcher with state-aware launch blocking
└── manager.py # KernelSpecManager subclass (core logic)
- discovery.py — Parses local
nebi workspace list --json, optionally discovers remote workspaces through the Nebi API, resolves environment names, and probes local env install/dependency health. - launcher.py — Clears
PIXI_*environment variables, blocks non-launchable states with actionable stderr messages, then execspixi runin the workspace directory. - manager.py — Subclasses
KernelSpecManager, merges local and remote workspace views, classifies per-kernel state, and emits structured kernelspec metadata.
License
Apache License 2.0
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file nb_nebi_kernels-0.3.tar.gz.
File metadata
- Download URL: nb_nebi_kernels-0.3.tar.gz
- Upload date:
- Size: 71.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
10da3801ce6dea72a094b412361ecfa4211fd2ff5865c25035d08446c1437f2d
|
|
| MD5 |
6709f370e08e834e5c1b48ff666a477e
|
|
| BLAKE2b-256 |
d6120f7e5faf79edfc70e97896bb9ec1b2cedac98203abe58ac8869482a74c88
|
Provenance
The following attestation bundles were made for nb_nebi_kernels-0.3.tar.gz:
Publisher:
release.yaml on nebari-dev/nb-nebi-kernels
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
nb_nebi_kernels-0.3.tar.gz -
Subject digest:
10da3801ce6dea72a094b412361ecfa4211fd2ff5865c25035d08446c1437f2d - Sigstore transparency entry: 2279731051
- Sigstore integration time:
-
Permalink:
nebari-dev/nb-nebi-kernels@3c2b8ed6d3a92079c10517f90170024b2c86b801 -
Branch / Tag:
refs/tags/v0.3 - Owner: https://github.com/nebari-dev
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yaml@3c2b8ed6d3a92079c10517f90170024b2c86b801 -
Trigger Event:
release
-
Statement type:
File details
Details for the file nb_nebi_kernels-0.3-py3-none-any.whl.
File metadata
- Download URL: nb_nebi_kernels-0.3-py3-none-any.whl
- Upload date:
- Size: 22.6 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
82b23f508b175b1112706f8d56e351c6fb79a590c8dbc49963ed7b8bc8fa99b7
|
|
| MD5 |
fd57f8cdc9f1267cbb6c85554133784c
|
|
| BLAKE2b-256 |
3252e28dd251332de04e3817f3abfc7202e4c3c6b669c6258ae258fcd9ccb27a
|
Provenance
The following attestation bundles were made for nb_nebi_kernels-0.3-py3-none-any.whl:
Publisher:
release.yaml on nebari-dev/nb-nebi-kernels
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
nb_nebi_kernels-0.3-py3-none-any.whl -
Subject digest:
82b23f508b175b1112706f8d56e351c6fb79a590c8dbc49963ed7b8bc8fa99b7 - Sigstore transparency entry: 2279731068
- Sigstore integration time:
-
Permalink:
nebari-dev/nb-nebi-kernels@3c2b8ed6d3a92079c10517f90170024b2c86b801 -
Branch / Tag:
refs/tags/v0.3 - Owner: https://github.com/nebari-dev
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yaml@3c2b8ed6d3a92079c10517f90170024b2c86b801 -
Trigger Event:
release
-
Statement type: