nonebot-plugin-npu


Namenonebot-plugin-npu JSON
Version 1.0.1 PyPI version JSON
download
home_pageNone
Summary翱翔门户成绩监控插件,能获取成绩、排名、绩点,当出现新成绩时推送给使用者
upload_time2025-01-21 06:25:35
maintainerNone
docs_urlNone
authorqllokirin
requires_python<4.0,>=3.9
licenseNone
keywords nonebot nonebot2 npu nwpu
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            <!-- markdownlint-disable MD033 MD036 MD041 -->

<div align="center">
<a href="https://v2.nonebot.dev/store">
    <img src="./images/NoneBotPlugin.svg" width="300" alt="logo">
</a>

# nonebot-plugin-npu

_✨ 西工大翱翔门户成绩监控插件,能获取成绩、排名、绩点,当出现新成绩时推送给使用者 ✨_

</div>

<p align="center">
  <a href="https://github.com/qllokirin/nonebot-plugin-npu/blob/master/LICENSE">
    <img src="https://img.shields.io/github/license/qllokirin/nonebot-plugin-npu.svg" alt="license">
  </a>
  <a href="https://pypi.python.org/pypi/nonebot-plugin-npu">
    <img src="https://img.shields.io/pypi/v/nonebot-plugin-npu.svg" alt="pypi">
  </a>
  <img src="https://img.shields.io/badge/python-3.9+-blue.svg" alt="python">
</p>
<p align="center">
  <a href="https://www.bilibili.com/video/BV1ga411T7mv">
    <img src="images/headset.jpg" alt="【洛天依原创】所以我戴上了耳机【COP投稿十周年】">
  </a>
</p>
<h2 align="center">"摘下耳机时眼眶依旧会微红
戴上耳机依旧是你描绘的梦"
</h2>

# 📖 介绍

nonebot-plugin-npu,翱翔门户成绩监控插件,能获取成绩、排名、绩点,当出现新成绩时推送给使用者

- [x] 获取成绩、绩点、排名
- [x] 出现新成绩、新考试时推送
- [x] 排名变动时推送
- [x] 宿舍电费监控
- [x] 排考检测
- [x] 课表提取

# 🔔 安装

<details>
<summary>法一:nb plugin安装方法[推荐]</summary>

安装插件

```
nb plugin install nonebot-plugin-npu
```

安装wkhtmltopdf

```
打开https://wkhtmltopdf.org/downloads.html安装
```

</details>

<details>
<summary>法二:pip安装</summary>

* 1.激活python环境

  ```
  .\.venv\Scripts\activate   				(Windows)
  source \.venv\Scripts\activate			(Ubuntu)
  ```

* 2.安装

  ```
  pip install nonebot-plugin-npu
  ```
  
* 3.安装wkhtmltopdf

  ```
  打开https://wkhtmltopdf.org/downloads.html安装
  ```
  

打开 nonebot2 项目根目录下的 `pyproject.toml` 文件, 在 `[tool.nonebot]` 部分追加写入

```
plugins = ["nonebot-plugin-npu"]
```

</details>


# 📣配置

在`.env.prod`/`.env`中写入以下字段,也可不填,默认值如下

```
npu_check_time=60
npu_electric_check_time=30
npu_if_check_grades=true
npu_if_check_rank=false
npu_if_check_exams=true
npu_if_check_when_connect=false
npu_begin_check_hour=8
npu_end_check_hour=22
```

|        参数         |  值  |          说明          |
| :-----------------: | :--: | :--------------------: |
|   npu_check_time    | int  | 每多少分钟检测一次成绩 |
|   npu_electric_check_time    | int  | 每多少分钟检测一次电费 |
| npu_if_check_grades | bool |      是否检测成绩      |
|  npu_if_check_rank  | bool |      是否检测排名      |
| npu_if_check_exams  | bool |     是否检测新考试     |
| npu_if_check_when_connect  | bool |     当connect的是否执行一次检测     |
| npu_begin_check_hour | int | 起始检测时间,在x点之前不会检测 |
| npu_end_check_hour | int | 最末检测时间,在x点之后不会检测 |

> [!TIP]
>
> 记得配置[SUPERUSERS](https://nonebot.dev/docs/appendices/config#superusers),当发生错误时会推送消息给超级用户
>
> 推荐设置[Command Start](https://nonebot.dev/docs/appendices/config#command-start-%E5%92%8C-command-separator)为`COMMAND_START=["/", ""]`,这样有`/`和没`/`都可以响应指令

# 🎉 使用

### 指令表

<details>
<summary>指令列表</summary>

|         指令          |   范围    |                           说明                           |           示例           |
| :-------------------: | :-------: | :------------------------------------------------------: | :----------------------: |
|       **/翱翔**       | 私聊/艾特 |                       登陆翱翔门户                       |   ![](images/翱翔.png)   |
|       /翱翔成绩       | 私聊/艾特 |                     获取本学期的成绩                     | ![](images/翱翔成绩.png) |
|       /翱翔排名       | 私聊/艾特 |                       获取排名信息                       |     ![](images/翱翔排名.png)     |
|       /翱翔考试       | 私聊/艾特 |                   获取未结束的考试信息                   |     ![](images/翱翔考试.png)     |
|       /翱翔课表       | 私聊/艾特 |           获取课表(需要搭配wake up软件使用)            |     ![](images/翱翔课表.png)     |
|     /翱翔本周课表    | 私聊/艾特 |          获取本周课表图片文件                             |                                  |
| /翱翔综测排名 | 私聊/艾特 | 获取综测参评中的综测排名 |   ![](images/翱翔综测排名.png) |
| /翱翔退出登陆(登录) | 私聊/艾特 |                         退出登陆                         |     ![](images/翱翔退出登陆.png)     |
|     /翱翔全部成绩     | 私聊/艾特 |                       获取全部成绩                       |     ![](images/翱翔全部成绩.png)     |
|     /翱翔全部考试     | 私聊/艾特 |                     获取全部考试信息                     |     ![](images/翱翔全部考试.png)     |
|  /翱翔加权百分制成绩  | 私聊/艾特 |                    计算加权百分制成绩                    |     ![](images/翱翔加权百分制成绩.png)     |
|     /翱翔电费绑定     | 私聊/艾特 | 绑定宿舍,当电费小于25时会推送消息,每天中午12点检测一次 |     ![](images/翱翔电费绑定.png)     |
|     /翱翔电费查询     | 私聊/艾特 |                       查询当前电费                       |     ![](images/翱翔电费查询.png)     |
|     /翱翔电费解绑     | 私聊/艾特 |                       解除宿舍绑定                       |     ![](images/翱翔电费解绑.png)     |

</details>

# 🤩致谢

翱翔门户登陆以及数据获取参考了:https://github.com/cheanus/Automation/blob/main/GradesMonitorLinux.py

README写法 [参考](https://github.com/A-kirami/nonebot-plugin-template/blob/master/README.md) [参考](https://github.com/WJZ-P/LiteLoaderQQNT-Echo-Message/blob/main/README.md)


            

Raw data

            {
    "_id": null,
    "home_page": null,
    "name": "nonebot-plugin-npu",
    "maintainer": null,
    "docs_url": null,
    "requires_python": "<4.0,>=3.9",
    "maintainer_email": null,
    "keywords": "nonebot, nonebot2, npu, nwpu",
    "author": "qllokirin",
    "author_email": null,
    "download_url": "https://files.pythonhosted.org/packages/9c/29/ed257dba8b0dd0f005bdf5c9a6c8fe022b16eea73ddadef4bd55014c42c8/nonebot_plugin_npu-1.0.1.tar.gz",
    "platform": null,
    "description": "<!-- markdownlint-disable MD033 MD036 MD041 -->\n\n<div align=\"center\">\n<a href=\"https://v2.nonebot.dev/store\">\n    <img src=\"./images/NoneBotPlugin.svg\" width=\"300\" alt=\"logo\">\n</a>\n\n# nonebot-plugin-npu\n\n_\u2728 \u897f\u5de5\u5927\u7ff1\u7fd4\u95e8\u6237\u6210\u7ee9\u76d1\u63a7\u63d2\u4ef6\uff0c\u80fd\u83b7\u53d6\u6210\u7ee9\u3001\u6392\u540d\u3001\u7ee9\u70b9\uff0c\u5f53\u51fa\u73b0\u65b0\u6210\u7ee9\u65f6\u63a8\u9001\u7ed9\u4f7f\u7528\u8005 \u2728_\n\n</div>\n\n<p align=\"center\">\n  <a href=\"https://github.com/qllokirin/nonebot-plugin-npu/blob/master/LICENSE\">\n    <img src=\"https://img.shields.io/github/license/qllokirin/nonebot-plugin-npu.svg\" alt=\"license\">\n  </a>\n  <a href=\"https://pypi.python.org/pypi/nonebot-plugin-npu\">\n    <img src=\"https://img.shields.io/pypi/v/nonebot-plugin-npu.svg\" alt=\"pypi\">\n  </a>\n  <img src=\"https://img.shields.io/badge/python-3.9+-blue.svg\" alt=\"python\">\n</p>\n<p align=\"center\">\n  <a href=\"https://www.bilibili.com/video/BV1ga411T7mv\">\n    <img src=\"images/headset.jpg\" alt=\"\u3010\u6d1b\u5929\u4f9d\u539f\u521b\u3011\u6240\u4ee5\u6211\u6234\u4e0a\u4e86\u8033\u673a\u3010COP\u6295\u7a3f\u5341\u5468\u5e74\u3011\">\n  </a>\n</p>\n<h2 align=\"center\">\"\u6458\u4e0b\u8033\u673a\u65f6\u773c\u7736\u4f9d\u65e7\u4f1a\u5fae\u7ea2\n\u6234\u4e0a\u8033\u673a\u4f9d\u65e7\u662f\u4f60\u63cf\u7ed8\u7684\u68a6\"\n</h2>\n\n# \ud83d\udcd6 \u4ecb\u7ecd\n\nnonebot-plugin-npu\uff0c\u7ff1\u7fd4\u95e8\u6237\u6210\u7ee9\u76d1\u63a7\u63d2\u4ef6\uff0c\u80fd\u83b7\u53d6\u6210\u7ee9\u3001\u6392\u540d\u3001\u7ee9\u70b9\uff0c\u5f53\u51fa\u73b0\u65b0\u6210\u7ee9\u65f6\u63a8\u9001\u7ed9\u4f7f\u7528\u8005\n\n- [x] \u83b7\u53d6\u6210\u7ee9\u3001\u7ee9\u70b9\u3001\u6392\u540d\n- [x] \u51fa\u73b0\u65b0\u6210\u7ee9\u3001\u65b0\u8003\u8bd5\u65f6\u63a8\u9001\n- [x] \u6392\u540d\u53d8\u52a8\u65f6\u63a8\u9001\n- [x] \u5bbf\u820d\u7535\u8d39\u76d1\u63a7\n- [x] \u6392\u8003\u68c0\u6d4b\n- [x] \u8bfe\u8868\u63d0\u53d6\n\n# \ud83d\udd14 \u5b89\u88c5\n\n<details>\n<summary>\u6cd5\u4e00\uff1anb plugin\u5b89\u88c5\u65b9\u6cd5[\u63a8\u8350]</summary>\n\n\u5b89\u88c5\u63d2\u4ef6\n\n```\nnb plugin install nonebot-plugin-npu\n```\n\n\u5b89\u88c5wkhtmltopdf\n\n```\n\u6253\u5f00https://wkhtmltopdf.org/downloads.html\u5b89\u88c5\n```\n\n</details>\n\n<details>\n<summary>\u6cd5\u4e8c\uff1apip\u5b89\u88c5</summary>\n\n* 1.\u6fc0\u6d3bpython\u73af\u5883\n\n  ```\n  .\\.venv\\Scripts\\activate   \t\t\t\t(Windows)\n  source \\.venv\\Scripts\\activate\t\t\t(Ubuntu)\n  ```\n\n* 2.\u5b89\u88c5\n\n  ```\n  pip install nonebot-plugin-npu\n  ```\n  \n* 3.\u5b89\u88c5wkhtmltopdf\n\n  ```\n  \u6253\u5f00https://wkhtmltopdf.org/downloads.html\u5b89\u88c5\n  ```\n  \n\n\u6253\u5f00 nonebot2 \u9879\u76ee\u6839\u76ee\u5f55\u4e0b\u7684 `pyproject.toml` \u6587\u4ef6, \u5728 `[tool.nonebot]` \u90e8\u5206\u8ffd\u52a0\u5199\u5165\n\n```\nplugins = [\"nonebot-plugin-npu\"]\n```\n\n</details>\n\n\n# \ud83d\udce3\u914d\u7f6e\n\n\u5728`.env.prod`/`.env`\u4e2d\u5199\u5165\u4ee5\u4e0b\u5b57\u6bb5\uff0c\u4e5f\u53ef\u4e0d\u586b\uff0c\u9ed8\u8ba4\u503c\u5982\u4e0b\n\n```\nnpu_check_time=60\nnpu_electric_check_time=30\nnpu_if_check_grades=true\nnpu_if_check_rank=false\nnpu_if_check_exams=true\nnpu_if_check_when_connect=false\nnpu_begin_check_hour=8\nnpu_end_check_hour=22\n```\n\n|        \u53c2\u6570         |  \u503c  |          \u8bf4\u660e          |\n| :-----------------: | :--: | :--------------------: |\n|   npu_check_time    | int  | \u6bcf\u591a\u5c11\u5206\u949f\u68c0\u6d4b\u4e00\u6b21\u6210\u7ee9 |\n|   npu_electric_check_time    | int  | \u6bcf\u591a\u5c11\u5206\u949f\u68c0\u6d4b\u4e00\u6b21\u7535\u8d39 |\n| npu_if_check_grades | bool |      \u662f\u5426\u68c0\u6d4b\u6210\u7ee9      |\n|  npu_if_check_rank  | bool |      \u662f\u5426\u68c0\u6d4b\u6392\u540d      |\n| npu_if_check_exams  | bool |     \u662f\u5426\u68c0\u6d4b\u65b0\u8003\u8bd5     |\n| npu_if_check_when_connect  | bool |     \u5f53connect\u7684\u662f\u5426\u6267\u884c\u4e00\u6b21\u68c0\u6d4b     |\n| npu_begin_check_hour | int | \u8d77\u59cb\u68c0\u6d4b\u65f6\u95f4\uff0c\u5728x\u70b9\u4e4b\u524d\u4e0d\u4f1a\u68c0\u6d4b |\n| npu_end_check_hour | int | \u6700\u672b\u68c0\u6d4b\u65f6\u95f4\uff0c\u5728x\u70b9\u4e4b\u540e\u4e0d\u4f1a\u68c0\u6d4b |\n\n> [!TIP]\n>\n> \u8bb0\u5f97\u914d\u7f6e[SUPERUSERS](https://nonebot.dev/docs/appendices/config#superusers)\uff0c\u5f53\u53d1\u751f\u9519\u8bef\u65f6\u4f1a\u63a8\u9001\u6d88\u606f\u7ed9\u8d85\u7ea7\u7528\u6237\n>\n> \u63a8\u8350\u8bbe\u7f6e[Command Start](https://nonebot.dev/docs/appendices/config#command-start-%E5%92%8C-command-separator)\u4e3a`COMMAND_START=[\"/\", \"\"]`\uff0c\u8fd9\u6837\u6709`/`\u548c\u6ca1`/`\u90fd\u53ef\u4ee5\u54cd\u5e94\u6307\u4ee4\n\n# \ud83c\udf89 \u4f7f\u7528\n\n### \u6307\u4ee4\u8868\n\n<details>\n<summary>\u6307\u4ee4\u5217\u8868</summary>\n\n|         \u6307\u4ee4          |   \u8303\u56f4    |                           \u8bf4\u660e                           |           \u793a\u4f8b           |\n| :-------------------: | :-------: | :------------------------------------------------------: | :----------------------: |\n|       **/\u7ff1\u7fd4**       | \u79c1\u804a/\u827e\u7279 |                       \u767b\u9646\u7ff1\u7fd4\u95e8\u6237                       |   ![](images/\u7ff1\u7fd4.png)   |\n|       /\u7ff1\u7fd4\u6210\u7ee9       | \u79c1\u804a/\u827e\u7279 |                     \u83b7\u53d6\u672c\u5b66\u671f\u7684\u6210\u7ee9                     | ![](images/\u7ff1\u7fd4\u6210\u7ee9.png) |\n|       /\u7ff1\u7fd4\u6392\u540d       | \u79c1\u804a/\u827e\u7279 |                       \u83b7\u53d6\u6392\u540d\u4fe1\u606f                       |     ![](images/\u7ff1\u7fd4\u6392\u540d.png)     |\n|       /\u7ff1\u7fd4\u8003\u8bd5       | \u79c1\u804a/\u827e\u7279 |                   \u83b7\u53d6\u672a\u7ed3\u675f\u7684\u8003\u8bd5\u4fe1\u606f                   |     ![](images/\u7ff1\u7fd4\u8003\u8bd5.png)     |\n|       /\u7ff1\u7fd4\u8bfe\u8868       | \u79c1\u804a/\u827e\u7279 |           \u83b7\u53d6\u8bfe\u8868\uff08\u9700\u8981\u642d\u914dwake up\u8f6f\u4ef6\u4f7f\u7528\uff09            |     ![](images/\u7ff1\u7fd4\u8bfe\u8868.png)     |\n|     /\u7ff1\u7fd4\u672c\u5468\u8bfe\u8868    | \u79c1\u804a/\u827e\u7279 |          \u83b7\u53d6\u672c\u5468\u8bfe\u8868\u56fe\u7247\u6587\u4ef6                             |                                  |\n| /\u7ff1\u7fd4\u7efc\u6d4b\u6392\u540d | \u79c1\u804a/\u827e\u7279 | \u83b7\u53d6\u7efc\u6d4b\u53c2\u8bc4\u4e2d\u7684\u7efc\u6d4b\u6392\u540d |   ![](images/\u7ff1\u7fd4\u7efc\u6d4b\u6392\u540d.png) |\n| /\u7ff1\u7fd4\u9000\u51fa\u767b\u9646\uff08\u767b\u5f55\uff09 | \u79c1\u804a/\u827e\u7279 |                         \u9000\u51fa\u767b\u9646                         |     ![](images/\u7ff1\u7fd4\u9000\u51fa\u767b\u9646.png)     |\n|     /\u7ff1\u7fd4\u5168\u90e8\u6210\u7ee9     | \u79c1\u804a/\u827e\u7279 |                       \u83b7\u53d6\u5168\u90e8\u6210\u7ee9                       |     ![](images/\u7ff1\u7fd4\u5168\u90e8\u6210\u7ee9.png)     |\n|     /\u7ff1\u7fd4\u5168\u90e8\u8003\u8bd5     | \u79c1\u804a/\u827e\u7279 |                     \u83b7\u53d6\u5168\u90e8\u8003\u8bd5\u4fe1\u606f                     |     ![](images/\u7ff1\u7fd4\u5168\u90e8\u8003\u8bd5.png)     |\n|  /\u7ff1\u7fd4\u52a0\u6743\u767e\u5206\u5236\u6210\u7ee9  | \u79c1\u804a/\u827e\u7279 |                    \u8ba1\u7b97\u52a0\u6743\u767e\u5206\u5236\u6210\u7ee9                    |     ![](images/\u7ff1\u7fd4\u52a0\u6743\u767e\u5206\u5236\u6210\u7ee9.png)     |\n|     /\u7ff1\u7fd4\u7535\u8d39\u7ed1\u5b9a     | \u79c1\u804a/\u827e\u7279 | \u7ed1\u5b9a\u5bbf\u820d\uff0c\u5f53\u7535\u8d39\u5c0f\u4e8e25\u65f6\u4f1a\u63a8\u9001\u6d88\u606f\uff0c\u6bcf\u5929\u4e2d\u534812\u70b9\u68c0\u6d4b\u4e00\u6b21 |     ![](images/\u7ff1\u7fd4\u7535\u8d39\u7ed1\u5b9a.png)     |\n|     /\u7ff1\u7fd4\u7535\u8d39\u67e5\u8be2     | \u79c1\u804a/\u827e\u7279 |                       \u67e5\u8be2\u5f53\u524d\u7535\u8d39                       |     ![](images/\u7ff1\u7fd4\u7535\u8d39\u67e5\u8be2.png)     |\n|     /\u7ff1\u7fd4\u7535\u8d39\u89e3\u7ed1     | \u79c1\u804a/\u827e\u7279 |                       \u89e3\u9664\u5bbf\u820d\u7ed1\u5b9a                       |     ![](images/\u7ff1\u7fd4\u7535\u8d39\u89e3\u7ed1.png)     |\n\n</details>\n\n# \ud83e\udd29\u81f4\u8c22\n\n\u7ff1\u7fd4\u95e8\u6237\u767b\u9646\u4ee5\u53ca\u6570\u636e\u83b7\u53d6\u53c2\u8003\u4e86\uff1ahttps://github.com/cheanus/Automation/blob/main/GradesMonitorLinux.py\n\nREADME\u5199\u6cd5 [\u53c2\u8003](https://github.com/A-kirami/nonebot-plugin-template/blob/master/README.md) [\u53c2\u8003](https://github.com/WJZ-P/LiteLoaderQQNT-Echo-Message/blob/main/README.md)\n\n",
    "bugtrack_url": null,
    "license": null,
    "summary": "\u7ff1\u7fd4\u95e8\u6237\u6210\u7ee9\u76d1\u63a7\u63d2\u4ef6\uff0c\u80fd\u83b7\u53d6\u6210\u7ee9\u3001\u6392\u540d\u3001\u7ee9\u70b9\uff0c\u5f53\u51fa\u73b0\u65b0\u6210\u7ee9\u65f6\u63a8\u9001\u7ed9\u4f7f\u7528\u8005",
    "version": "1.0.1",
    "project_urls": null,
    "split_keywords": [
        "nonebot",
        " nonebot2",
        " npu",
        " nwpu"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "13f98f67cad07fe4fd98901937217c326232f02e9eebca3c620fa8866df906b1",
                "md5": "c5602e93f2acf5d3a63d20dd8698b585",
                "sha256": "5f5e30e7112db7a84f620ea9f878e1e8be21f0aa70e8f2ddd443f2f767b1b83d"
            },
            "downloads": -1,
            "filename": "nonebot_plugin_npu-1.0.1-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "c5602e93f2acf5d3a63d20dd8698b585",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": "<4.0,>=3.9",
            "size": 1668536,
            "upload_time": "2025-01-21T06:25:32",
            "upload_time_iso_8601": "2025-01-21T06:25:32.697425Z",
            "url": "https://files.pythonhosted.org/packages/13/f9/8f67cad07fe4fd98901937217c326232f02e9eebca3c620fa8866df906b1/nonebot_plugin_npu-1.0.1-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "9c29ed257dba8b0dd0f005bdf5c9a6c8fe022b16eea73ddadef4bd55014c42c8",
                "md5": "3fbb15ffc5a6e377966882207fa7141a",
                "sha256": "2d9251331a3a7ca6c000950e90ec83f7c4ceabbaa27ca9fccf71a07dee4c1f6c"
            },
            "downloads": -1,
            "filename": "nonebot_plugin_npu-1.0.1.tar.gz",
            "has_sig": false,
            "md5_digest": "3fbb15ffc5a6e377966882207fa7141a",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": "<4.0,>=3.9",
            "size": 1660997,
            "upload_time": "2025-01-21T06:25:35",
            "upload_time_iso_8601": "2025-01-21T06:25:35.259263Z",
            "url": "https://files.pythonhosted.org/packages/9c/29/ed257dba8b0dd0f005bdf5c9a6c8fe022b16eea73ddadef4bd55014c42c8/nonebot_plugin_npu-1.0.1.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2025-01-21 06:25:35",
    "github": false,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "lcname": "nonebot-plugin-npu"
}
        
Elapsed time: 0.57918s