Skip to main content

为生科查课提供便利

Project description


title: SkSchedule文档

[TOC]

介绍

SkSchedule用于湖北生物科技职业学院的查课,使用python进行封装,一定程度上降低了开发者的工作量。

开始使用

安装模块以及依赖包

pip install SkSchedule 
pip install pandas
pip install requests

导入模块

from SkSchedule.course import Course

Course

Course是唯一的一个主类,实例化时接受三个参数:username,password,weeks

username:学号,字符型,必选参数

password:密码,字符型,必选参数

weeks:周次,整数型,默认为2,即查询第二周的课表,非必选参数

例如,

from SkSchedule.course import Course
Course('1905080101','1905080101a')

fetch

fetch:Course类的方法,用于获取一周的课表数据。

from SkSchedule.course import Course
course = Course('1905080101','1905080101a')
data = course.fetch()
print(data)

query

query:Course类的方法,用于查询单条或者多条数据,它接受两个参数,week,teacher

week:星期,str类型或者list类型,可选的值为:

['周一','周二','周三','周四','周五','周六','周日']

当给定week参数类型为str时候,则查询单条,类型为list时候查询多条数据

teacher:教师姓名,str类型

如,查询周一课表:

query('周一')

组合查询

#查询周一并且是教师为孙智武老师的课程
query('周一','孙智武')

查询多条数据

#查询周一和周三的课程
query(['周一','周三'])

to_excel

to_excel:Course类的方法,用于导出数据为excel文件,它接受一个参数path

path:文件保存路径

from SkSchedule.course import Course
course = Course('1905080101','1905080101a')
course.to_excel('课程表.xlsx')

常见问题

1.当Course中的usernamepassword给定有误或者学校教务系统无此信息的时候,会抛出ValueError:参数错误。

文档待完善,具体问题请联系开发者:2528104776@qq.com

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

SkSchedule-0.0.2.tar.gz (4.0 kB view details)

Uploaded Source

File details

Details for the file SkSchedule-0.0.2.tar.gz.

File metadata

  • Download URL: SkSchedule-0.0.2.tar.gz
  • Upload date:
  • Size: 4.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.5.0 importlib_metadata/4.8.1 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.9.6

File hashes

Hashes for SkSchedule-0.0.2.tar.gz
Algorithm Hash digest
SHA256 eb8573b9fd4e0a7040a701bd397d8b657aa16288f5f37a12c8f1bff60a6efc08
MD5 b34430db56cdd5577be03644d7db79f8
BLAKE2b-256 8b21a18e07e801418d3f2ac6c4825f13b47186ccef4a06b229780aa0fbbe476a

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page