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

Was this helpful?

  1. APIS

一卡通 API

Previoushdu_apiNext考试 API

Last updated 6 years ago

Was this helpful?

此章节是关于一卡通 API 的描述。

Card objects

对象提供了一系列一卡通信息 API。

Constructor:

class hdu_api.Card(session)

参数

type

required

default

备注

session

objects CardSession

true

无

一个已初始化的 CardSession 对象

Class methods:

  • classmethod Card.account(raw=False, dictionary=DEFAULT_DICTIONARY)

      一卡通账户信息。

  • classmethod Card.balance(raw=False, dictionary=DEFAULT_DICTIONARY)

      一卡通余额。

  • classmethod Card.consume(year, month, raw=False, dictionary=DEFAULT_DICTIONARY)

      某年某月一卡通流水。

  • classmethod Card.consume_today(raw=False, dictionary=DEFAULT_DICTIONARY)

      今日一卡通流水。

  • classmethod Card.statistics(year, month, raw=False, dictionary=DEFAULT_DICTIONARY)

      月交易统计。

参数说明:

  • raw - 是否输出为原始格式

  • dictionary - raw 为 true 时,使用该字典替换返回数据的 key

  • year - 年份,如 2019

  • month - 月份,如 1, 3, 4, 12

Class attributes:

  • Card.session

      CardSession 对象。

Card