Skip to content

Commit

Permalink
Clarify some event committees (#4698)
Browse files Browse the repository at this point in the history
* PA: Events: Add chamber to linked committee

* USA: Events: Add parent com to house event committees
  • Loading branch information
showerst authored Sep 14, 2023
1 parent 27d84ca commit 0b05d48
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 1 deletion.
4 changes: 4 additions & 0 deletions scrapers/pa/events.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@

class PAEventScraper(Scraper):
_tz = pytz.timezone("US/Eastern")
chamber_names = {"upper": "Senate", "lower": "House"}

def scrape(self, chamber=None):
chambers = [chamber] if chamber is not None else ["upper", "lower"]
Expand Down Expand Up @@ -92,6 +93,9 @@ def scrape_chamber(self, chamber):
parsed = urllib.parse.urlparse(committee.get("href"))
qs = urllib.parse.parse_qs(parsed.query)
com_name = re.sub(r" \([S|H]\)$", "", committee.text)
if "joint" not in com_name.lower():
chamber_name = self.chamber_names[chamber].upper()
com_name = f"{chamber_name} {com_name}"
item.add_committee(
com_name,
id=qs.get("Code"),
Expand Down
7 changes: 6 additions & 1 deletion scrapers/usa/events.py
Original file line number Diff line number Diff line change
Expand Up @@ -249,7 +249,12 @@ def house_meeting(self, xml, source_url):

coms = xml.xpath("//committees/committee-name | //subcommittees/committee-name")
for com in coms:
com_name = com.xpath("string(.)")
if com.xpath("@parent-name"):
com_name = "{} {}".format(
com.xpath("@parent-name")[0], com.xpath("string(.)")
)
else:
com_name = com.xpath("string(.)")
com_name = f"House {com_name}"
event.add_participant(
com_name,
Expand Down

0 comments on commit 0b05d48

Please sign in to comment.