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

Propagate Cosponsor table to the cosponsor_dict in the detail.html view #305

Closed
aih opened this issue Apr 13, 2021 · 4 comments
Closed

Propagate Cosponsor table to the cosponsor_dict in the detail.html view #305

aih opened this issue Apr 13, 2021 · 4 comments
Assignees

Comments

@aih
Copy link
Collaborator

aih commented Apr 13, 2021

There are now Cosponsor and Committee tables in the bills model, and a scraper in common.cosponsor.py that downloads, processes and loads those tables.

Meanwhile, the list of cosponsors of a bill is stored in a list within the bill table, cosponsors_dict. For this issue, we:

  1. Look up each item in the cosponsors_dict,

  2. Get the committees field for each cosponsor (the cosponsor's bioguide_id is unique). The committees field looks like: [{"name": "Raphael G. Warnock", "rank": 7, "party": "majority", "bioguide": "W000790", "committee": "SPAG"}...]

  3. Filter this list by the committees_dict list associated with the bill (e.g. [{"activity": ["referral"], "committee": "Senate Judiciary", "committee_id": "SSJU", "subcommittee": "", "subcomittee_id": ""}])
    image

  4. For each committee that the cosponsor is on that is in the bill's committees_dict, add it to a committees field for that user in the cosponsor_dict. That is the information that goes into the 'On Assigned Committee(s)' column of the Committees and Cosponsors box in the top right, and the Committees column of the Sponsors of Related Measures section.

The Cosponsor model looks like:
image

@aih
Copy link
Collaborator Author

aih commented Apr 13, 2021

I will create a dump of the database (about 2Gb) to make the Committee, Cosponsor and other data available, but the info above should be enough to get started on a branch for this issue.

@ayeshamk
Copy link
Collaborator

There are now Cosponsor and Committee tables in the bills model, and a scraper in common.cosponsor.py that downloads, processes and loads those tables.

Is there a readme file with instructions on how to populate Cosponsor and Committee tables?

@aih
Copy link
Collaborator Author

aih commented Apr 14, 2021

There is a note on Cosponsors in https://www.github.com/aih/FlatGov/tree/main/DATA_BACKGROUND.adoc

It doesn't provide details. The cosponsors.py has an updateCosponsorsAndCommittees (check the spelling) function at the bottom. Running that will download the yaml files, process them and update the db tables.

@ayeshamk
Copy link
Collaborator

Implemented. Propagated data in both the top-right and the lower table.

image
image

aih pushed a commit that referenced this issue Apr 26, 2021
* issue #305 committe cosponsors

* cosponsors table upddated

* committes and cosponsors updated

* committees and cosponsors,  related bills features added

* committees cosponsors sorted
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