Socket
Socket
Sign inDemoInstall

weatheril

Package Overview
Dependencies
4
Maintainers
1
Alerts
File Explorer

Install Socket

Detect and block malicious and high-risk dependencies

Install

    weatheril

Israel Meteorological Service unofficial python api wrapper


Maintainers
1

Readme

weatheril

Downloads DownloaFormatds DownloaFormatds Security Rating

weatheril is an unofficial IMS (Israel Meteorological Service) python API wrapper.

Features supported

  • Get current weather status.
  • Get Daily and Hourly forecast (5 days ahead).
  • Get Radar and Satellite images.

Components and Frameworks used in weatheril

Getting started

Use git to clone or you can also manually download the project repository just as shown below;

$ git clone https://github.com/t0mer/py-weatheril/
$ cd py-weatheril
py-weatheril $ python3 setup.py install 

Installing from PyPi

# For Windows 

pip install  --upgrade weatheril

#For Linux | MAC 

pip3 install --upgrade weatheril

Working with the API

weatheril can be configured to retrive forecast information for specific location. when initiating the library you must set the location id and language (Currently only he and en are supported)

from weatheril import *
weather = WeatherIL(21,"he")

In the above example i set Raanana as the location and Hebrew as language. Full locations list in the table below.

IdLocation
1Jerusalem
2Tel Aviv - Yafo
3Haifa
4Rishon le Zion
5Petah Tiqva
6Ashdod
7Netania
8Beer Sheva
9Bnei Brak
10Holon
11Ramat Gan
12Asheqelon
13Rehovot
14Bat Yam
15Bet Shemesh
16Kfar Sava
17Herzliya
18Hadera
19Modiin
20Ramla
21Raanana
22Modiin Illit
23Rahat
24Hod Hasharon
25Givatayim
26Kiryat Ata
27Nahariya
28Beitar Illit
29Um al-Fahm
30Kiryat Gat
31Eilat
32Rosh Haayin
33Afula
34Nes-Ziona
35Akko
36Elad
37Ramat Hasharon
38Karmiel
39Yavneh
40Tiberias
41Tayibe
42Kiryat Motzkin
43Shfaram
44Nof Hagalil
45Kiryat Yam
46Kiryat Bialik
47Kiryat Ono
48Maale Adumim
49Or Yehuda
50Zefat
51Netivot
52Dimona
53Tamra
54Sakhnin
55Yehud
56Baka al-Gharbiya
57Ofakim
58Givat Shmuel
59Tira
60Arad
61Migdal Haemek
62Sderot
63Araba
64Nesher
65Kiryat Shmona
66Yokneam Illit
67Kafr Qassem
68Kfar Yona
69Qalansawa
70Kiryat Malachi
71Maalot-Tarshiha
72Tirat Carmel
73Ariel
74Or Akiva
75Bet Shean
76Mizpe Ramon
77Lod
78Nazareth
79Qazrin
80En Gedi
200Nimrod Fortress
201Banias
202Tel Dan
203Snir Stream
204Horshat Tal
205Ayun Stream
206Hula
207Tel Hazor
208Akhziv
209Yehiam Fortress
210Baram
211Amud Stream
212Korazim
213Kfar Nahum
214Majrase
215Meshushim Stream
216Yehudiya
217Gamla
218Kursi
219Hamat Tiberias
220Arbel
221En Afek
222Tzipori
223Hai-Bar Carmel
224Mount Carmel
225Bet Shearim
226Mishmar HaCarmel
227Nahal Me‘arot
228Dor-HaBonim
229Tel Megiddo
230Kokhav HaYarden
231Maayan Harod
232Bet Alpha
233Gan HaShlosha
235Taninim Stream
236Caesarea
237Tel Dor
238Mikhmoret Sea Turtle
239Beit Yanai
240Apollonia
241Mekorot HaYarkon
242Palmahim
243Castel
244En Hemed
245City of David
246Me‘arat Soreq
248Bet Guvrin
249Sha’ar HaGai
250Migdal Tsedek
251Haniya Spring
252Sebastia
253Mount Gerizim
254Nebi Samuel
255En Prat
256En Mabo‘a
257Qasr al-Yahud
258Good Samaritan
259Euthymius Monastery
261Qumran
262Enot Tsukim
263Herodium
264Tel Hebron
267Masada
268Tel Arad
269Tel Beer Sheva
270Eshkol
271Mamshit
272Shivta
273Ben-Gurion’s Tomb
274En Avdat
275Avdat
277Hay-Bar Yotvata
278Coral Beach

Get Satellite and Radar Images

from weatheril import *
weather = WeatherIL(21,"he")
images = weather.get_radar_images()

The get_radar_images will retun an object with four lists:

  • imsradar_images - Rain radar images (IMS).
  • radar_images - Radar images.
  • middle_east_satellite_images - Middel East weather sattelite images.
  • europe_satellite_images - Eourope weather sattelite images.

You can also create animateg gif from this images lists by using the create_animation method as follows:

from weatheril import *
weather = WeatherIL(21,"he")
images = weather.get_radar_images()
animated = images.create_animation(images = images.middle_east_satellite_images, animated_file = "file.gif", path="/tmp")

The function will return the path for the created image.

Optional You can use the following function to create animated gifs for all images

from weatheril import *
weather = WeatherIL(21,"he")
images = weather.get_radar_images()
images.generate_images(path="Path to store the images")

Sattelite

Get current weather status for given location

from weatheril import *
weather = WeatherIL(21,"he")
current = weather.get_current_analysis()

The result will be a weather object containing the data requested:

  • Location.
  • Humidity.
  • Rain.
  • Temperature.
  • Wind speed.
  • Feels like.
  • UV.
  • Time
  • Json result
       "33": {
            "id": "1601809",
            "lid": "33",
            "forecast_time": "2023-01-25 16:00:00",
            "type": "analysis",
            "main_hour": "0",
            "heat_stress": "17",
            "relative_humidity": "58",
            "due_point_Temp": "11",
            "rain": null,
            "temperature": "20",
            "wind_direction_id": "15",
            "wind_speed": "2",
            "wind_chill": "20",
            "weather_code": null,
            "heat_stress_level": "0",
            "feels_like": "20",
            "min_temp": null,
            "max_temp": null,
            "modified": "2023-01-25 15:55:00",
            "created": "2023-01-22 11:50:05",
            "u_v_index": "0",
            "u_v_level": "L",
            "u_v_i_max": null,
            "u_v_i_factor": null
        }

Get weather forecast

from weatheril import *
weather = WeatherIL(21,"he")
forcats = weather.get_forecast()

This method wil return forecast object that includes weather forecast for the new 5 days. The object contains data on Coutry level and also on give location Forecast >> Daily >> Hourly.


class Forecast:
    days: list

class Daily:
    date: datetime
    location: str
    day: str
    weather: str
    minimum_temperature: int
    maximum_temperature: int
    maximum_uvi: int
    hours: list
    description: str

class Hourly:
    hour: str
    weather: str
    temperature: int


Keywords

FAQs


Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc