Skip to content

Latest commit

 

History

History
56 lines (48 loc) · 5.43 KB

DataRepo.md

File metadata and controls

56 lines (48 loc) · 5.43 KB

OpenElections Data Repository Specs

Repository

There should be 52 repositories for data, with the url of the form https://github.com/openelections/openelections-data-CODE where CODE can be:

  • One of the 50 state postal abbeviations (lower-case)
  • dc (for the District of Columbia)
  • us (for national results)
Repositories
Alabama Alaska Arizona Arkansas California
Colorado Connecticut Delaware Florida Georgia
Hawaii Idaho Illinois Indiana Iowa
Kansas Kentucky Louisiana Maine Maryland
Massachusetts Michigan Minnesota Mississippi Missouri
Montana Nebraska Nevada New Hampshire New Jersey
New Mexico New York North Carolina North Dakota Ohio
Oklahoma Oregon Pennsylvania Rhode Island South Carolina
South Dakota Tennessee Texas Utah Vermont
Virginia Washington West Virginia Wisconsin Wyoming
District of Columbia United States

Filenames

The root of the repository should contain folders with the four digit year for each election.

Election results should be placed in a csv file for statewide results with a filename following the pattern: $YEAR/$YEAR$MONTH$DAY__$STATE__$ELECTIONNAME__$BREAKDOWN.csv where

  • $YEAR is the four digit year of the election
  • $MONTH is the two digit month of the election
  • $DAY is the two digit day of the election
  • $STATE is the two letter state abbreviation (lower-case)
  • $ELECTIONNAME is the election "name"
  • $BREAKDOWN is how the results are broken down, either county or precinct

The county-specific data should be in a csv file with the filename $YEAR/counties/$YEAR$MONTH$DAY__$STATE__$ELECTIONNAME__$COUNTY__$BREAKDOWN.csv where

  • $COUNTY is the full name of the county in all lower-case.

CSV Format

Each csv should be comma delineated (not tabs). The first row should specify which fields are present. Here are the expected fields and whether the column is required (which does not necessarily mean that the field has a value defined for every row).

  • Region Fields
    • county (string) required
    • precinct (string) required for county-specific results
  • Election Fields
    • office (string) required
    • district (int) required
    • party (string) required
    • candidate (string) required
  • Count Fields (int type for all)
    • votes required
    • Optional Vote Types, including
      • election_day
      • provisional
      • early_voting
      • absentee
      • advance_in_person