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

senate_class for legislators.csv? #530

Open
dannguyen opened this issue Dec 8, 2017 · 3 comments
Open

senate_class for legislators.csv? #530

dannguyen opened this issue Dec 8, 2017 · 3 comments

Comments

@dannguyen
Copy link
Contributor

First of all, I love that the project now provides CSV versions of the data. The YAML has always been great but a major obstacle for non-dev types. CSV makes the data so much more accessible to folks learning data science, and for those of us who are somewhat experienced and need to look up a quick fact. Thanks for the feature!

Now my complaint :) -- could a senate_class column be added? I like doing exercises analyzing upcoming races, and having the senate_class field would make it much easier to include analysis for Senate races.

I've just discovered the CSV versions so I can poke around and make the tweak for a pull request. Wanted to see if there was a reason for not including it (maybe to keep the file/column array slim?) before giving it a go. Thanks!

@JoshData
Copy link
Member

JoshData commented Dec 8, 2017 via email

@AlJohri
Copy link

AlJohri commented Feb 20, 2018

hey @dannguyen did you ever get around to this? might need this too

@dannguyen
Copy link
Contributor Author

Thanks for pinging me on this. I believing adding a single line -- to scripts/alternate_bulk_formats.py#generate_csv should do the trick:

	term_fields = [
	("type", "type"),
	("state", "state"),
	("district", "district"),
	("class", "senate_class"),  ## this is the line
	("party", "party"),
	("url", "url"),
	("address", "address"),
	("phone", "phone"),
	("contact_form", "contact_form"),
	("rss_url", "rss_url"),
	]

I submitted the single line change as a pull request.
cf155b4

I'm too incompetent (and sleepy) to figure out how to run alternate_bulk_formats.py to generate the data files used in production and on the Github repo. But the legislators-current.csv file seems to be fine:

https://gist.github.com/dannguyen/501ce45467d20d7d3535bb277dfe7719

(again, sorry for being incapable for just getting the test suites and deploy scripts to run on my machine, just wanted to post what looks like the solution for anyone who needs the field ASAP)

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

3 participants