Richland Technology
Richland Technology
← Back to Blog
open-sourcepythonwebassemblypyodidedatasettetooling

Datasette Lite now runs the full server-side Python app in the browser — service workers, Pyodide, and a pick-your-SQLite-version parameter

A service worker + Pyodide rewrite makes Datasette's JavaScript, plugins, CSRF, and streaming work client-side — and a new wheels repo lets you pick any of 163 SQLite versions.

Richland AI Desk·18 November 2026·5 min read
Datasette Lite now runs the full server-side Python app in the browser — service workers, Pyodide, and a pick-your-SQLite-version parameter

Simon Willison shipped a complete rewrite of Datasette Lite that runs the full server-side Datasette Python ASGI app in the browser — service worker, Pyodide, streaming responses, CSRF, cookies, uploads, and JavaScript-heavy plugins all working client-side. It's open source, live today, and it turns a demo hack into a faithful in-browser emulation of a real server.

What shipped

Datasette Lite is Willison's port of the Datasette Python application to WebAssembly via Pyodide. The first version launched in 2022 as "a bit of a joke," but it was a hack: it ran Datasette in a Pyodide web worker, simulated requests through the stack, and injected the resulting HTML with innerHTML. Any feature using JavaScript failed — script tags in innerHTML don't execute, and the worker tricks couldn't load additional JS or CSS.

The rewrite abandons that approach. Datasette Lite now registers a service worker for the whole lite.datasette.io domain. The parent page creates an iframe that sends requests for Datasette pages to URLs prefixed with a random session ID, like /app/aa94e6851595/data/places. The service worker intercepts those requests and relays them to a web worker running a dedicated Pyodide Datasette instance for that session.

The prefix exists because the service worker is shared across all open tabs; without it, every tab would route to one shared Datasette instance regardless of the plugins or settings its URL requested. The random prefix gives each tab its own isolated instance. A web worker is still required because Pyodide in a service worker can't maintain state beyond roughly 30 seconds in most browsers.

The payoff: Datasette's own JavaScript, plugin JS/CSS, POST forms, CSRF tokens, cookies, uploads, downloads, and streaming responses all work. The demonstration is the new datasette-maplibre plugin, which renders GeoJSON maps with MapLibre GL — a JavaScript-heavy visualization that could not run under the old innerHTML approach. A single URL loads the plugin from PyPI, fetches a database and metadata file from a Gist, and drops you on a working map view:

https://lite.datasette.io/
  ?install=datasette-maplibre
  &url=https://.../demo.db
  &metadata=https://.../metadata.yml
  #/demo/capitals_and_countries%23map=0/4.2/180&color=continent

Screenshot of the datasette-maplibre plugin running in Datasette Lite: a world map of capitals and countries shaded by continent, with clustered dots and a table showing each country's boundary map.

The full set of URL parameters is documented in the Datasette Lite README: ?ref= loads a specific Datasette version, branch, tag, or commit SHA from PyPI or GitHub; ?install= adds plugins (repeatable); ?url= loads SQLite databases (repeatable); ?metadata= loads a metadata file; ?sql= runs init SQL; ?sqlite= picks a SQLite version. There are also ?csv=, ?json=, ?parquet=, ?config=, ?memory=1, and ?root=1.

Willison already uses it in Datasette development. A recent pagination bug is documented with two Lite links — one against ?ref=1.0a42 showing the broken behavior, one against 1.0a43 showing the fix — so anyone can reproduce the bug and verify the fix without spinning up a server.

Why it matters

Two things make this more than a novelty, and both landed in 2026.

First, PEP 783 (accepted 6 April 2026) standardized a pyemscripten_${YEAR}_${PATCH}_wasm32 platform-tag series for binary Python wheels targeting Pyodide. Before that, projects couldn't ship Pyodide-compatible binaries to PyPI at all — they had to use anaconda.org or jsdelivr. With the tag standardized, C and Rust extensions can be compiled to WebAssembly and published as wheels, which is what lets plugins with C or Rust extensions install via ?install=.

Second, the new pysqlite3-wasm-wheels repo ships WebAssembly-compiled pysqlite3 wheels — one per tagged SQLite release, named like pysqlite3-0.6.2-3.54.1-cp314-cp314-pyemscripten_2026_0_wasm32.whl (the SQLite version sits in the build-tag slot). A GitHub Action builds them hourly and tests each wheel in Pyodide under Node.js. That powers the ?sqlite= parameter: you can run Datasette against any of the 163 SQLite versions on the wheels index — useful for demonstrating new SQLite features and reproducing version-specific bugs, all in a tab you can just close.

Nothing about this is Datasette-specific. Willison argues almost any Python application can pull the same trick — running entirely in the browser as a cheap preview environment, feature demo, or bug-reproduction harness. The historical blocker was C and Rust extensions; with PEP 783 and modern coding agents that can compile them to Pyodide-compatible WebAssembly, that blocker is largely gone. The one real catch is databases: SQLite is fine, but PostgreSQL or MySQL in WebAssembly, while possible, remains "a path less trodden."

Caveats

Several claims are vendor-reported. The "163 SQLite versions" figure comes from Willison's post; the repo README itself only says "one for every tagged SQLite 3 release." I could not independently count all 163.

PEP 783's PyPI story is softer than it sounds: the spec says package indexes should accept pyemscripten_*_wasm32 wheels and notes PyPI already accepts the Emscripten trove classifier — a SHOULD-level recommendation, not a confirmed end-to-end hosting pipeline.

There are real operational constraints. Service workers are disabled in some private-browsing modes (e.g. Firefox private windows), which breaks the whole approach there. The README documents a set of HTTP error codes — 503 for a closed/reloaded tab, 504 if the worker stops answering partway through a request (after four minutes), 500 for a worker failure, 409 for a stale tab against an incompatible release. GitHub source-zip fetching relies on a Cloudflare Worker proxy scoped to simonw repos and lite.datasette.io/localhost origins — a third-party dependency in the trust chain.

Finally, "almost indistinguishable from the real server-side application" is Willison's own characterization. The maplibre demo proves JavaScript plugins work, but no third-party plugin author has independently confirmed compatibility, as far as the announcement indicates.

Sources

Start a Conversation

Ready to build something like this?

Tell us about your project and we'll respond with a clear plan within one business day.

Tell Us About Your Project

Takes 3 minutes. We read every submission personally.