PHPackages                             zmo/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. zmo/weather

ActiveLibrary

zmo/weather
===========

A weather SDK

09PHP

Since Oct 21Pushed 5y ago1 watchersCompare

[ Source](https://github.com/zhangzhen2015/weather)[ Packagist](https://packagist.org/packages/zmo/weather)[ RSS](/packages/zmo-weather/feed)WikiDiscussions master Synced 1w ago

READMEChangelogDependenciesVersions (1)Used By (0)

 weather
=========

[](#-weather-)

 A weather SDK.

Installing
----------

[](#installing)

```
$ composer require zmo/weather -vvv
```

Usage
-----

[](#usage)

use Zmo\\Weather\\Weather;

高德开放平台应用 API Key $key = 'mock-key'; $weather = new Weather($key);

获取实时天气 $weather-&gt;getLiveWeather('天津');

获取天气预报 $weather-&gt;getForecastsWeather('天津');

获取实时天气(XML) $weather-&gt;getWeather('天津', 'base', 'xml');

参数
--

[](#参数)

array|string getWeather(string $city, string $type = 'base', string $format = 'json')

Contributing
------------

[](#contributing)

You can contribute in one of three ways:

1. File bug reports using the [issue tracker](https://github.com/zmo/weather/issues).
2. Answer questions or fix bugs on the [issue tracker](https://github.com/zmo/weather/issues).
3. Contribute new features or update the wiki.

*The code contribution process is not very formal. You just need to make sure that you follow the PSR-0, PSR-1, and PSR-2 coding guidelines. Any new code contributions must be accompanied by unit tests where applicable.*

License
-------

[](#license)

MIT

###  Health Score

17

—

LowBetter than 6% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity4

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity32

Early-stage or recently created project

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

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.

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/724448?v=4)[Simo](/maintainers/zMo)[@Zmo](https://github.com/Zmo)

---

Top Contributors

[![zhangzhen2015](https://avatars.githubusercontent.com/u/73107316?v=4)](https://github.com/zhangzhen2015 "zhangzhen2015 (2 commits)")

### Embed Badge

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

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

PHPackages © 2026

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