An API wrapper for Pikud Haoref's rocket API.
Project description
PikudHaoref.py
An unofficial API wrapper for Pikud Haoref's rocket API written in python.
The documentation is not done yet.
Credits
- HoshenKadosh for pikudhaoref API help.
Features
- Very easy to use and user-friendly.
- Object Oriented.
- Detect sirens in real time.
- View city data (zone, name, countdown, location).
- Supports many languages (English, Russian, Hebrew, Spanish, Arabic).
- Both sync and async support. (MORE COMING SOON)
The pikudhaoref API is only accessible from Israel.
Installation
Installing pikudhaoref.py is very easy.
python -m pip install pikudhaoref.py
Examples
Siren detector example
from datetime import datetime
import pikudhaoref
client = pikudhaoref.SyncClient(update_interval=2)
history_range = client.get_history(
date_range=pikudhaoref.Range(datetime(year=2014, month=7, day=24), datetime.now())
)
history_month = client.get_history(mode=pikudhaoref.HistoryMode.LAST_MONTH)
print(history_month)
print(history_range)
# The get_history method does not create a city object as it might take a long time.
# In case you need the city information, you can use the get_city method.
print(client.current_sirens)
# The current_sirens property returns the list of current sirens, and gets the city automatically.
@client.event()
def on_siren(sirens):
print(f"Siren alert! started sirens: {sirens}")
@client.event()
def on_siren_end(sirens):
print(f"Sirens {sirens} have ended.")
while True:
pass # To make sure the script doesnt stop
TODO
- None
Known Issues
- None
Incase you do find bugs, please create an issue or a PR.
Support
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
pikudhaoref.py-0.0.6.tar.gz
(10.7 kB
view details)
File details
Details for the file pikudhaoref.py-0.0.6.tar.gz
.
File metadata
- Download URL: pikudhaoref.py-0.0.6.tar.gz
- Upload date:
- Size: 10.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.4.2 importlib_metadata/4.8.1 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.9.7
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | ca4ed0ac25550f4a900d9baa37ba22ca1351f4fbd45363e33b409698172dac79 |
|
MD5 | 24c1240e93ade2dcffd0eb4c40e9c1ef |
|
BLAKE2b-256 | c3651ee0da97b70526cf0d177030502bd0400ee5bef0f3b7684b7d17010c774e |