-
-
Notifications
You must be signed in to change notification settings - Fork 106
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
activity_report #282
base: main
Are you sure you want to change the base?
activity_report #282
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pretty good stuff. Lots of smallish comments, I think. Maybe a few bigger ones.
One thing that's missing is tests. Can you look at our testing framework and add some of those too? Let me know if you need help.
data = [] | ||
|
||
table = self.tree.xpath('//table')[0] | ||
|
||
rows = table.xpath('.//tr') | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This whitespace should go.
|
||
def _main(): | ||
if len(sys.argv) != 2: | ||
print("Usage: python -m juriscraper.pacer.case_query filepath") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Update this please
self._metadata = data | ||
return data | ||
|
||
def query(self, open, closed, office, type, start, end, text): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can't use type
as a parameter, it's a Python keyword.
This should also support docket number, event category, case flags, and sorting.
Are start and end done the same as other examples in Juriscraper? I think they have different names elsewhere.
Finally, your docstring should outline the parameters using :param
, as elsewhere.
<option selected=""></option> | ||
<option value="cv">Civil</option> | ||
<option value="cr">Criminal</option> | ||
<option value="em">Emergency Matter</option> | ||
<option value="mj">Magistrate Judge</option> | ||
<option value="mc">Miscellaneous</option> | ||
<option value="md">Multi-District Litigation</option> | ||
<option value="nr">Non Reportable</option> | ||
<option value="nc">Non-Compliance</option> | ||
<option value="po">Petty Offense</option> | ||
<option value="ph">Pro Hac Vice Case</option> | ||
<option value="pt">Probation Transfer</option> | ||
<option value="ps">Prose Screening</option> | ||
<option value="sc">Sealed Civil</option> | ||
<option value="sm">Sealed Miscellaneous</option> | ||
<option value="mb">Search Warrant</option> | ||
<option value="sa">Staff Attorney Assignment</option> | ||
<option value="at">Temporary Case Type</option> | ||
<option value="vc">Virtual CR Case for 3rd Judge</option> | ||
<option value="wi">Waiver of Indictment</option> | ||
<option value="wt">Wire Tap</option> | ||
<option value="gj">~Grand Jury</option> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Are these universal or per court? If the latter, we should either remove them from here (I think this is probably preferred) or note that loudly.
start = 'm/d/yyyy' | ||
end = 'm/d/yyyy' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These should be date objects. That way calling code doesn't have to think about dumb PACER date formatting decisions.
""" | ||
|
||
assert self.session is not None, \ | ||
"session attribute of DocketReport cannot be None." |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Update this, please.
def isFlags(cols): | ||
#Check for case flags. It's not always present. | ||
try: | ||
cols.index('Case Flags:') | ||
except ValueError: | ||
flag = "none" | ||
return flag | ||
else: | ||
flag = cols[cols.index('Case Flags:')+3] | ||
return flag |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think I would nest this here. Better to pull it out.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Also, shouldn't it be more like has_flags
?
u"docket_report_url":cols[1].xpath('@href')[0], | ||
u"entered": cols[cols.index('Entered: ')+1], | ||
u"time": cols[cols.index('Entered: ')+3], | ||
u"filed": cols[cols.index('Filed: ')+1], | ||
u"closed": cols[8], | ||
u"event": cols[cols.index('Event:')+1], | ||
u"case_flags": flags, | ||
u"category": cols[cols.index('Category:')+1], | ||
u"presider": cols[cols.index('Presider: ')+1], | ||
u"office": cols[cols.index('Office:')+1], | ||
u"docketed_by":cols[cols.index('Document: ')+5], | ||
u"doc1":cols[cols.index('Document: ')+1].xpath('@href')[0], | ||
u"doc_count":cols[cols.index('Document: ')+2] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's hard to understand here what you're doing with the math and the indexing and whatnot. Could you pull some of these cols.index(xxx)
bits into usefully named variables, maybe?
Formatting wise, these should have spaces around the +
signs. Also, no whitespace before the tailing }
.
|
||
def parse(self): | ||
self._clear_caches() | ||
print(self) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I assume printing this every time isn't desirable?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
And if that's true, do we need this function at all?
|
As discussed, a parser for PACER's Docket Activity Report (https://ecf.azd.uscourts.gov/cgi-bin/DktActivityRpt.pl).