-
Notifications
You must be signed in to change notification settings - Fork 0
/
setup.py
29 lines (25 loc) · 974 Bytes
/
setup.py
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
28
29
from services.matcher import NotionAssignmentMatcher
from scripts.load_activities import load_activities
import os
import json
def create_directory(path):
try:
os.makedirs(path, exist_ok=True)
print(f"Directory '{path}' created successfully")
except OSError as error:
print(f"Error creating directory '{path}': {error}")
try:
create_directory('outputs')
create_directory('cache')
create_directory('constants')
loaded_activities = load_activities()
print(f"Loaded activities type: {type(loaded_activities)}")
print(f"Number of activities loaded: {len(loaded_activities)}")
print("First few activities:")
print(json.dumps(loaded_activities[:5], indent=2))
matcher = NotionAssignmentMatcher(activities=loaded_activities, output_path="constants/activities_with_teachers.json")
matcher.run()
except Exception as e:
print(f"An error occurred: {str(e)}")
import traceback
traceback.print_exc()