ellisvalentiner / Early-Vote-2020G-Data

2020 general election early vote (mail and in-person) data

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Early Vote 2020G Data

The U.S. Elections project publishes 2020 General Election early vote statistics. The website shows detailed state statistics and analyses for reporting states but doesn't report how these statistics have changed over time. For example, it may be interesting to see how early voter turnout has grown throughout the election.

Fortunately the 2020 General Election Early Vote Statistics website is hosted on GitHub pages. Thus, the website code itself is on GitHub. This project is an effort to recover the underlying data from the Git history.

About the U.S. Elections Project

The U.S. Elections Project 2020 General Election early vote statistics is distributed under a Creative Commons Attribution-ShareAlike License. This license lets others remix, adapt, and build upon this work even for commercial purposes, as long as credit is provided and license their new creations under the identical terms.

Please consider making a donation to a charitable University of Florida fund for Election Science education and research.

Description

This project works to recover national and state data from the https://github.com/ElectProject/Early-Vote-2020G repository.

Prerequisites:

The code requires Python 3.6+. I recommend Python 3.9.

I suggest installing the Python dependencies in a virtual environment:

python -m venv venv
pip install -r requirements.txt

Main

Run main.sh to produce a newline delimited JSON file containing national and state data recovered by parsing the html pages.

/bin/zsh main.sh

Output

The output is a newline delimited JSON file. Each row contains data for a state on a given report date.

Here is a sample, prettified, record:

{
  "date": "2020-10-23",
  "total": 358783,
  "in-person": 277118,
  "returned": 81665,
  "requested": 123057,
  "locality": "AR"
}

About

2020 general election early vote (mail and in-person) data

License:The Unlicense


Languages

Language:HTML 94.7%Language:Python 4.9%Language:Shell 0.3%