-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathlookups.py
More file actions
253 lines (242 loc) · 10.6 KB
/
Copy pathlookups.py
File metadata and controls
253 lines (242 loc) · 10.6 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
# This file defines a series of constants that represent the values used as reference dicts.
# Rather than define the values in the db setup scripts and then make db calls to lookup the surrogate keys,
# we'll define everything here, in a file that can be used by the db setup scripts *and* the application code.
from collections import namedtuple
LookupType = namedtuple("LookupType", ["name", "desc"])
LookupFileType = namedtuple("LookupFileType", ["name", "desc", "letter", "order", "crossfile", "model"])
ACTION_TYPE = [
LookupType("A", "New"),
LookupType("B", "Continuation"),
LookupType("C", "Revision"),
LookupType("D", "Adjustment to Completed Project"),
LookupType("E", "Aggregate Mixed"),
]
ACTION_TYPE_DICT = {item.name: item.desc for item in ACTION_TYPE}
ASSISTANCE_TYPE = [
LookupType("02", "block grant (A)"),
LookupType("03", "formula grant (A)"),
LookupType("04", "project grant (B)"),
LookupType("05", "cooperative agreement (B)"),
LookupType(
"06", "direct payment for specified use, as a subsidy or other non-reimbursable direct financial aid " "(C)"
),
LookupType("07", "direct loan (E)"),
LookupType("08", "guaranteed/insured loan (F)"),
LookupType("09", "insurance (G)"),
LookupType("10", "direct payment with unrestricted use (retirement, pension, veterans benefits, etc.) (D)"),
LookupType("11", "other reimbursable, contingent, intangible, or indirect financial assistance"),
]
ASSISTANCE_TYPE_DICT = {item.name: item.desc for item in ASSISTANCE_TYPE}
CORRECTION_DELETE_IND = [
LookupType("C", "Correct an Existing Record"),
LookupType("D", "Delete an Existing Record"),
]
CORRECTION_DELETE_IND_DICT = {item.name: item.desc for item in CORRECTION_DELETE_IND}
RECORD_TYPE = [
LookupType(1, "Aggregate Record"),
LookupType(2, "Non-Aggregate Record"),
LookupType(3, "Non-Aggregate Record to an Individual Recipient (PII-Redacted)"),
]
RECORD_TYPE_DICT = {item.name: item.desc for item in RECORD_TYPE}
BUSINESS_TYPE = [
LookupType("A", "State Government"),
LookupType("B", "County Government"),
LookupType("C", "City or Township Government"),
LookupType("D", "Special District Government"),
LookupType("E", "Regional Organization"),
LookupType("F", "U.S. Territory or Possession"),
LookupType("G", "Independent School District"),
LookupType("H", "Public/State Controlled Institution of Higher Education"),
LookupType("I", "Indian/Native American Tribal Government (Federally-Recognized)"),
LookupType("J", "Indian/Native American Tribal Government (Other than Federally-Recognized)"),
LookupType("K", "Indian/Native American Tribal Designated Organization"),
LookupType("L", "Public/Indian Housing Authority"),
LookupType("M", "Nonprofit with 501C3 IRS Status (Other than an Institution of Higher Education)"),
LookupType("N", "Nonprofit without 501C3 IRS Status (Other than an Institution of Higher Education)"),
LookupType("O", "Private Institution of Higher Education"),
LookupType("P", "Individual"),
LookupType("Q", "For-Profit Organization (Other than Small Business)"),
LookupType("R", "Small Business"),
LookupType("S", "Hispanic-serving Institution"),
LookupType("T", "Historically Black College or University (HBCU)"),
LookupType("U", "Tribally Controlled College or University (TCCU)"),
LookupType("V", "Alaska Native and Native Hawaiian Serving Institutions"),
LookupType("W", "Non-domestic (non-U.S.) Entity"),
LookupType("X", "Other"),
]
BUSINESS_TYPE_DICT = {item.name: item.desc for item in BUSINESS_TYPE}
SAM_BUSINESS_TYPE = [
LookupType("A6", "SBA Certified 8(a), Program Participant"),
LookupType("JT", "SBA Certified 8(a), Joint Venture"),
LookupType("XX", "SBA Certified HUBZone Small Business Concern"),
LookupType("A7", "AbilityOne Non Profit Agency"),
LookupType("2R", "U.S. Federal Government"),
LookupType("2F", "U.S. State Government"),
LookupType("12", "U.S. Local Government"),
LookupType("3I", "Tribal Government"),
LookupType("CY", "Foreign Government"),
LookupType("20", "Foreign Owned"),
LookupType("1D", "Small Agricultural Cooperative"),
LookupType("LJ", "Limited Liability Company"),
LookupType("XS", "Subchapter S Corporation"),
LookupType("MF", "Manufacturer of Goods"),
LookupType("2X", "For Profit Organization"),
LookupType("A8", "Non-Profit Organization"),
LookupType("2U", "Other Not For Profit Organization"),
LookupType("HK", "Community Development Corporation Owned Firm"),
LookupType("A3", "Labor Surplus Area Firm"),
LookupType("A5", "Veteran Owned Business"),
LookupType("QF", "Service Disabled Veteran Owned Business"),
LookupType("A2", "Woman Owned Business"),
LookupType("23", "Minority Owned Business"),
LookupType("FR", "Asian-Pacific American Owned"),
LookupType("QZ", "Subcontinent Asian (Asian-Indian), American Owned"),
LookupType("OY", "Black American Owned"),
LookupType("PI", "Hispanic American Owned"),
LookupType("NB", "Native American Owned"),
LookupType("ZZ", "Other"),
LookupType("8W", "Woman Owned Small Business"),
LookupType("27", "Self Certified Small Disadvantaged Business"),
LookupType("JX", "Self Certified HUBZone Joint Venture"),
LookupType("8E", "Economically Disadvantaged Women-Owned Small Business"),
LookupType("8C", "Joint Venture Women-Owned Small Business"),
LookupType("8D", "Economically Disadvantaged Joint Venture Women-Owned Small Business"),
LookupType("NG", "Federal Agency"),
LookupType("QW", "Federally Funded Research and Development Center"),
LookupType("C8", "City"),
LookupType("C7", "County"),
LookupType("ZR", "Inter-municipal"),
LookupType("MG", "Local Government Owned"),
LookupType("C6", "Municipality"),
LookupType("H6", "School District"),
LookupType("TW", "Transit Authority"),
LookupType("UD", "Council of Governments"),
LookupType("8B", "Housing Authorities Public/Tribal"),
LookupType("86", "Interstate Entity"),
LookupType("KM", "Planning Commission"),
LookupType("T4", "Port Authority"),
LookupType("H2", "Community Development Corporation"),
LookupType("6D", "Domestic Shelter"),
LookupType("M8", "Educational Institution"),
LookupType("G6", "1862 Land Grant College"),
LookupType("G7", "1890 Land Grant College"),
LookupType("G8", "1994 Land Grant College"),
LookupType("HB", "Historically Black College or University"),
LookupType("1A", "Minority Institution"),
LookupType("1R", "Private University or College"),
LookupType("ZW", "School of Forestry"),
LookupType("GW", "Hispanic Servicing Institution"),
LookupType("OH", "State Controlled Institution of Higher Learning"),
LookupType("HS", "Tribal College"),
LookupType("QU", "Veterinary College"),
LookupType("G3", "Alaskan Native Servicing Institution"),
LookupType("G5", "Native Hawaiian Servicing Institution"),
LookupType("BZ", "Foundation"),
LookupType("80", "Hospital"),
LookupType("FY", "Veterinary Hospital"),
LookupType("HQ", "DOT Certified DBE"),
LookupType("05", "Alaskan Native Corporation Owned Firm"),
LookupType("OW", "American Indian Owned"),
LookupType("XY", "Indian Tribe (Federally Recognized),"),
LookupType("8U", "Native Hawaiian Organization Owned Firm"),
LookupType("1B", "Tribally Owned Firm"),
LookupType("FO", "Township"),
LookupType("TR", "Airport Authority"),
LookupType("G9", "Other Than One of the Proceeding"),
LookupType("2J", "Sole Proprietorship"),
LookupType("2K", "Partnership or Limited Liability Partnership"),
LookupType("2L", "Corporate Entity (Not Tax Exempt),"),
LookupType("8H", "Corporate Entity (Tax Exempt),"),
LookupType("2A", "U.S. Government Entity"),
LookupType("X6", "International Organization"),
]
SAM_BUSINESS_TYPE_DICT = {item.name: item.desc for item in SAM_BUSINESS_TYPE}
BUSINESS_FUNDS_IND = [LookupType("NON", "Not Recovery Act"), LookupType("REC", "Recovery Act")]
BUSINESS_FUNDS_IND_DICT = {item.name: item.desc for item in BUSINESS_FUNDS_IND}
BUSINESS_CATEGORY_FIELDS = [
"airport_authority",
"alaskan_native_owned_corpo",
"alaskan_native_servicing_i",
"american_indian_owned_busi",
"asian_pacific_american_own",
"black_american_owned_busin",
"c1862_land_grant_college",
"c1890_land_grant_college",
"c1994_land_grant_college",
"c8a_program_participant",
"city_local_government",
"community_developed_corpor",
"community_development_corp",
"contracting_officers_deter",
"corporate_entity_not_tax_e",
"corporate_entity_tax_exemp",
"council_of_governments",
"county_local_government",
"domestic_or_foreign_entity",
"domestic_shelter",
"dot_certified_disadvantage",
"economically_disadvantaged",
"educational_institution",
"emerging_small_business",
"federal_agency",
"federally_funded_research",
"for_profit_organization",
"foreign_government",
"foreign_owned_and_located",
"foundation",
"hispanic_american_owned_bu",
"hispanic_servicing_institu",
"historically_black_college",
"historically_underutilized",
"hospital_flag",
"housing_authorities_public",
"indian_tribe_federally_rec",
"inter_municipal_local_gove",
"international_organization",
"interstate_entity",
"joint_venture_economically",
"joint_venture_women_owned",
"labor_surplus_area_firm",
"limited_liability_corporat",
"local_government_owned",
"manufacturer_of_goods",
"minority_institution",
"minority_owned_business",
"municipality_local_governm",
"native_american_owned_busi",
"native_hawaiian_owned_busi",
"native_hawaiian_servicing",
"nonprofit_organization",
"other_minority_owned_busin",
"other_not_for_profit_organ",
"partnership_or_limited_lia",
"planning_commission",
"port_authority",
"private_university_or_coll",
"sba_certified_8_a_joint_ve",
"school_district_local_gove",
"school_of_forestry",
"self_certified_small_disad",
"service_disabled_veteran_o",
"small_agricultural_coopera",
"small_disadvantaged_busine",
"sole_proprietorship",
"state_controlled_instituti",
"subchapter_s_corporation",
"subcontinent_asian_asian_i",
"the_ability_one_program",
"township_local_government",
"transit_authority",
"tribal_college",
"tribally_owned_business",
"us_federal_government",
"us_government_entity",
"us_local_government",
"us_state_government",
"us_tribal_government",
"veteran_owned_business",
"veterinary_college",
"veterinary_hospital",
"woman_owned_business",
"women_owned_small_business",
]