Skip to content
This repository has been archived by the owner on Aug 16, 2018. It is now read-only.

A simple loader for AP FTP elections results.

License

Notifications You must be signed in to change notification settings

nprapps/elex-ftp-loader

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

35 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

ELEX-FTP-LOADER

A simple script for loading AP elections results only into a Postgres database using the COPY function and CSV.

Prerequisites

Installation

Clone the repository, create a virtualenvironment and install requirements.

git clone git@github.com:newsdev/elex-ftp-loader.git
mkvirtualenv elex-ftp-loader
cd elex-ftp-loader
pip install -r requirements.txt

Export environment variables you need.

export RACEDATE=<YYYY-MM-DD>
export AP_FTP_USER=<YOUR AP FTP USERNAME>
export AP_FTP_PASS=<YOUR AP FTP PASSWORD>

Usage

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:

./init.sh

To get results one time:

./update.sh

To run a daemon which inserts results into the database every 60 seconds:

./daemon.sh

About

A simple loader for AP FTP elections results.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Python 76.6%
  • Shell 23.4%