Pyodide interactive python web pages with Quarto
Gem City Tech, Dayton Dynamic Languages
Abstract
Interactive python code in web assembly using Quarto.
Follow along
https://whitenoisetech.codeberg.page/2025-03-12-ddl-pyodide/
Basic demonstration
Why?
- Everything runs client-side in browser
- No client configuration needed
- Libraries and data can be loaded directly into the browser’s sandbox
- Code and results are editable live
- results from mods happen real time
Using
- Quarto markdown-based publishing system
- r-wasm/quarto-live Quarto extension for pyodide
- Pyodide Python web assembly engine
Quarto
- Quarto is a markdown-based technical publishing system
- web-pages
- slides (reveal.js)
- books
- latex
- …
Pyodide
- Interfaces with Quarto via r-wasm/quarto-live
- Pyodide compiles python to web assembly to run in the browser
- large library of python packages via
micropip
- any other pure python package can be used
- data has to be downloaded - no access to local file system
- can be served as part of the web page resources