A Python package that allows for quick use of USTC network services
Project description
PyUSTC
A Python package that allows for quick use of USTC network services.
Installation
pip install pyustc
If you want to use the default validate code processer, you need to install pytesseract as well:
pip install pytesseract
And you also need to install tesseract on your system from here.
Usage
The project is based on the Unified Identity Authentication System of USTC, here is an example of how to login:
from pyustc import Passport
passport = Passport()
passport.login('username', 'password')
If you have already logged in, you can save the token so that you don't need to login again next time:
passport.save_token('token.json')
And then you can login next time with the saved token
passport = Passport('token.json')
After you have logged in, you can use the passport object to access other services. For example, you can get your personal information:
info = passport.get_info()
Or you can use the EduSystem to get your course table:
from pyustc import EduSystem
es = EduSystem(passport)
table = es.get_course_table()
for course in table.courses:
print(course)
License
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file pyustc-0.0.1.tar.gz.
File metadata
- Download URL: pyustc-0.0.1.tar.gz
- Upload date:
- Size: 11.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.0.1 CPython/3.12.1
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
8b73a09d7147952a216e8eadd8c4bac21e90fa9ae85af521d586b4b3dd877eea
|
|
| MD5 |
1c5c9f8521937f46f132f484a82f05a1
|
|
| BLAKE2b-256 |
3d0523fafdb27c7482a74a9db902dafa0af9e24e899e59253442c5ecedae4cf0
|
File details
Details for the file pyustc-0.0.1-py3-none-any.whl.
File metadata
- Download URL: pyustc-0.0.1-py3-none-any.whl
- Upload date:
- Size: 14.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.0.1 CPython/3.12.1
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
7f0a580ec10a94dbc3c8b8ea0efe1e5a562bb8cc9f85f3022b10a1fd0ca5ad2f
|
|
| MD5 |
88b8eeb8d1c75f6b7b2cdfd7df4b342d
|
|
| BLAKE2b-256 |
5714b65353334274813af11e886f421e28002e7dbc78a4620f98f97b5e3a8a95
|