Name: elex-ftp-loader
Owner: NYT Newsroom Developers
Description: A simple loader for AP FTP elections results.
Created: 2016-01-28 14:30:05.0
Updated: 2018-05-23 02:38:18.0
Pushed: 2017-11-15 19:36:37.0
Homepage: null
Size: 64
Language: Python
GitHub Committers
User | Most Recent Commit | # Commits |
---|
Other Committers
User | Most Recent Commit | # Commits |
---|
A simple script for loading AP elections results only into a Postgres database using the COPY
function and CSV.
Clone the repository, create a virtualenvironment and install requirements.
clone git@github.com:newsdev/elex-ftp-loader.git
rtualenv elex-ftp-loader
lex-ftp-loader
install -r requirements.txt
Export environment variables you need.
rt RACEDATE=<YYYY-MM-DD>
rt AP_FTP_USER=<YOUR AP FTP USERNAME>
rt AP_FTP_PASS=<YOUR AP FTP PASSWORD>
If you're using something like The New York Times's AP election loader, elex-ftp-loader
is a drop-in replacement.
To initialize your database with races, reporting units and candidates:
it.sh
To get results one time:
date.sh
To run a daemon which inserts results into the database every 60 seconds:
emon.sh