Package: ninette
NinetteA simple alerting system to get notified about important events or news.Ninette generates alerts as email messages or by executing a command
(which could generate a Signal, Jabber, Matrix, SMS, ... message) to inform about
important events or news in your region.It can be used as an alternative or addition to smart phone apps which create push notifications.
With the Command alerter, any form of notification can be used.Currently supported alert providers are:NINA(service of the German disaster control organization) andTagesschau(German television news service).More providers can be added easily.FeaturesAlerts from GermanBundesamt für Bevölkerungsschutz(NINA API viahttps://nina.api.bund.dev, including events from DWD, MOWAS, Hochwasserzentrale)Alerts for breaking news fromTagesschau(viahttps://www.tagesschau.de)Notification viaEmailNotification via custom command, e.g. to create a Signal, Jabber, Matrix, SMS messageRegional events can be filtered by location (based on county), multiple locations can be configuredAutomatic creation of a map image for each event if it contains geo coordinatesEvent state is stored in a SQLite database to not create alerts for already alerted eventsMade with Python and loveInstallation and setupNinette requires Python 3.8 or newer.
The easiest method is to install directly from pypi using pip:pip install ninetteWhen installing or running manually, the following requirements must be installed:
html2text, py-staticmaps, requestsBefore using Ninette, you need to create a configuration file calledninette.conf.
Ninette will search forninette.confin the following locations (in that order):/etc/ninette.conf~/.config/ninette.confninette.conf (in current working directory)Alternatively, you can specify the name of the configuration file to be read
using the--configcommand line parameter.An example configuration file can be found in the sources or online
athttps://raw.githubusercontent.com/eht16/ninette/main/ninette.conf.example.For details on the configuration options, consider the comments in the
example configuration file.UsageRun only once:ninetteRun in foreground:ninette -fRun in foreground and override configured event fetch interval to 5 minutes (300 seconds):ninette -f -i 300Run with verbose output and dry-run tonotsend any alerts:ninette -v -nCommand line optionsusage: ninette [-h] [-V] [-d] [-v] [-c FILE] [-f] [-i NUM] [-n]

options:
  -h, --help            show this help message and exit
  -V, --version         show version and exit (default: False)
  -d, --debug           enable tracebacks and enable --verbose (default: False)
  -v, --verbose         Show more log messages (default: False)
  -c FILE, --config FILE
                        configuration file path (default: None)
  -f, --foreground      Keep running in foreground (default: False)
  -i NUM, --interval NUM
                        Check for new events every X seconds (only used when in foreground) (default: None)
  -n, --dry-run         Dry run mode - do not send and remember any alerts (default: False)Available providersNINA provideruses the NINA API (https://nina.api.bund.dev/) which is based on the warnings
of the German Bundesamt für Bevölkerungsschutz (https://warnung.bund.de).In general the alerts are created if the configured area is affected by accidents or disasters
(fire, flood or a release of hazardous substances) from the following services:MoWaS (modular warning system)DWD - Deutscher Wetterdienst (weather service for Germany)Hochwasserzentrale (flood warnings for Germany)The provider can generate alerts for multiple areas which are listed in the configuration file.
To add an area, the "Amtlicher Gemeindeschlüssel"
(Community Identification Number) for the area must be used.
A list of such numbers can be found onhttps://www.xrepository.de/details/urn:de:bund:destatis:bevoelkerungsstatistik:schluessel:rs.Since the warnings are provided only on county level, the last seven digits of the number must be
replaced by "0000000".Tagesschau breaking news providerqueries the German television news service for breaking
news and creates alerts for each breaking news.Ping providera provider for debugging purposes only which generates an alert every hour.Available alertersEmail alertersends an email to a configured list of recipients, email server
and credentials can be configured.Command alerterexecutes a custom command which receives all alert information so it can generate
a push notification or SMS for a mobile phone, a message in a chat like Matrix, a message for a Pager
or any other form of notification or post processing.DisclaimerUse this tool at your own risk only.
There is no warranty that all alerts are processed and sent reliably and in time.This project has no relation to the official German NINA warn app.AuthorEnrico Trögerenrico.troeger@uvena.de