You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
13 lines
388 B
Python
13 lines
388 B
Python
import json
|
|
|
|
def load_json (path="index.json"):
|
|
with open(path) as fin:
|
|
data = json.load(fin)
|
|
data['projects'] = [x for x in data['@graph'] if x['type'] == 'project']
|
|
data['projects'].sort(key=lambda x: x['title'].strip('"').lower())
|
|
|
|
data['students'] = data['projects'][:]
|
|
data['students'].sort(key=lambda x: x['student'].strip('"').lower())
|
|
|
|
return data
|