

GitHub - simonw/datasette: An instant JSON API for your SQLite databases
source link: https://github.com/simonw/datasette
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.

An open source multi-tool for exploring and publishing data
Datasette is a tool for exploring and publishing data. It helps people take data of any shape or size and publish that as an interactive, explorable website and accompanying API.
Datasette is aimed at data journalists, museum curators, archivists, local governments, scientists, researchers and anyone else who has data that they wish to share with the world.
Explore a demo, watch a video about the project or try it out by uploading and publishing your own CSV data.
Want to stay up-to-date with the project? Subscribe to the Datasette newsletter for tips, tricks and news on what's new in the Datasette ecosystem.
Installation
If you are on a Mac, Homebrew is the easiest way to install Datasette:
brew install datasette
You can also install it using pip
or pipx
:
pip install datasette
Datasette requires Python 3.7 or higher. We also have detailed installation instructions covering other options such as Docker.
Basic usage
datasette serve path/to/database.db
This will start a web server on port 8001 - visit http://localhost:8001/ to access the web interface.
serve
is the default subcommand, you can omit it if you like.
Use Chrome on OS X? You can run datasette against your browser history like so:
datasette ~/Library/Application\ Support/Google/Chrome/Default/History
Now visiting http://localhost:8001/History/downloads will show you a web interface to browse your downloads data:
metadata.json
If you want to include licensing and source information in the generated datasette website you can do so using a JSON file that looks something like this:
{
"title": "Five Thirty Eight",
"license": "CC Attribution 4.0 License",
"license_url": "http://creativecommons.org/licenses/by/4.0/",
"source": "fivethirtyeight/data on GitHub",
"source_url": "https://github.com/fivethirtyeight/data"
}
Save this in metadata.json
and run Datasette like so:
datasette serve fivethirtyeight.db -m metadata.json
The license and source information will be displayed on the index page and in the footer. They will also be included in the JSON produced by the API.
datasette publish
If you have Heroku or Google Cloud Run configured, Datasette can deploy one or more SQLite databases to the internet with a single command:
datasette publish heroku database.db
datasette publish cloudrun database.db
This will create a docker image containing both the datasette application and the specified SQLite database files. It will then deploy that image to Heroku or Cloud Run and give you a URL to access the resulting website and API.
See Publishing data in the documentation for more details.
Recommend
-
35
Datasette (previously) is my open source tool for exploring and publishing structured data. There are a lot of ideas embedded in Datasette. I realized that I haven’t...
-
23
README.md db-to-sqlite
-
37
Running Datasette on Glitch The worst part of any software project is setting up a development environment. It’s by far the biggest barrier for anyone trying to get started learning to code. I’ve been a develop...
-
26
datasette-atom: Define an Atom feed using a custom SQL query I’ve been having a ton of fun iterating on www.niche-museums.com . I put together
-
4
Publishing data with DatasetteI think the Datasette ecosystem of tools is amazing. Built basically single-handedly by Simon Willison, it provides a way to turn collections of CSV files into read-only collections of SQLite databases that one c...
-
10
Building a desktop application for Datasette (and weeknotes) This week I started experimenting with a desktop application version of Datasette—with the goal of providing people who aren’t comforta...
-
55
sqlite-tui: A TUI for viewing sqlite databases, written in Go made with modernc.org/sqlite, charmbracelet/bubbletea, and charmbracelet/lipgloss Works with keyboard: ... And mouse! NOTE: Mouse controls don...
-
8
Datasette Desktop—a macOS desktop application for Datasette I just released version 0.1.0 of the new Datasette macOS desktop application, the first version that end-users can easily install...
-
3
Datasette’s new JSON write API: The first alpha of Datasette 1.0 This week I published the first alpha release of Datasette 1.0, with a signif...
-
11
Migrate Migrate is a tool for migrating databases in a declarative way. It can be used from the command line or as a library. Installation If you just want to test the tool without installing
About Joyk
Aggregate valuable and interesting links.
Joyk means Joy of geeK