newsdev/congress-candidates-2018

Name: congress-candidates-2018

Owner: NYT Newsroom Developers

Description: null

Created: 2017-12-07 18:37:11.0

Updated: 2017-12-08 16:29:21.0

Pushed: 2017-12-15 19:56:29.0

Homepage: null

Size: 936

Language: Python

GitHub Committers

UserMost Recent Commit# Commits

Other Committers

UserEmailMost Recent Commit# Commits

README

congress-candidates-2018

Setup
install -r requirements.txt

If running campfin/get_candidates.py with the --totals flag I recommend getting 4 API keys from https://api.open.fec.gov/developers/ to avoid throttling. After retrieving them, in ~/.bashrc:

rt FEC_KEY_0=<key>
rt FEC_KEY_1=<key>
rt FEC_KEY_2=<key>
rt FEC_KEY_3=<key>

Syntax and num keys matters. See update_key() function in campfin/get_candidates.py

Fetch data from FEC api
t csv of candidates who filed for 2018
on campfin/get_candidates.py --year 2018

t csv of candidates with fund totals for 2018
on campfin/get_candidates.py --year 2018 --totals

t csv of districts with FEC ids and candidate count for 2018
on campfin/get_candidates.py --year 2018 --districts
Get Rutgers data
on campfin/rutgers.py //Gets Rutgers candidates into a csv. 
                         //Should look over to look at unicode errors or if name/party are conjoined from typos.
Compare FEC data with Rutgers data (list of females registered to run for 2018)
on campfin/get_candidates.py --year 2018 --totals
on campfin/rutgers.py
on compare/compare_rutgers.py --rutgers data/2018_rutgers.csv --fec 2018_totals.csv

This adds a rutgers_sex label to FEC totals in fec_gender.csv and a candidate_id label to Rutgers candidates in data/rutgers_fec_ids.csv.


This work is supported by the National Institutes of Health's National Center for Advancing Translational Sciences, Grant Number U24TR002306. This work is solely the responsibility of the creators and does not necessarily represent the official views of the National Institutes of Health.