Skip to main content

cqujwc

重庆大学教务处登录模块

  1. 自动登录教务网

  2. 封装了带session的GET和POST请求,方便开发者使用

  3. 所有请求均加入了失败重试机制

  4. 获取当前登录用户姓名

安装

pip install cqujwc

使用

from cqujwc import Student
student = Student('学号', '密码')

说明

实例化Student对象时可选参数server(默认为0):

0: jxgl.cqu.edu.cn
1: 202.202.1.41
2: 202.202.1.176:8080
3: 222.198.128.126

利用当前session发起GET和POST请求

GET

student.get(url, params=None, headers=None)

参数说明

参数名

说明

备注

url

GET请求去掉server字段的url

例如,若要请求http://202.202.1.176:8080/MAINFRM.aspx,只需在实例化student对象时将server设置为2,然后调用student.get('/MAINFRM.aspx')即可

params

GET请求参数

和requests.get()的params参数一致

headers

请求头

默认只有UA

POST

student.post(url, data=None, headers=None)

参数说明

参数名

说明

备注

url

POST请求去掉server字段的url

同上

data

POST请求参数

和requests.post()的data参数一致

headers

请求头

默认只有UA

获取当前登录用户信息

student.get_current_name()

返回示例

{
  "student_id": "学号",
  "name": "姓名"
}

获取入学以来每个学期的成绩

student.get_grade()

返回示例

{
  "total": {
    "name": "姓名",
    "student_id": "学号",
    "credit": "获得总学分",
    "GPA": "平均学分绩点",
    "no_pass": "未通过课程门数"
  },
  "items": [
    {
      "name": "学期",
      "courses": [
        {
          "name": "课程名称",
          "credit": "学分",
          "category": "类别",
          "take_property": "修读性质",
          "score": "成绩",
          "notes": "备注"
        }
      ]
    }
  ]
}

统一认证

from cqujwc import verify_auth
verify_auth('统一认证号', '密码')

验证成功返回True,失败返回False

开发计划

  • 获取成绩信息

  • 获取课表

  • 多服务器session管理

Release files for cqujwc 0.0.7

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

Source distribution (sdist)

Source distribution for cqujwc 0.0.7
File Size Uploaded
cqujwc-0.0.7.tar.gz 6.7 kB Details

Release files / cqujwc-0.0.7.tar.gz

Download URL cqujwc-0.0.7.tar.gz
Size 6.7 kB
Tags Source
SHA-256 checksum
How to use checksums
6cf2714e3abed143fb38aa301ab226f25b210e68f254f97f6e28d994a79ff2a6
BLAKE2b-256 checksum
How to use checksums
986984215d46b67a9d36ff06e08b304b40ef9689605efae6d1e7b2a847fb7935
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No

Release history Release notifications | RSS feed

This release

0.0.7 This release

1 release file

0.0.6

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