返回顶部
y

yr-weather天气查询

Fetch weather forecasts from the Norwegian Meteorological Institute (MET) using the yr.no API. Use when the user asks for weather information, forecasts, temperature, precipitation, wind conditions, or any weather-related queries for specific locations. Supports coordinates-based lookups and returns current conditions plus forecasts. REQUIRES latitude/longitude - no defaults. See common locations table.

作者: admin | 来源: ClawHub
源自
ClawHub
版本
V 1.0.0
安全检测
已通过
344
下载量
免费
免费
0
收藏
概述
安装方式
版本历史

yr-weather

Yr.no 天气

通过yr.no API获取挪威气象研究所的天气预报(免费,无需密钥)。

快速开始

bash

当前天气 + 预报(需要经纬度)


python3 {baseDir}/scripts/weather.py <纬度> <经度> [海拔]

常见地点示例:

python3 {baseDir}/scripts/weather.py -33.9288 18.4174 # 开普敦 python3 {baseDir}/scripts/weather.py -33.8688 151.2093 # 悉尼 python3 {baseDir}/scripts/weather.py 51.5074 -0.1278 # 伦敦

明日天气摘要(需要经纬度)

python3 {baseDir}/scripts/tomorrow.py <纬度> <经度>

运行测试

python3 -m unittest discover {baseDir}/tests

测试

  • - 单元测试模拟API调用(无需网络)。
  • 示例数据位于 scripts/tests/data/。
  • 运行:cd {baseDir}/scripts && python3 ../tests/test_*.py

常见地点

城市纬度经度
开普敦-33.928818.4174
约翰内斯堡
-26.2041 | 28.0473 | | 德班 | -29.8587 | 31.0218 | | 悉尼 | -33.8688 | 151.2093 | | 伦敦 | 51.5074 | -0.1278 | | 纽约 | 40.7128 | -74.0060 | | 东京 | 35.6762 | 139.6503 |

目录结构

scripts/
├── yr_service.py # API调用(已测试/模拟)
├── utils.py # 表情符号/图标辅助工具
├── weather.py # 当前天气+预报命令行工具
├── tomorrow.py # 明日天气摘要命令行工具
└── tests/data/ # 示例JSON数据
tests/
├── test_weather.py
└── test_service.py

独立仓库

通过pip安装:pip install git+https://github.com/brandoncrabpi/yr-weather.git

  • - yr-weather -33.9288 18.4174
  • 标签:v1.0.0

使用条款

  • - 需要User-Agent(已包含)。
  • 每个地点缓存10分钟以上。
  • 致谢:数据来自挪威气象研究所。

为生产环境重构:无默认值、包含测试、模块化服务。

标签

skill ai

通过对话安装

该技能支持在以下平台通过对话安装:

OpenClaw WorkBuddy QClaw Kimi Claude

方式一:安装 SkillHub 和技能

帮我安装 SkillHub 和 yr-weather-1776299239 技能

方式二:设置 SkillHub 为优先技能安装源

设置 SkillHub 为我的优先技能安装源,然后帮我安装 yr-weather-1776299239 技能

通过命令行安装

skillhub install yr-weather-1776299239

下载

⬇ 下载 yr-weather v1.0.0(免费)

文件大小: 8.61 KB | 发布时间: 2026-4-16 18:15

v1.0.0 最新 2026-4-16 18:15
Initial release: Fetch accurate weather forecasts via the MET Norway yr.no API.

- Fetches current weather and multi-day forecasts using latitude/longitude (coordinates required; no defaults).
- Includes CLI scripts for general and tomorrow's weather.
- Mocked unit tests for offline validation.
- Predefined table of common locations for reference.
- Modular code structure for easy maintenance and extension.
- Caching and proper attribution per MET usage guidelines.

Archiver·手机版·闲社网·闲社论坛·智能体自动化市场· 多链控股集团有限公司 · 苏ICP备2025199260号-1

Powered by Discuz! X5.0   © 2024-2026 闲社网·AI智能体论坛·AI自动化解决方案·http://xianshe.com

p2p_official_large
返回顶部