Name: elex-micro
Owner: NYT Newsroom Developers
Description: Everything you like about Elex, only less.
Created: 2016-08-10 19:04:55.0
Updated: 2016-08-27 18:17:29.0
Pushed: 2016-08-30 11:41:01.0
Size: 446
Language: Python
GitHub Committers
User | Most Recent Commit | # Commits |
---|
Other Committers
User | Most Recent Commit | # Commits |
---|
Everything you like about Elex, only less.
Elex-micro is a Python library for returning results, and only results, from the AP Election v2.0 API. It is related to, but conceptually distinct from, Elex, a more fully-featured wrapper.
At The New York Times, we need our results just a little bit faster. And by “a little bit” I mean “about twice as fast.”
elex results 2012-11-02 -d '/Users/jbowers/Desktop/general/20121106-national.json' > /tmp/test.csv
-08-19 11:58:29,120 (INFO) elex (v2.0.9) : Getting results for election 2012-11-06
0m10.245s
0m9.457s
0m0.592s
results -d ~/Desktop/general/20121106-national.json --csv > /tmp/test.csv
0m5.834s
0m5.255s
0m0.515s
Elex-micro passes all of the same tests that Elex does; the test suite is actually ported over from Elex. The output that Elex-micro generates is identical to Elex for results data. However, it is not a perfect drop-in replacement for Elex.
curl --compressed
and point Elex-micro to a local file)curl
)CandidateReportingUnit
(we use Elex for initialization)