Skip to content

Commit f47dd43

Browse files
committed
additional details from sheet
Signed-off-by: John Seekins <[email protected]>
1 parent f46e022 commit f47dd43

File tree

2 files changed

+31
-3
lines changed

2 files changed

+31
-3
lines changed

schemas.py

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,13 +56,26 @@
5656
"criminal": 0,
5757
"non_criminal": 0,
5858
},
59+
"ice_threat_level": {
60+
"level_1": 0,
61+
"level_2": 0,
62+
"level_3": 0,
63+
"none": 0,
64+
},
5965
},
6066
"facility_type": {
6167
"id": "",
6268
"description": "",
6369
"expanded_name": "",
70+
"housing": {
71+
"mandatory": 0,
72+
"guaranteed_min": 0,
73+
},
74+
},
75+
"inspection": {
76+
"last_date": None,
77+
"last_rating": "",
6478
},
65-
"inspection_date": None,
6679
"avg_stay_length": 0,
6780
}
6881

scraper.py

Lines changed: 17 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -271,13 +271,28 @@ def _load_sheet(self) -> dict:
271271
details["population"]["female"]["allowed"] = True
272272
else:
273273
details["population"]["male"]["allowed"] = True
274-
details["facility_type"] = {"id": row["Type Detailed"]}
274+
details["population"]["ice_threat_level"] = {
275+
"level_1": row["ICE Threat Level 1"],
276+
"level_2": row["ICE Threat Level 2"],
277+
"level_3": row["ICE Threat Level 3"],
278+
"none": row["No ICE Threat Level"],
279+
}
280+
details["facility_type"] = {
281+
"id": row["Type Detailed"],
282+
"housing": {
283+
"mandatory": row["Mandatory"],
284+
"guaranteed_min": row["Guaranteed Minimum"],
285+
},
286+
}
275287
ft_details = ice_facility_types.get(row["Type Detailed"], {})
276288
if ft_details:
277289
details["facility_type"]["description"] = ft_details["description"]
278290
details["facility_type"]["expanded_name"] = ft_details["expanded_name"]
279291
details["avg_stay_length"] = row["FY25 ALOS"]
280-
details["inspection_date"] = row["Last Inspection End Date"]
292+
details["inspection"] = {
293+
"last_date": row["Last Inspection End Date"],
294+
"last_rating": row["Last Final Rating"],
295+
}
281296
details["source_urls"].append(self.sheet_url)
282297
details["address_str"] = full_address
283298
details["field_office"] = default_field_office

0 commit comments

Comments
 (0)