Skip to content

Commit

Permalink
Merge pull request #5212 from openstates/or-2025-session
Browse files Browse the repository at this point in the history
OR: add and activate 2025 session
  • Loading branch information
jessemortenson authored Jan 13, 2025
2 parents 6813c26 + 37b9005 commit f43e4e2
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 1 deletion.
8 changes: 8 additions & 0 deletions scrapers/or/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -205,6 +205,14 @@ class Oregon(State):
"name": "2024 Special Session",
"start_date": "2024-12-12",
"end_date": "2024-12-20",
"active": False,
},
{
"_scraped_name": "2025 Regular Session",
"identifier": "2025R1",
"name": "2025 Regular Session",
"start_date": "2025-01-21",
"end_date": "2025-06-30",
"active": True,
},
]
Expand Down
12 changes: 11 additions & 1 deletion scrapers/or/bills.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,10 @@

logger = logging.getLogger("openstates")

digest_and_readability_score_regex = re.compile(
r".+\(Flesch Readability Score: [0-9.]+\)\."
)


class ORBillScraper(Scraper):
tz = get_timezone()
Expand Down Expand Up @@ -65,7 +69,13 @@ def scrape_bills(self, session):
classification=self.bill_types[measure["MeasurePrefix"][1:]],
)
if measure.get("MeasureSummary", None):
bill.add_abstract(measure["MeasureSummary"].strip(), note="summary")
# MeasureSummary actually incdes two abstracts: a "digest" + readability score
# and a slightly longer version. These are concatenated together
# the longer version seems more useful so just cutting out the "digest" text
abstract = measure["MeasureSummary"]
abstract = re.sub(digest_and_readability_score_regex, "", abstract)
abstract = re.sub(r"\s+", " ", abstract)
bill.add_abstract(abstract.strip(), note="summary")

if measure["RelatingTo"] is None:
self.warning("No bill title for {}, skipping.".format(bid))
Expand Down
1 change: 1 addition & 0 deletions scrapers/or/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -54,4 +54,5 @@ def url_fix(s):
"2023R1": "2023R1",
"2024R1": "2024R1",
"2024S1": "2024S1",
"2025R1": "2025R1",
}

0 comments on commit f43e4e2

Please sign in to comment.