ltc-code 0.1.81__tar.gz → 0.1.83__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.3
2
2
  Name: ltc-code
3
- Version: 0.1.81
3
+ Version: 0.1.83
4
4
  Summary: Add your description here
5
5
  Requires-Python: >=3.9
6
6
  Description-Content-Type: text/markdown
@@ -1,6 +1,6 @@
1
1
  [project]
2
2
  name = "ltc-code"
3
- version = "0.1.81"
3
+ version = "0.1.83"
4
4
  description = "Add your description here"
5
5
  readme = "README.md"
6
6
  requires-python = ">=3.9"
@@ -0,0 +1,283 @@
1
+ # info snap select
2
+ infosnap = infosnap.select(
3
+ # --------------------------------------------------
4
+ # Metadata
5
+ # --------------------------------------------------
6
+ pl.col("school_year"),
7
+ pl.col("cmo_name"),
8
+ pl.col("data_type"),
9
+ pl.col("ren_num"),
10
+
11
+ # --------------------------------------------------
12
+ # Student name
13
+ # --------------------------------------------------
14
+ pl.col("First Name").alias("fname"),
15
+ pl.col("stu_MiddleName").alias("mname"),
16
+ pl.col("Last Name").alias("lname"),
17
+
18
+ # --------------------------------------------------
19
+ # DOB
20
+ # --------------------------------------------------
21
+ # Ambiguous / duplicate DOB fields; keep raw
22
+ pl.col("DateOfBirth"),
23
+ pl.col("stu_DoB"),
24
+ pl.col("stu_DobCheck"),
25
+
26
+ # --------------------------------------------------
27
+ # School / campus
28
+ # --------------------------------------------------
29
+ pl.col("School").alias("school_name"),
30
+
31
+ # Ambiguous duplicate/alternate campus fields; keep raw
32
+ pl.col("stu_Campus"),
33
+ pl.col("Campus"),
34
+
35
+ # --------------------------------------------------
36
+ # Grades
37
+ # --------------------------------------------------
38
+ # Grade only exists in 2010 and can be missing
39
+ pl.col("Grade"),
40
+
41
+ pl.col("Enroll Grade").alias("enrollment_grade"),
42
+
43
+ # Ambiguous / alternate enrollment-grade fields; keep raw
44
+ pl.col("stu_EnrollGrade"),
45
+ pl.col("stu_GradeLastYear"),
46
+
47
+ # --------------------------------------------------
48
+ # IDs
49
+ # --------------------------------------------------
50
+ pl.col("Snapcode"),
51
+ pl.col("ExternalStudentID").alias("student_id"),
52
+
53
+ # --------------------------------------------------
54
+ # Status / enrollment status
55
+ # --------------------------------------------------
56
+ pl.col("Status"),
57
+ pl.col("Enroll Status").alias("enroll_status"),
58
+ pl.col("stu_Status"),
59
+
60
+ # --------------------------------------------------
61
+ # Dates / timestamps
62
+ # --------------------------------------------------
63
+ pl.col("Imported").alias("imported_date"),
64
+
65
+ # Started is after imported date; may proxy registration started/submitted
66
+ pl.col("Started"),
67
+
68
+ # Notification/contact dates
69
+ pl.col("NotificationDate"),
70
+ pl.col("LetterHistory"),
71
+
72
+ # --------------------------------------------------
73
+ # Address / geography
74
+ # --------------------------------------------------
75
+ pl.col("p1_Address").alias("address1"),
76
+ pl.col("p1_Address2").alias("address2"),
77
+ pl.col("p1_City").alias("city"),
78
+ pl.col("p1_Zip").alias("zip"),
79
+ pl.col("p1_NewarkRes"),
80
+
81
+ # --------------------------------------------------
82
+ # Parent / guardian
83
+ # --------------------------------------------------
84
+ pl.col("p1_FirstName").alias("p1_fname"),
85
+ pl.col("p1_LastName").alias("p1_lname"),
86
+ pl.col("p_Agree1"),
87
+
88
+ # --------------------------------------------------
89
+ # Sibling variables
90
+ # --------------------------------------------------
91
+ pl.col("sib1_FirstName").alias("sib1_fname"),
92
+ pl.col("sib1_LastName").alias("sib1_lname"),
93
+ pl.col("sib1_Grade").alias("sib1_grade"),
94
+ pl.col("stu_NumberOfSibs"),
95
+
96
+ # --------------------------------------------------
97
+ # Prior school / preschool
98
+ # --------------------------------------------------
99
+ pl.col("stu_PrevSchool").alias("prior_school"),
100
+ pl.col("stu_PreSchool"),
101
+
102
+ # --------------------------------------------------
103
+ # Language / student attributes
104
+ # --------------------------------------------------
105
+ pl.col("stu_Language1").alias("preferred_language"),
106
+
107
+ # Possible SPED / IEP fields
108
+ pl.col("stu_IEPStatus").alias("sped"),
109
+ pl.col("stu_NeedsIEP"),
110
+ pl.col("stu_AdaptiveSkillsIssue"),
111
+ pl.col("stu_GrossMotorSkillsIssue"),
112
+
113
+ # Health / documentation fields
114
+ pl.col("stu_ImmunizationReceived"),
115
+ pl.col("stu_BirthCityNJ"),
116
+ pl.col("stu_BirthCityNotNJ"),
117
+
118
+ # --------------------------------------------------
119
+ # Notification validation / communication
120
+ # --------------------------------------------------
121
+ pl.col("EmailNotificationValidationStatus"),
122
+ pl.col("LetterNotificationValidationStatus"),
123
+ pl.col("NotificationDate"),
124
+
125
+ # --------------------------------------------------
126
+ # Call / follow-up fields
127
+ # --------------------------------------------------
128
+ pl.col("Call_Date"),
129
+ pl.col("Call_HomeVisit"),
130
+ pl.col("Call_HomeVisitStatus"),
131
+ pl.col("Call_Meeting_Date"),
132
+ pl.col("Call_Notes"),
133
+ pl.col("Call_OutcomeDecl"),
134
+ pl.col("Follow-up"),
135
+ pl.col("Outcome"),
136
+
137
+ # --------------------------------------------------
138
+ # Notes / admin flags
139
+ # --------------------------------------------------
140
+ pl.col("Tags"),
141
+ pl.col("Notes"),
142
+ pl.col("stu_OptInAgreement"),
143
+ )
144
+
145
+
146
+ # --- survey monkey select ---
147
+
148
+ survey_monkey = survey_monkey.select(
149
+ # --------------------------------------------------
150
+ # Metadata
151
+ # --------------------------------------------------
152
+ pl.col("school_year"),
153
+ pl.col("cmo_name"),
154
+ pl.col("data_type"),
155
+ pl.col("ren_num"),
156
+
157
+ # --------------------------------------------------
158
+ # SurveyMonkey / application IDs
159
+ # --------------------------------------------------
160
+ pl.col("Respondent ID").alias("application_id"),
161
+ pl.col("Collector ID"),
162
+
163
+ # --------------------------------------------------
164
+ # Dates
165
+ # --------------------------------------------------
166
+ # Probably application/submission date
167
+ pl.col("End Date").alias("application_date"),
168
+
169
+ # --------------------------------------------------
170
+ # Student name / DOB
171
+ # --------------------------------------------------
172
+ pl.col("fname"),
173
+ pl.col("lname"),
174
+ pl.col("dob"),
175
+
176
+ # --------------------------------------------------
177
+ # Grade
178
+ # --------------------------------------------------
179
+ # Missing in Spark Academy file
180
+ pl.col("entry_grade"),
181
+
182
+ # Spark-only fields that may help infer entry grade
183
+ pl.col("daycare"),
184
+ pl.col("Headstartprek"),
185
+ pl.col("otherprek"),
186
+
187
+ # Many “Other” fields may indicate kindergarten/1st/2nd/etc.; keep raw for grade imputation
188
+ pl.col("Other"),
189
+
190
+ # --------------------------------------------------
191
+ # Parent / guardian
192
+ # --------------------------------------------------
193
+ pl.col("p_fname"),
194
+ pl.col("p_lname"),
195
+ pl.col("p_sig"),
196
+
197
+ # --------------------------------------------------
198
+ # Prior school / prior setting
199
+ # --------------------------------------------------
200
+ pl.col("prior_school_type"),
201
+ pl.col("prior_school"),
202
+
203
+ # --------------------------------------------------
204
+ # Sibling priority
205
+ # --------------------------------------------------
206
+ pl.col("sib_enroll_school"),
207
+ pl.col("sib_fname"),
208
+ pl.col("sib_lname"),
209
+ pl.col("Sib_school").alias("sib_school"),
210
+
211
+ # Only exists in 2011-2012 CLOSED file
212
+ pl.col("sib_concur_school"),
213
+
214
+ # TEAM/Rise/NCA-specific sibling campus fields from 2009 import
215
+ pl.col("sib_TEAM_campus"),
216
+ pl.col("sib_Rise_Academy_Campus"),
217
+ pl.col("sib_Newark_Collegiate_Academy_campus"),
218
+
219
+ # --------------------------------------------------
220
+ # Address / geography
221
+ # --------------------------------------------------
222
+ pl.col("address1"),
223
+ pl.col("address2"),
224
+ pl.col("city"),
225
+ pl.col("zip"),
226
+
227
+ # NJ residency field; null may imply non-NJ / missing residency status
228
+ pl.col("state_nj_residents_only"),
229
+ )
230
+
231
+
232
+ # --- kipp newark enrollment ---
233
+
234
+ enrollment = enrollment.select(
235
+ # --------------------------------------------------
236
+ # Metadata
237
+ # --------------------------------------------------
238
+ pl.col("academic_year").alias("school_year"),
239
+
240
+ # --------------------------------------------------
241
+ # Student IDs
242
+ # --------------------------------------------------
243
+ pl.col("Student_number").alias("student_id"),
244
+
245
+ # Alternate network-specific identifiers; keep raw
246
+ pl.col("newark_enrollment_number"),
247
+ pl.col("infosnap_id"),
248
+
249
+ # --------------------------------------------------
250
+ # Student name
251
+ # --------------------------------------------------
252
+ pl.col("first_name").alias("fname"),
253
+ pl.col("middle_name").alias("mname"),
254
+ pl.col("last_name").alias("lname"),
255
+
256
+ # --------------------------------------------------
257
+ # Grade / enrollment
258
+ # --------------------------------------------------
259
+ pl.col("grade_level").alias("grade"),
260
+
261
+ # Years enrolled in TEAM/KIPP network
262
+ pl.col("year_in_network"),
263
+
264
+ # Enrollment entry date
265
+ pl.col("entrydate"),
266
+
267
+ # --------------------------------------------------
268
+ # Parent / guardian
269
+ # --------------------------------------------------
270
+ # Full names; can split later if desired
271
+ pl.col("Mother"),
272
+ pl.col("Father"),
273
+
274
+ # --------------------------------------------------
275
+ # Address
276
+ # --------------------------------------------------
277
+ pl.col("street").alias("address1"),
278
+ pl.col("city"),
279
+ pl.col("Zip").alias("zip"),
280
+ )
281
+
282
+
283
+
@@ -0,0 +1,581 @@
1
+ # KIPP HOUSTON LOTTO
2
+ df = df.select(
3
+ # --------------------------------------------------
4
+ # Metadata
5
+ # --------------------------------------------------
6
+ pl.col("school_year"),
7
+ pl.col("cmo_name"),
8
+ pl.col("data_type"),
9
+ pl.col("ren_num"),
10
+
11
+ # --------------------------------------------------
12
+ # Student name
13
+ # --------------------------------------------------
14
+ pl.col("First Name").alias("fname"),
15
+ pl.col("stu_MiddleName").alias("mname"),
16
+ pl.col("Last Name").alias("lname"),
17
+
18
+ # Ambiguous / duplicate DOB fields; keep raw
19
+ pl.col("Date Of Birth"),
20
+ pl.col("stu_DOB"),
21
+
22
+ # --------------------------------------------------
23
+ # Grades
24
+ # --------------------------------------------------
25
+ pl.col("Apply Grade").alias("entry_grade"),
26
+ pl.col("Grade").alias("grade"),
27
+
28
+ # Current grade, not necessarily application grade
29
+ pl.col("Stu_CurrGrade"),
30
+
31
+ # --------------------------------------------------
32
+ # Application IDs / student IDs
33
+ # --------------------------------------------------
34
+ pl.col("SubmissionRecordID").alias("application_id"),
35
+ pl.col("ExternalStudentID").alias("student_id"),
36
+ pl.col("LotteryFamilyCode").alias("family_id"),
37
+ pl.col("Confirmation ID"),
38
+ pl.col("ActionSessionID"),
39
+
40
+ # --------------------------------------------------
41
+ # Application dates / admin timestamps
42
+ # --------------------------------------------------
43
+ pl.col("Submitted").alias("application_date"),
44
+
45
+ # Ambiguous: lottery-specific app date
46
+ pl.col("LotterySubmissionDate"),
47
+
48
+ # Ambiguous: unclear how this differs from Submitted
49
+ pl.col("Started"),
50
+
51
+ pl.col("ApprovalDate"),
52
+ pl.col("DeliveryDate").alias("last_update_date"),
53
+ pl.col("stu_RegistrationDate").alias("registration_complete_date"),
54
+ pl.col("p_Date").alias("parent_signature_date"),
55
+
56
+ # --------------------------------------------------
57
+ # Lottery / status
58
+ # --------------------------------------------------
59
+ pl.col("LotteryStatus").alias("lottery_status"),
60
+ pl.col("LotteryPosition").alias("lottery_number"),
61
+ pl.col("LotteryPriority").alias("priority_group"),
62
+
63
+ # Ambiguous alt lottery number field
64
+ pl.col("stu_NumberPickedInLottery"),
65
+
66
+ pl.col("Status").alias("application_status"),
67
+ pl.col("ApprovalHistory"),
68
+ pl.col("DeliveryHistory"),
69
+ pl.col("SWMMatchStatus"),
70
+
71
+ # --------------------------------------------------
72
+ # Offer / enrollment proxies
73
+ # --------------------------------------------------
74
+ pl.col("stu_OfferingSpot").alias("offer"),
75
+ pl.col("Accepted School1"),
76
+ pl.col("Accepted School2"),
77
+ pl.col("Accepted School3"),
78
+ pl.col("Accepted School4"),
79
+
80
+ # Ambiguous post-offer/enrollment process variables
81
+ pl.col("stu_SignedCte"),
82
+ pl.col("stu_HomeVisit"),
83
+ pl.col("stu_HSPacketAgree"),
84
+ pl.col("stu_ExportToFE"),
85
+
86
+ # --------------------------------------------------
87
+ # School applying to / school attended
88
+ # --------------------------------------------------
89
+ pl.col("School Applying To").alias("school_name"),
90
+
91
+ # Ambiguous school-applied-to alternatives; keep raw
92
+ pl.col("hid_ApplyingSchoolName"),
93
+ pl.col("lottery_ApplyingToWhichSchool"),
94
+ pl.col("Applied School"),
95
+ pl.col("School"),
96
+
97
+ # Ambiguous: current/prior/next-year school fields
98
+ pl.col("Stu_CurrSchool"),
99
+ pl.col("stu_CurrentlyAttendingSchool"),
100
+ pl.col("stu_SchoolNextYear"),
101
+ pl.col("stu_School"),
102
+ pl.col("stu_School2"),
103
+
104
+ # Zoned / feeder school fields
105
+ pl.col("Zoned School").alias("feeder_school"),
106
+ pl.col("hid_ZonedSchoolName"),
107
+ pl.col("lottery_ZonedForWhichSchools"),
108
+ pl.col("zone_school_id"),
109
+ pl.col("zone_school_address"),
110
+ pl.col("zone_school_address2"),
111
+ pl.col("zone_school_grades"),
112
+ pl.col("zone_school_grades2"),
113
+
114
+ # --------------------------------------------------
115
+ # Address / geography
116
+ # --------------------------------------------------
117
+ pl.col("Stu_address").alias("address1"),
118
+ pl.col("Stu_address2").alias("address2"),
119
+ pl.col("Stu_address3"),
120
+ pl.col("Stu_city").alias("city"),
121
+ pl.lit("TX").alias("state"),
122
+
123
+ # Duplicate/alternate zip fields; keep raw
124
+ pl.col("stu_Zip"),
125
+ pl.col("Zip"),
126
+ pl.col("stu_ZipOther"),
127
+
128
+ pl.col("stu_CurrSchoolDistrict"),
129
+
130
+ # --------------------------------------------------
131
+ # Parent / guardian
132
+ # --------------------------------------------------
133
+ pl.col("p1_FirstName").alias("p1_fname"),
134
+ pl.col("p1_LastName").alias("p1_lname"),
135
+ pl.col("p2_FirstName").alias("p2_fname"),
136
+ pl.col("p2_LastName").alias("p2_lname"),
137
+ pl.col("p_Sig").alias("p_name"),
138
+
139
+ pl.col("Stu_kippsterparent").alias("p_employed"),
140
+
141
+ # Ambiguous / alternate parent employment fields
142
+ pl.col("Parent Employee Priority"),
143
+ pl.col("stu_KIPPParentName"),
144
+ pl.col("stu_KIPPsterParentSchool"),
145
+
146
+ # --------------------------------------------------
147
+ # Sibling priority / sibling names
148
+ # --------------------------------------------------
149
+ pl.col("Stu_kippsibling").alias("sib_enroll_cmo"),
150
+ pl.col("Stu_kippsiblingfirstname").alias("sib_fname"),
151
+ pl.col("Stu_kippsiblinglastname").alias("sib_lname"),
152
+ pl.col("Stu_kippsiblingschool").alias("sib_school"),
153
+
154
+ pl.col("sib1_FirstName").alias("sib1_fname"),
155
+ pl.col("sib1_LastName").alias("sib1_lname"),
156
+ pl.col("sib2_FirstName").alias("sib2_fname"),
157
+ pl.col("sib2_LastName").alias("sib2_lname"),
158
+ pl.col("sib3_FirstName").alias("sib3_fname"),
159
+ pl.col("sib3_LastName").alias("sib3_lname"),
160
+
161
+ # Ambiguous / alternate sibling priority fields
162
+ pl.col("Sibling Priority"),
163
+ pl.col("stu_KIPPSiblingName"),
164
+ pl.col("stu_KIPPSiblingAlum").alias("sib_grad_cmo"),
165
+ pl.col("stu_KIPPSiblingAlumFirstName"),
166
+ pl.col("stu_KIPPSiblingLastName"),
167
+ pl.col("stu_KIPPSiblingAlumSchool"),
168
+ pl.col("stu_KIPPSiblingAlumGradYear"),
169
+
170
+ # --------------------------------------------------
171
+ # Priority / geography priority
172
+ # --------------------------------------------------
173
+ pl.col("Priority Tier"),
174
+ pl.col("Stu_priorityzone"),
175
+ pl.col("nozonedschool"),
176
+ pl.col("outofdistrict"),
177
+ pl.col("stu_RequestingZonedSchool"),
178
+ pl.col("lottery_HasAffiliationToKIPP"),
179
+ pl.col("stu_CurrKipp"),
180
+
181
+ # --------------------------------------------------
182
+ # Late app / submission type
183
+ # --------------------------------------------------
184
+ pl.col("stu_Deadline").alias("late_app"),
185
+ pl.col("stu_SubmissionType").alias("application_source"),
186
+
187
+ # --------------------------------------------------
188
+ # Language / demographics / student attributes
189
+ # --------------------------------------------------
190
+ pl.col("stu_Language").alias("preferred_language"),
191
+ pl.col("stu_LanguageOther"),
192
+ pl.col("stu_HomeLanguage"),
193
+ pl.col("Stu_age"),
194
+ pl.col("stu_QualifyPK"),
195
+ pl.col("stu_BirthCertificate"),
196
+ pl.col("stu_LunchAppResults"),
197
+ pl.col("stu_ResidencyQuestionaire"),
198
+ pl.col("stu_SpecNeedQuestionnaire").alias("sped"),
199
+ pl.col("stu_TXCharter"),
200
+
201
+ # --------------------------------------------------
202
+ # School application flags
203
+ # --------------------------------------------------
204
+ pl.col("stu_SHARP"),
205
+ pl.col("stu_Sharpstown"),
206
+ pl.col("stu_SHINE"),
207
+ pl.col("stu_KMS"),
208
+ pl.col("stu_KHHS"),
209
+ pl.col("stu_Unity"),
210
+ pl.col("stu_WestHoustonAcademy"),
211
+ pl.col("stu_3D"),
212
+ pl.col("stu_BellaireMiddle"),
213
+ pl.col("stu_BellairePrimary"),
214
+ pl.col("stu_CONNECTMiddle"),
215
+ pl.col("stu_CONNEXTPrimary"),
216
+ pl.col("stu_Coastal"),
217
+ pl.col("stu_Courage"),
218
+ pl.col("stu_DREAM"),
219
+ pl.col("stu_Explore"),
220
+ pl.col("stu_Generations"),
221
+ pl.col("stu_Intrepid"),
222
+ pl.col("stu_Polaris"),
223
+ pl.col("stu_Legacy"),
224
+ pl.col("stu_Liberation"),
225
+ pl.col("stu_NortheastCollegePrep"),
226
+ pl.col("stu_PEACE"),
227
+ pl.col("stu_Spirit"),
228
+ pl.col("stu_Sunnyside"),
229
+ pl.col("stu_Voyage"),
230
+ pl.col("stu_ZENITH"),
231
+
232
+ # --------------------------------------------------
233
+ # Notes / admin follow-up fields
234
+ # --------------------------------------------------
235
+ pl.col("Tags"),
236
+ pl.col("Notes"),
237
+ pl.col("Notes86"),
238
+ pl.col("Notes18"),
239
+ pl.col("Notes34"),
240
+ pl.col("stu_NotesComments"),
241
+ pl.col("stu_WD"),
242
+ pl.col("stu_PostLotteryParentCommunicationDate"),
243
+ pl.col("stu_CloseWaitlistDate"),
244
+ pl.col("stu_CloseWaitlistForSchool"),
245
+ pl.col("stu_ApplyOtherSchools"),
246
+ pl.col("stu_ConsiderOtherKipp"),
247
+ pl.col("stu_OtherSchool1"),
248
+ pl.col("stu_OtherSchool2"),
249
+ pl.col("stu_OtherSchool3"),
250
+ pl.col("stu_OtherSchool4"),
251
+ pl.col("stu_OtherSchool5"),
252
+ )
253
+
254
+
255
+
256
+
257
+ # Kipp houston registration data
258
+ registration = registration.select(
259
+ # --------------------------------------------------
260
+ # Metadata
261
+ # --------------------------------------------------
262
+ pl.col("school_year"),
263
+ pl.col("cmo_name"),
264
+ pl.col("data_type"),
265
+ pl.col("ren_num"),
266
+
267
+ # --------------------------------------------------
268
+ # Student name
269
+ # --------------------------------------------------
270
+ pl.col("First Name").alias("fname"),
271
+ pl.col("stu_MiddleName").alias("mname"),
272
+ pl.col("Last Name").alias("lname"),
273
+
274
+ # Ambiguous / duplicate student-name fields; keep raw
275
+ pl.col("stu_FirstName"),
276
+ pl.col("stu_LastName"),
277
+ pl.col("stu_Suffix").alias("suffix"),
278
+
279
+ # --------------------------------------------------
280
+ # DOB
281
+ # --------------------------------------------------
282
+ # Ambiguous / duplicate DOB fields; keep raw
283
+ pl.col("DateOfBirth"),
284
+ pl.col("stu_DoB"),
285
+
286
+ # --------------------------------------------------
287
+ # Grades
288
+ # --------------------------------------------------
289
+ pl.col("Grade").alias("grade"),
290
+ pl.col("stu_Grade").alias("enrollment_grade"),
291
+
292
+ # --------------------------------------------------
293
+ # School / enrollment school
294
+ # --------------------------------------------------
295
+ pl.col("School").alias("enrollment_school_name"),
296
+
297
+ # Ambiguous duplicate school field; keep raw
298
+ pl.col("stu_School"),
299
+
300
+ # --------------------------------------------------
301
+ # Enrollment / registration status
302
+ # --------------------------------------------------
303
+ pl.col("Enroll Status").alias("enroll_status"),
304
+ pl.col("stu_Status"),
305
+ pl.col("Status").alias("registration_status"),
306
+
307
+ # --------------------------------------------------
308
+ # IDs
309
+ # --------------------------------------------------
310
+ pl.col("ID"),
311
+ pl.col("SubmissionRecordID").alias("application_id"),
312
+ pl.col("stu_ID").alias("student_id"),
313
+ pl.col("SnapCode"),
314
+ pl.col("FamilyMemberID"),
315
+ pl.col("FamilyID").alias("family_id"),
316
+ pl.col("ActionSessionID"),
317
+ pl.col("stu_TSDSLocalID"),
318
+
319
+ # --------------------------------------------------
320
+ # Registration / admin dates
321
+ # --------------------------------------------------
322
+ pl.col("Submitted").alias("registration_submit_date"),
323
+
324
+ # Ambiguous: starts around June; maybe registration/enrollment start date
325
+ pl.col("Started"),
326
+
327
+ pl.col("ApprovalDate"),
328
+ pl.col("DeliveryDate").alias("last_update_date"),
329
+ pl.col("p_Date").alias("parent_signature_date"),
330
+
331
+ # Only exists 2017-2018; unclear exact meaning
332
+ pl.col("stu_Date"),
333
+
334
+ # --------------------------------------------------
335
+ # Lottery fields included in registration data
336
+ # --------------------------------------------------
337
+ # Mostly non-useful constants in registration files, but keep for checks
338
+ pl.col("LotteryStatus"),
339
+ pl.col("LotteryPosition").alias("lottery_number"),
340
+ pl.col("LotteryPriority").alias("priority_group"),
341
+ pl.col("LotterySubmissionDate"),
342
+
343
+ # --------------------------------------------------
344
+ # Prior / zoned school
345
+ # --------------------------------------------------
346
+ pl.col("stu_ZonedDistrict"),
347
+ pl.col("stu_ZonedSchool").alias("feeder_school"),
348
+ pl.col("stu_PrevKIPP"),
349
+ pl.col("stu_PrevKIPPYear"),
350
+
351
+ # Prior school name; other prev-school fields mostly broad missing per notes
352
+ pl.col("stu_PrevSch1Name").alias("prior_school"),
353
+
354
+ # --------------------------------------------------
355
+ # Address / geography
356
+ # --------------------------------------------------
357
+ pl.col("stu_Addrnum"),
358
+ pl.col("stu_AddrStreet"),
359
+ pl.col("stu_AddrCity").alias("city"),
360
+ pl.col("stu_AddrZip").alias("zip"),
361
+
362
+ # --------------------------------------------------
363
+ # Parent / guardian
364
+ # --------------------------------------------------
365
+ pl.col("p1_FirstName").alias("p1_fname"),
366
+ pl.col("p1_LastName").alias("p1_lname"),
367
+ pl.col("p2_FirstName").alias("p2_fname"),
368
+ pl.col("p2_LastName").alias("p2_lname"),
369
+
370
+ # Parent volunteer fields, not employment priority
371
+ pl.col("p1_Volunteer"),
372
+ pl.col("p2_Volunteer"),
373
+
374
+ pl.col("p_Agree"),
375
+ pl.col("p_Sig").alias("p_name"),
376
+
377
+ # --------------------------------------------------
378
+ # Sibling variables
379
+ # --------------------------------------------------
380
+ # Count/number of KIPP siblings, not binary
381
+ pl.col("stu_KIPPSibling"),
382
+
383
+ pl.col("stu_KIPPSib1Fname").alias("sib1_fname"),
384
+ pl.col("stu_KIPPSib1Lname").alias("sib1_lname"),
385
+ pl.col("stu_KIPPSib1Grade").alias("sib1_grade"),
386
+ pl.col("stu_KIPPSib1Sch").alias("sib_school"),
387
+
388
+ # --------------------------------------------------
389
+ # Language / student attributes
390
+ # --------------------------------------------------
391
+ pl.col("Language").alias("preferred_language"),
392
+ pl.col("stu_SNAPTANF"),
393
+ pl.col("stu_SNAPTANFNumber"),
394
+
395
+ # --------------------------------------------------
396
+ # Returning student indicators
397
+ # --------------------------------------------------
398
+ # Only 2018; useful for separating new vs returning registrations
399
+ pl.col("stu_ReturningNo"),
400
+ pl.col("stu_ReturningYesNo"),
401
+ )
402
+
403
+
404
+ # other files
405
+ app = app.select(
406
+ # --------------------------------------------------
407
+ # Metadata
408
+ # --------------------------------------------------
409
+ pl.col("school_year"),
410
+ pl.col("cmo_name"),
411
+ pl.col("data_type"),
412
+ pl.col("ren_num"),
413
+
414
+ # --------------------------------------------------
415
+ # Student IDs / application IDs
416
+ # --------------------------------------------------
417
+ pl.col("Application ID").alias("application_id"),
418
+ pl.col("Application_ID"),
419
+ pl.col("Applicant_ID"),
420
+ pl.col("Account ID").alias("account_id"),
421
+ pl.col("Account_ID"),
422
+ pl.col("SM_Student_Id"),
423
+ pl.col("SIS_Student_Id"),
424
+ pl.col("SIS ID"),
425
+ pl.col("Student_ID_Schoolmint"),
426
+ pl.col("Student_ID_Local").alias("student_id"),
427
+ pl.col("Student_ID_State"),
428
+
429
+ # --------------------------------------------------
430
+ # Student name
431
+ # --------------------------------------------------
432
+ pl.col("Students First Name").alias("fname"),
433
+ pl.col("Student Middle Name").alias("mname"),
434
+ pl.col("Students Last Name").alias("lname"),
435
+
436
+ # Duplicate/alternate name fields from KIPP Texas-style exporter; keep raw
437
+ pl.col("First_Name"),
438
+ pl.col("Middle_Name"),
439
+ pl.col("Last_Name"),
440
+
441
+ # --------------------------------------------------
442
+ # DOB
443
+ # --------------------------------------------------
444
+ pl.col("Student Birth Date").alias("dob"),
445
+
446
+ # Duplicate/alternate DOB from KIPP Texas-style exporter; keep raw
447
+ pl.col("Birth_Date"),
448
+
449
+ # --------------------------------------------------
450
+ # School applying to
451
+ # --------------------------------------------------
452
+ pl.col("School Applying to").alias("school_name"),
453
+ pl.col("School_Name"),
454
+ pl.col("School_Id"),
455
+
456
+ # --------------------------------------------------
457
+ # Grades
458
+ # --------------------------------------------------
459
+ pl.col("Grade Applying To").alias("entry_grade"),
460
+ pl.col("Current Grade"),
461
+
462
+ # KIPP Texas-style exporter fields; keep raw if ambiguous/alternate
463
+ pl.col("Grade"),
464
+ pl.col("Current_Grade_Level"),
465
+
466
+ # --------------------------------------------------
467
+ # Application / enrollment period
468
+ # --------------------------------------------------
469
+ pl.col("Enrollment Period"),
470
+ pl.col("Academic_Year"),
471
+
472
+ # --------------------------------------------------
473
+ # Application status
474
+ # --------------------------------------------------
475
+ pl.col("Application Status").alias("application_status"),
476
+ pl.col("Status"),
477
+ pl.col("Public_Status"),
478
+
479
+ # Status updated timestamp
480
+ pl.col("Status_Timestamp").alias("status_timestamp"),
481
+
482
+ # --------------------------------------------------
483
+ # Application type / rank
484
+ # --------------------------------------------------
485
+ pl.col("Application Type").alias("application_type"),
486
+ pl.col("Application_Type"),
487
+ pl.col("Applicant_Rank").alias("rank"),
488
+
489
+ # --------------------------------------------------
490
+ # Dates
491
+ # --------------------------------------------------
492
+ pl.col("Submission Date").alias("application_date"),
493
+ pl.col("Submission_Date"),
494
+ pl.col("Created_At"),
495
+
496
+ pl.col("Offered Date").alias("offer_date"),
497
+ pl.col("Offered_Date"),
498
+
499
+ pl.col("Accepted Date").alias("offer_accept_date"),
500
+ pl.col("Accepted_Date"),
501
+
502
+ pl.col("Registration Completed Date").alias("registration_complete_date"),
503
+ pl.col("Registration_Completed_Date"),
504
+
505
+ # Ambiguous: completion vs verification gap needs checking
506
+ pl.col("Registration_Verified_Date"),
507
+
508
+ # --------------------------------------------------
509
+ # Lottery / waitlist
510
+ # --------------------------------------------------
511
+ pl.col("Waitlist Number").alias("waitlist_number"),
512
+ pl.col("Waitlist_Number"),
513
+
514
+ # Ambiguous: compare global vs non-global lottery numbers
515
+ pl.col("Lottery_Global_Number"),
516
+ pl.col("Lottery_Number"),
517
+ pl.col("Lottery_Tickets"),
518
+
519
+ # --------------------------------------------------
520
+ # Parent / guardian
521
+ # --------------------------------------------------
522
+ pl.col("Primary Guardian First Name").alias("p1_fname"),
523
+ pl.col("Primary Guardian Last Name").alias("p1_lname"),
524
+ pl.col("Secondary Guardian First Name").alias("p2_fname"),
525
+ pl.col("Secondary Guardian Last Name").alias("p2_lname"),
526
+
527
+ # Parent/guardian employed by organization
528
+ pl.col("Is one of the parents or guardians employed by this organization?").alias("p_employed"),
529
+
530
+ # --------------------------------------------------
531
+ # Address / geography
532
+ # --------------------------------------------------
533
+ pl.col("StudentAddress: Street 1").alias("address1"),
534
+ pl.col("StudentAddress: Street 2").alias("address2"),
535
+ pl.col("StudentAddress: City").alias("city"),
536
+ pl.col("StudentAddress: ZIP").alias("zip"),
537
+ pl.col("District"),
538
+ pl.col("District_Name"),
539
+
540
+ # --------------------------------------------------
541
+ # Current / prior school
542
+ # --------------------------------------------------
543
+ pl.col("Current School").alias("prior_school"),
544
+ pl.col("Current_School_Name"),
545
+
546
+ # --------------------------------------------------
547
+ # Language
548
+ # --------------------------------------------------
549
+ pl.col("Account Preferred Language").alias("preferred_language"),
550
+
551
+ # --------------------------------------------------
552
+ # Admin/source fields
553
+ # --------------------------------------------------
554
+ pl.col("admin_info_source"),
555
+ pl.col("Homeless Shelter"),
556
+
557
+ # --------------------------------------------------
558
+ # Priority fields
559
+ # --------------------------------------------------
560
+ # Broad priority text/code fields; keep both because they differ by exporter
561
+ pl.col("Priorities"),
562
+ pl.col("Priority_List"),
563
+
564
+ # --------------------------------------------------
565
+ # Sibling priority fields
566
+ # --------------------------------------------------
567
+ pl.col(
568
+ "Does the student have a brother or sister currently attending a school within this organization?"
569
+ ).alias("sib_enroll_cmo"),
570
+
571
+ pl.col(
572
+ "Does the student have a brother or sister who has graduated from a school within this organization?"
573
+ ).alias("sib_grad_cmo"),
574
+
575
+ pl.col("Sibling 1 Name").alias("sib1_name"),
576
+ pl.col("Sibling 1 Grade").alias("sib1_grade"),
577
+ pl.col("Sibling 1 School").alias("sib1_school"),
578
+
579
+ pl.col("Sibling 2 Name").alias("sib2_name"),
580
+ pl.col("Sibling 2 School").alias("sib2_school"),
581
+ )
File without changes