-
Notifications
You must be signed in to change notification settings - Fork 0
Open
Description
The file students.csv contains data that need to be loaded into the Ed-Fi ODS/API. This file must be loaded into two endpoints in the Ed-Fi ODS/API: students and studentSchoolAssociations. Example CSV file:
uniqueId,birthDate,firstName,lastName,middleName,title,preferredFirstName,preferredLastName,enrollmentDate,enrollmentGradeLevel,fullTime
604835,2016-09-29,Diana,Holt,Emily,Ms,,,2021-08-23,Ninth grade,1,
604836,2007-03-30,Allie,Combs,Allison,Ms,,,2021-08-23,Tenth grade,1,
604837,2012-12-19,Glenn,Gross,Max,Mr,,,2021-08-23,Eleventh grade,0,
604839,2011-04-26,Meredith,Lloyd,Felicia,Mrs,,,2021-08-23,Eleventh grade,1,
604838,2005-11-29,Brent,Hartman,,Mr,,,2021-08-23,Tenth grade,1,
604841,2010-12-15,Mathew,Ramirez,,Mr,,,2021-08-23,Twelfth grade,1,
604840,2015-12-21,Nora,Blevins,Patricia,Ms,,,2021-08-23,Ninth grade,1,
604842,2015-12-02,Frederick,Munoz,Peter,Mr,,,2021-08-23,Twelfth grade,1,
604843,2009-09-24,Byron,Wilkerson,Keith,Mr,Page,Jackson,2021-08-23,Ninth grade,0,
604844,2009-03-21,Willie,Raymond,Allan,Mr,Will,Ray,2021-08-23,Twelfth grade,1,
Note
These are fake records with realistic names
The following table maps the CSV columns to the students endpoint.
| Source Column | API Property |
|---|---|
| uniqueId | studentUniqueId |
| birthDate | birthDate |
| firstName | lastSurName |
| middleName | middleName |
| title | personalTitlePrefix |
| preferredFirstName | preferredFirstName |
| preferredLastName | preferredLastSurname |
And this table maps the CSV columns to the studentSchoolAssociations endpoint.
| Source Column | API Property |
|---|---|
| enrollmentDate | entryDate |
| enrollmentGradeLevel | entryGradeLevelDescriptor |
| fullTime | fullTimeEquivalency |
For the entryGradeLevelDescriptor, the data must be formatted like uri://ed-fi.org/GradeLevelDescriptor#{enrollmentGradeLevel}
Write a Python script that:
- Authenticates with the Ed-Fi ODS/API using credentials provided in a
.envfile - Reads the CSV file
- For each line:
- First POST the
studentinformation to the Ed-Fi API - Then POST the
studentSchoolAssociationinformation to the Ed-Fi API.
- First POST the
I prefer to use poetry for Python dependency management.
Create the script in directory /poc/before.
Copilot
Metadata
Metadata
Assignees
Labels
No labels