sopel-weather is a weather lookup plugin for Sopel.
Since Yahoo deprecated their weather API on January 3, 2019, a reimplementation of the weather plugin was necessary
If possible, use pip
to install this plugin. Below are example commands; you
might need to add sudo
and/or call a different pip
(e.g. pip3
) depending
on your system and environment. Do not use setup.py install
; Sopel won't be
able to load the plugin correctly.
pip install sopel-modules.weather
Clone the repo, then run this in /path/to/sopel-weather
pip install .
You can automatically configure this plugin using the sopel configure --plugins command.
However, if you want or need to configure this plugin manually, you will need to define the following in ~/.sopel/default.cfg
[weather] geocoords_provider = GEOCOORDS_PROVIDER geocoords_api_key = GEOCOORDS_API_KEY weather_provider = WEATHER_PROVIDER weather_api_key = WEATHER_API_KEY
.weather # Only works if setlocation has been previously run .weather seattle, us .weather london
Paris, Ile-de-France, FR: 6°C (42°F), Clear, Humidity: 83%, UV Index: 0, Gentle breeze 4.0m/s (↗)
.forecast # Only works if setlocation has been previously run .forecast seattle, us .forecast london
Forecast: Paris, Ile-de-France, FR: Light rain tomorrow through next Saturday, High: 15°C (59°F), Low: 11°C (52°F), UV Index: 2
.setlocation london # Sets location by city name .setlocation 98101 # Sets location by US zip code
I now have you at Paris, Ile-de-France, FR
Modern weather APIs require Latitude & Longitude as inputs to their APIs, so we need to leverage a GeoCoords API to convert location searches to coordinates.
LocationIQ
https://locationiq.com/
Open-Meteo
Does not require an API key; use any string you want.
https://open-meteo.com/
OpenWeatherMap
https://openweathermap.org/
Pirate Weather
A drop-in replacement API for the old Dark Sky service bought by Apple.
https://pirateweather.net/
requests sopel