precipitation.py
is a small python3 script that checks if there is any precipitation for specified hours forward (8 is default) in a specified geographic area. I use this in i3blocks as a command to check if a need an umbrella today or not.
Note that the longitude and latitude needs to be in a valid geographic area.
Use this link to get correct latitude and longitude:
Change using --latitude
and --longitude
to get correct geographic area. Default is Lund Sweden.
See commands more using -h
or --help
.
Using API from SMHI Open Data.
Read more here: http://opendata.smhi.se/apidocs/.
Grant execution permisson to file owner: chmod u+x precipitation.py
.
$ ./precipitation.py
$ ./precipitation.py --hours 48
./precipitation.py --latitude 59.23 --longitude 18.15 --hours 12