Skip to main content

Help BUPT students access school system with python.

Project description

BUPT_Middleware

Ask DeepWiki

This project aims to help BUPT students simply access school systems with python, without authentication process manually.

Ability

Install

pip install buptmw

Usage

Before start, pass your BUPT Credential that you needed, which was used in below sites:

  1. CAS

to the BUPT_Auth.

from buptmw import BUPT_Auth, CAS_Credential

auth: CAS_Credential = {
    "username": "yourUsername",
    "password": "yourPassword"
}
user = BUPT_Auth(cas=auth)

Then you can call methods like get_xxx to get a verified entity, which you can use it as a requests.Session, and any tiresome authentication can be omitted for you.

from buptmw import BUPT_Auth, CAS_Credential

auth: CAS_Credential = {
    "username": "yourUsername",
    "password": "yourPassword"
}
user = BUPT_Auth(cas=auth)
ucloud = user.get_UCloud()
response = ucloud.get("https://someurl")
# do something with response

[!IMPORTANT]

DO NOT storage the entities which was obtained by get_xxx methods directly, because the cookies will expired but this entity can't detect it timely.

Use the get_xxx methods when you try to get a session.

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

buptmw-0.2.2.tar.gz (18.9 kB view details)

Uploaded Source

Built Distribution

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

buptmw-0.2.2-py3-none-any.whl (19.3 kB view details)

Uploaded Python 3

File details

Details for the file buptmw-0.2.2.tar.gz.

File metadata

  • Download URL: buptmw-0.2.2.tar.gz
  • Upload date:
  • Size: 18.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.8.14

File hashes

Hashes for buptmw-0.2.2.tar.gz
Algorithm Hash digest
SHA256 df2fc9278b392829ca635d1d60ad637b8bb1e9229412a57c6d77a2ae607a09c8
MD5 8afb73b0d7b6397c3576a35a27e6c74e
BLAKE2b-256 746ae0ea02053c067854f633b33387420953e7fe53a8252c881752724e081c1e

See more details on using hashes here.

File details

Details for the file buptmw-0.2.2-py3-none-any.whl.

File metadata

  • Download URL: buptmw-0.2.2-py3-none-any.whl
  • Upload date:
  • Size: 19.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.8.14

File hashes

Hashes for buptmw-0.2.2-py3-none-any.whl
Algorithm Hash digest
SHA256 0f640e1ef57f16f715992bdb21687bd478f0552849618d732d56364bc52510cc
MD5 ea39ff4e444ceb7177e9dcfb62361331
BLAKE2b-256 7c7a7f274ad4d083046d82f2e53e0483ec7a3a4dc944c35f12d4a2b8c9cfbef3

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