Skip to content

Alcheri/Weather

Repository files navigation

Weather

Python versions Supported Python versions Code style: black Build Status Maintenance CodeQL Lint

A fully asynchronous Weather plugin for Limnoria using the OpenWeather and Google Maps APIs.

All output is in Metric

This plugin uses Alpha-2 Code for country code iso.org

Setting up

OpenWeather One Call 3.0 API gathers data requiring a (free? )subscription.
Subscription: One Call API 3.0

Google Maps API gathers data requiring a (free?) subscription.
Subscription: Google Maps API

Google gives each Google Maps account $200/month of free credit, equivalent to 40,000 addresses geocoded per month.

Install

Go into your Limnoria plugin dir, usually ~/runbot/plugins and run:

git clone https://github.com/Alcheri/Weather.git

To install additional requirements, run from /plugins/Weather folder:

pip install --upgrade -r requirements.txt 

Next, load the plugin:

/msg bot load Weather

Configure your bot

  • config plugins.Weather.openweatherAPI [your_key_here]
  • config plugins.Weather.googlemapsAPI [your_key_here]
  • config channel #channel plugins.Weather.enable True or False (On or Off)

Note: For all Southern Hemisphere latitudes prefix the argument with '--' i.e.:

   -- -37.5621587 143.8502556

Using

<Barry> @weather 1600 Amphitheatre Pkwy, Mountain View, CA
<Borg> 1600 Amphitheatre Pkwy, Mountain View, CA 94043, USA (Lat: 122°5' 7.08" W, Lon: 37°25' 19.56" N) | Clear sky, Temp: ${\texttt{\color{green}18.0°C}}$, Feels like: ${\texttt{\color{green}17.0°C}}$, Humidity: 33%, Clouds: 0%, Wind: 22 Km/h N, ${\texttt{\color{green}UVI 1 (Low)}}$

<Barry> @weather -- -37.5621587 143.8502556
<Borg> Ballarat Central VIC 3350, Australia (Lat: 143°51' 1.08" E, Lon: 37°33' 43.92" S) | Clear sky, Temp: ${\texttt{\color{yellow}24.0°C}}$, Feels like: ${\texttt{\color{yellow}23.0°C }}$, Humidity: 99%, Clouds: 9%, Wind: 5 Km/h SSE, ${\texttt{\color{red}UVI 9 (Very High)}}$

<Barry> @google -37.5283674, 143.8164991
<Borg>  From Google Maps: 1275 Grevillea Rd, Wendouree VIC 3355, Australia 3355 [ID: ChIJcSzC6YxD0WoRWtgRRJh8D2U] -37.5283674 143.8164991

<Barry> @google Ballarat VIC AU
<Borg>  From Google Maps: Ballarat VIC, Australia N/A [ID: ChIJeRiTMFRE0WoRILegMKR5BQQ] -37.5621587 143.8502556

@weather set [location] -- Sets your current ident@host to [location]

@weather unset -- Removes your current ident@host

@weather help -- Plugin help - accepts no arguments.



Copyright © MMXXIV, Barry Suridge

About

Get the current weather for the specified location, or a default location.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages