Skip to main content

A Python library for Pikud Haoref's unofficial rocket alert API.

Project description

python-pikudHaoref-api

A Python library for Pikud Haoref's unofficial rocket alert API.

Getting rocket alerts data - in Real time

With the library you can listen to the new alerts.

The data comes from the library in the following format:

[{
        "value":"אשקלון",
        "name":"אשקלון",
        "name_en":"Ashkelon",
        "name_ru":"Ашкелон",
        "name_ar":"أشكلون",
        "zone":"מערב לכיש",
        "zone_en":"Western Lakhish",
        "zone_ru":"запад Лахиш",
        "zone_ar":"الغربي لاخيش",
        "countdown":30,
        "time":"30 שניות",
        "time_en":"30 Seconds",
        "time_ru":"30 секунд",
        "time_ar":"30 ثانية",
        "lat":31.6688,
        "lng":34.5743
}]

With the library you can:

  • Listen to new rocket alerts, and get the Data into your Alerts_Handler function.
  • You can choose to receive only alerts from certain cities !
  • Get the latest alerts history, with time filtering and different languages.

tzevaadom is open source with a public repository on GitHub.

Installation

Install tzevaadom from PIP.

$ pip install tzevaadom

The library doesn't require installing any additional PIP package.

Examples

import tzevaadom

def handler(List_Alerts):
  for alert in List_Alerts:
    
    message = "New Alarm: " + alert["name_en"] + ". Zone: " + alert["zone_en"]
    print(message)

    
    
''' start monitor api '''
tzevaadom.alerts_listener(handler) # listening to alerts in background (Thread)

Filter and get alerts, only from certain cities.

tzevaadom.alerts_listener(handler, ["אשקלון","נחל עוז"])  # You will receive alerts, only if it was in `אשקלון` or `נחל עוז`.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

tzevaadom-1.1.tar.gz (68.2 kB view details)

Uploaded Source

File details

Details for the file tzevaadom-1.1.tar.gz.

File metadata

  • Download URL: tzevaadom-1.1.tar.gz
  • Upload date:
  • Size: 68.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.2.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/40.8.0 requests-toolbelt/0.9.1 tqdm/4.47.0 CPython/3.7.4

File hashes

Hashes for tzevaadom-1.1.tar.gz
Algorithm Hash digest
SHA256 d26034b51a484f3c327fbb6d1a84d494a2d98206d8c15783203616789004b7be
MD5 e6433e31948ff8f31767947d88acbeb0
BLAKE2b-256 ac4c6b0a9db403c6ec1444d46a0d133aa1bd3c68d565996aab69e02ed5c1e42b

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page