Menu

Mirror a CSV dataset to DoltHub every week with its write API
📰

Mirror a CSV dataset to DoltHub every week with its write API

DEV Community: sql·Elliot Marsh·2 days ago
#bOqBpuK6
#devtosql#devto#dev#festivals#write
Long article (1374 words) — no AI summary yet.
Reading 0:00
15s threshold

We publish an open dataset of food festivals with the dates of their next editions (CC BY 4.0). It lives as CSV and JSON in a GitHub repository and as a citable record on Zenodo. Both are good for downloading; neither lets someone ask a question without downloading first. DoltHub fills that gap: it hosts Dolt databases, which are MySQL-compatible and versioned like Git, so anyone can run SQL in the browser or over HTTP, and every weekly refresh becomes a commit with a diff.

You do not need the dolt CLI to publish there. This post shows how we mirror the dataset weekly with nothing but HTTP calls from Python.

The shape of the write API

DoltHub's v1alpha1 API has a few properties worth knowing before you write code:

Reads are a GET with the SQL in q : GET /api/v1alpha1/{owner}/{db}/{ref}?q=... . Public databases need no token.

Writes are asynchronous. POST /api/v1alpha1/{owner}/{db}/write/{from_branch}/{to_branch} with the SQL in a JSON body returns an operation name.…

Continue reading — create a free account

Join HashtagPLUS to read full articles, follow hashtags, vote, and join the conversation.