Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

update fork #1

Merged
merged 35 commits into from Nov 2, 2016
Merged
Changes from 1 commit
Commits
Show all changes
35 commits
Select commit Hold shift + click to select a range
cf756ad
return blank on error
mlambright Oct 24, 2014
e2ae14c
skip geocode if error
mlambright Oct 24, 2014
7feb5d1
add Kentucky
mlambright Oct 24, 2014
c3ab935
add support for st lucie and lake counties
mlambright Oct 24, 2014
793d9d0
add starting Texas
mlambright Oct 25, 2014
5c0c249
add Dallas county
mlambright Oct 25, 2014
9ce5e91
texas with dallas
mlambright Oct 25, 2014
1954e3d
remove unnecessary function
mlambright Oct 25, 2014
33a00ba
add SC
mlambright Oct 25, 2014
b423d6f
add beginning WV
mlambright Oct 25, 2014
f9ff8ae
update wv
mlambright Oct 25, 2014
bca3d69
remove leftover hidden fields
mlambright Oct 25, 2014
ab0fc85
last attempt with session
mlambright Oct 25, 2014
281d815
fixed button
mlambright Oct 25, 2014
b295390
fix submit button
mlambright Oct 26, 2014
84b6366
add sleep
mlambright Oct 26, 2014
00cf8a9
Merge branch 'wv'
mlambright Oct 26, 2014
a78a2c2
add EPC
mlambright Oct 27, 2014
dd55a38
add Denton county
mlambright Oct 27, 2014
febb6ee
fix denton odditites
mlambright Oct 27, 2014
1850308
add NM
mlambright Oct 29, 2014
e454840
add hidalgo county
mlambright Oct 29, 2014
bcacd73
add fort bend county
mlambright Oct 29, 2014
53d7262
add montgomery
mlambright Oct 29, 2014
884de37
add Jefferson county
mlambright Oct 29, 2014
4080499
allow precincts without pps
mlambright Oct 29, 2014
1d17422
collect NM precincts
mlambright Oct 30, 2014
798bfea
fix precincts
mlambright Oct 30, 2014
5bb6544
add election-day tool which only pulls precincts
mlambright Nov 2, 2014
81fd1c9
working election-day sites
mlambright Nov 2, 2014
ee2d7fc
collect pp list url where available
mlambright Nov 2, 2014
f305d0a
add main and VIP readmes
mlambright Nov 2, 2014
6fa1e95
add main and VIP readmes
mlambright Nov 2, 2014
64d696a
add DECC readme
mlambright Nov 2, 2014
c2c823f
fix readme
mlambright Nov 2, 2014
File filter...
Filter file types
Jump to…
Jump to file
Failed to load files.

Always

Just for now

add main and VIP readmes

  • Loading branch information
mlambright committed Nov 2, 2014
commit f305d0a405e2a920b94c270c52bbfbf9fccfb8d2
@@ -0,0 +1,20 @@
#EA-Tools 2014
This repository contains a flask app which managed processes for VIP QA and DECC through the 2014 Election. VIP-specific scripts are stored in the vip folder, and decc-specific scripts are stored in the decc folder. Each folder, except app, contains its own README detailing the included scripts.


##For this app to run, the following environment variables must be defined:
###For DECC:
+ *DECCINPUT:* the directory to use to input to decc scripts
+ *DECCOUTPUT:* the directory to output decc files after processing
+ *PGHOST:* the URL or IP of the DECC database server
+ *PGUSER:* the username to connect to the DECC database
+ *PGPASSWORD:* the password associated with PGUSER
+ *PGDB:* the DECC database name

###For VIP QA:
+ *GOOGLE_NATIVE_APP_CLIENT_ID:* The client ID associated with the VIP QA app
+ *GOOGLE_NATIVE_APP_CLIENT_SECRET:* The client secret associated with the VIP QA app
+ *GOOGLE_PUBLIC_API_KEY:* The API key used to query the Google civicInfo API
+ *GOOGLE_GEOCODE_API_KEY:* The API key used to query the Google geocode API
+ *VIPQADATA:* The directory containing TargetSmart PII spreadsheets used to QA election-day voting sites
+ *EVIPQADATA:* The directory containing TargetSmart PII spreadsheets used to QA early voting sites
@@ -0,0 +1,34 @@
#VIP QA Scripts
This folder contains the scripts which QA early and election-day voting sites. Each of the scripts are summarized below.


+ *readData.py* contains a very simple function (read()) which accepts a directory and a state abbreviation. Reads in a csv named {state abbreviation}.csv from the provided directory.


+ *civicInfo.py* interacts with the Google CivicInfo API. Contains 3 functions.
..+ *getVoterInfo()* returns a decoded json object for the provided address string and electionID, by default the electionID is set to 4100-the 2014 General Election.
..+ *getVIPValues()* accepts the object provided by getVoterInfo() and returns the election day polling location details.
..+ *getEVValue()* accepts the object provided by getVoterInfo() and returns the early-vote polling location details.


+ *sheets.py* interacts with the Google Drive and Spreadsheets API's includes functions which can be used to copy a Google Sheet and then write rows to it.
..+ *getService()* accepts as arguments the service name, version, and credential object. It creates and authorizes a service which can be used with the Google API client library
..+ *copySheet()* accepts as arguments a sheet name, an original sheet key, and a credentials object. It uses the Google API client library (and calls getService()) to copy a sheet template.
..+ *getClient()* creates a gData spreadsheets client and authorizes it using stored credentials (created in app/views.py)
..+ *convertRow()* accepts a dictionary with row values. It replaces the keys in the dictionary with lower-case, spaceless versions of themselves.
..+ *writeRow()* accepts a dictionary with row values, a gdata client, a sheetKey, and sheetID (sheet within the google spreadsheet). It converts the input dictionary using convertRow() and then writes it to the sheet provided.


+ *geocode.py* geocodes and finds the distance between address strings.
..+ *geocode()* accepts a string containing an address and returns a dictionary with the latitude (lat) and longitude (lng) of the best match for that address.
..+ *haversine()* accepts two location dictionaries and returns the haversine distance (in miles) between them.


+ The scripts named *{state abbreviation}.py* each have a different structure based on the state on which they work. The unifying factor is a function titled *run()* which accepts a row dictionary from the TargetSmart data and returns the Polling Place ID, name, and address.


+ *execute.py* calls all of the other scripts in this folder to read and process VIP QA data.
..+ *getRowData()* accepts a row dictionary from TargetSmart data, and returns an address string and county which can be used to query the civicInfo API.
..+ *VIP()* accepts a state abbreviation and credentials object which reads in that state's TargetSmart data, creates a Google Spreadsheet, and then iterates over the data to query the civicInfo API, query the state lookup tool, and write the returned data to the new Google Spreadsheet.
..+ *EVIP()*: accepts a state abbreviation, a credentials object, and a boolean indicating whether to run 25 or 50 rows. This function reads in state Data, creates a google spreadsheet, and then iterates over rows querying the Google CivicInfo API and writing returned data to the new spreadsheet. No SOS tools were created for EV data.

ProTip! Use n and p to navigate between commits in a pull request.
You can’t perform that action at this time.