Skip to main content

Help BUPT students access school system with python.

Project description

BUPT_Middleware

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.1.tar.gz (18.7 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.1-py3-none-any.whl (19.3 kB view details)

Uploaded Python 3

File details

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

File metadata

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

File hashes

Hashes for buptmw-0.2.1.tar.gz
Algorithm Hash digest
SHA256 713d80fa0d37f20e4b4f383dd2ae2dd9b977ed20b8dc0543feed31c5783a50a4
MD5 a9ff69f47ced2440501b382a26e7138f
BLAKE2b-256 f7fd0cd317964b5b234f36fbccafcf14b89c595d46fb460807b7b1acf6822922

See more details on using hashes here.

File details

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

File metadata

  • Download URL: buptmw-0.2.1-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.1-py3-none-any.whl
Algorithm Hash digest
SHA256 38b8f6e0006a23e16289562deae72e2769663ec67d600762b456153f176e84f9
MD5 4ca32c70cf21c2fd87f7e979c8b058d3
BLAKE2b-256 e5daa6ad3376bc3baa8a6df34a57a41b4640285918211370e2b219fad6a6bc68

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