Datasette: The Open-Source Tool for Data Exploration and Publication

Can you imagine sharing a CSV file as URL and letting the recipients view the data through just their browser? Guess what, you can do that & more with Datasette. Click on this link to see a table showing shelf life of some perishable food items

Datasette is a tool created by Simon Willison for exploring and publishing data

It's a web application that provides a user interface (UI) for browsing, viewing, faceting, filtering, sharing and exploring data

Datasette allows you to convert CSV files into a database table.

Datasette runs on top of SQLite, which is a fast, widely used database where each database is a single file that's easy to copy and back up.

Datasette is designed for read-only data, meaning you can't make changes to the data through the Datasette interface.

You can run your own SQL queries against the data, which is usually risky for web applications but safe in Datasette because it uses a read-only database.

Datasette's JSON API can be used to quickly build custom visualizations

Use Cases for Datasette:

When combined with GitHub Actions, Datasette can be used to automatically deploy new databases on a scheduled basis. 

HOW TO Deploy Your Own Copy of Datasette

Thank Simon Willison for making it super easy to host your own copy of Datasette on Glitch. Glitch.com is an online platform that lets you create, remix, and host web apps without worrying about servers or complex setup.

Here are the steps he describes in a blog post with my own screenshots if you want to get started without bothering about the technical details -

Click on this link to have hosted Datasette on Glitch - https://glitch.com/edit/#!/remix/datasette-csvs 

In a few seconds, you'll see a web page with a sidebar on the left.

Drag-and-drop a CSV file

Listing of the contents of the file SmartestWatch.csv file from the left sidebar

Click on Open preview pane option from the Preview menu in the footer to watch it get served by Datasette on Glitch just a few seconds later.

In the above screenshot, there are links to 2 tables - SmartestWatch & example which reveal the respective tables when clicked. 

You can share or bookmark the URL you see in the address bar.

Anonymous Glitch projects expire after 5 days. Create an account if you want to save your progress.

Datasette has a plugin mechanism that allows users to add additional features. One example is the dataset-cluster-map plugin which visualizes data with latitude and longitude columns on a map.  Dependencies can be installed from a requirements.txt which means you can add extra plugins just by adding them to that file (or by uncommenting some example lines)

Watch the creator of the tool explain how to instantly publish data to the internet with Datasette at PyBay2018

Comments

Popular posts from this blog

Things Near Me – Find & Learn About Landmarks Nearby

Google Mobilizer Bookmarklet - view just text of web pages

This Week I Learned - Week #9 2025