TheWalkers / congress-legislators

Members of the United States Congress, 1789-Present, in YAML, as well as committees, presidents, and vice presidents.
Creative Commons Zero v1.0 Universal
4 stars 6 forks source link

Add unique IDs for district offices #13

Closed lavaturtle closed 7 years ago

lavaturtle commented 7 years ago

This modifies the legislators-district-offices.yaml file to add a unique id field to each office record. The purpose is to make it easier for clients ingesting the data to update their records when the file changes.

The ID is comprised of the legislator's bioguide ID, the name of the city the office is in, and an optional integer for disambiguation.

tcarobruce commented 7 years ago

Looks great, thank you! Can you share the specific approach taken to generate these ids? I'd like to add that to TheWalkers/congress-turk and district office validation tests (once we have them!)

lavaturtle commented 7 years ago

Sure! I ran this script to add the IDs to the file: https://github.com/controlshift/congress-legislators/blob/add-ids-to-offices-script/add_ids_to_offices.rb

(Just running that on the existing file also caused other YAML normalization changes, so what I actually did was: load/dump the YAML on a different local branch to normalize it; run the script on the normalized file; cherry-pick that second commit to get just the ID changes)