A client for NYUST SSO system, providing authenticated access and common API calls.
Project description
NYUST SSO Client
NYUST 單一登入系統 (SSO) 模擬客戶端登入,並取得相關資訊。
安裝
pip install ddddocr
使用範例
import ddddocr
from nyust_sso import NYUSTSSOClient
if __name__ == "__main__":
ocr = ddddocr.DdddOcr(show_ad=False)
client = NYUSTSSOClient()
captcha = client.fetch_captcha()
captcha_text = ocr.classification(captcha)
client.login("<username>", "<password>", captcha_text.lower())
# 獲取當前學期所有課程資訊
courses = client.fetch_my_courses()
參數說明
NYUSTSSOClient: 模組的核心,用於與 NYUST SSO 系統互動。fetch_captcha(): 抓取登入頁面上的驗證碼圖片。login(username, password, captcha_text): 執行登入動作,需提供使用者名稱、密碼以及辨識後的驗證碼文字。fetch_my_courses(): 登入後,取得當前學期的課程資訊。
驗證碼處理
此範例中使用了 ddddocr 模組來辨識驗證碼。若對驗證碼有其他需求可自行實現替換 ddddocr,此範例只是提供一種破解示範。
注意事項
captcha_text.lower(): 轉換驗證碼文字為小寫,確保與伺服器驗證格式一致。
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
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 nyust_sso_client-0.1.0.tar.gz.
File metadata
- Download URL: nyust_sso_client-0.1.0.tar.gz
- Upload date:
- Size: 6.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.12.4
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
c214b3a19aefc70169ef12e5c025795108f99b25a286495e7fdaa39f6f0c8b0f
|
|
| MD5 |
16115f632704b162faa5428a3e349cf7
|
|
| BLAKE2b-256 |
759220eafbeaf883d09cb1b6ef63f1d27bdb804dd23156d71d211750a8a07b6a
|
File details
Details for the file nyust_sso_client-0.1.0-py3-none-any.whl.
File metadata
- Download URL: nyust_sso_client-0.1.0-py3-none-any.whl
- Upload date:
- Size: 6.9 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.12.4
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
e2470dd1fe358418eafefecd31114e5becb278194d98dc5088c12b91ab98754b
|
|
| MD5 |
3bf278a18ee16b34d1db4dd813ae4136
|
|
| BLAKE2b-256 |
d02c77c4d45d9a6776909fc928ec846f6ab0070fc9d84220ce89b9876978608c
|