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
Release files for nb-nebi-kernels 0.3
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| nb_nebi_kernels-0.3.tar.gz | 71.8 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| nb_nebi_kernels-0.3-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 94.3 kB
Release files / nb_nebi_kernels-0.3.tar.gz
| Download URL | nb_nebi_kernels-0.3.tar.gz |
|---|---|
| Size | 71.8 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
10da3801ce6dea72a094b412361ecfa4211fd2ff5865c25035d08446c1437f2d
|
|
BLAKE2b-256 checksum How to use checksums |
d6120f7e5faf79edfc70e97896bb9ec1b2cedac98203abe58ac8869482a74c88
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.14
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Jul 29, 2026.
Transparency logRelease files / nb_nebi_kernels-0.3-py3-none-any.whl
| Download URL | nb_nebi_kernels-0.3-py3-none-any.whl |
|---|---|
| Size | 22.6 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
82b23f508b175b1112706f8d56e351c6fb79a590c8dbc49963ed7b8bc8fa99b7
|
|
BLAKE2b-256 checksum How to use checksums |
3252e28dd251332de04e3817f3abfc7202e4c3c6b669c6258ae258fcd9ccb27a
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.14
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Jul 29, 2026.
Transparency log