HDU-API: A simple SDK for HDU. — hdu-api documenta
  • 简介
  • 安装
  • 快速上手
  • APIS
    • hdu_api
    • 一卡通 API
    • 考试 API
    • 课程 API
    • 个人信息 API
    • 公共信息 API
  • changelog
Powered by GitBook
On this page
  • HDU Objects
  • HduClient Objects

Was this helpful?

  1. APIS

hdu_api

PreviousAPISNext一卡通 API

Last updated 6 years ago

Was this helpful?

此章节是关于如何创建一个 client 的描述。

HDU Objects

对象是使用 hdu-api 的起点,它提供了创建 HduClient 对象的方法。

Constructor:

class hdu_api.HDU(username, password, **kwargs)

参数

type

required

default

备注

username

str

true

无

学号

password

str

true

无

密码

kwargs

dict

false

无

Class methods:

  • classmethod HDU.create(*args)

      返回一个 HduClient 对象。

Class attributes:

  • HDU.username

      学号,字符串类型。

  • HDU.password

      密码,数字杭电的密码,字符串类型。

HduClient Objects

Constructor:

class hdu_api.HduClient(sess_mgr, **kwargs)

参数

type

required

default

备注

sess_mgr

objects SessionManager

true

无

kwargs

dict

false

无

Class methods:

Class attributes:

  • HduClient.sess_mgr

      SessionManager 对象,提供了 session 管理。

  • HduClient.username

      学号,字符串类型。

  • HduClient.card

  • HduClient.exam

  • HduClient.person

  • HduClient.course

  • HduClient.public

对象提供了对 API 访问的通道。

  Card 对象,提供了对一卡通 API 的访问,详情请查看。

  Exam 对象,提供了对考试 API 的访问,详情请查看。

  Person 对象,提供了对个人信息 API 的访问,详情请查看。

  Course 对象,提供了对课程 API 的访问,详情请查看。

  Public 对象,提供了对公共信息 API 的访问,详情请查看。

HDU
HduClient
这里
这里
这里
这里
这里