nonebot-plugin-heweather


Namenonebot-plugin-heweather JSON
Version 0.8.2 PyPI version JSON
download
home_page
SummaryGet Heweather information and convert to pictures
upload_time2024-03-14 08:49:13
maintainer
docs_urlNone
author
requires_python<4.0,>=3.8
licenseMIT License Copyright (c) 2021 kexue Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
keywords
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            <p align="center">
  <a href="https://v2.nonebot.dev/store"><img src="https://user-images.githubusercontent.com/44545625/209862575-acdc9feb-3c76-471d-ad89-cc78927e5875.png" width="180" height="180" alt="NoneBotPluginLogo"></a>
</p>

<div align="center">

# nonebot-plugin-heweather

_✨ 获取和风天气信息并转换为图片 ✨_

</div>

<p align="center">
  <a href="https://raw.githubusercontent.com/kexue-z/nonebot-plugin-heweather/master/LICENSE">
    <img src="https://img.shields.io/github/license/kexue-z/nonebot-plugin-heweather.svg" alt="license">
  </a>
  <a href="https://pypi.org/project/nonebot-plugin-heweather/">
    <img src="https://img.shields.io/pypi/v/nonebot-plugin-heweather" alt="pypi">
  </a>
  <img src="https://img.shields.io/badge/python-3.8+-blue.svg" alt="python">
</p>

<div align="center">

# 使用 html+playwright 来渲染好看的!

<img src="docs/weather.png"  width="50%">
</div>

- 使用了~~自产自销的~~[nonebot-plugin-htmlrender](https://github.com/kexue-z/nonebot-plugin-htmlrender)
- **需要先保证 playwright 可以正常运行并在系统(或容器中)存在中文字体**

# 安装

直接使用 `pip install nonebot-plugin-heweather` 进行安装

在 `bot.py` 中 写入 `nonebot.load_plugin("nonebot_plugin_heweather")`

# 指令

`天气+地区` 或 `地区+天气`  
例如:`上海天气` 或 `天气广州`

# 配置

## apikey 必须配置 环境配置

```
QWEATHER_APIKEY = xxx
```

## api 类型 必须配置 环境配置

0 = 普通版 **免费订阅** (3 天天气预报)  
1 = 个人开发版 **标准订阅** (7 天天气预报)  
2 = 商业版 (7 天天气预报)  

```
QWEATHER_APITYPE = 0
```

## 逐小时类型 可选配置 环境变量

1 = 未来12小时 (默认值)  
2 = 未来24小时  

```
QWEATHER_HOURLYTYPE = 1
```

## APIKEY 获取方式

**1、注册和风天气账号**  
进入官网注册[https://id.qweather.com/#/login](https://id.qweather.com/#/login)  
**2、进入控制台**  
登录后,点击 “和风天气开发者控制台”  
**3、创建项目**  
点击控制台左侧 “项目管理”,然后点击 “创建项目”,根据提示自行填写  
“选择订阅” -> “免费订阅”,“设置 KEY” -> “Web API”,都填好后“创建”  
**4、获取 key 并配置.env.xx**  
返回 “项目管理”,可以看到创建的项目,点击 KEY 下面的 “查看”,复制 KEY 到你的.env.xx 即可。

            

Raw data

            {
    "_id": null,
    "home_page": "",
    "name": "nonebot-plugin-heweather",
    "maintainer": "",
    "docs_url": null,
    "requires_python": "<4.0,>=3.8",
    "maintainer_email": "",
    "keywords": "",
    "author": "",
    "author_email": "kexue <xana278@foxmail.com>",
    "download_url": "https://files.pythonhosted.org/packages/09/39/2ab683509a87842093511af235862319a00b83801b2abd87ffdb8bfd6a8e/nonebot_plugin_heweather-0.8.2.tar.gz",
    "platform": null,
    "description": "<p align=\"center\">\n  <a href=\"https://v2.nonebot.dev/store\"><img src=\"https://user-images.githubusercontent.com/44545625/209862575-acdc9feb-3c76-471d-ad89-cc78927e5875.png\" width=\"180\" height=\"180\" alt=\"NoneBotPluginLogo\"></a>\n</p>\n\n<div align=\"center\">\n\n# nonebot-plugin-heweather\n\n_\u2728 \u83b7\u53d6\u548c\u98ce\u5929\u6c14\u4fe1\u606f\u5e76\u8f6c\u6362\u4e3a\u56fe\u7247 \u2728_\n\n</div>\n\n<p align=\"center\">\n  <a href=\"https://raw.githubusercontent.com/kexue-z/nonebot-plugin-heweather/master/LICENSE\">\n    <img src=\"https://img.shields.io/github/license/kexue-z/nonebot-plugin-heweather.svg\" alt=\"license\">\n  </a>\n  <a href=\"https://pypi.org/project/nonebot-plugin-heweather/\">\n    <img src=\"https://img.shields.io/pypi/v/nonebot-plugin-heweather\" alt=\"pypi\">\n  </a>\n  <img src=\"https://img.shields.io/badge/python-3.8+-blue.svg\" alt=\"python\">\n</p>\n\n<div align=\"center\">\n\n# \u4f7f\u7528 html+playwright \u6765\u6e32\u67d3\u597d\u770b\u7684\uff01\n\n<img src=\"docs/weather.png\"  width=\"50%\">\n</div>\n\n- \u4f7f\u7528\u4e86~~\u81ea\u4ea7\u81ea\u9500\u7684~~[nonebot-plugin-htmlrender](https://github.com/kexue-z/nonebot-plugin-htmlrender)\n- **\u9700\u8981\u5148\u4fdd\u8bc1 playwright \u53ef\u4ee5\u6b63\u5e38\u8fd0\u884c\u5e76\u5728\u7cfb\u7edf\uff08\u6216\u5bb9\u5668\u4e2d\uff09\u5b58\u5728\u4e2d\u6587\u5b57\u4f53**\n\n# \u5b89\u88c5\n\n\u76f4\u63a5\u4f7f\u7528 `pip install nonebot-plugin-heweather` \u8fdb\u884c\u5b89\u88c5\n\n\u5728 `bot.py` \u4e2d \u5199\u5165 `nonebot.load_plugin(\"nonebot_plugin_heweather\")`\n\n# \u6307\u4ee4\n\n`\u5929\u6c14+\u5730\u533a` \u6216 `\u5730\u533a+\u5929\u6c14`  \n\u4f8b\u5982\uff1a`\u4e0a\u6d77\u5929\u6c14` \u6216 `\u5929\u6c14\u5e7f\u5dde`\n\n# \u914d\u7f6e\n\n## apikey \u5fc5\u987b\u914d\u7f6e \u73af\u5883\u914d\u7f6e\n\n```\nQWEATHER_APIKEY = xxx\n```\n\n## api \u7c7b\u578b \u5fc5\u987b\u914d\u7f6e \u73af\u5883\u914d\u7f6e\n\n0 = \u666e\u901a\u7248 **\u514d\u8d39\u8ba2\u9605** (3 \u5929\u5929\u6c14\u9884\u62a5)  \n1 = \u4e2a\u4eba\u5f00\u53d1\u7248 **\u6807\u51c6\u8ba2\u9605** (7 \u5929\u5929\u6c14\u9884\u62a5)  \n2 = \u5546\u4e1a\u7248 (7 \u5929\u5929\u6c14\u9884\u62a5)  \n\n```\nQWEATHER_APITYPE = 0\n```\n\n## \u9010\u5c0f\u65f6\u7c7b\u578b \u53ef\u9009\u914d\u7f6e \u73af\u5883\u53d8\u91cf\n\n1 = \u672a\u676512\u5c0f\u65f6 (\u9ed8\u8ba4\u503c)  \n2 = \u672a\u676524\u5c0f\u65f6  \n\n```\nQWEATHER_HOURLYTYPE = 1\n```\n\n## APIKEY \u83b7\u53d6\u65b9\u5f0f\n\n**1\u3001\u6ce8\u518c\u548c\u98ce\u5929\u6c14\u8d26\u53f7**  \n\u8fdb\u5165\u5b98\u7f51\u6ce8\u518c[https://id.qweather.com/#/login](https://id.qweather.com/#/login)  \n**2\u3001\u8fdb\u5165\u63a7\u5236\u53f0**  \n\u767b\u5f55\u540e\uff0c\u70b9\u51fb \u201c\u548c\u98ce\u5929\u6c14\u5f00\u53d1\u8005\u63a7\u5236\u53f0\u201d  \n**3\u3001\u521b\u5efa\u9879\u76ee**  \n\u70b9\u51fb\u63a7\u5236\u53f0\u5de6\u4fa7 \u201c\u9879\u76ee\u7ba1\u7406\u201d\uff0c\u7136\u540e\u70b9\u51fb \u201c\u521b\u5efa\u9879\u76ee\u201d\uff0c\u6839\u636e\u63d0\u793a\u81ea\u884c\u586b\u5199  \n\u201c\u9009\u62e9\u8ba2\u9605\u201d -> \u201c\u514d\u8d39\u8ba2\u9605\u201d\uff0c\u201c\u8bbe\u7f6e KEY\u201d -> \u201cWeb API\u201d\uff0c\u90fd\u586b\u597d\u540e\u201c\u521b\u5efa\u201d  \n**4\u3001\u83b7\u53d6 key \u5e76\u914d\u7f6e.env.xx**  \n\u8fd4\u56de \u201c\u9879\u76ee\u7ba1\u7406\u201d\uff0c\u53ef\u4ee5\u770b\u5230\u521b\u5efa\u7684\u9879\u76ee\uff0c\u70b9\u51fb KEY \u4e0b\u9762\u7684 \u201c\u67e5\u770b\u201d\uff0c\u590d\u5236 KEY \u5230\u4f60\u7684.env.xx \u5373\u53ef\u3002\n",
    "bugtrack_url": null,
    "license": "MIT License  Copyright (c) 2021 kexue  Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the \"Software\"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:  The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.  THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.",
    "summary": "Get Heweather information and convert to pictures",
    "version": "0.8.2",
    "project_urls": {
        "Bug tracker": "https://github.com/kexue-z/nonebot-plugin-heweather/issues",
        "Homepage": "https://github.com/kexue-z/nonebot-plugin-heweather"
    },
    "split_keywords": [],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "6232d9546bfbc0d15ef03f3fed8fc166da564d680b22a148d16abbb34c377974",
                "md5": "cd0dedda91580aca8051ef4d49a604c4",
                "sha256": "0976906a4124e8c080d16bae36f63950dfda9834d6d6b741bb51f74e57cedf2a"
            },
            "downloads": -1,
            "filename": "nonebot_plugin_heweather-0.8.2-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "cd0dedda91580aca8051ef4d49a604c4",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": "<4.0,>=3.8",
            "size": 95054,
            "upload_time": "2024-03-14T08:49:11",
            "upload_time_iso_8601": "2024-03-14T08:49:11.758260Z",
            "url": "https://files.pythonhosted.org/packages/62/32/d9546bfbc0d15ef03f3fed8fc166da564d680b22a148d16abbb34c377974/nonebot_plugin_heweather-0.8.2-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "09392ab683509a87842093511af235862319a00b83801b2abd87ffdb8bfd6a8e",
                "md5": "304be60016704e03ba366486d76afc43",
                "sha256": "e6c883cca049c8adb6bf3d3d597e816edcc7a1fda498ad827d7e0be476126e79"
            },
            "downloads": -1,
            "filename": "nonebot_plugin_heweather-0.8.2.tar.gz",
            "has_sig": false,
            "md5_digest": "304be60016704e03ba366486d76afc43",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": "<4.0,>=3.8",
            "size": 96349,
            "upload_time": "2024-03-14T08:49:13",
            "upload_time_iso_8601": "2024-03-14T08:49:13.562788Z",
            "url": "https://files.pythonhosted.org/packages/09/39/2ab683509a87842093511af235862319a00b83801b2abd87ffdb8bfd6a8e/nonebot_plugin_heweather-0.8.2.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-03-14 08:49:13",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "kexue-z",
    "github_project": "nonebot-plugin-heweather",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": true,
    "lcname": "nonebot-plugin-heweather"
}
        
Elapsed time: 0.20932s