Get Heweather information and convert to pictures
Project description
nonebot-plugin-heweather
✨ 获取和风天气信息并转换为图片 ✨
使用 html+playwright 来渲染好看的!
- 使用了
自产自销的nonebot-plugin-htmlrender - 需要先保证 playwright 可以正常运行并在系统(或容器中)存在中文字体
安装
直接使用 pip install nonebot-plugin-heweather 进行安装
在 bot.py 中 写入 nonebot.load_plugin("nonebot_plugin_heweather")
指令
天气+地区 或 地区+天气
例如:上海天气 或 天气广州
配置
API 认证方式
插件支持两种 API 认证方式:
- API Key (传统方式,不推荐)
- JWT 认证 (更安全,推荐使用)
JWT 认证配置(推荐)
参考文档 身份认证 生成 生成 Ed25519 密钥,并且上传公钥
# 是否使用 JWT 认证,默认为 True
QWEATHER_USE_JWT=true
# JWT sub,即控制台中的项目管理的项目ID
QWEATHER_JWT_SUB=
# JWT Key ID,在控制台上传公钥后获取,凭据 ID
QWEATHER_JWT_KID=
# JWT 私钥文本,需要自行生成,需要单行填写,例如
# qweather_jwt_private_key="-----BEGIN PRIVATE KEY-----\n123abc\n-----END PRIVATE KEY-----"
QWEATHER_JWT_PRIVATE_KEY=
API Key 认证配置(不推荐)
QWEATHER_APIKEY=
API 主机配置
参考文档 API 配置 在 控制台-设置 获取地址。务必添加 scheme https://
# API 主机地址,默认为 https://api.qweather.com
QWEATHER_APIHOST=https://api.qweather.com
API 订阅类型
参考 订阅
# 0 = 免费订阅 (3-7 天天气预报)
# 1 = 标准订阅 (3-30 天天气预报)
# 2 = 高级订阅 (3-30 天天气预报)
QWEATHER_APITYPE=0
天气预报配置
# 每日预报天数,默认 3 天 根据订阅类型可选最多 30 天
QWEATHER_FORECASE_DAYS=3
# 逐小时预报类型
# 1 = 未来12小时 (默认值)
# 2 = 未来24小时
QWEATHER_HOURLYTYPE=1
调试配置
# 是否开启调试模式,默认为 false
DEBUG=false
配置获取方式
- 进入控制台
- 项目管理 -> 创建项目
- 创建凭据
- 选择 JWT 类型,并按照文档创建公钥和私钥
- 上传公钥并保存提交
- 设置 -> 开发者信息 -> API Host 获取地址
- 填写 .env 文件
参考文档
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file nonebot_plugin_heweather-0.9.0.tar.gz.
File metadata
- Download URL: nonebot_plugin_heweather-0.9.0.tar.gz
- Upload date:
- Size: 1.1 MB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.0.1 CPython/3.12.8
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
1b7089c31df4c6e8a778268bf3f90f4ddfda6b55d6666128b5981d724c10ccb8
|
|
| MD5 |
f51159206a05bcd0f2724cd6c855d9de
|
|
| BLAKE2b-256 |
6e8218433fd39999a15379cc4cb3b5a1ebdb3092c20a5abb83b673f769703395
|
Provenance
The following attestation bundles were made for nonebot_plugin_heweather-0.9.0.tar.gz:
Publisher:
publish.yml on kexue-z/nonebot-plugin-heweather
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
nonebot_plugin_heweather-0.9.0.tar.gz -
Subject digest:
1b7089c31df4c6e8a778268bf3f90f4ddfda6b55d6666128b5981d724c10ccb8 - Sigstore transparency entry: 192533998
- Sigstore integration time:
-
Permalink:
kexue-z/nonebot-plugin-heweather@ceea93d2fd31fe2345a6e3322e30616ab4485b1a -
Branch / Tag:
refs/tags/v0.9.0 - Owner: https://github.com/kexue-z
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@ceea93d2fd31fe2345a6e3322e30616ab4485b1a -
Trigger Event:
push
-
Statement type:
File details
Details for the file nonebot_plugin_heweather-0.9.0-py3-none-any.whl.
File metadata
- Download URL: nonebot_plugin_heweather-0.9.0-py3-none-any.whl
- Upload date:
- Size: 96.6 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.0.1 CPython/3.12.8
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
dd58aa1b4dd865d052bcd68089edbf8c8d5af105f92534a18b848901b7eaa812
|
|
| MD5 |
a46fd96e57d23dd2498dc7fd0cef87cb
|
|
| BLAKE2b-256 |
fc251b73d0144103b3242798df512ce92395fb24e3906068f234563ea50f53ce
|
Provenance
The following attestation bundles were made for nonebot_plugin_heweather-0.9.0-py3-none-any.whl:
Publisher:
publish.yml on kexue-z/nonebot-plugin-heweather
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
nonebot_plugin_heweather-0.9.0-py3-none-any.whl -
Subject digest:
dd58aa1b4dd865d052bcd68089edbf8c8d5af105f92534a18b848901b7eaa812 - Sigstore transparency entry: 192534011
- Sigstore integration time:
-
Permalink:
kexue-z/nonebot-plugin-heweather@ceea93d2fd31fe2345a6e3322e30616ab4485b1a -
Branch / Tag:
refs/tags/v0.9.0 - Owner: https://github.com/kexue-z
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@ceea93d2fd31fe2345a6e3322e30616ab4485b1a -
Trigger Event:
push
-
Statement type: