You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: schemas.py
+47-3Lines changed: 47 additions & 3 deletions
Original file line number
Diff line number
Diff line change
@@ -2,33 +2,77 @@
2
2
3
3
facilities_schema= {
4
4
"scraped_date": datetime.datetime.utcnow(),
5
-
"page_updated_date": datetime.datetime.utcnow(),
6
5
"scrape_runtime": 0,
7
6
"enrich_runtime": 0,
8
7
"facilities": [],
9
8
}
10
9
10
+
# default keys to "false"-y values so we can merge easier
11
11
facility_schema= {
12
12
"address": {
13
-
"street": "",
14
13
"administrative_area": "",
15
14
"country": "",
16
15
"locality": "",
17
16
"postal_code": "",
17
+
"street": "",
18
18
},
19
19
"facility_url": "",
20
20
"field_office": "",
21
21
"image_url": "",
22
22
"name": "",
23
23
"phone": "",
24
24
"raw_scrape": "",
25
-
"source_url": "",
25
+
"source_urls": [],
26
26
"wikipedia_page_url": "",
27
27
"wikidata_page_url": "",
28
28
"osm_result_url": "",
29
29
"wikipedia_search_query": "",
30
30
"wikidata_search_query": "",
31
31
"osm_search_query": "",
32
+
"page_updated_date": None,
33
+
"population": {
34
+
"male": {
35
+
"allowed": False,
36
+
"criminal": 0,
37
+
"non_criminal": 0,
38
+
},
39
+
"female": {
40
+
"allowed": False,
41
+
"criminal": 0,
42
+
"non_criminal": 0,
43
+
},
44
+
},
45
+
"facility_type": "",
46
+
"inspection_date": None,
47
+
"avg_stay_length": 0,
48
+
}
49
+
50
+
# extracted from https://www.ice.gov/doclib/detention/FY25_detentionStats08292025.xlsx 2025-09-07
51
+
ice_facility_types= {
52
+
"BOP": {
53
+
"expanded_name": "Federal Bureau of Prisons",
54
+
"description": "A facility operated by the Federal Bureau of Prisons",
55
+
},
56
+
"DIGSA": {
57
+
"expanded_name": "Dedicated Intergovernmental Service Agreement",
58
+
"decsription": "A publicly-owned facility operated by state/local government(s), or private contractors, in which ICE contracts to use all bed space via a Dedicated Intergovernmental Service Agreement; or facilities used by ICE pursuant to Inter-governmental Service Agreements, which house only ICE detainees – typically these are operated by private contractors pursuant to their agreements with local governments.",
59
+
},
60
+
"IGSA": {
61
+
"expanded_name": "Intergovernmental Service Agreement",
62
+
"description": "A publicly-owned facility operated by state/local government(s), or private contractors, in which ICE contracts for bed space via an Intergovernmental Service Agreement; or local jails used by ICE pursuant to Inter-governmental Service Agreements, which house both ICE and non-ICE detainees, typically county prisoners awaiting trial or serving short sentences, but sometimes also USMS prisoners.",
63
+
},
64
+
"SPC": {
65
+
"expanded_name": "Service Processing Center",
66
+
"description": "A facility owned by the government and staffed by a combination of federal and contract employees.",
67
+
},
68
+
"USMS": {
69
+
"expanded_name": "United States Marshals Service",
70
+
"description": "A facility primarily contracted with the USMS for housing of USMS detainees, in which ICE contracts with the USMS for bed space.",
0 commit comments