Skip to main content

A working re-implementation of the weather module for Sopel

Project description

version build issues alerts coverage-status license

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 (Deprecated 03/31/2023)

https://darksky.net/

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/

Python Requirements

requests
sopel

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

sopel_modules.weather-1.5.0.tar.gz (13.7 kB view details)

Uploaded Source

Built Distribution

sopel_modules.weather-1.5.0-py3-none-any.whl (13.0 kB view details)

Uploaded Python 3

File details

Details for the file sopel_modules.weather-1.5.0.tar.gz.

File metadata

  • Download URL: sopel_modules.weather-1.5.0.tar.gz
  • Upload date:
  • Size: 13.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.9.16

File hashes

Hashes for sopel_modules.weather-1.5.0.tar.gz
Algorithm Hash digest
SHA256 b8fc2dd8f09e0c651a386f51a7e12265d9157248911f701c34b04d6d76295aab
MD5 3455365472ce0970f8e31be66f302ebd
BLAKE2b-256 3e0f5c63a8f6c1bb1756c29d1a4644b9ac53918ccdf65e70e1389f677bbc0d92

See more details on using hashes here.

File details

Details for the file sopel_modules.weather-1.5.0-py3-none-any.whl.

File metadata

File hashes

Hashes for sopel_modules.weather-1.5.0-py3-none-any.whl
Algorithm Hash digest
SHA256 e63f76e82bd0b25937e3ffc2fa3c78d070dcc0f4097ac42bdd600f958f80f427
MD5 92e23fc63f8fa6223cb17cf5fa1613b7
BLAKE2b-256 de81137c2ee0145f6236116e2d014d90301de500fb9741d2f9de22049da99a06

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page