Weather Widget - A Simple Widget Displaying the Current Weather and Forecast Written in Python

A script for fetching the current weather data for a location and a 12 hour forecast

Weather Widget has been replaced by weather-go (GitHub Repo), read more here weather-go (Blog post)

Weather Widget

This script fetches the current weather data of a given location. It uses the OpenWeatherMap One Call API and the Geocoding API.

It can also show a 12 hour forecast for that location.

I use it in my Polybar bar on my i3 setup.

Code

weather-widget-python (GitHub) The Python repo has a lot more documentation and some screenshots.

weather-widget-go (GitHub) The Go implementation does not have all features of the python version yet. But has some improvements over the python one.

Preview

small preview

full preview

Usability

In theory this script can be called by everything that can call a script and display the output. E.g. as a polybar module

[module/weather]
type = custom/script

exec = <execute script here> small <location>

# refresh every 30 minutes
interval = 1800.0

format =<label>
label =%output%

click-right = <execute script here> full <location>
Last modified 2022.12.21