Skip to main content

北京化工大学课程平台作业查询

Project description

buct-course

北京化工大学课程平台API库

功能特性

  • 自动化登录北化课程平台
  • 获取课程信息、待办任务
  • 查询和参与在线测试
  • 异常处理和错误提示

安装

从PyPI安装(发布后可用)

pip install buct-course

从源码安装

# 克隆仓库
git clone https://github.com/yourusername/buct-course.git
cd buct-course

# 安装开发版本
pip install -e .

# 或者直接安装
pip install .

快速开始

from buct_course import BUCTAuth, CourseUtils

# 创建认证实例
auth = BUCTAuth()

# 登录
if auth.login("your_username", "your_password"):
    session = auth.get_session()
    
    # 使用课程工具
    course_utils = CourseUtils(session)
    tasks = course_utils.get_pending_tasks()
    print(f"待办任务: {tasks}")
else:
    print("登录失败")

API 参考

BUCTAuth

  • login(username, password): 登录课程平台
  • get_session(): 获取认证后的会话
  • logout(): 退出登录

CourseUtils

  • get_courses(): 获取所有课程
  • get_pending_tasks(): 获取待办任务
  • get_course_content(course_id): 获取课程内容

TestUtils

  • get_test_categories(): 获取测试分类
  • get_tests_by_category(cate_id): 按分类获取测试
  • take_test(test_id): 开始测试
  • get_test_results(test_id): 获取测试结果

异常处理

库提供了详细的异常类型:

  • BUCTCourseError: 基础异常
  • LoginError: 登录相关错误
  • NetworkError: 网络连接错误
  • ParseError: 解析错误

许可证

MIT License

免责声明

本库仅供学习和技术研究使用,请遵守学校相关规定,合理使用自动化工具。

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

buct_course-0.3.0.tar.gz (14.1 kB view details)

Uploaded Source

Built Distribution

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

buct_course-0.3.0-py3-none-any.whl (16.7 kB view details)

Uploaded Python 3

File details

Details for the file buct_course-0.3.0.tar.gz.

File metadata

  • Download URL: buct_course-0.3.0.tar.gz
  • Upload date:
  • Size: 14.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.10

File hashes

Hashes for buct_course-0.3.0.tar.gz
Algorithm Hash digest
SHA256 d497925752784dd18344e39b41f43520e4ab1d9737d97d8d1f5b7c959c5a072b
MD5 99a7749bc7f34b711aed9714588eb410
BLAKE2b-256 83692b4374c460d452f5888cd8394495a88d698ea48eb94a288e9c5ec41a60f1

See more details on using hashes here.

File details

Details for the file buct_course-0.3.0-py3-none-any.whl.

File metadata

  • Download URL: buct_course-0.3.0-py3-none-any.whl
  • Upload date:
  • Size: 16.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.10

File hashes

Hashes for buct_course-0.3.0-py3-none-any.whl
Algorithm Hash digest
SHA256 168236e5e045cfb48858ed952aee58c307f48b623fe4abc977942aed1be549af
MD5 6962caf3256ab63a1d73e67a6e1d2fe4
BLAKE2b-256 45c3270c1871e78b1b17e2c80429145f4bd5248bf90232d7c497f99b9286195c

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