Skip to content

Commit

Permalink
IN: correct concurrent resolution bill identifiers to match website
Browse files Browse the repository at this point in the history
  • Loading branch information
jessemortenson committed Dec 23, 2024
1 parent 5434de9 commit b669b09
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion scrapers/in/bills.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,17 @@
SCRAPE_WEB_VERSIONS = "INDIANA_SCRAPE_WEB_VERSIONS" in os.environ


# IN API differs from IN website in how it displays some bill identifiers
# This function corrects from API notation to web notation
def correct_bill_identifier(display_name, bill_type):
if bill_type == "CRES":
# IN API lists these as HC 1, SC 2, etc.
# but IN website lists them as HCR 1, SCR 1
return display_name.replace("C", "CR")
else:
return display_name


class INBillScraper(Scraper):
categorizer = Categorizer()

Expand Down Expand Up @@ -313,7 +324,7 @@ def scrape(self, session=None):

for b in all_pages:
bill_id = b["billName"]
disp_bill_id = b["displayName"]
disp_bill_id = correct_bill_identifier(b["displayName"], b["type"])
bill_link = b["link"]

api_source = urljoin(api_base_url, bill_link)
Expand Down

0 comments on commit b669b09

Please sign in to comment.