Skip to main content

🚨 Pikud Ha'oref Alarm Tracking

Build PyPI

A simple CLI tool for tracking Pikud Ha'oref alarms.

Polls the unofficial API endpoint every second for incoming alarms. Prints active alarms as they occur. Prints routine messages once every 5 minutes by default.

example.png

⚠️ Disclaimer ⚠️

This tool is based on an unofficial API, and cannot be guaranteed to show correct or timely data. Do not use it if human life is at stake. Do not assume it shows you correct data. Do not assume it works properly, or even works at all. Always follow official guidelines and procedures published by Pikud Ha'oref.

Further fine-print covering the terms of use of this tool can be found in the GPLv3 license file.

Install

Pip

The easiest way to install is from PyPI with pip:

$ pip install alarmpy

You can then run the alarmpy executable directly:

$ alarmpy --help

Pipenv

For development usage it's recommended to clone the git repo and use pipenv:

$ git clone https://github.com/yuvadm/alarmpy
$ cd alarmpy
$ pipenv sync -d
$ pipenv run alarmpy

Usage

For the default usage after installation, just run:

$ alarmpy

Display

  • Set the output language using --language [en|he|ar|ru], this uses the official city and area name translations for Hebrew, Arabic, English and Russian.
  • In case of RTL issues in the terminal use --reverse to output all names in reverse.
  • Use --highlight abc in order to highlight any alarm which contains the string abc.

Proxy

The unofficial API is limited for use for Israeli-originating IPs only. In order to use alarmpy from outside Israel, users must route traffic through an Israeli exit point. The HTTPS_PROXY environment variable is supported for this use case.

Advanced

Advanced flags can be set as described in the usage:

$ pipenv run alarmpy --help
Usage: alarmpy.py [OPTIONS]

Options:
  --language [en|he|ar|ru]  Alert language
  --highlight TEXT          String to search for and highlight in case of
                            alarm
  --reverse                 Reverse Hebrew/Arabic output for terminals with
                            RTL bugs
  --polling-delay INTEGER   Polling delay in seconds
  --routine-delay INTEGER   Routine message delay in seconds
  --alarm-id                Print alarm IDs
  --repeat-alarms           Do not suppress ongoing alarms
  --quiet                   Print only active alarms
  --desktop-notifications   Create push notifications on your desktop
                            notification center (currently only in Mac OS)
  --mqtt-server TEXT        Hostname / IP of MQTT server (optional)
  --mqtt-client-id TEXT     MQTT client identifier
  --mqtt-port INTEGER       Port for MQTT server
  --mqtt-topic TEXT         Topic on which to send MQTT messages
  --mqtt-filter TEXT        Payload value to filter before sending as a
                            message (semicolon separated)
  --output-test             Print a debug output and exit
  --help                    Show this message and exit.

MQTT Notifications

Integration with an MQTT server provides the ability to send custom MQTT messages for all or some of the alerts that are received. MQTT requires paho-mqtt to be installed separately as an optional dependency.

To enable, specify at least the following parameters via the command line:

  • mqtt-server - The MQTT Server hostname or IP, e.g. localhost
  • mqtt-topic - The MQTT topic to which the MQTT message will be sent, e.g. alarmpy/zone

Additional optional parameters for MQTT integration are:

  • mqtt-client-id - The ID of the MQTT client used by alarmpy. This will be used to connect to the MQTT server. Default: alarmPyClient. This only needs to be change in case you plan to have more than one instance of alarmpy running
  • mqtt-port - The port on which the MQTT server is listening to. Default: 1883

Filtering

When MQTT is enabled, all alerts are sent as separate messages on the specified topic. In case there is a desire to include only specific alert, use the mqtt-filter parameter to provide a semicolon separated list of substrings enclosed in double quotes. Each alert city and area will be checked against all filters, and only when a match is found, will an MQTT message be sent. For example: --mqtt-filter "gaza;negev".

License

GPLv3

Metadata

Release files for alarmpy 1.5.4

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for alarmpy 1.5.4
File Size Uploaded Provenance
alarmpy-1.5.4.tar.gz 119.2 kB Without provenance Details

Built distribution (wheel)

Table of built distributions (wheels) for alarmpy 1.5.4
File Interpreter ABI Platform
alarmpy-1.5.4-py3-none-any.whl Python 3 none any Details

Total release size: 241.6 kB

Release files / alarmpy-1.5.4.tar.gz

Download URL alarmpy-1.5.4.tar.gz
Size 119.2 kB
Tags Source
SHA-256 checksum
How to use checksums
390651893da64b21b02805030783af98eeab03bb7032023b918776e97fa2a3a1
BLAKE2b-256 checksum
How to use checksums
18287cc8e783be93bddfd8570675cb88fc31e902ed929205357e4e7c5803c8b6
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.0 CPython/3.10.5

Release files / alarmpy-1.5.4-py3-none-any.whl

Download URL alarmpy-1.5.4-py3-none-any.whl
Size 122.3 kB
Tags Python 3
SHA-256 checksum
How to use checksums
bf7e803b0a9e26b874f0b204f2afa2bf2d61b842e3f404c20b91df58040b3586
BLAKE2b-256 checksum
How to use checksums
030e7bb87c07499f4e52020ef319add9b743b6db3b243775cc7afbb6a5809543
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.0 CPython/3.10.5

Security for alarmpy 1.5.4

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page