Show HN: Datasette – Create and publish an API for SQLite databases
A couple of demos:<p><a href="https://fivethirtyeight.datasettes.com/" rel="nofollow">https://fivethirtyeight.datasettes.com/</a> contains SQLite versions of every CSV published by the FiveThirtyEight crew to <a href="https://github.com/fivethirtyeight/data" rel="nofollow">https://github.com/fivethirtyeight/data</a><p>I built a separate tool on top of pandas which can mass-convert CSVs to SQLite - <a href="https://github.com/simonw/csvs-to-sqlite" rel="nofollow">https://github.com/simonw/csvs-to-sqlite</a> - so building the database for <a href="https://fivethirtyeight.datasettes.com/" rel="nofollow">https://fivethirtyeight.datasettes.com/</a> is now a one-liner:<p><pre><code>    csvs-to-sqlite ~/fivethirtyeight/data fivethirtyeight.db
</code></pre>
<a href="https://parlgov.datasettes.com/" rel="nofollow">https://parlgov.datasettes.com/</a> uses the SQLite database from <a href="http://www.parlgov.org/" rel="nofollow">http://www.parlgov.org/</a> - this is a more interesting demo as it includes things like SQL views - e.g. <a href="https://parlgov.datasettes.com/parlgov/view_election" rel="nofollow">https://parlgov.datasettes.com/parlgov/view_election</a><p>Both of these demos are served through Cloudflare - since the URL to each database incorporates a sha256 hash of the database contents, I can send a far-future cache expiry header on everything.