newsdev/elex-micro

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

Homepage:

Size: 446

Language: Python

GitHub Committers

UserMost Recent Commit# Commits

Other Committers

UserEmailMost Recent Commit# Commits

README

ELEX-MICRO

Everything you like about Elex, only less.

What?

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.

Why?

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
How?

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.

Things Elex-micro does not do that Elex does

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.