add custom 'intern' age so we can keep track of them seperately

This commit is contained in:
stupidcomputer 2024-06-24 04:57:51 -05:00
parent e9f3047751
commit 23e771c981
2 changed files with 28 additions and 0 deletions

View File

@ -40,4 +40,5 @@ mapper_data = {
"ai/an": "American Indian/Alaskan Native",
"None": "Unknown",
"nh/opi": "Native Hawaiian/Other Pacific Islander",
"i": "Intern",
}

27
interndata.py Normal file
View File

@ -0,0 +1,27 @@
import json
intern_data_file = "data/staffrecord.json"
def get_staff_records():
with open(intern_data_file, "r") as fd:
return json.loads(fd.read())
def map_name_to_record(name, data, first=True):
for i in data["payload"]:
if first:
if i["name"].split()[0] == name:
return i["innerpayload"]
else:
if i["name"] == name:
return i["innerpayload"]
return None
def return_intern_data_from_present_array(array, data):
output = []
for i in array:
record = map_name_to_record(i, data)
if record:
output.append(record)
return output