Skip to main content

DataLab-Kernel

license pypi version PyPI status PyPI pyversions Documentation (stable) Documentation (latest) Quick Start Advanced Showcase

A standalone Xeus-Python-based Jupyter kernel providing seamless, reproducible access to DataLab workspaces, with optional live synchronization to the DataLab GUI.


Overview

DataLab-Kernel is a custom Jupyter kernel designed to bridge DataLab and the Jupyter ecosystem. It is built on top of Xeus-Python, a lightweight and efficient Python kernel for Jupyter that offers improved performance, native debugger support, and excellent Qt event loop integration.

Thanks to Xeus-Python's architecture, DataLab-Kernel runs seamlessly in both:

  • Native Jupyter environments (JupyterLab, Jupyter Notebook, VS Code)
  • JupyterLite (browser-based Jupyter, no server required)

This enables scientists and engineers to:

  • run reproducible analyses in Jupyter notebooks,
  • interact transparently with DataLab’s internal workspace when DataLab is running,
  • share notebooks that can be replayed with or without DataLab,
  • combine narrative, code, and results without sacrificing interactive visualization.

DataLab-Kernel is not a replacement for DataLab’s GUI. It is a complementary execution layer that turns DataLab into a hybrid scientific platform: GUI-driven when needed, notebook-driven when appropriate.


Try it Online

Experience DataLab-Kernel instantly in your browser — no installation required!

Quick Start Introduction to Workspace, Plotter, and basic Sigima processing
Advanced Showcase Advanced plotting, signal/image processing, ROI, and analysis

Click a badge to open the notebook in a live JupyterLite environment powered by notebook.link. This service, developed by QuantStack, enables sharing and running Jupyter notebooks directly in the browser with zero setup.


Documentation

📖 Full documentation is available at: 👉 https://datalab-kernel.readthedocs.io/

Want to use DataLab-Kernel inside DataLab with GUI tools? Check out the full platform: DataLab


Key Features

  • Single, stable user API

    • workspace for data access and persistence
    • plotter for visualization (Plotly interactive or Matplotlib static)
    • sigima for scientific processing
  • Two execution modes, one notebook

    • Live mode: automatic synchronization with a running DataLab instance
    • Standalone mode: notebook-only execution, fully reproducible
  • Reproducibility by design

    • Analyses can be saved and reloaded using .h5 files
    • Notebooks run unchanged across environments
  • Smart visualization backend

    • Plotly (interactive) preferred when installed, Matplotlib (static) fallback
    • Switch backends at runtime with plotter.set_backend("matplotlib")
    • Override via DATALAB_PLOTTER_BACKEND environment variable
  • Performance-aware

    • Optimized data handling when DataLab is attached
    • No unnecessary serialization for large datasets
  • Decoupled architecture

    • Installable independently of DataLab
    • DataLab is a privileged host, not a requirement

Typical Usage

img = workspace.get("i042")
filtered = sigima.proc.image.butterworth(img, cut_off=0.2)
workspace.add("filtered_i042", filtered)
plotter.plot("filtered_i042")  # interactive Plotly figure (or static PNG)

Depending on the execution context:

  • the result appears inline in the notebook,
  • and, if DataLab is running, it also appears automatically in the DataLab GUI, with views and metadata kept in sync.

Execution Modes

Live Mode (DataLab-attached)

  • DataLab launches a Jupyter server and starts kernel-datalab.
  • The kernel detects DataLab at runtime.
  • Workspace operations and visualizations are synchronized with the GUI.

Connection is automatic via auto-discovery: DataLab-Kernel finds running DataLab instances via a connection file written by DataLab, or by probing the well-known port (18080).

No environment variables or manual configuration needed — just start DataLab with the Web API enabled and load the kernel extension.

Standalone Mode (Notebook-only)

  • The kernel is used like any standard Jupyter kernel.
  • No DataLab installation or GUI is required.
  • Data are managed locally and persisted to .h5 files.

The same notebook runs unchanged in both modes.


Installation

Standalone usage (desktop Jupyter)

pip install datalab-kernel[cli] sigima
python -m datalab_kernel install
jupyter lab

Then select DataLab Kernel from the kernel list.

JupyterLite

DataLab-Kernel is compatible with JupyterLite (browser-based Jupyter). In this environment, kernels are bundled at build time, so you load DataLab-Kernel as an IPython extension instead.

1. Add to your environment.yml:

Compiled packages come from emscripten-forge, while Sigima and DataLab-Kernel are installed from PyPI: the conda-forge Sigima package requires imagecodecs, which is not available for WebAssembly.

name: xeus-python-kernel
channels:
  - https://prefix.dev/emscripten-forge-4x
  - https://prefix.dev/conda-forge
dependencies:
  - xeus-python
  - numpy
  - scipy
  - scikit-image
  - pandas <3.1
  - pywavelets
  - h5py
  - matplotlib-base
  - guidata >=3.17
  - httpx
  - makefun
  - packaging
  - pip:
      - sigima
      - datalab-kernel

The pure-Python dependencies are also listed because some tools, such as jupyterlite-xeus, install pip packages without their dependencies. Version bounds follow Sigima's requirements. The .nblink/environment.yml file used by the notebook.link examples above is a tested reference.

2. Load the extension in your notebook:

%load_ext datalab_kernel

This injects the DataLab namespace (workspace, plotter, sigima, etc.) into your environment.

The [cli] extra is not needed in JupyterLite since jupyter-client depends on pyzmq, which requires native sockets unavailable in WebAssembly.

Dependencies

DataLab-Kernel uses xeus-python as its backend, which provides:

  • Improved performance compared to ipykernel
  • Native debugger support
  • JupyterLite compatibility
  • Better Qt event loop integration

The kernel requires:

  • Python 3.10 or later
  • xeus-python>=0.17.0 - The xeus-based Python kernel
  • xeus-python-shell>=0.6.0 - Python shell utilities for xeus-python
  • sigima>=1.4.0 - Scientific signal and image processing
  • numpy>=1.22, h5py>=3.0, matplotlib>=3.5

Optional dependencies (via extras):

  • [plotly] — plotly>=5.0 for interactive plots (auto-used when installed)
  • [cli] — jupyter-client>=7.0 for install/uninstall CLI commands

With DataLab

When installed alongside DataLab, the kernel is automatically available and can be launched directly from the DataLab interface.

For best compatibility, especially on Windows:

mamba create -n datalab-kernel
mamba activate datalab-kernel
mamba install xeus-python datalab-kernel -c conda-forge
python -m datalab_kernel install

Visualization Backends

DataLab-Kernel supports two plotting backends:

Backend Output Install
Plotly Interactive HTML pip install datalab-kernel[plotly]
Matplotlib Static PNG Included by default

When both are installed, Plotly is used automatically for its richer interactive experience. You can switch at any time:

# Check current backend
print(plotter.backend)  # "plotly" or "matplotlib"

# Switch at runtime
plotter.set_backend("matplotlib")
plotter.plot("my_signal")  # static PNG

plotter.set_backend("plotly")
plotter.plot("my_signal")  # interactive figure

Or set the default before starting the kernel via an environment variable:

export DATALAB_PLOTTER_BACKEND=matplotlib

Persistence and Sharing

Workspace state can be saved and reloaded:

workspace.save("analysis.h5")
workspace.load("analysis.h5")

This enables:

  • sharing notebooks and data with collaborators,
  • replaying analyses without DataLab,
  • resuming workflows inside DataLab by reopening the associated project.

Project Status

DataLab-Kernel is under active design and development.


License

This project is released under an open-source license (see LICENSE file).

Metadata

Release files for datalab-kernel 0.2.12

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for datalab-kernel 0.2.12
File Size Uploaded Provenance Actions
datalab_kernel-0.2.12.tar.gz 107.5 kB Without provenance Details for datalab_kernel-0.2.12.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for datalab-kernel 0.2.12
File Interpreter ABI Platform Actions
datalab_kernel-0.2.12-py3-none-any.whl Python 3 none any Details for datalab_kernel-0.2.12-py3-none-any.whl

Total release size: 228.8 kB

Release files / datalab_kernel-0.2.12.tar.gz

Download URL datalab_kernel-0.2.12.tar.gz
Size 107.5 kB
Tags Source
SHA-256 checksum
How to use checksums
dfcd61038d211bbef2094db16ec1a3bf060b4b2934b39b9c126b9c284b95cb6f
BLAKE2b-256 checksum
How to use checksums
cc26d41392a89a333155e1c559455bf844aa63daec03319dd17f08cffc289d5c
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.9.25

Release files / datalab_kernel-0.2.12-py3-none-any.whl

Download URL datalab_kernel-0.2.12-py3-none-any.whl
Size 121.2 kB
Tags Python 3
SHA-256 checksum
How to use checksums
ac2bd9fcd2ffa7161319d02f6ff4af60229e0c17f429930ba5266f619f66dcdc
BLAKE2b-256 checksum
How to use checksums
3e710047d4ba5059d33be17146119a62075ce00ef7dde564a4cc67ee158926bf
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.9.25

Security for datalab-kernel 0.2.12

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.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page