mirror of
https://github.com/unitedstates/congress-legislators.git
synced 2026-04-12 09:00:03 -04:00
* added bioguide ids for new senators by guessing bioguide.congress.gov urls using our bioguide_guess_new_member_ids.py tool * ran scripts/election_results_senate_2016.py * ran scripts/sweep.py (renamed from sweep_memberships and now also sweeps the social media file)
36 lines
1.4 KiB
Python
Executable File
36 lines
1.4 KiB
Python
Executable File
#!/usr/bin/env python
|
|
|
|
from utils import load_data, save_data
|
|
|
|
def run():
|
|
# load in members, orient by bioguide ID
|
|
print("Loading current legislators...")
|
|
current = load_data("legislators-current.yaml")
|
|
|
|
current_bioguide = { }
|
|
for m in current:
|
|
if "bioguide" in m["id"]:
|
|
current_bioguide[m["id"]["bioguide"]] = m
|
|
|
|
# remove out-of-office people from current committee membership
|
|
print("Sweeping committee membership...")
|
|
membership_current = load_data("committee-membership-current.yaml")
|
|
for committee_id in list(membership_current.keys()):
|
|
for member in membership_current[committee_id]:
|
|
if member["bioguide"] not in current_bioguide:
|
|
print("\t[%s] Ding ding ding! (%s)" % (member["bioguide"], member["name"]))
|
|
membership_current[committee_id].remove(member)
|
|
save_data(membership_current, "committee-membership-current.yaml")
|
|
|
|
# remove out-of-office people from social media info
|
|
print("Sweeping social media accounts...")
|
|
socialmedia_current = load_data("legislators-social-media.yaml")
|
|
for member in list(socialmedia_current):
|
|
if member["id"]["bioguide"] not in current_bioguide:
|
|
print("\t[%s] Ding ding ding! (%s)" % (member["id"]["bioguide"], member["social"]))
|
|
socialmedia_current.remove(member)
|
|
save_data(socialmedia_current, "legislators-social-media.yaml")
|
|
|
|
if __name__ == '__main__':
|
|
run()
|