nonebot-plugin-oi-helper


Namenonebot-plugin-oi-helper JSON
Version 0.1.1 PyPI version JSON
download
home_pageNone
SummaryA NoneBot2 plugin for querying OI/ACM related information, including LeetCode daily question and Luogu daily report.
upload_time2024-12-28 09:23:38
maintainerNone
docs_urlNone
authorNone
requires_python<4.0,>=3.10
licenseAGPL-3.0-or-later
keywords acm leetcode luogu oi nonebot plugin
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            <div align="center">
  <a href="https://v2.nonebot.dev/store"><img src="https://raw.githubusercontent.com/A-kirami/nonebot-plugin-template/resources/nbp_logo.png" width="180" height="180" alt="NoneBotPluginLogo"></a>
  </br>
  <p><img src="https://raw.githubusercontent.com/talentestors/nonebot-plugin-oi-helper/refs/heads/main/docs/img/NoneBotPlugin.svg" width="240" alt="NoneBotPluginText"></p>
</div>
<div align="center">

# nonebot-plugin-OI-helper

_✨ NoneBot 插件简单描述 ✨_

[![license](https://img.shields.io/github/license/talentestors/nonebot-plugin-oi-helper.svg)](./LICENSE)
[![pypi](https://img.shields.io/pypi/v/nonebot-plugin-oi-helper.svg)](https://pypi.python.org/pypi/nonebot-plugin-oi-helper)
![python](https://img.shields.io/badge/python-3.10+-blue.svg)

</div>

## 📖 介绍

一个基于 <https://clist.by> v4 接口,提供 OI/ACM 相关信息查询的 nonebot2 插件。

扩展内容:

- [x] 获取 **LeetCode 每日一题**
- [x] 获取 **洛谷日报**
- [ ] ...

## 💿 安装

<details>
<summary>使用 nb-cli 安装</summary>

在 nonebot2 项目的根目录下打开命令行, 输入以下指令即可安装

```bash
nb plugin install nonebot-plugin-oi-help # 未上架商店
```

</details>

<details>
<summary>使用包管理器安装</summary>

在 nonebot2 项目的插件目录下, 打开命令行, 根据你使用的包管理器, 输入相应的安装命令

<details>
<summary>pip</summary>

```bash
pip install nonebot-plugin-oi-help
```

</details>

<details>
<summary>pdm</summary>

```bash
pdm add nonebot-plugin-oi-help
```

</details>

<details>
<summary>poetry</summary>

```bash
poetry add nonebot-plugin-oi-help
```

</details>

<details>
<summary>conda</summary>

```bash
conda install nonebot-plugin-oi-help
```

</details>

<details>
<summary>uv</summary>

[uv:](https://github.com/astral-sh/uv) <https://docs.astral.sh/uv/>

```bash
uv add nonebot-plugin-oi-help
```

</details>

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

```bash
plugins = ["nonebot-plugin-oi-help"]
```

</details>

## ⚙️ 配置

在 nonebot2 项目的`.env`文件中添加下表中的必填配置

> [!TIP]
> 需要使用 aiohttp 的驱动器

| 配置项 | 必填 | 默认值 | 说明 |
|:-----:|:----:|:----:|:----:|
| CLIST__USERNAME | 是 | 无 | 你的clist用户名 |
| CLIST__USER_KEY | 是 | 无 | 你的 key |
| CLIST_API__REQ_URL | 否 | <https://clist.by:443/api/v4/contest/?upcoming=true&filtered=true&order_by=start&format=json> | 自定义查询url |

例如在你的 `.env` 文件里:

```sh
# OI-helper 配置
# CLIST_API__REQ_URL =  # clist API 地址
CLIST__USERNAME = talentestors
CLIST__USER_KEY = 60e44a5582aa4433b69b99022b3ae4e9
```

### 如何获取 clist 的 key?

<details>
<summary>点击展开</summary>

1. 进入CLIST官网:<https://clist.by/>
2. 如果你是新用户,你需要新建一账户。
3. 前往 <https://clist.by/api/v4/doc/> 页面
    也可以去这里进去:
    ![api](docs/img/image.png)
4. 点 here 获取你的 API KEY
    > Accessing the API requires an API key, available to authenticated users _here_.

    ![here](docs/img/guide.png)

</details>

### 关于 Filter

<details>
<summary>点击展开</summary>

默认的clist的url加入了,`filtered=true` 参数。

这意味着你可以在你的账户里面直接配置规则,而不用设置复杂的 url 请求参数。

<https://clist.by/settings/filters/>

点击 create 去创建一个规则

`Resources` 项,能筛选对应的平台。

![filter](./docs/img/filter.png)

</details>

## 🎉 使用

[See docs](https://github.com/talentestors/nonebot-plugin-oi-helper/blob/main/docs/README.md)

            

Raw data

            {
    "_id": null,
    "home_page": null,
    "name": "nonebot-plugin-oi-helper",
    "maintainer": null,
    "docs_url": null,
    "requires_python": "<4.0,>=3.10",
    "maintainer_email": null,
    "keywords": "ACM, LeetCode, Luogu, OI, nonebot, plugin",
    "author": null,
    "author_email": "talentestors <talentestors@outlook.com>",
    "download_url": "https://files.pythonhosted.org/packages/33/9f/9d152afe526298c6321380a1c57993da5d9f009fb1199ff313d2379b217d/nonebot_plugin_oi_helper-0.1.1.tar.gz",
    "platform": null,
    "description": "<div align=\"center\">\n  <a href=\"https://v2.nonebot.dev/store\"><img src=\"https://raw.githubusercontent.com/A-kirami/nonebot-plugin-template/resources/nbp_logo.png\" width=\"180\" height=\"180\" alt=\"NoneBotPluginLogo\"></a>\n  </br>\n  <p><img src=\"https://raw.githubusercontent.com/talentestors/nonebot-plugin-oi-helper/refs/heads/main/docs/img/NoneBotPlugin.svg\" width=\"240\" alt=\"NoneBotPluginText\"></p>\n</div>\n<div align=\"center\">\n\n# nonebot-plugin-OI-helper\n\n_\u2728 NoneBot \u63d2\u4ef6\u7b80\u5355\u63cf\u8ff0 \u2728_\n\n[![license](https://img.shields.io/github/license/talentestors/nonebot-plugin-oi-helper.svg)](./LICENSE)\n[![pypi](https://img.shields.io/pypi/v/nonebot-plugin-oi-helper.svg)](https://pypi.python.org/pypi/nonebot-plugin-oi-helper)\n![python](https://img.shields.io/badge/python-3.10+-blue.svg)\n\n</div>\n\n## \ud83d\udcd6 \u4ecb\u7ecd\n\n\u4e00\u4e2a\u57fa\u4e8e <https://clist.by> v4 \u63a5\u53e3\uff0c\u63d0\u4f9b OI/ACM \u76f8\u5173\u4fe1\u606f\u67e5\u8be2\u7684 nonebot2 \u63d2\u4ef6\u3002\n\n\u6269\u5c55\u5185\u5bb9\uff1a\n\n- [x] \u83b7\u53d6 **LeetCode \u6bcf\u65e5\u4e00\u9898**\n- [x] \u83b7\u53d6 **\u6d1b\u8c37\u65e5\u62a5**\n- [ ] ...\n\n## \ud83d\udcbf \u5b89\u88c5\n\n<details>\n<summary>\u4f7f\u7528 nb-cli \u5b89\u88c5</summary>\n\n\u5728 nonebot2 \u9879\u76ee\u7684\u6839\u76ee\u5f55\u4e0b\u6253\u5f00\u547d\u4ee4\u884c, \u8f93\u5165\u4ee5\u4e0b\u6307\u4ee4\u5373\u53ef\u5b89\u88c5\n\n```bash\nnb plugin install nonebot-plugin-oi-help # \u672a\u4e0a\u67b6\u5546\u5e97\n```\n\n</details>\n\n<details>\n<summary>\u4f7f\u7528\u5305\u7ba1\u7406\u5668\u5b89\u88c5</summary>\n\n\u5728 nonebot2 \u9879\u76ee\u7684\u63d2\u4ef6\u76ee\u5f55\u4e0b, \u6253\u5f00\u547d\u4ee4\u884c, \u6839\u636e\u4f60\u4f7f\u7528\u7684\u5305\u7ba1\u7406\u5668, \u8f93\u5165\u76f8\u5e94\u7684\u5b89\u88c5\u547d\u4ee4\n\n<details>\n<summary>pip</summary>\n\n```bash\npip install nonebot-plugin-oi-help\n```\n\n</details>\n\n<details>\n<summary>pdm</summary>\n\n```bash\npdm add nonebot-plugin-oi-help\n```\n\n</details>\n\n<details>\n<summary>poetry</summary>\n\n```bash\npoetry add nonebot-plugin-oi-help\n```\n\n</details>\n\n<details>\n<summary>conda</summary>\n\n```bash\nconda install nonebot-plugin-oi-help\n```\n\n</details>\n\n<details>\n<summary>uv</summary>\n\n[uv:](https://github.com/astral-sh/uv) <https://docs.astral.sh/uv/>\n\n```bash\nuv add nonebot-plugin-oi-help\n```\n\n</details>\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```bash\nplugins = [\"nonebot-plugin-oi-help\"]\n```\n\n</details>\n\n## \u2699\ufe0f \u914d\u7f6e\n\n\u5728 nonebot2 \u9879\u76ee\u7684`.env`\u6587\u4ef6\u4e2d\u6dfb\u52a0\u4e0b\u8868\u4e2d\u7684\u5fc5\u586b\u914d\u7f6e\n\n> [!TIP]\n> \u9700\u8981\u4f7f\u7528 aiohttp \u7684\u9a71\u52a8\u5668\n\n| \u914d\u7f6e\u9879 | \u5fc5\u586b | \u9ed8\u8ba4\u503c | \u8bf4\u660e |\n|:-----:|:----:|:----:|:----:|\n| CLIST__USERNAME | \u662f | \u65e0 | \u4f60\u7684clist\u7528\u6237\u540d |\n| CLIST__USER_KEY | \u662f | \u65e0 | \u4f60\u7684 key |\n| CLIST_API__REQ_URL | \u5426 | <https://clist.by:443/api/v4/contest/?upcoming=true&filtered=true&order_by=start&format=json> | \u81ea\u5b9a\u4e49\u67e5\u8be2url |\n\n\u4f8b\u5982\u5728\u4f60\u7684 `.env` \u6587\u4ef6\u91cc\uff1a\n\n```sh\n# OI-helper \u914d\u7f6e\n# CLIST_API__REQ_URL =  # clist API \u5730\u5740\nCLIST__USERNAME = talentestors\nCLIST__USER_KEY = 60e44a5582aa4433b69b99022b3ae4e9\n```\n\n### \u5982\u4f55\u83b7\u53d6 clist \u7684 key\uff1f\n\n<details>\n<summary>\u70b9\u51fb\u5c55\u5f00</summary>\n\n1. \u8fdb\u5165CLIST\u5b98\u7f51\uff1a<https://clist.by/>\n2. \u5982\u679c\u4f60\u662f\u65b0\u7528\u6237\uff0c\u4f60\u9700\u8981\u65b0\u5efa\u4e00\u8d26\u6237\u3002\n3. \u524d\u5f80 <https://clist.by/api/v4/doc/> \u9875\u9762\n    \u4e5f\u53ef\u4ee5\u53bb\u8fd9\u91cc\u8fdb\u53bb\uff1a\n    ![api](docs/img/image.png)\n4. \u70b9 here \u83b7\u53d6\u4f60\u7684 API KEY\n    > Accessing the API requires an API key, available to authenticated users _here_.\n\n    ![here](docs/img/guide.png)\n\n</details>\n\n### \u5173\u4e8e Filter\n\n<details>\n<summary>\u70b9\u51fb\u5c55\u5f00</summary>\n\n\u9ed8\u8ba4\u7684clist\u7684url\u52a0\u5165\u4e86\uff0c`filtered=true` \u53c2\u6570\u3002\n\n\u8fd9\u610f\u5473\u7740\u4f60\u53ef\u4ee5\u5728\u4f60\u7684\u8d26\u6237\u91cc\u9762\u76f4\u63a5\u914d\u7f6e\u89c4\u5219\uff0c\u800c\u4e0d\u7528\u8bbe\u7f6e\u590d\u6742\u7684 url \u8bf7\u6c42\u53c2\u6570\u3002\n\n<https://clist.by/settings/filters/>\n\n\u70b9\u51fb create \u53bb\u521b\u5efa\u4e00\u4e2a\u89c4\u5219\n\n`Resources` \u9879\uff0c\u80fd\u7b5b\u9009\u5bf9\u5e94\u7684\u5e73\u53f0\u3002\n\n![filter](./docs/img/filter.png)\n\n</details>\n\n## \ud83c\udf89 \u4f7f\u7528\n\n[See docs](https://github.com/talentestors/nonebot-plugin-oi-helper/blob/main/docs/README.md)\n",
    "bugtrack_url": null,
    "license": "AGPL-3.0-or-later",
    "summary": "A NoneBot2 plugin for querying OI/ACM related information, including LeetCode daily question and Luogu daily report.",
    "version": "0.1.1",
    "project_urls": {
        "documentation": "https://github.com/talentestors/nonebot-plugin-oi-helper#readme",
        "homepage": "https://github.com/talentestors/nonebot-plugin-oi-helper",
        "repository": "https://github.com/talentestors/nonebot-plugin-oi-helper"
    },
    "split_keywords": [
        "acm",
        " leetcode",
        " luogu",
        " oi",
        " nonebot",
        " plugin"
    ],
    "urls": [
        {
            "comment_text": null,
            "digests": {
                "blake2b_256": "e5f36f8970dac59eebaaf23f4483df6be9b343f6ea1e9e30d1ace156927a4373",
                "md5": "6cdf85e9ee22064b9d6f153a0fcc94f5",
                "sha256": "34b185997c8523cbf6b82ac1dc47a56da03a8305707ad21936035ebf44fad931"
            },
            "downloads": -1,
            "filename": "nonebot_plugin_oi_helper-0.1.1-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "6cdf85e9ee22064b9d6f153a0fcc94f5",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": "<4.0,>=3.10",
            "size": 38358,
            "upload_time": "2024-12-28T09:23:36",
            "upload_time_iso_8601": "2024-12-28T09:23:36.036460Z",
            "url": "https://files.pythonhosted.org/packages/e5/f3/6f8970dac59eebaaf23f4483df6be9b343f6ea1e9e30d1ace156927a4373/nonebot_plugin_oi_helper-0.1.1-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": null,
            "digests": {
                "blake2b_256": "339f9d152afe526298c6321380a1c57993da5d9f009fb1199ff313d2379b217d",
                "md5": "84de305e5b6deda1ad58a5627225c436",
                "sha256": "d0bf473eae1d72bf21963b5004e8281075c28eb2021db73869974eaa76b761a2"
            },
            "downloads": -1,
            "filename": "nonebot_plugin_oi_helper-0.1.1.tar.gz",
            "has_sig": false,
            "md5_digest": "84de305e5b6deda1ad58a5627225c436",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": "<4.0,>=3.10",
            "size": 23194,
            "upload_time": "2024-12-28T09:23:38",
            "upload_time_iso_8601": "2024-12-28T09:23:38.916031Z",
            "url": "https://files.pythonhosted.org/packages/33/9f/9d152afe526298c6321380a1c57993da5d9f009fb1199ff313d2379b217d/nonebot_plugin_oi_helper-0.1.1.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-12-28 09:23:38",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "talentestors",
    "github_project": "nonebot-plugin-oi-helper#readme",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": true,
    "lcname": "nonebot-plugin-oi-helper"
}
        
Elapsed time: 0.38541s