PHPackages                             hesunfly/weather - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Utility &amp; Helpers](/categories/utility)
4. /
5. hesunfly/weather

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

hesunfly/weather
================

天气查询扩展包

1.0.1(7y ago)023MITPHP

Since Jan 5Pushed 7y agoCompare

[ Source](https://github.com/hesunfly/weather)[ Packagist](https://packagist.org/packages/hesunfly/weather)[ RSS](/packages/hesunfly-weather/feed)WikiDiscussions master Synced 2d ago

READMEChangelog (2)Dependencies (1)Versions (6)Used By (0)

Weather
-------

[](#weather)

PHP天气查询扩展组件

[![StyleCI build status](https://camo.githubusercontent.com/8f4928f3edcc01dc9c0610ea5aaf40b3c87a616df5e04672954e6ee8e78edc50/68747470733a2f2f6769746875622e7374796c6563692e696f2f7265706f732f3136343034373237302f736869656c64)](https://camo.githubusercontent.com/8f4928f3edcc01dc9c0610ea5aaf40b3c87a616df5e04672954e6ee8e78edc50/68747470733a2f2f6769746875622e7374796c6563692e696f2f7265706f732f3136343034373237302f736869656c64)

### 安装

[](#安装)

```
composer require hesunfly/weather

```

### 使用

[](#使用)

使用前需要在高德地图开放平台申请天气查询接口的key

### 代码示例

[](#代码示例)

基本使用：

1. 获取实时天气：

```
use Hesunfly\Weather\Weather;

$weather = new Weather('高德地图key');

$weather->currenct('城市名称');

```

2. 获取预告天气：

```
use Hesunfly\Weather\Weather;

$weather = new Weather('高德地图key');

$weather->forecast('城市名称');

```

3. 获取xml形式的数据：

```
use Hesunfly\Weather\Weather;

$weather = new Weather('高德地图key');

$weather->currenct('城市名称', 'xml');

```

### License

[](#license)

MIT

###  Health Score

27

—

LowBetter than 47% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity6

Limited adoption so far

Community2

Small or concentrated contributor base

Maturity65

Established project with proven stability

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~0 days

Total

4

Last Release

2732d ago

Major Versions

0.0.2 → 1.0.02019-01-05

### Community

Maintainers

![](https://www.gravatar.com/avatar/0f2634d7ceda148b891d5903bf356c24c30bc86ea6691f3f6806b323a5e8836e?d=identicon)[Hesunfly](/maintainers/Hesunfly)

---

Tags

packagephp

### Embed Badge

![Health badge](/badges/hesunfly-weather/health.svg)

```
[![Health](https://phpackages.com/badges/hesunfly-weather/health.svg)](https://phpackages.com/packages/hesunfly-weather)
```

###  Alternatives

[neuron-core/neuron-ai

The PHP Agentic Framework.

2.0k656.1k34](/packages/neuron-core-neuron-ai)[google/cloud-core

Google Cloud PHP shared dependency, providing functionality useful to all components.

346132.9M110](/packages/google-cloud-core)[tencentcloud/tencentcloud-sdk-php

TencentCloudApi php sdk

3741.3M46](/packages/tencentcloud-tencentcloud-sdk-php)[roundcube/roundcubemail

The Roundcube Webmail suite

7.0k1.4k3](/packages/roundcube-roundcubemail)[spatie/laravel-export

Create a static site bundle from a Laravel app

673139.5k6](/packages/spatie-laravel-export)[workos/workos-php

WorkOS PHP Library

423.0M9](/packages/workos-workos-php)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
