Skip to content

Commit

Permalink
wip
Browse files Browse the repository at this point in the history
  • Loading branch information
grossir committed Feb 24, 2025
1 parent 5841163 commit 22502e3
Showing 1 changed file with 15 additions and 5 deletions.
20 changes: 15 additions & 5 deletions juriscraper/opinions/united_states/state/mont.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,22 +8,25 @@


class Site(OpinionSiteLinear):
base_url = "https://juddocumentservice.mt.gov"
download_base = f"{base_url}/getDocByCTrackId?DocId="
cite_regex = r"((19|20)\d{2}\sMT\s\d{1,3}[A-Z]?)"

def __init__(self, *args, **kwargs):
super().__init__(*args, **kwargs)
self.court_id = self.__module__
self.base = "https://juddocumentservice.mt.gov"
self.url = f"{self.base}/getDailyOrders"
self.download_base = f"{self.base}/getDocByCTrackId?DocId="
self.url = f"{self.base_url}/getDailyOrders"
self.expected_content_types = None
self.cite_regex = r"((19|20)\d{2}\sMT\s\d{1,3}[A-Z]?)"

def _process_html(self):
for row in self.html:
summary = row["documentDescription"]
if not summary.startswith("Opinion"):
# skip orders and just do opinions
continue

status = "Published" if "Published" in summary else "Unpublished"

docket = row["caseNumber"]
if docket.startswith("DA"):
nature = "Direct Appeal"
Expand All @@ -36,6 +39,10 @@ def _process_html(self):
else:
nature = "Unknown"

# TODO: parse disp?
# Opinion - Noncite/Memorandum Chief Justice McGrath authored, Affirmed.
# Opinion - Noncite/Memorandum - Justice Baker - Affirmed and Remanded
# Opinion - Noncite/Memorandum; Justice Rice Author - Affirmed in part, reversed in part and remanded.
m = re.search(
r"Justice (?P<author>.*?)\s*(?:author|,|-)", summary, re.I
)
Expand All @@ -47,7 +54,6 @@ def _process_html(self):
"date": row["fileDate"],
"name": row["title"],
"docket": docket,
"summary": summary,
"nature_of_suit": nature,
"author": author,
}
Expand All @@ -63,3 +69,7 @@ def extract_from_text(self, scraped_text: str) -> dict:
if match := re.search(self.cite_regex, first_text):
return {"Citation": match.group(0)}
return {}

def cleanup_content(content: str):
""""""
pass

0 comments on commit 22502e3

Please sign in to comment.