client

class gduter.client.AcademicAffairsOfficeClient(login_instance: LoginClient)[源代码]

用于与广东工业大学教务系统进行交互的客户端。

依赖于已登录的 LoginClient 实例,提供获取课程表、 考试安排、成绩等功能。

get_academic_scores(period: int, plan: str = '', page: int = 1, rows: int = 60, sort: str = 'xnxqdm', order: str = 'asc') dict[源代码]

获取学生指定学期的学业成绩。

参数:
  • period -- 学年学期代码,例如 202401。

  • plan -- 计划类型代码,默认为空字符串。

  • page -- 页码,默认为 1。

  • rows -- 每页显示的行数,默认为 60。

  • sort -- 排序字段,默认为 "xnxqdm"。

  • order -- 排序顺序,默认为 "asc"。

返回:

包含成绩信息的字典。

抛出:
get_course_schedule(period: int) List[Dict][源代码]

获取指定学期代码的课程表。

参数:

period -- 学年学期代码,例如 202401。

返回:

包含课程信息的字典列表。

抛出:
get_exam_schedule(period: int, page: int = 1, rows: int = 60, sort: str = 'zc,xq,jcdm2', order: str = 'asc') Dict[源代码]

获取指定学期代码的考试安排。

参数:
  • period -- 学年学期代码,例如 202401。

  • page -- 页码,默认为 1。

  • rows -- 每页显示的行数,默认为 60。

  • sort -- 排序字段,默认为 "zc,xq,jcdm2"。

  • order -- 排序顺序,默认为 "asc"。

返回:

包含考试安排信息的字典。

抛出:
login() None[源代码]

登录教务系统。

使用共享的客户端发送 GET 请求到教务系统登录 URL。

抛出:

AcademicLoginError -- 登录教务系统失败。

model_config: ClassVar[ConfigDict] = {'arbitrary_types_allowed': True}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

class gduter.client.LoginClient[源代码]

用于与广东工业大学统一身份认证平台进行交互的客户端。

该类封装了与统一身份认证平台交互所需的参数和方法, 包括初始化登录数据和执行登录操作。

login(username: str, password: str) None[源代码]

进行统一身份验证平台的登录操作。

参数:
  • username -- 登录的用户名。

  • password -- 用户的明文密码。

抛出:
model_config: ClassVar[ConfigDict] = {'arbitrary_types_allowed': True}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].