Skip to main content

A Python package that allows for quick use of USTC network services

Project description

PyUSTC

pypi code size last commit commits since last release

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

MIT

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

pyustc-0.0.2.tar.gz (12.7 kB view details)

Uploaded Source

Built Distribution

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

pyustc-0.0.2-py3-none-any.whl (15.2 kB view details)

Uploaded Python 3

File details

Details for the file pyustc-0.0.2.tar.gz.

File metadata

  • Download URL: pyustc-0.0.2.tar.gz
  • Upload date:
  • Size: 12.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.0.1 CPython/3.12.1

File hashes

Hashes for pyustc-0.0.2.tar.gz
Algorithm Hash digest
SHA256 25a3a8ee97100f0b9ae2b25d140d3bdc55f325721b1597db7e8a99f25106640f
MD5 38c09ab6430a12bb57cd9f377d68b82e
BLAKE2b-256 a02941389ece9fdef2733d56a77a41bdd393fea31bf6fca4239f3ced3a420209

See more details on using hashes here.

File details

Details for the file pyustc-0.0.2-py3-none-any.whl.

File metadata

  • Download URL: pyustc-0.0.2-py3-none-any.whl
  • Upload date:
  • Size: 15.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.0.1 CPython/3.12.1

File hashes

Hashes for pyustc-0.0.2-py3-none-any.whl
Algorithm Hash digest
SHA256 ca5b723733a0d767ff97c7cf90abcb0dcd190f7d8198907c56539e46b0489e89
MD5 de8760c4a6f9b00c53fe1e244f58818b
BLAKE2b-256 d7b381a496e026f0f4095124dd015b55b5067b4b2d82f03ef27c5d3ae50a4edd

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