Datasette Lite
A browser-based implementation of Datasette that runs Python in WebAssembly via Pyodide, allowing CSV and SQLite files to be loaded and the full Datasette application to run without a local installation; it also supports JavaScript plugins.
Core Facts
Timeline (last 90 days)
This system was initially a research prototype that the author generated with Claude Opus, and it was only formally put into production after the author became sufficiently familiar with the overall mechanism.
The new version of Datasette Lite registers a Service Worker that acts on the entire lite.datasette.io domain, intercepting HTTP requests and having client-side code respond; the parent page creates an iframe and makes requests to standard Datasette URLs with an /app/<session>/ prefix.
The /app/<session>/ prefix is used for multi-tab isolation: the Service Worker is shared across all tabs, and the parent page generates a random session ID for each tab to route requests to the Datasette instance in that session's dedicated Web Worker.
Datasette Lite supports customizing instances via URL parameters: ?install= installs plugins from PyPI (multiple can be passed repeatedly), ?url= loads any SQLite database that provides open CORS headers, ?metadata= loads metadata.yml, and fragment hashes are used to locate views and control the map plugin.
The server hosting the SQLite file loaded by the ?url= parameter must return the Access-Control-Allow-Origin response header; otherwise the browser will not allow Pyodide's fetch request to read its contents.
The author created the datasette/pysqlite3-wasm-wheels repository, providing WebAssembly-compiled pysqlite3 wheels for 163 different SQLite versions; when a ?sqlite= version number is passed, Datasette Lite resolves the corresponding wheel path, downloads it, and installs it into the Pyodide environment.
Simon Willison released a complete Service Worker–based rewrite of Datasette Lite, which the author says is almost indistinguishable from a real server-side application.
The first version of Datasette Lite was created in 2022, running Datasette in a Pyodide Web Worker and injecting the generated HTML into the top-level page via innerHTML.
The old version of Datasette Lite injected content via innerHTML, which caused script tags not to execute, Workers to be unable to load additional JS and CSS, and a large number of JavaScript-dependent plugins and interactive features to fail.
The datasette-maplibre demo can run in the latest version of Datasette Lite, loading the plugin and demo database in the browser via Pyodide and WebAssembly, with no local installation required.
4 more timeline events
All Facts (14)
Datasette Lite is a version of Datasette that runs in the browser, using Pyodide to compile the Python runtime to WebAssembly and execute it in the browser, with no need to install a local Python environment or start a server.
65%UnverifiedThis system was initially a research prototype that the author generated with Claude Opus, and it was only formally put into production after the author became sufficiently familiar with the overall mechanism.
50%UnverifiedThe first version of Datasette Lite was created in 2022, running Datasette in a Pyodide Web Worker and injecting the generated HTML into the top-level page via innerHTML.
50%UnverifiedThe old version of Datasette Lite injected content via innerHTML, which caused script tags not to execute, Workers to be unable to load additional JS and CSS, and a large number of JavaScript-dependent plugins and interactive features to fail.
50%UnverifiedThe new version of Datasette Lite registers a Service Worker that acts on the entire lite.datasette.io domain, intercepting HTTP requests and having client-side code respond; the parent page creates an iframe and makes requests to standard Datasette URLs with an /app/<session>/ prefix.
50%UnverifiedThe /app/<session>/ prefix is used for multi-tab isolation: the Service Worker is shared across all tabs, and the parent page generates a random session ID for each tab to route requests to the Datasette instance in that session's dedicated Web Worker.
50%UnverifiedDatasette Lite supports customizing instances via URL parameters: ?install= installs plugins from PyPI (multiple can be passed repeatedly), ?url= loads any SQLite database that provides open CORS headers, ?metadata= loads metadata.yml, and fragment hashes are used to locate views and control the map plugin.
50%UnverifiedThe server hosting the SQLite file loaded by the ?url= parameter must return the Access-Control-Allow-Origin response header; otherwise the browser will not allow Pyodide's fetch request to read its contents.
50%UnverifiedThe datasette-maplibre demo can run in the latest version of Datasette Lite, loading the plugin and demo database in the browser via Pyodide and WebAssembly, with no local installation required.
50%UnverifiedThe README online demo of datasette-vega 0.7 now links to Datasette Lite, using FiveThirtyEight's airline-safety dataset to demonstrate the bar chart effect.
50%UnverifiedSimon Willison released a complete Service Worker–based rewrite of Datasette Lite, which the author says is almost indistinguishable from a real server-side application.
50%UnverifiedThe author created the datasette/pysqlite3-wasm-wheels repository, providing WebAssembly-compiled pysqlite3 wheels for 163 different SQLite versions; when a ?sqlite= version number is passed, Datasette Lite resolves the corresponding wheel path, downloads it, and installs it into the Pyodide environment.
50%UnverifiedDatasette Lite previously could not load JavaScript plugins, and has just gained the ability to run such JS plugins, with datasette-vega being a beneficiary.
50%UnverifiedThe primary motivation for the datasette-vega 0.7 release was compatibility with the latest Datasette alpha version, along with some visual tweaks to work better in Datasette Lite.
50%