Pre-processed election results for Wisconsin elections
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
2000
2002
2004
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
local_data_cache
tests
wigab @ 89200c7
.gitignore
.gitmodules
.travis.yml
README.md
api_inspector.py
cleaner.py
fetch.py
format_feature_test.py
office_table.xlsx
officetable.py
package.json
parser.py
requirements.txt

README.md

Build Status

openelections-data-wi

Pre-processed election results for Wisconsin elections

parser.py processes files based on cached metadata in local_data_cache/elections_metadata.json
To update this metadata from the OpenElections API, run python fetch.py wi -m
(fetch.py fetches data files based on the cached metadata)

To re-parse data files:

python parser.py

To parse data files for specific elections, append one or more election ids:

python parser.py 426

Elections will be processed in the order they appear in the metadata.

A folder local_data_cache keeps a local copy of input data files. To update it:

cd local_data_cache
python fetch.py wi

To fetch input files for specific elections, append one or more election ids:

python fetch.py wi 1577 404

There are two types of tests:

  1. Tests to validate the CSV output using csv-test. To test:
npm install
node_modules/csv-test/bin/csv-test tests/csv-test-config.yml '2014/*' tests/csv-test-validators.yml
  1. Tests to validate a sampling of results. These use behave and follow the format:
Examples: 20150929__wi__general_ward.csv
  | candidate                   | office   | ward                           | votes  | total |
  | Cindi Duchow                | Assembly | Village of Hartland Wards 1-13 | 117    | 140   |
  | Thomas D. Hibbard (Write-In)| ASSEMBLY | Village of Wales Wards 1-4     | 10     | 106   |

To run those tests:

cd tests; behave