-
Notifications
You must be signed in to change notification settings - Fork 14
Expand file tree
/
Copy pathattendees.py
More file actions
27 lines (22 loc) · 778 Bytes
/
attendees.py
File metadata and controls
27 lines (22 loc) · 778 Bytes
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
import json
def read_graph_data(filename):
with open(filename, 'r') as file:
data = json.load(file)
return data
def extract_responses(graph_data):
attendees = {}
for node in graph_data['nodes']:
node_id = node['id']
response = node['data']['response']
attendees[node_id] = response
return attendees
def write_attendees(attendees_data, filename):
with open(filename, 'w') as file:
json.dump(attendees_data, file, indent=4)
def main():
ai_summarization = False
graph_data = read_graph_data('summarizedGraphData.json' if ai_summarization else 'graphData.json')
attendees_data = extract_responses(graph_data)
write_attendees(attendees_data, 'attendees.json')
if __name__ == "__main__":
main()