
Simon Willison · 6 min readPython
Running the full server-side Datasette Python app in the browser with service workers and Pyodide
Datasette Lite runs the full Datasette Python app in the browser by combining Pyodide WebAssembly with service workers, enabling URL‑addressable demos, plugin installation, and custom SQLite versions without a server. The article details the service‑worker architecture, session isolation, and how to load specific SQLite builds, showing a pattern that other Python tools can adopt.
- Service workers intercept requests and route them to per‑tab Pyodide instances, preserving isolation.
- The ?sqlite= URL parameter fetches a matching pysqlite3‑wasm wheel, allowing any SQLite release to be used in‑browser.
- Plugins and data files can be loaded via URL parameters, making fully configurable, server‑less demos possible.