SciPy 2024

Building Complex Web Apps with Jupyter Widgets
07-09, 13:30–17:30 (US/Pacific), Room 316

Interactive widgets were introduced to the Jupyter ecosystem over 10 years ago. A number of progressively more powerful interactive widget packages have been developed since then, supporting the construction of sophisticated dashboards and interactives. This tutorial will describe a number of approaches to developing and managing complex web apps that are compatible with Jupyter widgets and promote scalable application development.


Jupyter widgets are powerful tools for building user interfaces with graphical controls inside a Jupyter notebook. At first, programmers may use control widgets, like sliders and textboxes, to enable their users to make choices, enter information, and control the value of Python variables using click-and-drag and other kinds of interactions. While it is possible to put together a stylish and functional dashboard using only control widgets linked to global variables, this style of development does not scale well for more complicated applications.
In this tutorial we will work through a number of tools for building more complicated web apps that use Jupyter widgets. One is nbdev, which is a literate programming tool that allows programmers to develop Python modules and packages directly from one or more notebooks. nbdev is especially useful for widget development because developers can work on one piece of the larger application in a single notebook. With nbdev, developers can easily compose those pieces into a single app in a single notebook.
We will also explore a number of other packages devised to reduce the amount and complexity of code required to construct a web application when compared to fundamental core Jupyter widgets. These include the combination of pydantic and ipyautoui for managing and constructing widget settings and solara for building components or entire applications declaratively.
Finally, we will review some deployment options for widget-based web apps: voilà on a server running Python kernels, static web pages built around Jupyter-lite, github pages using nbdev, or as part of Sphinx documentation.


Prerequisites

Basic familiarity with Jupyter widgets.

We will write and make use of libraries to automate the building of more complicated widgets, but familiarity with Jupyter widgets will be needed to exploit these more complicated widgets.

Installation Instructions

Installation instructions can be found at: https://github.com/Jupyter4Science/scipy2024-jupyter-widgets-tutorial/blob/main/README.md

Nicole Brewer is a research software engineer and PhD student in History and Philosophy of Science at Arizona State University. Her dissertation research focuses on current and better practices for computational research workflows in Jupyter Notebooks. She was a Better Scientific Software fellow in 2023, which resulted in the website Jupyter4Science, a knowledge base of original and curated content about Jupyter Notebooks as they are used in scientific contexts. Site content includes the first widgets tutorial she gave at SciPy 2023.

I teach Physics and Astronomy at a small undergraduate-only state university. I started using Python over 10 years ago, just at the time project Jupyter was announced. Since then, I've been an enthusiastic user of Jupyter widgets in performing accessible, reproducible science and have contributed to the core ipywidgets package.

I am a Astrophysicist by training and a Computer Programmer by necessity. I have recently transitioned from teaching primarily Physics and Astrophysics to teaching Computer Science.

Maarten Breddels is an entrepreneur and ex-scientist mainly working with Python, C++, and Javascript in the Jupyter ecosystem. He is the creator of Solara, ipyvolume, and Vaex and Co-founder of Widgetti. His expertise includes fast numerical computation, API design, 3D visualization, and building data apps. He has a Bachelor's in ICT, a Master's, and Ph.D. in Astronomy, and he likes to solve real problems.