Skip to main content

PySJTU - The Python iSJTU client for Humans.

PyPI version Documentation Status

screenshot


>>> 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
datetime.date(2019, 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
519027910001

Features

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.name 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.

Installation

Install with pip:

$ pip install pysjtu[ocr]

PySJTU requires Python 3.8+.

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.

License

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

—💖—

Built with love by LightQuantum

Metadata

Release files for pysjtu 0.4.2

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

Source distribution (sdist)

Source distribution for pysjtu 0.4.2
File Size Uploaded
pysjtu-0.4.2.tar.gz 1.2 MB Details

Built distribution (wheel)

Table of built distributions (wheels) for pysjtu 0.4.2
File Interpreter ABI Platform
pysjtu-0.4.2-py3-none-any.whl Python 3 none any Details

Total release size: 2.4 MB

Release files / pysjtu-0.4.2.tar.gz

Download URL pysjtu-0.4.2.tar.gz
Size 1.2 MB
Tags Source
SHA-256 checksum
How to use checksums
1be6866e3381bf7298b4dfe8bc91ed83e0bcce22a5722f140d3a4db37108200a
BLAKE2b-256 checksum
How to use checksums
6d7f107b3408af75791bf512443f4bbc203da3f78b6196f8ff31e9d3f55fe130
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via pdm/2.15.4 CPython/3.10.12 Linux/6.5.0-1021-azure

Release files / pysjtu-0.4.2-py3-none-any.whl

Download URL pysjtu-0.4.2-py3-none-any.whl
Size 1.2 MB
Tags Python 3
SHA-256 checksum
How to use checksums
f684d05a873ad46adc342427797e0585d71ccccd4127c4a3bc57f42ef27f91a2
BLAKE2b-256 checksum
How to use checksums
44ddfe4e573c8d14fbe9526560a8d3b1c1b7ce85edceb0da8db05773a5609b20
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via pdm/2.15.4 CPython/3.10.12 Linux/6.5.0-1021-azure

Release history Release notifications | RSS feed

This release

0.4.2 This release

2 release files

0.4.1

2 release files

0.4.0

2 release files

0.3.5

2 release files

0.3.4

2 release files

0.3.3

2 release files

0.3.2

2 release files

0.3.1

2 release files

0.3.0

2 release files

0.2.1

2 release files

0.2.0

2 release files

0.1.1

2 release files

0.1.0

2 release files

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