Skip to main content

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

Project description

NYUST SSO Client 0.1.0

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

安裝

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.1.1.tar.gz (6.0 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.1.1-py3-none-any.whl (7.0 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: nyust_sso_client-0.1.1.tar.gz
  • Upload date:
  • Size: 6.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.12.5

File hashes

Hashes for nyust_sso_client-0.1.1.tar.gz
Algorithm Hash digest
SHA256 259104864d28b7e9cfa47b57ec8bc865dc5f62bef4aea5e8c7c0c28978f768e2
MD5 a23315b7e039d0b03ce98c7dc314f9d5
BLAKE2b-256 34237824d15815443c1767dbe375e7894082ba90347199f03b795c7c87903094

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for nyust_sso_client-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 414aac85586bc997cae6890a6e005333bca1ef21837ef5ff2d326282eb526822
MD5 cde1f95e0fbafa53ff25a511f729cdd6
BLAKE2b-256 bb6543db67d90bb44bdb0d8393f01850e68aa37913d30cfd9ad71bdf4419eb42

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