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.1.0.tar.gz (12.3 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.1.0-py3-none-any.whl (13.3 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: buct_course-0.1.0.tar.gz
  • Upload date:
  • Size: 12.3 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.1.0.tar.gz
Algorithm Hash digest
SHA256 2501699134378b5982099fe5e3982098c7e8b20826a22361cfa6460007e99e84
MD5 73042f8eeb5a2eac0f4410bd220065a6
BLAKE2b-256 677e5d8b41d82ad9e1255b8ce12fa94d5740b778b475d5caa19e5cc585829b70

See more details on using hashes here.

File details

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

File metadata

  • Download URL: buct_course-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 13.3 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.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 7cb3142b66c304b03bbaf8e5fdedac33c62b6a5f6494f13cf789b52eefdeb788
MD5 1053f103827140a53be0897bc159d592
BLAKE2b-256 f63e374f6c447005e540a24f8237cd65622b5cce965ee5d9722e1e9bbfa58dc9

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