unitedstates / congress

Public domain data collectors for the work of Congress, including legislation, amendments, and votes.
https://github.com/unitedstates/congress/wiki
Creative Commons Zero v1.0 Universal
906 stars 197 forks source link

Mapping a vote to a specific text version of a bill #313

Open TTrapper opened 1 day ago

TTrapper commented 1 day ago

Once I've downloaded votes and bill texts, is there a way to map them? I'm currently doing this manually by extracting the billI_id from the vote data, then searching through the downloaded bills. It works but I'm still not sure if/how I can map a vote to a particular text_version (eg ih, pcs, eh, etc). Thanks!

JoshData commented 9 hours ago

I don't think there is a direct way to map a vote to a text version. There's no text version in the XML vote data from the House or Senate. Often the text of what is being voted on hasn't been published yet, in some cases that's because the vote outcome is what causes the new text to be published. And there's no vote ID in the govinfo text MODS metadata. While it would be helpful, there are a lot of votes that don't have IDs (anything that isn't a roll call vote).

The govinfo bill text MODS metadata has a "Last Action Date Listed" field (which I guess is the originInfo/dateIssued element) which might correspond to the date of a congressional action, but I recall that I haven't found it reliable. I think one reason is that fast-moving bills can have multiple significant actions on the same date.

For GovTrack, I have a map from bill text versions to bill status codes that are emitted by this project. The bill status codes are determined by parsing the govinfo BILLSTATUS XML data's action list. That usually works well. https://github.com/govtrack/govtrack.us-web/blob/main/bill/billtext.py