A command line tool to help streamline election coverage.

Developed by the New York Times and NPR, Elex allows you to integrate the AP Elections API into non-Python environments.

Unlike previous versions of the API that used a FTP-based system, AP's updated version for the 2016 cycle returns data over HTTP. Since this means that established ways of working with the API may not be fully compatible, Jeremy Bowers and David Eads sought to create a tool that would allow newsrooms to focus on the API's content, rather than loading and parsing its data.

Their result was Elex - a self-contained command line tool that returns AP's data in either CSV or JSON.

Although still in development, there are already number of recipes available and the developers encourage users to contribute more.

Some tried and tested recipes include:

- Retrieve local election results
- Auto-generate SQL schemas with csvkit
- Filter with jq and upload to S3

Some experimental implementations are also available, such as one to convert Elex data into HTML5 text track for live video streaming and a node-based admin interface.

Explore the tool further on its website here.

Image: Jeff Warren