Running the full server-side Datasette Python app in the browser with service workers and Pyodide
AI-generated summary of reporting by Simon Willison’s Weblog. Read the original for the full story.
Why it matters
Python web apps can now run fully in-browser as shareable, URL-configured demo and bug-reproduction environments, removing the need to host servers.
Simon Willison has rebuilt Datasette Lite, a version of his data-browsing tool Datasette that runs entirely inside a web browser instead of on a server. A web technology called service workers, which intercept web requests, plus WebAssembly-based Python (Pyodide), makes it behave almost identically to the real server version. Users can load any SQLite database, CSV, or JSON file, pick plugins and one of over 100 SQLite versions, all via a single link. Anyone sharing data demos or reproducing software bugs benefits, since no server setup is needed.
Willison shipped a service-worker-based rewrite of Datasette Lite that runs the full Python app in the browser, usable now at lite.datasette.io for zero-cost demo and bug-reproduction links. The pattern is not Datasette-specific: any Python app could work, opening a cheap way to deliver preview environments without hosting infrastructure. Caveats: it needs CORS-enabled file hosting, and PostgreSQL or MySQL in WebAssembly remain immature. Teams maintaining Python products face rising user expectations for linkable, browser-run demos.
The rewrite replaces the original Pyodide web worker plus innerHTML hack (which broke script tags and JS/CSS loading) with a service worker on lite.datasette.io that intercepts requests; a parent page opens an iframe whose requests carry a /app/<session>/ prefix. Session IDs route each tab to a dedicated web worker instance because service workers cannot hold Pyodide state beyond roughly 30 seconds. URL parameters support ?install=, ?url=, ?ref=, ?sqlite= and ?metadata=. 163 pysqlite3 WebAssembly wheels were compiled for versions back to SQLite 3.25.
Questions this answers
The article above answers these:
- How does Datasette Lite run server-side Python in the browser?
- How do I share a Datasette demo or bug reproduction with a URL?
- How can I test a specific SQLite version in the browser?
Read the original
This summary exists to save you time, not to replace the source.
Key terms
Datasette Datasette Lite Pyodide SQLite PyPI lite.datasette.io datasette-maplibre
Was this summary useful?
One click, anonymous. It tells us which summaries to re-run.
Related reading
Code-driven AI illustrations are more useful than images from dedicated image models
Code-driven AI illustrations let designers edit assets directly in code, saving time on iteration and ensuring consistency, which is a game-changer for teams that need rapid, reusable visual content.
A hierarchical note-taking app for building large personal knowledge bases
Trilium lets users build and navigate massive personal knowledge bases without duplicating content, saving time on organization and retrieval.
Desktop apps in Go with native UI or web frontend
Go developers can now ship cross-platform desktop and mobile apps in a single small binary without cgo or heavy runtimes, cutting build complexity and deployment size.
OpenBitFun: an agent workspace with four harness modes and phone remote control
OpenBitFun lets agents run on any machine and be controlled from a phone, eliminating the need to choose between local power and remote access, saving developers time switching contexts.
Intel One Mono: a monospaced font designed with low-vision developers
Developers with low vision or eye fatigue can read code more clearly, reducing errors and improving productivity.