Package: wolkenbruch
WolkenbruchChecks the weather forecast for a configurable place and sends an e-mail
reminder to pack your rain gear if precipitation is forecast.Wolkenbruch makes use of theMET Norway API, and usesOpenStreetmapto find the location from place names.DependenciesWolkenbruch is written in Python 3, and depends on the Python modulesgeocoder,requestsandyaml.Installationusingpipor similar:pip3installwolkenbruchOR: manually:Clone this repositorygitclonehttps://gitlab.com/christoph.fink/wolkenbruch.gitChange to the cloned directoryUse the Pythonsetuptoolsto install the package:cdwolkenbruch
python3./setup.pyinstallConfigurationCopy the example configuration filewolkenbruch.yml.exampleto a suiteable location, depending on your operating system:on Linux systems:system-wide configuration:/etc/wolkenbruch.ymlper-user configuration:~/.config/wolkenbruch.ymlOR${XDG_CONFIG_HOME}/wolkenbruch.ymlon MacOS systems:per-user configuration:${XDG_CONFIG_HOME}/wolkenbruch.ymlon Microsoft Windows systems:per-user configuration:%APPDATA%\wolkenbruch.ymlAdapt the configuration:Change the place the forecast searches for. For bigger cities their name might be sufficient (Unicode is supported), e.g. “Helsinki”. When it comes to smaller places, or places that share their name with other places in different parts of the world, you might have to add a country, state or county name, e.g. ”Springfield, Fife”.Adapt the SMTP host and credentials (leave user and password empty if not authentication is required).Be careful:the credentials are (obviously) saved in plain-text. Protect access to the configuration file, e.g. on a GNU/Linux or MacOS system usingchmod 0600 "~/.config/wolkenbruch.yml".Set the sender and receiver e-mail address (they can and often will be the same address)If you feel like it, change the subject line and message body of the e-mail. The message body can containPython string formatting codefor a float variablesaandm(the average and maximum precipitation rates over the next 14 hours, in mm/h).Adjust the amount of rain you can stand:average_precipitation_rate_thresholdis the average precipitation rate over the next 14 hours (in mm per hour) that has to be exceeded to send you a reminder,max_precipitation_rate_thresholdthe highest single hourly value that makes you want to not forget your rain gear.The verbose flag toggles whetherwolkenbruchprints a status or operated silently.# example configuration file# (/etc/wolkenbruch.yml, ~/.config/wolkenbruch.yml,#    %APPDATA%/wolkenbruch.yml, ${XDG_CONFIG_HOME}/wolkenbruch.yml)smtp:host:localhost:587user:foobarpassword:BARFOOemail:from:me@whereever.comto:myself@whereever.comsubject:Pack your rain gear!message:The forecast precipitation rate for today is {a:.2f} mm/h, maximum {m:2f} mm/h.place:Helsinkiaverage_precipitation_rate_threshold:0.1max_precipitation_rate_threshold:0.5verbose:FalseUsageRunwolkenbruchto check the precipitation for the next 14 hours and send you an e-mail reminder. Ideally, set up a cron job or a systemd timer to runwolkenbruche.g. every morning.Systemd timerCopywolkenbruch.serviceandwolkenbruch.timerfromextra/systemd/to/etc/systemd/user/or~/.config/systemd/user/and enable the timer to run wolkenbruch at 6:30 every morning:systemctl--userdaemon-reload
systemctl--userenable--nowwolkenbruch.timerIf you want the systemd timer to trigger when you’re not logged in, enablelingeringfor your user:sudologinctlenable-lingerUSERNAME