Skip to main content

A client for NYUST SSO system, providing authenticated access and common API calls.

Project description

NYUST SSO Client

NYUST 單一登入系統 (SSO) 模擬客戶端登入,並取得相關資訊。

⚠️ WARNING:

  • 目前還在趕工與測試階段,可能會有不穩定的情況。
  • 本模組僅供學術研究使用,請勿用於非法用途。

安裝

pip install nyust-sso-client

使用範例

以下示範使用 ddddocr 處理驗證碼。執行以下指令安裝ddddocr(可選)。

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

nyust_sso_client-0.2.0.tar.gz (9.2 kB view details)

Uploaded Source

Built Distribution

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

nyust_sso_client-0.2.0-py3-none-any.whl (12.8 kB view details)

Uploaded Python 3

File details

Details for the file nyust_sso_client-0.2.0.tar.gz.

File metadata

  • Download URL: nyust_sso_client-0.2.0.tar.gz
  • Upload date:
  • Size: 9.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.8.5 CPython/3.12.5 Windows/11

File hashes

Hashes for nyust_sso_client-0.2.0.tar.gz
Algorithm Hash digest
SHA256 810ff973e69fca3b9243a8131978a480af0392faf3733c8f52703afc7385c67a
MD5 c461b6a7fb7ae69f05888c2e838bc7b0
BLAKE2b-256 7abcbb3f4c50692fdb0f98329ad433cb5ec9f5b280295be91dadded5eea34138

See more details on using hashes here.

File details

Details for the file nyust_sso_client-0.2.0-py3-none-any.whl.

File metadata

  • Download URL: nyust_sso_client-0.2.0-py3-none-any.whl
  • Upload date:
  • Size: 12.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.8.5 CPython/3.12.5 Windows/11

File hashes

Hashes for nyust_sso_client-0.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 646eaa1928afa10e07918188755841f377e07897ab8198f5acd6cf7974022934
MD5 64f2f2d48de1ddf622e332d2c7e075ad
BLAKE2b-256 9e98337e5b25b20fa5b15f95ceffba16a8ff3f1fb7b06ac10325b6ac01b3baef

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