Skip to main content

HDU-API

A simple SDK for HDU.

996.icu


hdu-api 是一个集结 HDU 所有教务管理服务的 SDK,提供了一卡通服务、考试、课表、选课和一些公共信息如空闲教室、上课时间等信息的 API。 hdu-api 主要基于 Requests 库和 Beautiful Soup 库写成。

特性

  • 支持一卡通服务的信息查询
  • 支持教务管理系统的考试、课程等信息查询
  • 支持学生管理系统的信息查询
  • 支持 ihdu PC 版和手机版的信息查询
  • 易用,友好的 API
  • 基于 requests 库,支持每个网站的 session 使用和管理,重用性高
  • 自定义,对返回数据进行自定义化

安装

使用包管理器安装,如 pip:

pip install hdu-api

快速开始

>>> import hdu_api
>>> hdu = hdu_api.HDU('学号', '密码')
>>> client = hdu.create()
>>> client.exam.schedule_current()
[{'classroom': '第12教研楼201',
  'course_name': '操作系统(甲)',
  'exam_time': '2019年1月17日(09:00-11:00)',
  'exam_type': '',
  'seat': '10',
  'select_code': '(2018-2019-1)-A0507050-06018-1',
  'staff_name': 'xxx'},

 ...

 {'classroom': '第6教研楼北308',
  'course_name': '软件工程(甲)',
  'exam_time': '2019年1月9日(13:45-15:45)',
  'exam_type': '',
  'seat': '24',
  'select_code': '(2018-2019-1)-A0507190-06061-2',
  'staff_name': 'xxx'}]

>>> client.card.balance()
[{'account_id': 'xxxxxx',
  'balance': '69.97',
  'card_id': 'xxxxxx',
  'staff_id': 'xxxxxx',
  'staff_name': 'xxx'}]

文档

https://liuxingran.gitbook.io/hdu-api/

Metadata

Release files for hdu-api 0.1.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Built distribution (wheel)

Table of built distributions (wheels) for hdu-api 0.1.0
File Interpreter ABI Platform
hdu_api-0.1.0-py2.py3-none-any.whl Python 3, Python 2 none any Details

Release files / hdu_api-0.1.0-py2.py3-none-any.whl

Download URL hdu_api-0.1.0-py2.py3-none-any.whl
Size 25.4 kB
Tags Python 2 Python 3
SHA-256 checksum
How to use checksums
cf883be794e0a455de94d6c9f589c6bfe0e9a2cd44092267240063f0b96f0531
BLAKE2b-256 checksum
How to use checksums
4d16c43f28a09145a6821c4a8d0ba71409bbb9fa7323c9042a6afd4da92c7596
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/1.12.1 pkginfo/1.5.0.1 requests/2.21.0 setuptools/40.6.3 requests-toolbelt/0.9.1 tqdm/4.31.1 CPython/3.6.8

Release history Release notifications | RSS feed

This release

0.1.0 This release

1 release file

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page