openelections / openelections-data-al

Pre-processed results for Alabama elections
0 stars 3 forks source link

Convert precinct-level spreadsheet files to CSV #1

Open dwillis opened 7 years ago

dwillis commented 7 years ago

Alabama has precinct-level results for general elections since 2010 and primaries in 2012 and 2016 here. Inside each zipped folder are county-specific Excel files, but the layout is different from what we want. Instead of having each column be a different precinct, we want a file with the following headers:

county, precinct, office, district, party, candidate, votes

The ideal outcome is a Python script that downloads the zip file, extracts its contents, iterates over each county file and writes the output to a single CSV file for each election. For offices that have a district or seat component (U.S. House, state supreme court), put the district or seat in the district column. You do not have to include local (county) races, but if it's easier to include all of them, please do.

The following elections can be done:

ndanielsen commented 7 years ago

I'm going to give this one a shot today =)

devinbrady commented 7 years ago

I'm on it.

devinbrady commented 7 years ago

I have a work-in-progress PR for converting the 2016 General CSV. I'd like to get some feedback on it. Could you grant me permission to add to this repo? Thanks!

dwillis commented 7 years ago

Hey @devinbrady: sure thing!