课表接口: get_schedule
字段 |
默认值 |
类型 |
描述 |
schedule_year |
None |
String |
学年 |
schedule_term |
None |
String |
学期 |
schedule_type |
None |
Int |
课表类型 个人0, 班级1 |
from school_api import SchoolClient
school = SchoolClient('http://210.38.137.126:8016')
student = school.user_login('xxxxxxxx', 'xxxx')
student.get_schedule()
student.get_schedule(schedule_type=1)
student.get_schedule(schedule_year='2017-2018', schedule_term='1')
{"schedule_term": "1", "schedule_year": "2018-2019",
"schedule":[
[[{"place": "8-503", "name": "形势与政策", "time": "8:30 ~ 10:05", "color": "blue", "section": 2, "weeks_text": "8", "weeks_arr": [8], "teacher": "潘晶晶"}], [{"place": "8-501", "name": "思政课实践教学", "time": "10:25 ~ 12:00", "color": "purple", "section": 2, "weeks_text": "7,13", "weeks_arr": [7, 13], "teacher": "周红禄"}, {"place": "8-505", "name": "毛泽东思想和中国特色社会主义理论体系概论", "time": "10:25 ~ 12:00", "color": "purple", "section": 2, "weeks_text": "1-6,8-12,14-18", "weeks_arr": [1, 2, 3, 4, 5, 6, 8, 9, 10, 11, 12, 14, 15, 16, 17, 18], "teacher": "周红禄"}], [{"place": "4-402", "name": "大学生职业发展与就业指导", "time": "14:40 ~ 16:15", "color": "red", "section": 2, "weeks_text": "1-4", "weeks_arr": [1, 2, 3, 4], "teacher": "朱玲梅"}], [], []],
[[], [{"place": "9-202", "name": "Android开发技术", "time": "10:25 ~ 12:00", "color": "green", "section": 2, "weeks_text": "1-19", "weeks_arr": [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19], "teacher": "段汝林"}], [], [], []],
[[{"place": "8-506", "name": "UI设计及应用", "time": "8:30 ~ 12:00", "color": "purple", "section": 4, "weeks_text": "1-19", "weeks_arr": [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19], "teacher": "陈萍"}], [], [{"place": "8-306", "name": "数据库应用技术", "time": "14:40 ~ 17:15", "color": "yellow", "section": 3, "weeks_text": "1-19", "weeks_arr": [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19], "teacher": "张晓健"}], [], []],
[[], [{"place": "9-202", "name": "Java Web开发技术", "time": "10:25 ~ 12:00", "color": "blue", "section": 2, "weeks_text": "1-19", "weeks_arr": [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19], "teacher": "段汝林"}], [{"place": "9-202", "name": "Android开发技术", "time": "14:40 ~ 16:15", "color": "purple", "section": 2, "weeks_text": "1-19", "weeks_arr": [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19], "teacher": "段汝林"}], [{"place": "8-503", "name": "形势与政策", "time": "16:30 ~ 18:05", "color": "red", "section": 2, "weeks_text": "10", "weeks_arr": [10], "teacher": "卓泽楼"}], []],
[[{"place": "9-202", "name": "Java Web开发技术", "time": "8:30 ~ 10:05", "color": "red", "section": 2, "weeks_text": "1-19", "weeks_arr": [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19], "teacher": "段汝林"}], [], [], [], []],
[[], [], [], [], []],
[[], [], [], [], []]
]
}
{"schedule_term": "学期", "schedule_year": "学年", "schedule": "课表数据"}
["周一课表", "周二课表", "周三课表", "周四课表", "周五课表", "周六课表", "周日课表"]
["一二节", "三四节", "五六节" ...]
["课程一", "课程二" ...]
{"place": "地点", "name": "课程名称", "time": "上课时间", "color": "显示颜色", "section": "节数", "weeks_text": "周数文本", "weeks_arr": "周数数组", "teacher": "教师名称"}
from school_api import SchoolClient
school = SchoolClient('http://210.38.137.126:8016')
student = school.user_login('xxxxxxxx', 'xxxx')
schedule_data = student.get_schedule()
week_num = 5
what_day = 3
day_schedule = schedule_data['schedule'][what_day - 1]
for section_schedule in day_schedule:
for schedule in section_schedule:
if week_num in schedule['weeks_arr']:
print (schedule)