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.1.tar.gz (29.4 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.1-py3-none-any.whl (27.7 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: gdou_jwxt-0.2.1.tar.gz
  • Upload date:
  • Size: 29.4 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.1.tar.gz
Algorithm Hash digest
SHA256 9b79cb7ca6a8d2b4fe336c7092f40c9f0f4e300806df91a3def4a730f91fff6d
MD5 d24443d8e0d9baa3acea97198e6f4d1a
BLAKE2b-256 fcaab68110735b9f2f901822b95581d3c4574b54aa98406177a8542c1207d89c

See more details on using hashes here.

File details

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

File metadata

  • Download URL: gdou_jwxt-0.2.1-py3-none-any.whl
  • Upload date:
  • Size: 27.7 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.1-py3-none-any.whl
Algorithm Hash digest
SHA256 bb96b1704d3db0917c3fc64e81916dd6db256ab4acbf80e34001b085faa6de2d
MD5 913f00b4a67b127c1d447e86eaded5d4
BLAKE2b-256 b79eb973654938aa82227a441705cf4af0ea764ab2532a66a660a85d8f540f4f

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