Simon WillisonWednesday · November 18, 2026FREE

Running the full server-side Datasette Python app in the browser with service workers and Pyodide

datasettepyodidewebassemblyservice-workerssqlite

Simon Willison published a complete rewrite of Datasette Lite, his port of the Datasette Python application that runs directly in the browser using WebAssembly and Pyodide. The first version, launched in 2022, ran Datasette in a Pyodide web worker, simulated requests, and injected the resulting HTML into the top-level page using innerHTML. Willison writes that this meant features using JavaScript failed to work, because script tags in innerHTML do not execute and the web worker approach failed to load additional JavaScript or CSS files. The rewrite registers a service worker for the entire lite.datasette.io domain; a parent page creates an iframe that sends requests for Datasette pages to URLs prefixed with /app/<session>/, which Willison says is necessary because of multiple tabs. Willison lists what crafted URLs to lite.datasette.io can now do: browse any SQLite database, JSON file, CSV file, or SQL script; select a released Datasette version from PyPI; load a specific commit, tag, or branch from the Datasette GitHub repository; pick from over 100 versions of SQLite; and install additional Datasette plugins from PyPI or wheel file URLs, including JavaScript visualization tools. He describes the ability to load specific Datasette references, plugins, and SQLite versions as useful for linking to demos of work-in-progress features or bug reproductions without spinning up a web server. He cites a pagination bug issue where he posted links demonstrating the broken behavior on 1.0a42 and the fix on 1.0a43.

// why it matters

Developers can link to reproducible Datasette demos pinned to specific versions, commits, plugins, and SQLite builds without running a web server.

Sources

Primary · Simon Willison
▸ Read original at simonwillison.net

Like this? Get the next digest.

Running the full server-side Datasette Python app in the browser with service workers and Pyodide — aigest.dev