This is an elections results management, editing, parsing, web publishing and print publishing solution based around the Elex-CSV pseudo-standard.
In theory, you could go live in minutes by using the Elex package from the New York Times and National Public Radio, using results from the Associated Press.
This was built to allow people to publish election results in near-real time, using AP results, local scrapers or a combination of the two. Florida-election-results is one example of this, pulling in results from a state-level scraper and several county-level scrapers.
Any code that works or reads well should be credited to Caitlin Ostroff. Any code that fails or is profane should be blamed on Mike Stucka.
Friend of the project Acton Gorton suggested we should use an alternative data model, known as NIST SP 1500-100. Instead, we're using Elex-CSV for the data. However, the code is built squarely against the XKCD 2054 standard.
Installation: Clone repo. Use Python 3. Run pip install -r requirements.txt Start editing the configuration file.
The files:
Politico is trying to do much more than we're looking for, and brings a good deal of complexity. McCElections is no longer maintained and relies on some specific versions of older technologies, which would reasonably require updating. We didn't have the time. The MinnPost project looks good, but isn't working with the AP data we can reasonably expect would be a starting point for most news organizations.
This rig ran successfully for 11 papers in November, and for two races for one paper in March, and in April for another paper. It's fast. It's easy. There's a lot that should work out of the box, and a lot that can be customized. It's fast; three scrapers and full web publishing for 11 papers took something like six seconds to generate. (Adding in the detailed races option, implemented later, would slow it down some but probably not unreasonably so.)