Skip to main content

广东海洋大学教务系统客户端

Project description

gdou-jwxt

广东海洋大学教务系统全自动登录 Python 模块。

安装

基础安装:

pip install -e .

导入

from gdou_jwxt import AutoLogin, Authenticator, JwxtClient, JwxtConfig

无头登录

from gdou_jwxt import Authenticator, JwxtConfig

auth = Authenticator(config=JwxtConfig(headless=True))
result = auth.login("学号", "密码")

会话保持

登录成功后会把 Cookie 保存到程序运行目录:

.gdou_jwxt/cookies.json

下次调用 login() 会先尝试复用 Cookie,失效后再重新自动登录。

快捷接口

已预留这些接口方法:

from gdou_jwxt import JwxtClient, JwxtConfig

client = JwxtClient(
    username="学号",
    password="密码",
    config=JwxtConfig(headless=True),
)

auth, grades = client.query_grades(academic_year="2025-2026", term="12")
auth, timetable = client.query_timetable(academic_year="2025-2026", term="3")
auth, mobile_timetable = client.query_mobile_timetable(academic_year="2025-2026", term="3", campus_id="1")
auth, exams = client.query_exam_schedule(academic_year="2025-2026", term="12")
auth, info = client.query_student_info()
auth, plan = client.query_training_plan()
auth, courses = client.query_course_selection()
auth, rooms = client.query_empty_classrooms()

成绩和考试日程返回 PageResult,数据在 items;课表返回 TimetableResult,课程在 courses,学生信息在 student_info

if auth.ok:
    for item in exams.items:
        print(item.course_name, item.exam_time, item.classroom)

    for course in timetable.courses:
        print(course.course_name, course.weekday_name, course.periods, course.classroom)

query_grades()query_timetable()query_mobile_timetable()query_exam_schedule() 已有默认 URL。academic_year2025-2026 这种学年格式,内部会自动转换成教务系统需要的 xnm=2025

成绩查询参数里 academic_year 对应 xnmterm 对应 xqmcourse_mark 对应 kcbj

课表查询参数里 academic_year 对应 xnmterm 对应 xqmview_type 对应 kzlxstudent_code 对应 xsdmcourse_category 对应 kclbdmcourse_type 对应 kclxdm

移动端课表查询参数里 academic_year 对应 xnmterm 对应 xqmcampus_id 对应 xqh_id

考试日程查询参数里 academic_year 对应 xnmterm 对应 xqmexam_name_id 对应 ksmcdmb_idcourse_code 对应 kchcourse_name 对应 kcexam_date 对应 ksrqdepartment_id 对应 kkbm_id

其他接口需要在 JwxtConfig 里补 URL:

config = JwxtConfig(
    headless=True,
    student_info_url="待补充",
    training_plan_url="待补充",
    course_selection_url="待补充",
    empty_classroom_url="待补充",
)

也可以直接请求任意已知接口:

auth, data = client.query_endpoint("接口 URL", data={"xnm": "2025"})

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

gdou_jwxt-0.2.0.tar.gz (29.2 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

gdou_jwxt-0.2.0-py3-none-any.whl (27.6 kB view details)

Uploaded Python 3

File details

Details for the file gdou_jwxt-0.2.0.tar.gz.

File metadata

  • Download URL: gdou_jwxt-0.2.0.tar.gz
  • Upload date:
  • Size: 29.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.0

File hashes

Hashes for gdou_jwxt-0.2.0.tar.gz
Algorithm Hash digest
SHA256 0d476a2f608cd959ef2a80627735ea903e9f50269097a3a8711e2daa690d2526
MD5 50e294a124959bd1b367be8668853c5e
BLAKE2b-256 251972090ab4215bf7efc7bf32e26f1209f37f56dd47f8d8b19c51e22909d01d

See more details on using hashes here.

File details

Details for the file gdou_jwxt-0.2.0-py3-none-any.whl.

File metadata

  • Download URL: gdou_jwxt-0.2.0-py3-none-any.whl
  • Upload date:
  • Size: 27.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.0

File hashes

Hashes for gdou_jwxt-0.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 d136541e7bac0c239fb59ef050d40189830683da15a18fbac0b05353c231400a
MD5 44e2f26ac4b596c66963f99ab46fef0d
BLAKE2b-256 f008e81a5a5fbe6a48e8d3d406e9929ee1477844f704d1fa6c01e55d91f96d23

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page