Obtain historical US presidential election data
Project description
pyelection
Presidential election data collector in Python
Installation
pip install pyelection
Example: 2016 US Presidential
from pyelection import PyElection
pye = PyElection(2016)
By state
import json
state = pye.get_state_summary()
json.dumps(state, indent=4, sort_keys=True)
By candidate
import pandas as pd # need to install pandas
candidates = pye.get_candiate_summary()
pd.DataFrame(candidates)
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
pyelection-0.0.1.tar.gz
(4.2 kB
view hashes)