alex / nyt-2020-election-scraper

https://alex.github.io/nyt-2020-election-scraper/battleground-state-changes.html
MIT License
1.76k stars 289 forks source link

Use unformatted state name as dictionary key #358

Closed saleemrashid closed 3 years ago

saleemrashid commented 3 years ago
Motivation

Instead of the formatted state name (i.e. Alaska (EV: 3)), we should use the unformatted state name (i.e. Alaska) as the dictionary key, and then explicitly use the formatted state name when generating output files.

The CSV technically shouldn't have been using the formatted name, but in the interests of backwards-compatibility, I've kept the existing behaviour. However, this means we cannot change the formatted name without breaking backwards-compatibility - unless we add a formatted name for the CSV that's separate from the one used in the HTML.

Changes

This pull request should not change the output files at all.