Skip to content

Commit 54cd8ce

Browse files
committed
alphabetize fields
Signed-off-by: John Seekins <[email protected]>
1 parent 18aecf3 commit 54cd8ce

File tree

1 file changed

+40
-41
lines changed

1 file changed

+40
-41
lines changed

schemas.py

Lines changed: 40 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -2,37 +2,37 @@
22
import datetime
33

44
facilities_schema = {
5-
"scraped_date": datetime.datetime.now(datetime.UTC),
6-
"scrape_runtime": 0,
75
"enrich_runtime": 0,
86
"facilities": {},
7+
"scrape_runtime": 0,
8+
"scraped_date": datetime.datetime.now(datetime.UTC),
99
}
1010

1111
field_offices_schema: dict = {
1212
"field_offices": {},
13-
"scraped_date": datetime.datetime.now(datetime.UTC),
1413
"scrape_runtime": 0,
14+
"scraped_date": datetime.datetime.now(datetime.UTC),
1515
}
1616

1717
field_office_schema: dict = {
18-
"name": "",
19-
"field_office": "",
20-
"id": "",
21-
"address_str": "",
2218
"address": {
2319
"administrative_area": "",
2420
"country": "",
2521
"locality": "",
2622
"postal_code": "",
2723
"street": "",
2824
},
25+
"address_str": "",
2926
"aor": "",
3027
"email": "",
28+
"field_office": "",
29+
"id": "",
3130
"source_urls": [],
3231
}
3332

3433
# default keys to "false"-y values so we can merge easier
3534
facility_schema: dict = {
35+
"_repaired_record": False,
3636
"address": {
3737
"administrative_area": "",
3838
"country": "",
@@ -41,86 +41,85 @@
4141
"street": "",
4242
},
4343
"address_str": "",
44-
"_repaired_record": False,
4544
"field_office": copy.deepcopy(field_office_schema),
46-
"image_url": "",
47-
"name": "",
48-
"phone": "",
49-
"source_urls": [],
50-
"wikipedia": {
51-
"page_url": "",
52-
"search_query": "",
45+
"facility_type": {
46+
"description": "",
47+
"expanded_name": "",
48+
"id": "",
5349
},
54-
"wikidata": {
55-
"page_url": "",
56-
"search_query": "",
50+
"inspection": {
51+
"last_date": None,
52+
"last_rating": "",
53+
"last_type": "",
5754
},
55+
"image_url": "",
5856
"osm": {
59-
"url": "",
6057
"latitude": 0,
6158
"longitude": 0,
6259
"search_query": "",
60+
"url": "",
6361
},
62+
"name": "",
6463
"page_updated_date": None,
64+
"phone": "",
6565
"population": {
66-
"male": {
66+
"avg_stay_length": 0,
67+
"female": {
6768
"allowed": False,
6869
"criminal": 0,
6970
"non_criminal": 0,
7071
},
71-
"female": {
72+
"male": {
7273
"allowed": False,
7374
"criminal": 0,
7475
"non_criminal": 0,
7576
},
77+
"housing": {
78+
"mandatory": 0,
79+
"guaranteed_min": 0,
80+
},
7681
"ice_threat_level": {
7782
"level_1": 0,
7883
"level_2": 0,
7984
"level_3": 0,
8085
"none": 0,
8186
},
82-
"total": 0,
8387
"security_threat": {
8488
"low": 0,
8589
"medium_low": 0,
8690
"medium_high": 0,
8791
"high": 0,
8892
},
89-
"housing": {
90-
"mandatory": 0,
91-
"guaranteed_min": 0,
92-
},
93-
"avg_stay_length": 0,
93+
"total": 0,
9494
},
95-
"facility_type": {
96-
"id": "",
97-
"description": "",
98-
"expanded_name": "",
95+
"source_urls": [],
96+
"wikipedia": {
97+
"page_url": "",
98+
"search_query": "",
9999
},
100-
"inspection": {
101-
"last_type": "",
102-
"last_date": None,
103-
"last_rating": "",
100+
"wikidata": {
101+
"page_url": "",
102+
"search_query": "",
104103
},
105104
}
106105

107106

108107
# enrichment response object
109108
enrich_resp_schema = {
110-
"original_name": "",
111109
"cleaned_name": "",
112-
"search_query_steps": [],
113-
"url": "",
114110
"details": {},
115-
"method": "none",
116111
"enrichment_type": "",
112+
"method": "none",
113+
"original_name": "",
114+
"search_query_steps": [],
115+
"url": "",
117116
}
118117

119118
# enrichment print details
120119
enrichment_print_schema = {
120+
"osm_found": 0,
121121
"wiki_found": 0,
122122
"wikidata_found": 0,
123-
"osm_found": 0,
124123
}
125124

126-
supported_output_types = ["csv", "json", "xlsx", "parquet"]
125+
supported_output_types = ["csv", "json", "parquet", "xlsx"]

0 commit comments

Comments
 (0)