This repo contains the raw data and corresponding methodology behind the OpenSunshine project. It is meant to illustrate how I processed the data for publication. The data
directory and Methodology.ipynb
provides a step-by-step reproducible methodology to transform the source files from the government into the final dataset used on the project page.
If you want to search through and download the data, or any section thereof, the website is a better venue.
The basic deployment with Datasette follows this essential tutorial by the app's creator, Simon Willison. It requires some source data, in my case a CSV.
- CSV --> SQLite with
sqlite-utils
sqlite-insert main.db main main.csv --csv
main.db
is output filenamemain
is name of table within DBmain.csv --csv
is input file with CSV flag
- Deploy Datasette app for testing
datasette main.db
will host the app locallydatasette install <plugin>
will add useful plugins for built-in viz, data downloads, APIs etcdatasette main.db --template-dir=templates/
lets you customize the frontend as described in these docs- This is how I added the custom homepage
- Publishing online
- I published to Heroku with this command:
datasette publish heroku main.db -n opensunshine --install <plugin1> --install <plugin2> ... --templates-dir=templates/
- This requires the heroku CLI tool on your computer, with a corresponding Heroku account
- I published to Heroku with this command: