/precipitation-sweden

Check if there is any precipitation (downfall) in the coming hours.

Primary LanguagePythonMIT LicenseMIT

Precipitation

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/.

Example Usage

Grant execution permisson to file owner: chmod u+x precipitation.py.

Check if there is any precipitation in the next 8 hours:

$ ./precipitation.py

Check if there is any precipitation in the next 48 hours:

$ ./precipitation.py --hours 48

Check if there is any precipitation in the next 12 hours in Stockholm:

./precipitation.py --latitude 59.23 --longitude 18.15 --hours 12