Skip to main content

NoneBot2 course schedule plugin with queries, imports, reminders, and holiday checks

Project description

nonebot-plugin-class-schedule

适用于 NoneBot2 + OneBot V11 的课程表插件,支持课程查询、课表导入、作息表导入、课前提醒、节假日识别和文字/图片输出。

功能

  • 实时查询:/现在什么课/等会什么课
  • 每日查询:/今天什么课/明天什么课/周一/周日
  • 汇总查询:/本周课表/第几周/我的课表
  • 数据导入:/导入课表/导入作息表/确认导入/确认导入作息
  • 提醒功能:/课前提醒/假期订阅
  • 其他:/查课 <课目>/放假没/课表风格

安装

基础安装:

pip install nonebot-plugin-class-schedule

如果需要图片输出:

pip install "nonebot-plugin-class-schedule[image]"

如果需要课前提醒和假期订阅:

pip install "nonebot-plugin-class-schedule[reminder]"

全部功能:

pip install "nonebot-plugin-class-schedule[all]"

加载插件

在 NoneBot 项目中加载:

nonebot.load_plugin("nonebot_plugin_class_schedule")

或在 pyproject.toml 中配置:

[tool.nonebot]
plugins = ["nonebot_plugin_class_schedule"]

数据存储

插件默认使用 nonebot-plugin-localstore 保存用户数据,不会把课程表写入插件安装目录。

你也可以在 .env 中指定数据目录:

CLASS_SCHEDULE_DATA_DIR=/path/to/class_schedule_data

数据文件包括:

  • schedules/{qq_user_id}.json:用户课程表
  • preferences.json:输出风格、提醒设置、作息表等用户偏好

请不要把这些运行数据提交到 GitHub 或上传到 PyPI。

常用命令

命令 功能
/课程表帮助 查看帮助
/现在什么课 查询当前课程状态
/等会什么课 查询下一节课和倒计时
/今天什么课/课表 查询今日课表
/明天什么课 查询明日课表
/周一/周日 查询指定星期课表
/本周课表 查询本周概览
/第几周 查询当前教学周
/我的课表 查看完整课表
/查课 <课目> 搜索今天的某门课
/导入课表 进入课表导入流程
/导入作息表 进入作息表导入流程
/课表风格 文字 切换为文字输出
/课表风格 图片 切换为图片输出,需要 image 额外依赖
/课前提醒 开/关 开关课前提醒,需要 reminder 额外依赖
/假期订阅 开/关 开关假期提醒,需要 reminder 额外依赖
/放假没 查询今天是否节假日或补班

导入课表

发送 /导入课表 后,按提示发送课程内容:

周一:
早读 英语(李老师)
第1节 数学 @A201
第2节 物理(王老师)
第3节 化学
晚自习 语文

周二:
第1节 英语
第2节 数学

支持:

  • 星期:周一星期一周一:
  • 节次:早读第1节第一节1节晚自习
  • 老师:(老师名)(老师名)
  • 地点:@地点#地点

解析完成后发送 /确认导入 保存,或 /取消导入 放弃。

导入作息表

发送 /导入作息表 后,按提示发送作息时间:

早读 07:00-07:30
第1节 08:00-08:45
第2节 08:55-09:40
午休 12:00-14:00
第5节 14:00-14:45
晚自习 18:20-21:00

解析完成后发送 /确认导入作息 保存,或 /取消导入作息 放弃。

提醒

课前提醒:

/课前提醒 开
/课前提醒 关
/课前提醒 提前5分钟

假期订阅:

/假期订阅 开
/假期订阅 关

提醒功能依赖 nonebot-plugin-apscheduler。如果没有安装,查询和导入功能仍可正常使用。

隐私与发布注意事项

本仓库不包含任何真实课表数据、QQ 号、Token、Cookie、数据库或 .env 文件。

发布前建议检查:

python -m build
tar -tf dist/*.tar.gz
python -m twine check dist/*

确认构建产物里没有 data/*.json.env、数据库文件或真实用户信息后再上传。

License

MIT

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

nonebot_plugin_class_schedule-1.0.3.tar.gz (30.2 kB view details)

Uploaded Source

Built Distribution

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

nonebot_plugin_class_schedule-1.0.3-py3-none-any.whl (33.9 kB view details)

Uploaded Python 3

File details

Details for the file nonebot_plugin_class_schedule-1.0.3.tar.gz.

File metadata

File hashes

Hashes for nonebot_plugin_class_schedule-1.0.3.tar.gz
Algorithm Hash digest
SHA256 1010f0fc1f785fc6b737deb2356707038306fbcf20879a10dd0d14b6c743e8a1
MD5 6e7330d7f019f4be4f7820a75ac1126b
BLAKE2b-256 3277a55e398eb72a909fcde2aed818b261d20b3f4d473ac81be17cde58f211f9

See more details on using hashes here.

File details

Details for the file nonebot_plugin_class_schedule-1.0.3-py3-none-any.whl.

File metadata

File hashes

Hashes for nonebot_plugin_class_schedule-1.0.3-py3-none-any.whl
Algorithm Hash digest
SHA256 33e6edcaa6ac75ff1121d98e197cc15b5ef5991a2849c3a7cfff36d1fbe7fced
MD5 4a39931292aa57b0bbf2f27777f4f31f
BLAKE2b-256 1f5302749daf7985c70139f062ba373c5fbe80aef1e935218d6815ad53408c0e

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