Skip to main content

The Python iSJTU client for Humans.

Project description

PySJTU - The Python iSJTU client for Humans.

PyPI version Documentation Status


>>> import pysjtu
>>> c = pysjtu.create_client(username="FeiLin", password="WHISPERS")
>>> chemistry = c.schedule(year=2019, term=0).filter("大学化学")
>>> chemistry[0].teacher_name
>>> calculus_exam = c.exam(year=2019, term=0).filter(course_id="MA248")
>>> calculus_exam[0].date, 11, 6)

And, to persist your session...

>>> import pysjtu
>>> session = pysjtu.Session()
>>> session.login("FeiLin", "WHISPERS")
>>> session.dump("lin_fei.session")

>>> session = pysjtu.Session()
>>> session.load("lin_fei.session")
>>> pysjtu.Client(session).student_id


PySJTU allows you to manipulate iSJTU APIs easily.

You don't need to construct queries on your own, or guessing the meaning of poorly named variables (to name a few, kch_id, rwzxs) any more. Now course.hour_total is enough!

Main features of PySJTU:

  • A friendly API with understandable attribute names.
  • Easy session persistence.
  • Robust captcha recognition using ResNet.
  • 80% iSJTU APIs covered. (Course selection APIs included.)
  • Fully type annotated.
  • 99% test coverage.


Install with pip:

$ pip install pysjtu[ocr]

You may omit 'ocr' extra dependencies if you don't need the builtin captcha recognizers.

Python 3.9 still doesn't have a prebuilt ONNXRuntime release, so 'ocr' features won't work on it.

(You may still use the JCSSRecognizer which depends on a remote service called JCSS.)

PySJTU requires Python 3.7+.

Built With

  • HTTPX - A next generation HTTP client for Python.
  • marshmallow - An ORM/ODM/framework-agnostic library for converting complex datatypes, such as objects, to and from native Python datatypes.
  • ONNX Runtime - A performance-focused complete scoring engine for Open Neural Network Exchange (ONNX) models.
  • NumPy - The fundamental package for scientific computing with Python.
  • Pillow - The friendly PIL fork.


This project is licensed under GNU General Public License v3.0 - see the LICENSE file for details.


Built with love by LightQuantum

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

pysjtu-0.3.4.tar.gz (1.2 MB view hashes)

Uploaded source

Built Distribution

pysjtu-0.3.4-py3-none-any.whl (1.2 MB view hashes)

Uploaded py3

Supported by

AWS AWS Cloud computing Datadog Datadog Monitoring Facebook / Instagram Facebook / Instagram PSF Sponsor Fastly Fastly CDN Google Google Object Storage and Download Analytics Huawei Huawei PSF Sponsor Microsoft Microsoft PSF Sponsor NVIDIA NVIDIA PSF Sponsor Pingdom Pingdom Monitoring Salesforce Salesforce PSF Sponsor Sentry Sentry Error logging StatusPage StatusPage Status page