Skip to main content
osky
Sección
Technology

Simon Willison, creator of Datasette, published a complete rewrite of Datasette Lite on November 17, 2026. It is the version that runs inside the browser using WebAssembly and Pyodide. According to its author, it is now "almost indistinguishable" from the server version. JavaScript, plugins, forms and cookies all work, and everything is set up with a URL. It matters to anyone who maintains a Python app, because it is a concrete recipe for demos, test environments and bug reproductions without spinning up a single server.

What Datasette Lite is and what changed

Datasette is a Python tool for exploring and publishing SQLite databases as a website and API. Datasette Lite has existed since 2022: Willison launched it half as a joke and it ended up being useful.

The problem with that version was that it was a hack. Datasette ran in a Web Worker with Pyodide, requests were simulated, and the resulting HTML was injected into the page with innerHTML. Since <script> tags inserted that way don't execute, everything that depended on JavaScript broke.

The new version takes a different approach and uses service workers, the browser API that lets you intercept HTTP requests and answer them with client-side code.

How it works now

According to the project's README, Datasette pages are displayed in an <iframe> that points to /app/<session>/ routes. Those routes don't exist on any server: the service worker (sw.js) catches every request (clicks, GET and POST forms, fetch() calls, static files) and the tab hands it to Datasette's ASGI app, which runs in Pyodide with Python 3.14.

The session prefix exists because there is a single service worker for all tabs: without it, two tabs with different plugins or data would step on each other. Each tab generates a random session and the service worker routes each request to the tab that owns it, which passes it to its own Web Worker.

And why not run Python directly in the service worker? Willison explains that Pyodide there couldn't keep its state for more than about 30 seconds, depending on the browser.

Diagrama del flujo de una petición en Datasette Lite: el iframe pide una página, el service worker la intercepta, la pestaña la reenvía al Web Worker con Pyodide, Datasette consulta SQLite y la respuesta regresa por el mismo camino

The result, according to the README: Datasette's JavaScript and its plugins' JavaScript work, as do POST forms, CSRF protection, login cookies, uploads and downloads. Cookies and data last until you close or reload the tab.

Everything is configured in the URL

The most useful part is that a complete instance is described in a link to lite.datasette.io:

Parameter What it does
?url=, ?csv=, ?json=, ?sql= Loads a SQLite database, a CSV, a JSON or a SQL script (the file must have open CORS)
?install= Installs plugins from PyPI or from a wheel; can be repeated
?ref= Picks the Datasette version: one from PyPI, stable, or a branch, tag or commit from the repository
?sqlite= Picks the SQLite version, for example 3.54.1
#/… Opens a specific route inside Datasette

Willison already uses it in Datasette development: in an issue about a pagination bug he left two links, one with version 1.0a42 where the second page came up empty and another with 1.0a43 where it was already fixed.

The extra: choosing the SQLite version

Willison created the datasette/pysqlite3-wasm-wheels repository, with pysqlite3 wheels compiled to WebAssembly for 163 SQLite versions. Without the parameter, Datasette Lite uses the SQLite that ships with Pyodide, 3.39.0. With ?sqlite= the chosen version is used for everything: Datasette, plugins that import sqlite3, and file loading. He also built a tool to compare a query across versions.

Limitations

  • You need a browser with service workers. Some private modes, like Firefox private windows, disable them.
  • The Web Worker is a module type, so it requires Chrome 80, Safari 15 or Firefox 114 or later.
  • Loading code from GitHub goes through a proxy on Cloudflare Workers that only serves simonw and datasette repositories. If you host your own copy, you need your own proxy.
  • Willison admits SQLite gives no trouble, but PostgreSQL or MySQL in WebAssembly is "still a road less traveled."

My take

What's interesting isn't Datasette itself, but the pattern. Willison himself says none of this is exclusive to Datasette and that almost any Python app could do the same to get cheap test environments. Remember that, since PEP 783 in April 2026, packages compiled for Pyodide can now be published on PyPI. A link that reproduces the bug with the exact version is worth more than three paragraphs of "it fails for me." One more detail: the author says the system started in May as an experiment generated with Claude Opus 4.8 and that he took it to production in November, once he understood how it worked. I haven't tried it; this comes from the official announcement and README.

Sources