Skip to content

Commit 886b907

Browse files
committed
only one job needs facility_sheet_header, keep it with that job
Signed-off-by: John Seekins <john.seekins@spoileralert.com>
1 parent cded7f9 commit 886b907

2 files changed

Lines changed: 33 additions & 34 deletions

File tree

ice_scrapers/__init__.py

Lines changed: 0 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -4,38 +4,6 @@
44
may call them
55
"""
66

7-
# extracted ADP sheet header list 2025-09-07
8-
facility_sheet_header = [
9-
"Name",
10-
"Address",
11-
"City",
12-
"State",
13-
"Zip",
14-
"AOR",
15-
"Type Detailed",
16-
"Male/Female",
17-
"FY25 ALOS",
18-
"Level A",
19-
"Level B",
20-
"Level C",
21-
"Level D",
22-
"Male Crim",
23-
"Male Non-Crim",
24-
"Female Crim",
25-
"Female Non-Crim",
26-
"ICE Threat Level 1",
27-
"ICE Threat Level 2",
28-
"ICE Threat Level 3",
29-
"No ICE Threat Level",
30-
"Mandatory",
31-
"Guaranteed Minimum",
32-
"Last Inspection Type",
33-
"Last Inspection End Date",
34-
"Pending FY25 Inspection",
35-
"Last Inspection Standard",
36-
"Last Final Rating",
37-
]
38-
397
ice_inspection_types = {
408
# found in https://www.ice.gov/foia/odo-facility-inspections
419
"ODO": "Office of Detention Oversight",

ice_scrapers/spreadsheet_load.py

Lines changed: 33 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22
import copy
33
import datetime
44
from ice_scrapers import (
5-
facility_sheet_header,
65
ice_facility_types,
76
ice_inspection_types,
87
repair_locality,
@@ -27,6 +26,38 @@
2726
base_xlsx_url = "https://www.ice.gov/detain/detention-management"
2827
filename = f"{SCRIPT_DIR}{os.sep}detentionstats.xlsx"
2928

29+
# extracted ADP sheet header list 2025-09-07
30+
facility_sheet_header = [
31+
"Name",
32+
"Address",
33+
"City",
34+
"State",
35+
"Zip",
36+
"AOR",
37+
"Type Detailed",
38+
"Male/Female",
39+
"FY25 ALOS",
40+
"Level A",
41+
"Level B",
42+
"Level C",
43+
"Level D",
44+
"Male Crim",
45+
"Male Non-Crim",
46+
"Female Crim",
47+
"Female Non-Crim",
48+
"ICE Threat Level 1",
49+
"ICE Threat Level 2",
50+
"ICE Threat Level 3",
51+
"No ICE Threat Level",
52+
"Mandatory",
53+
"Guaranteed Minimum",
54+
"Last Inspection Type",
55+
"Last Inspection End Date",
56+
"Pending FY25 Inspection",
57+
"Last Inspection Standard",
58+
"Last Final Rating",
59+
]
60+
3061

3162
def _download_sheet(keep_sheet: bool = True, force_download: bool = True) -> Tuple[polars.DataFrame, str]:
3263
"""Download the detention stats sheet from ice.gov"""
@@ -154,9 +185,9 @@ def load_sheet(keep_sheet: bool = True, force_download: bool = True) -> dict:
154185
"last_rating": row["Last Final Rating"],
155186
}
156187
details["source_urls"].append(sheet_url)
157-
# details["field_office"] = self.field_offices["field_offices"][area_of_responsibility[row["AOR"]]]
158188
details["field_office"] = copy.deepcopy(field_office_schema)
159189
details["field_office"]["id"] = row["AOR"]
160190
details["address_str"] = full_address
161191
results[full_address] = details
192+
logger.info(" Loaded %s facilties", len(results.keys()))
162193
return results

0 commit comments

Comments
 (0)