I’ve just updated my introduction to using Jupyter notebooks in the GLAM Workbench so that it runs in Jupyter Lite – that means no more waiting for cloud services to spin up, it all happens in your browser!
All the Jupyter notebooks in GLAM Workbench can be run in the cloud using the free Binder service – either through the ARDC (requires authentication), or through the public, community-run service. While it’s usually just a matter of clicking a link, Binder can take a while to build the necessary computing environment, and sometimes it just fails. Jupyter Lite takes a different approach. Instead of building things in the cloud, it sets up everything it needs to run notebooks within your own browser.
I’ve been experimenting with Jupyter Lite a bit over the past couple of years, waiting for the technology to reach the point where I could integrate it into the GLAM Workbench without greatly multiplying the maintenance burden. The obvious place to start was my introductory notebook, which demonstrates how Jupyter notebooks themselves work. Using live data from the National Museum of Australia API, it describes the basic structure of notebooks, and shows you how to edit and run code within them. I’ve now set things up so this notebook runs in Jupyter Lite.
What does this mean? Previously, the link to the introductory notebook spun up a new Binder instance. Now, the link retrieves a static web page hosted on GitHub. As this page loads, it installs a Python kernel and everything else it needs to run the notebook within your browser. It’s a lot faster than waiting for Binder, and provides a smoother experience for new users. And because it’s just an ordinary web page, I can even embed a live, working version of the notebook within this blog post. Try it out!
Jupyter Lite won’t currently work with every notebook in the GLAM Workbench. Some Python packages are difficult to install, and some data sources can’t be accessed due to CORS problems. But I’m planning to add Jupyter Lite options where I can.