Skip to content

Commit

Permalink
Use nested attachment format for IA parser
Browse files Browse the repository at this point in the history
  • Loading branch information
ttys0dev committed Aug 26, 2024
1 parent 3e7db71 commit 4889bfd
Show file tree
Hide file tree
Showing 14 changed files with 1,731 additions and 1,648 deletions.
12 changes: 11 additions & 1 deletion juriscraper/pacer/internet_archive.py
Original file line number Diff line number Diff line change
Expand Up @@ -220,7 +220,17 @@ def docket_entries(self):
if not de["document_number"].isdigit():
# Some courts put weird stuff in this column.
continue
docket_entries.append(de)
if de.get("attachment_number"):
try:
last_de = docket_entries[-1]
except IndexError:
continue
if last_de.get("document_number") == de["document_number"]:
attachments = last_de.get("attachments", [])
attachments.append(de)
last_de["attachments"] = attachments
else:
docket_entries.append(de)

docket_entries = clean_court_object(docket_entries)
self._docket_entries = docket_entries
Expand Down
98 changes: 53 additions & 45 deletions tests/examples/pacer/dockets_internet_archive/almd_49523.json
Original file line number Diff line number Diff line change
Expand Up @@ -1146,6 +1146,17 @@
"short_description": "Order on Motion to Withdraw as Attorney"
},
{
"attachments": [
{
"attachment_number": "1",
"date_filed": "2014-07-09",
"description": "",
"document_number": "625",
"pacer_doc_id": "01702313993",
"pacer_seq_no": null,
"short_description": "Advertisement Certification Report and Notice of Forfeiture"
}
],
"date_filed": "2014-07-09",
"description": "NOTICE (Declaration of Publication) by USA as to Willie C. Moody (Attachments: # (1) Advertisement Certification Report and Notice of Forfeiture)(Davidson, Kevin)",
"document_number": "625",
Expand All @@ -1154,31 +1165,24 @@
"short_description": "Notice (Other)"
},
{
"attachment_number": "1",
"date_filed": "2014-07-09",
"description": "",
"document_number": "625",
"pacer_doc_id": "01702313993",
"pacer_seq_no": null,
"short_description": "Advertisement Certification Report and Notice of Forfeiture"
},
{
"attachments": [
{
"attachment_number": "1",
"date_filed": "2014-07-09",
"description": "",
"document_number": "626",
"pacer_doc_id": "01702314758",
"pacer_seq_no": null,
"short_description": "Exhibit A"
}
],
"date_filed": "2014-07-09",
"description": "NOTICE of Claim of Property by Vernon F. Johnson as to Willie C. Moody (Attachments: # (1) Exhibit A)(war, )",
"document_number": "626",
"pacer_doc_id": "01702314757",
"pacer_seq_no": null,
"short_description": "Notice (Other)"
},
{
"attachment_number": "1",
"date_filed": "2014-07-09",
"description": "",
"document_number": "626",
"pacer_doc_id": "01702314758",
"pacer_seq_no": null,
"short_description": "Exhibit A"
},
{
"date_filed": "2014-07-10",
"description": "TEXT ORDER as to Willie C. Moody: Sentencing set for 8/26/14 is RESET to 8/29/2014 at 10:00 AM in Courtroom 2FMJ before Honorable Judge Myron H. Thompson. Entered by Honorable Judge Myron H. Thompson on 7/10/14. (war, )",
Expand All @@ -1188,22 +1192,24 @@
"short_description": "Order"
},
{
"attachments": [
{
"attachment_number": "1",
"date_filed": "2014-07-09",
"description": "",
"document_number": "629",
"pacer_doc_id": "01702315696",
"pacer_seq_no": null,
"short_description": "Exhibit A"
}
],
"date_filed": "2014-07-09",
"description": "NOTICE Of Claim of Vernon F. Johnson as to Willie C. Moody (Attachments: # (1) Exhibit A)(ag, )",
"document_number": "629",
"pacer_doc_id": "01702315695",
"pacer_seq_no": null,
"short_description": "Notice (Other)"
},
{
"attachment_number": "1",
"date_filed": "2014-07-09",
"description": "",
"document_number": "629",
"pacer_doc_id": "01702315696",
"pacer_seq_no": null,
"short_description": "Exhibit A"
},
{
"date_filed": "2014-07-14",
"description": "ORDER as to Willie C. Moody re [629] Notice of Claim: Government and defendant Willie C. Moody's Responses to Notice of Claim due by 7/25/2014; Evidentiary Hearing on the Notice of Claim set for 8/29/2014 10:00 AM in Courtroom 2FMJ before Honorable Judge Myron H. Thompson; Claimant Johnson must be present and should be prepared to present admissible evidence in support of his claim; United States Magistrate Judge Susan Walker shall take care of subpoenaing any witnesses on behalf of claimant Johnson, including entering any appropriate orders regarding such matter; Claimant Johnson is informed that if he needs help in subpoenaing witnesses or obtaining documents, he should contact Magistrate Judge Walker. Signed by Honorable Judge Myron H. Thompson on 7/14/14. (war, )",
Expand All @@ -1229,31 +1235,33 @@
"short_description": "Response to Court Order"
},
{
"attachments": [
{
"attachment_number": "1",
"date_filed": "2014-07-28",
"description": "",
"document_number": "635",
"pacer_doc_id": "01702325954",
"pacer_seq_no": null,
"short_description": "Stipulation of Final Settlement and Release of All Claims as to Third Party Pet"
},
{
"attachment_number": "2",
"date_filed": "2014-07-28",
"description": "",
"document_number": "635",
"pacer_doc_id": "01702325955",
"pacer_seq_no": null,
"short_description": "Text of Proposed Order"
}
],
"date_filed": "2014-07-28",
"description": "MOTION for Approval of Stipulation of Final Settlement and Release of All Claims as to Third Party Petition of Vernon F. Johnson re [626] Notice (Other) by USA as to Willie C. Moody. (Attachments: # (1) Stipulation of Final Settlement and Release of All Claims as to Third Party Petition of Vernon F. Johnson, # (2) Text of Proposed Order)(Davidson, Kevin)",
"document_number": "635",
"pacer_doc_id": "01702325953",
"pacer_seq_no": null,
"short_description": "Motion for Miscellaneous Relief"
},
{
"attachment_number": "1",
"date_filed": "2014-07-28",
"description": "",
"document_number": "635",
"pacer_doc_id": "01702325954",
"pacer_seq_no": null,
"short_description": "Stipulation of Final Settlement and Release of All Claims as to Third Party Pet"
},
{
"attachment_number": "2",
"date_filed": "2014-07-28",
"description": "",
"document_number": "635",
"pacer_doc_id": "01702325955",
"pacer_seq_no": null,
"short_description": "Text of Proposed Order"
},
{
"date_filed": "2014-08-13",
"description": "TEXT ORDER granting [641] Motion to Seal as to Willie C. Moody (5). Entered by Honorable Judge Myron H. Thompson on 8/13/2014. (ag, )",
Expand Down
146 changes: 74 additions & 72 deletions tests/examples/pacer/dockets_internet_archive/azd_1061043.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,85 +10,87 @@
"demand": "",
"docket_entries": [
{
"attachments": [
{
"attachment_number": "1",
"date_filed": "2017-10-25",
"description": "",
"document_number": "1",
"pacer_doc_id": "025018027677",
"pacer_seq_no": null,
"short_description": "Civil Cover Sheet"
},
{
"attachment_number": "2",
"date_filed": "2017-10-25",
"description": "",
"document_number": "1",
"pacer_doc_id": "025018027678",
"pacer_seq_no": null,
"short_description": "Exhibit"
},
{
"attachment_number": "3",
"date_filed": "2017-10-25",
"description": "",
"document_number": "1",
"pacer_doc_id": "025018027679",
"pacer_seq_no": null,
"short_description": "Exhibit"
},
{
"attachment_number": "4",
"date_filed": "2017-10-25",
"description": "",
"document_number": "1",
"pacer_doc_id": "025018027680",
"pacer_seq_no": null,
"short_description": "Exhibit"
},
{
"attachment_number": "5",
"date_filed": "2017-10-25",
"description": "",
"document_number": "1",
"pacer_doc_id": "025018027681",
"pacer_seq_no": null,
"short_description": "Exhibit"
},
{
"attachment_number": "6",
"date_filed": "2017-10-25",
"description": "",
"document_number": "1",
"pacer_doc_id": "025018027682",
"pacer_seq_no": null,
"short_description": "Exhibit"
},
{
"attachment_number": "7",
"date_filed": "2017-10-25",
"description": "",
"document_number": "1",
"pacer_doc_id": "025018027683",
"pacer_seq_no": null,
"short_description": "Exhibit"
},
{
"attachment_number": "8",
"date_filed": "2017-10-25",
"description": "",
"document_number": "1",
"pacer_doc_id": "025018027684",
"pacer_seq_no": null,
"short_description": "Exhibit"
}
],
"date_filed": "2017-10-25",
"description": "COMPLAINT. Filing fee received: $ 400.00, receipt number 0970-14794507 filed by Suzanne Powers.(Submitted by Dana LeJune) (Attachments: # 1 Civil Cover Sheet, # 2 Exhibit, # 3 Exhibit, # 4 Exhibit, # 5 Exhibit, # 6 Exhibit, # 7 Exhibit, # 8 Exhibit)(KAS) (Entered: 10/25/2017)",
"document_number": "1",
"pacer_doc_id": "025018027676",
"pacer_seq_no": null,
"short_description": ""
},
{
"attachment_number": "1",
"date_filed": "2017-10-25",
"description": "",
"document_number": "1",
"pacer_doc_id": "025018027677",
"pacer_seq_no": null,
"short_description": "Civil Cover Sheet"
},
{
"attachment_number": "2",
"date_filed": "2017-10-25",
"description": "",
"document_number": "1",
"pacer_doc_id": "025018027678",
"pacer_seq_no": null,
"short_description": "Exhibit"
},
{
"attachment_number": "3",
"date_filed": "2017-10-25",
"description": "",
"document_number": "1",
"pacer_doc_id": "025018027679",
"pacer_seq_no": null,
"short_description": "Exhibit"
},
{
"attachment_number": "4",
"date_filed": "2017-10-25",
"description": "",
"document_number": "1",
"pacer_doc_id": "025018027680",
"pacer_seq_no": null,
"short_description": "Exhibit"
},
{
"attachment_number": "5",
"date_filed": "2017-10-25",
"description": "",
"document_number": "1",
"pacer_doc_id": "025018027681",
"pacer_seq_no": null,
"short_description": "Exhibit"
},
{
"attachment_number": "6",
"date_filed": "2017-10-25",
"description": "",
"document_number": "1",
"pacer_doc_id": "025018027682",
"pacer_seq_no": null,
"short_description": "Exhibit"
},
{
"attachment_number": "7",
"date_filed": "2017-10-25",
"description": "",
"document_number": "1",
"pacer_doc_id": "025018027683",
"pacer_seq_no": null,
"short_description": "Exhibit"
},
{
"attachment_number": "8",
"date_filed": "2017-10-25",
"description": "",
"document_number": "1",
"pacer_doc_id": "025018027684",
"pacer_seq_no": null,
"short_description": "Exhibit"
},
{
"date_filed": "2017-10-25",
"description": "Filing fee paid, receipt number 0970-14794507. This case has been assigned to the Honorable Judge Douglas L Rayes. All future pleadings or documents should bear the correct case number: CV-17-3923-PHX-DLR. Notice of Availability of Magistrate Judge to Exercise Jurisdiction form attached. (KAS) (Entered: 10/25/2017)",
Expand Down
Loading

0 comments on commit 4889bfd

Please sign in to comment.