A working re-implementation of the weather module for Sopel
Project description
Introduction
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
Installing
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.
Published release
pip install sopel-modules.weather
From source
Clone the repo, then run this in /path/to/sopel-weather
pip install .
Configuring
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
Usage
Current Weather
.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 (↗)
24h Forecast
.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
Customize User Location
.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
Requirements
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.
API Keys
GeoCoords
LocationIQ
https://locationiq.com/
Weather
Dark Sky
https://darksky.net/
OpenWeatherMap
https://openweathermap.org/
Python Requirements
requests
sopel
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file sopel_modules.weather-1.2.5.tar.gz
.
File metadata
- Download URL: sopel_modules.weather-1.2.5.tar.gz
- Upload date:
- Size: 11.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.4.1 importlib_metadata/4.0.1 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.60.0 CPython/3.9.4
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | f34fb20b863ed7ce44a01869f9489750a3a66ecf60ffeccc49d0945fb51407e7 |
|
MD5 | 51c6b20d198171dca74bc570ade1d8c7 |
|
BLAKE2b-256 | 034183399879f2dead41be74669b609fea0f713035815465835244b5a6aabf0c |
File details
Details for the file sopel_modules.weather-1.2.5-py3-none-any.whl
.
File metadata
- Download URL: sopel_modules.weather-1.2.5-py3-none-any.whl
- Upload date:
- Size: 10.2 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.4.1 importlib_metadata/4.0.1 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.60.0 CPython/3.9.4
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 2f7402ff7c8d07d41429564606cf9abdb773060eb55450f28107cc20a0f66f7d |
|
MD5 | e0e495bc8e714156964a6bb40d9116d6 |
|
BLAKE2b-256 | d764279513a07487741683780016f8d7900932bb6d45342dfef977c646baa19e |