此章节是关于课程 API 的描述。
Course
对象提供了一系列课程信息 API。
Constructor:
class hdu_api.Course(session)
参数 | type | required | default | 备注 |
---|---|---|---|---|
session | objects CourseSession |
true | 无 | 一个已初始化的 CourseSession 对象 |
Class methods:
-
classmethod Course.selected(year, term, raw=False, dictionary=DEFAULT_DICTIONARY)
已选课程。
-
classmethod Course.selected_current(raw=False, dictionary=DEFAULT_DICTIONARY)
本学期已选课程。
-
classmethod Course.schedule(year, term, raw=False, dictionary=DEFAULT_DICTIONARY)
课表。
-
classmethod Course.schedule_current(raw=False, dictionary=DEFAULT_DICTIONARY)
本学期课表。
参数说明:
- raw - 是否输出为原始格式
- dictionary - raw 为 true 时,使用该字典替换返回数据的 key
- year - 学年,格式如 '2018-2019'
- term - 学期,1 表示第一个学期,2 表示第二个学期
Class attributes:
-
Course.session
CourseSession
对象。