Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Missing FEC IDs #932

Closed
aaronrudkin opened this issue Jul 17, 2024 · 5 comments
Closed

Missing FEC IDs #932

aaronrudkin opened this issue Jul 17, 2024 · 5 comments

Comments

@aaronrudkin
Copy link

aaronrudkin commented Jul 17, 2024

We're using your data downstream. Thanks! A few hundred legislators serving post-2000 have no FEC IDs listed, and for our purposes we have to join legislators to donation data, so this is a necessary crosswalk. Our downstream pull of your data is slightly out of date, so some of these might already be fixed, but I figured I'd contribute back the results of an automated attempt to populate these fields.

Attached is a CSV with the following format:
Column 1: bioguide_id
Column 2: first_name
Column 3: last_name
Column 4: thomas_id
Column 5: state
Column 6: fec_id
(You can probably just use 1 and 6)

legislators_additional_fec_ids.csv

Note that many entries have multiple FEC IDs. I manually screened for same-named father-son pairs to remove those. Hope this is useful.

@aaronrudkin
Copy link
Author

Sorry, one additional omission there:

J000110,Christopher,John,01495,LA,S4LA00040
J000110,Christopher,John,01495,LA,H6LA07131

@JoshData
Copy link
Member

Thanks. I opened a PR to add this in #934.

For posterity, I wrote this script to import it:

import csv
import rtyaml

count = 0

for fn in ("current", "historical"):
	with rtyaml.edit(f"../legislators-{fn}.yaml") as P:
		PID = { }
		for p in P:
			PID[p["id"]["bioguide"]] = p
		for rec in csv.DictReader(open("/home/user/Downloads/legislators_additional_fec_ids.csv")):
			if rec["bioguide_id"] not in PID: continue
			p = PID[rec["bioguide_id"]]
			if "fec" not in p["id"]: p["id"]["fec"] = []
			if rec["fec_id"] not in p["id"]["fec"]:
				p["id"]["fec"].append(rec["fec_id"])
				count += 1
print(count)

dwillis added a commit that referenced this issue Jul 20, 2024
Add FEC IDs to historical legislators submitted by @aaronrudkin in #932
@JoshData
Copy link
Member

But our tests caught some FEC IDs that now occur duplicated on legislators:

H0MO01066 is duplicated: C000488 C001049
H4IL03077 is duplicated: L000342 L000563

I would appreciate if you could resolve this (so that my effort to import this isn't wasted...).

@aaronrudkin
Copy link
Author

aaronrudkin commented Jul 22, 2024

These are father/son pairs, good catch and my apologies for the wasted time -- I thought I had fixed all these before I let you know, but apparently had not.

The correction:

bioguide_id,fec_id
C000488,H6MO01022
L000342,H2IL05019

Source for Lipinski: https://www.fec.gov/data/candidate/H2IL05019/ (Lipinski's son has bioguide ID L000563 and FEC ID H4IL03077)
Source for Clay: https://www.fec.gov/data/candidate/H6MO01022/ (Clay Jr. has the other bioguide ID and FEC ID H0MO01066)

File with correction:
legislators_additional_fec_ids.csv

@JoshData
Copy link
Member

Thank you! All fixed & merged.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants