Putting state-by-state CSVs from ActBlue FEC filings into Datasette
For ActBlue filings, ProPublica provides state-specific CSV downloads (see example). Given a specific filing and state, this script grabs those CSV files and loads them into a SQLite database, then makes them available to browse with Datasette. CSV loading is done using csvs-to-sqlite, both made by Simon Willison.
To load CSV files with contributions from West Virginia residents and disbursements paid to West Virginia committees via ActBlue for the 2020 February Monthly report, run the following command:
python actblue.py 1385527 wv
Which will download the CSV files, load them into a SQLite database named actblue.db
and start up datasette.