Skip to main content

正方教务管理系统API

Project description

ZF-API 正方教务系统API

正方教务系统信息api,方便开发者二次开发。本着不想重复造轮子的心态,搜索了市面上开源的教务系统爬虫,发现对于本校的教务系统不适用,故参考了部分的正方教务系统的爬虫,尽可能的解决各方面的bug,因此创建此项目。如果有朋友也需要欢迎提issues,尽量解决。

PS:因为之前写过老版本正方教务系统的爬虫,没想刚写完学校升级教务系统了。后期会把旧版的也改写成api,方便部分没升级的同学使用。也推荐各位大佬推荐其他常用的教务系统,希望打造成一个全面的教务系统api or sdk。

后面会添加选课与抢课功能,与微信公众号小程序配合等等,还有最最最重要的一键评价。

原理:

爬虫方面登陆后使用cookies带入,然后抓包分析参数即可,至于登陆方面的加密,百度搜索有比较详细的讲解。

已实现功能:

  • 支持新版正方教务、旧版正方教务还未支持

  • 自动登陆、cookies获取

  • 获取个人信息

  • 获取学校通知

  • 调课、改课消息

  • 获取个人成绩

  • 获取课程表

  • 获取考试信息

  • 可返回原始正方数据json格式

如何使用:

  • 使用pip命令安装pip install zfapi

  • 或者手动安装

    • tar -zxvf 包名.tar.gz
      cd 包名
      python setup.py build
      python setup.py install
      

小试牛刀

运行如下代码:

from zfapi import *

base_url = 'http://xxxx/'

l = Login(base_url=base_url)
l.login('账号', '密码')
cookies = l.cookies
srpihot = GetInfo(base_url=base_url, cookies=cookies)
print(srpihot.get_information())

详细API介绍

详细查看这些例子

感谢以下项目:

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

zfapi-0.0.1.tar.gz (6.9 kB view details)

Uploaded Source

Built Distribution

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

zfapi-0.0.1-py3-none-any.whl (8.2 kB view details)

Uploaded Python 3

File details

Details for the file zfapi-0.0.1.tar.gz.

File metadata

  • Download URL: zfapi-0.0.1.tar.gz
  • Upload date:
  • Size: 6.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.3.0 pkginfo/1.7.0 requests/2.25.1 setuptools/53.0.0 requests-toolbelt/0.9.1 tqdm/4.48.0 CPython/3.7.0

File hashes

Hashes for zfapi-0.0.1.tar.gz
Algorithm Hash digest
SHA256 83825d42e0f1476c5b620f80f15ea7e9a7dfc71c58dc096ffdac73d320881280
MD5 982bd95737a70d00a09178c404829b09
BLAKE2b-256 5b9a005dc48550c12285eca169835eb05f2b0b39b3b6162dddc76155af59cd53

See more details on using hashes here.

File details

Details for the file zfapi-0.0.1-py3-none-any.whl.

File metadata

  • Download URL: zfapi-0.0.1-py3-none-any.whl
  • Upload date:
  • Size: 8.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.3.0 pkginfo/1.7.0 requests/2.25.1 setuptools/53.0.0 requests-toolbelt/0.9.1 tqdm/4.48.0 CPython/3.7.0

File hashes

Hashes for zfapi-0.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 e3943f319c94e8757fce55baf47107d7b5f3b8ec9920d4f3252c699f60a67cb8
MD5 4c3ce95c767f484cb88f20cd33fe1540
BLAKE2b-256 6489c368bd6bfdf6eb79a16f6dde5c718bde750c452630158d5a3d34bf3f58e8

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