-
Notifications
You must be signed in to change notification settings - Fork 1
/
DOE_Course.py
50 lines (43 loc) · 1.26 KB
/
DOE_Course.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
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
from canvasapi import Canvas
import config
import csv
def account_check(user_id):
if user_id == 'DOE_A':
accountID = '380'
elif user_id == 'DOE_B':
accountID = '381'
elif user_id == 'DOE_D':
accountID = '382'
elif user_id == 'DOE_E':
accountID = '383';
elif user_id == 'DOE_G':
accountID = '384';
elif user_id == 'DOE_H':
accountID = '385';
elif user_id == 'DOE_L':
accountID = '386';
elif user_id == 'DOE_M':
accountID = '387';
elif user_id == 'DOE_N':
accountID = '388';
elif user_id == 'DOE_P':
accountID = '389';
elif user_id == 'DOE_R':
accountID = '390';
elif user_id == 'DOE_T':
accountID = '391';
else:
accountID = '392';
return(accountID)
canvas = Canvas(config.API_URL, config.API_KEY)
def main():
with open('all_dce_courses.csv', 'r', newline='') as course_list:
reader = csv.reader(course_list, delimiter=',')
for row in reader:
courseID = row[0]
accountID = row[1]
course = account_check(accountID)
print(courseID + ": " + accountID + " -> " + course)
# course = canvas.get_course(row[1], True)
if __name__ == "__main__":
main()