Repo of the Day
simonw/datasette
Published: Aug 19, 2022
Open repository ↗Summary
Datasette is an open source Python tool that turns SQLite databases into interactive websites and JSON APIs. It runs as a local web server or can be deployed to hosting platforms, and the same codebase also ships as a WebAssembly build (Datasette Lite) that runs entirely in the browser. The project targets data journalists, researchers, archivists, and anyone who needs to share tabular data without writing a custom web app.
What it is useful for
Datasette is most useful when you have one or more SQLite files and need to expose them to others as a browsable website with a query API alongside it. The README shows concrete examples: pointing it at a .db file with datasette serve immediately gives you a web UI and JSON endpoints for every table. It can also serve ad hoc data such as a Chrome browser history SQLite file via the --nolock flag, since the browser holds the original file open, and a metadata.json file can attach license and source attribution that is rendered in the page footer and the JSON output.
For publishing, the datasette publish subcommand builds a Docker image containing the app and the database, then deploys it to Heroku or Google Cloud Run and returns a URL. This fits small datasets that don't need a full backend stack. Documented limitations: the project is scoped to SQLite, requires Python 3.10 or higher, and the publish commands only work when Heroku or Cloud Run is already configured on the host.
How engineers can use it
The README documents a short path from install to a running server. On macOS the project recommends brew install datasette; on other systems pip install datasette or pipx install datasette works. Starting the server is then:
datasette serve path/to/database.db
The server listens on port 8001 by default. To add license and source information, create a metadata.json (the README shows a FiveThirtyEight example with title, license, license_url, source, source_url) and pass it with -m metadata.json. For deployment, datasette publish heroku database.db or datasette publish cloudrun database.db packages everything into a Docker image and pushes it, assuming the respective platform is configured locally.
The project is Apache-2.0 licensed, and a datasetteproject/datasette Docker image is published on Docker Hub. Full installation, plugin, and publishing guides, along with Datasette Lite setup notes, live in the documentation at docs.datasette.io, which is the place to look for anything the README does not cover.