Skip to content

Conversation

@Luis-manzur
Copy link
Contributor

Fixes #1758

@Luis-manzur Luis-manzur requested review from flooie and grossir January 12, 2026 17:00
@Luis-manzur Luis-manzur linked an issue Jan 12, 2026 that may be closed by this pull request
@Luis-manzur Luis-manzur moved this to PRs to Review in Case Law Sprint Jan 12, 2026
pre-commit-ci bot and others added 3 commits January 12, 2026 17:00
…hanged-significantly' into 1758-the-ala-api-structure-has-changed-significantly

# Conflicts:
#	juriscraper/opinions/united_states/state/ala.py
@flooie
Copy link
Contributor

flooie commented Jan 12, 2026

Take another look at this. Your data doesnt look right to me

Copy link
Contributor

@flooie flooie left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Look at your output. it's not quite right.

{
"publicationItemUUID":"93C503F6-7E90-40CF-9C0F-FA9C20A8A036",
"docketEntryUUID":"73CC07D7-54C4-4BBA-9973-C1F4F5E5E3A3",
"caseInstanceUUID":"F46D02FF-367A-46FF-
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this file doesnt match what I expect, can you update the json to match the new api endpoint.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I updated all three example files, but just using the second API call json to do the testing

@Luis-manzur Luis-manzur requested a review from flooie January 12, 2026 22:53
Copy link
Contributor

@flooie flooie left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

a few more things

Comment on lines 28 to 46
def _download(self, request_dict=None):
"""Download the publication list and then fetch detailed publication data.
The initial API returns a list of publications, but we need to fetch
the detailed publication endpoint to get full case information.
"""
if self.test_mode_enabled():
return super()._download(request_dict)

# First, get the list of publications
html = super()._download(request_dict)

# Get the publicationUUID from the initial response
releases = html["_embedded"]["results"]
publication_uuid = releases[0].get("publicationUUID")

# Processes only the first result to scrape the most recent data.
item = self.json["_embedded"]["results"][0]
# Fetch detailed publication data
self.url = f"{self.base_url}/courts/{self.court_str}/cms/publication/{publication_uuid}"
return super()._download(request_dict)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

maybe something like this


    def _download(self, request_dict=None):
        """Download the publication list and then fetch detailed publication data.

        The initial API returns a list of publications, but we need to fetch
        the detailed publication endpoint to get full case information.
        """
        if self.test_mode_enabled():
            return super()._download(request_dict)

        resp = super()._download(request_dict)
        releases = resp["_embedded"]["results"]
        publication_uuid = releases[0].get("publicationUUID")

        self.url = f"{self.base_url}/courts/{self.court_str}/cms/publication/{publication_uuid}"
        self.json = super()._download(request_dict)

and drop the item = self.html since this is json

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I feel like this isnt resolved

@flooie flooie removed the request for review from grossir January 13, 2026 17:06
@flooie flooie assigned Luis-manzur and unassigned flooie Jan 13, 2026
@Luis-manzur Luis-manzur requested a review from flooie January 13, 2026 19:30
@Luis-manzur Luis-manzur assigned flooie and unassigned Luis-manzur Jan 13, 2026
return super()._download(request_dict)

# First, get the list of publications
html = super()._download(request_dict)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

maybe this should be called resp and not html since its not html

Comment on lines 77 to 84
r"\((?:Appeal from ([^:]+):\s*([^)]+)|[^;]+;\s*([^:]+Appeals):\s*([^)]+))\)",
name,
)
if match:
lower_court = match.group("lower_court").strip()
lower_court_number = match.group("lower_court_number").strip()
# Remove the parenthetical from the name
name = name[: match.start()].rstrip()
# Groups 1,2 for "Appeal from"; groups 3,4 for Ex parte format
lower_court = (match.group(1) or match.group(3) or "").strip()
lower_court_number = (
match.group(2) or match.group(4) or ""
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why did you strip out the group names

Comment on lines 91 to 94
name = re.sub(
r"\s*PETITION FOR WRIT OF .+?(?=\(|$)", "", name
).strip()
name = re.sub(r"\s*\(In re:\s*.+?\)", "", name).strip()
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this makes me think we are collecting things we shouldnt.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we dont wnat to remove in re from case names but we dont want to be collecting petitions for writ of anything I think.

@flooie flooie assigned Luis-manzur and unassigned flooie Jan 13, 2026
@Luis-manzur Luis-manzur requested a review from flooie January 15, 2026 19:47
@Luis-manzur Luis-manzur assigned flooie and unassigned Luis-manzur Jan 15, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: PRs to Review

Development

Successfully merging this pull request may close these issues.

The ala API structure has changed significantly.

3 participants