JupyterCon 2023

Thebe - add Jupyter-based interactive computing to modern websites
05-10, 14:30–15:00 (Europe/Paris), Louis Armand 2

thebe let's you easily add interactive visualisations, reproducible figures and interactive code editors to any publication on the web -- backed by a kernel from a Jupyter server or an in-browser WASM kernel with thebe-lite.

It’s a compact and versatile tool that is easy to add to any static HTML page where, by default code blocks are turned into editors and made ready for execution, just by adding a couple of additional script tags. So in contrast to nbconvert or nbviewer, thebe enables the interleaving of Jupyter input cells and output areas with other content (e.g. from myst markdown files) in flexible ways while maintaining the ability to run the underlying notebooks or individual code cells. This enables rich reading experiences that no longer have to be linear in flow or look anything like a notebook.

Over the last year, thebe has seen major upgrades making it more flexible and usable in different web contexts. Whilst keeping the original “drop it on the page” mode of operation for static websites, it has been refactored to be less opinionated, allow for more control over the UI and provide a simplified API for server, session and notebook management, as well as integrating with jupyterlite for enabling WASM based kernels. These changes also make it much easier to use thebe with modern javascript frameworks like React, Vue and Next.js.

The project provides:

  • thebe - the original drop-in library with improved event management and configuration.
  • thebe-core library - an out-of-core refactor of server, session/kernel and notebook management code in a typescript API, giving developers full control of UI interaction.
  • thebe-lite library - an extension library that enables in-browser computation via jupyterlite & pyodide.
  • Now written in typescript and utilises the latest services from JupyterLab and ipywidgets 8.

In this presentation, we’ll introduce thebe, its new sub-packages and their capabilities, explaining where each is best applied through example use cases. We’ll then walk-through how to get started using thebe to get computational content from Jupyter notebooks into an interactive website with a custom layout. We’ll also demonstrate how easy it is to enable in-browser computation via jupyterlite/pyodide, discussing current capabilities and future direction.

Our presentation is aimed at attendees who are looking to incorporate Juptyer Notebooks with other materials in new and novel ways - to create compelling scientific communication materials whether in the form of books, blogs or articles, for education or research. The talk will cover how and where thebe can be applied effectively, as well as going into some development basics. Some knowledge of basic web development with HTML, javascript or typescript will be beneficial for walk-through element of the talk as we'll cover some code and configuration, but we aim for the talk to be accessible by anyone interested in putting interactive scientific communication on the web, whether they develop themselves or not.

I am a scientific software developer, data scientist/researcher and software product developer rolled into one. A team member of the Executable Books project where I work on thebe and CTO and co-founder of Curvenote where we are building tools and infrastructure for [much] better scientific communication and publishing.

An (electronic) engineer by background (Newcastle University, UK), I specialized in signal processing, computer vision, data science and machine learning and spent 20+ years helping both research and industry scientists (a lot of earth and geoscientists, but also data scientists in healthcare, finance, manufacturing, even dentists) build software to solve highly technical and scientific problems. I build apps that worked with huge datasets, 3d visualization and GPU-based HPC for server, desktops and the web.

Now I'm applying all of my time and experience to building software that can help change how we communicate, re-use and build on scientific work for a better future.