PHPackages                             th3mouk/yahoo-weather-bundle - 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. [API Development](/categories/api)
4. /
5. th3mouk/yahoo-weather-bundle

ActiveSymfony-bundle[API Development](/categories/api)

th3mouk/yahoo-weather-bundle
============================

Symfony bundle that include Yahoo Weather API and archive datas in database.

0.9(10y ago)0224MITPHPPHP ^5.4|^7.0

Since Apr 21Pushed 9y ago1 watchersCompare

[ Source](https://github.com/Th3Mouk/YahooWeatherBundle)[ Packagist](https://packagist.org/packages/th3mouk/yahoo-weather-bundle)[ RSS](/packages/th3mouk-yahoo-weather-bundle/feed)WikiDiscussions master Synced 4w ago

READMEChangelogDependencies (9)Versions (2)Used By (0)

Yahoo Weather Bundle
====================

[](#yahoo-weather-bundle)

This [Symfony](http://symfony.com/) bundle providing communication and historian of [Yahoo Weather API](https://developer.yahoo.com/weather/).

[![SensioLabsInsight](https://camo.githubusercontent.com/03ea29096f56fd70f6825e7471b13e7a84b283a020bb4194bd900a8079d1885a/68747470733a2f2f696e73696768742e73656e73696f6c6162732e636f6d2f70726f6a656374732f38336235393936312d383961322d343761302d383439362d3637656561333239346236662f6d696e692e706e67)](https://insight.sensiolabs.com/projects/83b59961-89a2-47a0-8496-67eea3294b6f) [![Latest Stable Version](https://camo.githubusercontent.com/3c7db7d63a454b48d5a792a9214fb9d5090a2c1adf759fa205d1dd813d033bf1/68747470733a2f2f706f7365722e707567782e6f72672f7468336d6f756b2f7961686f6f2d776561746865722d62756e646c652f762f737461626c65)](https://packagist.org/packages/th3mouk/yahoo-weather-bundle) [![Total Downloads](https://camo.githubusercontent.com/e0325a6192c1a0f07f69d8e6336ca528788d44bb56de7a5d7f5866a0a01ba959/68747470733a2f2f706f7365722e707567782e6f72672f7468336d6f756b2f7961686f6f2d776561746865722d62756e646c652f646f776e6c6f616473)](https://packagist.org/packages/th3mouk/yahoo-weather-bundle) [![Build Status](https://camo.githubusercontent.com/33fb113bbfacc5057577a74faf716526b9d0af969ab91ed8e9536cb65d260a33/68747470733a2f2f7472617669732d63692e6f72672f5468334d6f756b2f5961686f6f5765617468657242756e646c652e7376673f6272616e63683d6d6173746572)](https://travis-ci.org/Th3Mouk/YahooWeatherBundle) [![Latest Unstable Version](https://camo.githubusercontent.com/97f08ca44b2ab7fbcc7d002b7608f32e7b79adeeeff26bf33681e6bfdcd0beb5/68747470733a2f2f706f7365722e707567782e6f72672f7468336d6f756b2f7961686f6f2d776561746865722d62756e646c652f762f756e737461626c65)](https://packagist.org/packages/th3mouk/yahoo-weather-bundle) [![License](https://camo.githubusercontent.com/b28da5b694a936cea8611388832750bbc8d619d2ce98d0735c4290d87069a2d2/68747470733a2f2f706f7365722e707567782e6f72672f7468336d6f756b2f7961686f6f2d776561746865722d62756e646c652f6c6963656e7365)](https://packagist.org/packages/th3mouk/yahoo-weather-bundle)

Installation
------------

[](#installation)

`composer require th3mouk/yahoo-weather-bundle ^1.0@dev`

Add to the `appKernel.php`:

```
// Weather Bundle
new Th3Mouk\YahooWeatherBundle\Th3MoukYahooWeatherBundle(),
```

Full configuration of `config.yml`

```
th3mouk_yahoo_weather:
    templates:
        today:     Th3MoukYahooWeatherBundle:Default:today.html.twig
        forecast:  Th3MoukYahooWeatherBundle:Default:forecast.html.twig

    pictograms:
        helper: ImplementsYourOwn
        extension: Th3Mouk\YahooWeatherBundle\Twig\PictoExtension
```

Usage
-----

[](#usage)

This bundle provides two entities: `Th3Mouk\YahooWeatherBundle\Entity\City` and `Th3Mouk\YahooWeatherBundle\Entity\Forecast`.

The first one is relative to communication with the API, city object must have the name of the city like in the Yahoo Weather Documentation, or a WOEID code. The second is for data persistence and history retrieve.

Extends them or feel free to hack it !

### Twig Extensions

[](#twig-extensions)

#### Weather

[](#weather)

You have two extensions to draw the forecasts, they use templates defined in configuration. Feel free to to implements or add your own !

```
{{ weather_forecast(city, unit = 'c') }}
{{ weather_today(city, unit = 'c') }}
```

#### Icons

[](#icons)

You can add a pictogram helper in the configuration that activate this extension, that must implement `Th3Mouk\YahooWeatherBundle\Helper\PictogramInterface`.

```
{{ code|weather_pictogram }}
```

This is an exemple of PictogramHelper :

```
namespace AppBundle\Helper;

use Th3Mouk\YahooWeatherBundle\Helper\PictogramInterface;

class WeatherPictogramHelper implements PictogramInterface
{
    /**
     * Function that retrieve the html string corresponding to a weather code.
     *
     * @param $code
     *
     * @return string|null
     */
    public function getPictogram($code)
    {
        return "";
    }
}
```

### Sonata Integration Exemple

[](#sonata-integration-exemple)

This bundle automatically provide an administration for cities.

The service is named `th3mouk_yahoo_weather.admin.city`.

```
th3mouk_yahoo_weather.admin.city:
    class: Th3Mouk\YahooWeatherBundle\Admin\CityAdmin
    arguments: [~, Th3Mouk\YahooWeatherBundle\Entity\City, SonataAdminBundle:CRUD]
    tags:
        - {name: sonata.admin, manager_type: orm, group: weather, label: city}
```

Add the admin group on the dashboard:

```
sonata.admin.group.weather:
    label:           weather
    label_catalogue: messages
    icon:            ''
    items:
        - th3mouk_yahoo_weather.admin.city
    roles: [ ROLE_ADMIN ]
```

Don't forget to add this group on a block:

```
sonata_admin:
    dashboard:
        blocks:
            - { position: left, type: sonata.admin.block.admin_list, settings: { groups: [...sonata.admin.group.weather...] }}
```

You're done! 👍

TODO
----

[](#todo)

- Add template option on weather twig extension
- Add today forecast without city object
- Remove sonata configuration in the bundle
- Add weather extension configuration
- Add twig extension of history
- Add twig extension for comparison of weather (today and Y-1)
- Add twig extension for comparison of weather (forecast and Y-1)

Please
------

[](#please)

Feel free to improve this bundle.

###  Health Score

24

—

LowBetter than 31% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity11

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity48

Maturing project, gaining track record

 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.

###  Release Activity

Cadence

Unknown

Total

1

Last Release

3722d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/5006899?v=4)[Jérémy](/maintainers/Th3Mouk)[@Th3Mouk](https://github.com/Th3Mouk)

---

Top Contributors

[![Th3Mouk](https://avatars.githubusercontent.com/u/5006899?v=4)](https://github.com/Th3Mouk "Th3Mouk (12 commits)")

---

Tags

symfonybundleweatheryahooforecasts

### Embed Badge

![Health badge](/badges/th3mouk-yahoo-weather-bundle/health.svg)

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

PHPackages © 2026

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