Skip to main content

Israel Meteorological Service Envista API wrapper package

Project description

IMS Envista

==========================

Pypi Downloads CI CodeQuality DownloadFormats

ims_envista is an unofficial IMS (Israel Meteorological Service) python API wrapper for Envista service.

Features supported

  • Get latest meteorological readings from IMS Envista
  • Get measurement data by region, station and date range.
  • Get Daily and Monthly readings by measurement station.

Components and Frameworks used

Installing

pip3 install --upgrade ims-envista

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)

Getting an IMS Token

You can read about the API and about how to get a token here - signing terms of use, etc.

from ims_envista import IMSEnvista

# Create IMS object with Token
ims = IMSEnvista("2cc57fb1-cda5-4965-af12-b397e5b8eb32")

# Get JERUSALEM stations for getting an id
[station for station in await ims.get_all_stations_info() if station.name.startswith("JERUSALEM")]
> [JERUSALEM GIVAT RAM(22) - Location: [Lat - 31.771 / Long - 35.197], Active, Owner: ims, RegionId: 7, Monitors: [
    Rain(mm), WSmax(m / sec), WDmax(deg), WS(m / sec), WD(deg), STDwd(deg), TD(degC), RH( %), TDmax(degC), TDmin(
    degC), Grad(w / m2), DiffR(w / m2), WS1mm(m / sec), Ws10mm(m / sec), Time(hhmm), NIP(
    w / m2)], StationTarget:, JERUSALEM
CENTRE(23) - Location: [Lat - 31.781 / Long - 35.222], Active, Owner: ims, RegionId: 7, Monitors: [Rain(mm),
                                                                                                   WSmax(m / sec),
                                                                                                   WDmax(deg),
                                                                                                   WS(m / sec), WD(deg),
                                                                                                   STDwd(deg), TD(degC),
                                                                                                   TDmax(degC),
                                                                                                   TDmin(degC),
                                                                                                   WS1mm(m / sec),
                                                                                                   Ws10mm(m / sec),
                                                                                                   Time(hhmm), BP(mb),
                                                                                                   RH( %)], StationTarget:, JERUSALEM
CENTRE_1m(248) - Location: [Lat - 31.7806 / Long - 35.2217], Active, Owner: ims, RegionId: 7, Monitors: [Rain_1_min(mm),
                                                                                                         Rain_Corr(
                                                                                                             mm)], StationTarget:, JERUSALEM
GIVAT
RAM_1m(249) - Location: [Lat - 31.7704 / Long - 35.1973], Active, Owner: ims, RegionId: 7, Monitors: [Rain_1_min(mm),
                                                                                                      Rain_Corr(
                                                                                                          mm)], StationTarget:]

# Get latest data by a station id
await ims.get_latest_station_data(23)
> Station(23), Data: [Station: 23, Date: 2023 - 02 - 21
12: 00:00 + 02: 00, Readings: [(TD: 17.6°C), (TDmax: 17.8°C), (TDmin: 17.5°C), (RH: 58.0 %), (Rain: 0.0mm),
                               (WS: 2.8m / s), (WSmax: 3.7m / s), (WD: 285.0deg), (WDmax: 289.0deg), (STDwd: 10.5deg),
                               (WS1mm: 3.4m / s), (WS10mm: 2.9m / s)]]

Methods

Method Description Parameters Returns
get_latest_station_data Get Latest Station Readings station_id: int,
(optional) channel_id: int
StationMeteorologicalReadings
get_earliest_station_data Get Earliest Station Readings station_id: int,
(optional) channel_id: int
StationMeteorologicalReadings
get_station_data_from_date Get Station Reading from a specific date station_id: int,
date: datetime,
(optional) channel_id: int
StationMeteorologicalReadings
get_station_data_by_date_range Get Station Readings from a date range station_id: int,
from_date: datetime,
to_date: datetime,
(optional) channel_id: int
StationMeteorologicalReadings
get_daily_station_data Get Daily Station Readings station_id: int,
(optional) channel_id: int
StationMeteorologicalReadings
get_monthly_station_data Get Monthly Station Readings station_id: int,
(optional) channel_id: int,
(optional) month: str, [e.g. 03]
(optional) year: str [e.g. 2020]
StationMeteorologicalReadings
get_all_stations_data Get Station Info of all stations list[Station]
get_station_data Get Station Info by station_id station_id: int Station
get_all_regions_data Get Region Info of all regions list[Region]
get_region_info Get Region Info by region_id station_id: int Region
get_metric_descriptions Get Station Measurements Description listIMSVariable

Local Development

Clone from Github

Clone the repo from GitHub

git clone git@github.com:GuyKh/ims-envista.git

Requirements

Package requirements are handled using pip. To install them do

pip install -r requirements.txt

Local Installation

To install locally:

python setup.py install

Tests

Testing is set up using pytest and coverage is handled with the pytest-cov plugin.

Run your tests with py.test in the root directory.

Coverage is ran by default and is set in the pytest.ini file. To see an html output of coverage open htmlcov/index.html after running the tests.

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

ims_envista-0.1.11.tar.gz (14.4 kB view details)

Uploaded Source

Built Distribution

ims_envista-0.1.11-py3-none-any.whl (14.7 kB view details)

Uploaded Python 3

File details

Details for the file ims_envista-0.1.11.tar.gz.

File metadata

  • Download URL: ims_envista-0.1.11.tar.gz
  • Upload date:
  • Size: 14.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.12.7

File hashes

Hashes for ims_envista-0.1.11.tar.gz
Algorithm Hash digest
SHA256 85f49ee44b4ed200341dab3acdcc223c3be9af8c82f3e07f1be7da7ccf426d91
MD5 84088ea638e1d25a581e4e5b950495ad
BLAKE2b-256 809418cbe77a5e63d47ea1173177ea4565074505ff4504e08bd58bfa1af24444

See more details on using hashes here.

File details

Details for the file ims_envista-0.1.11-py3-none-any.whl.

File metadata

  • Download URL: ims_envista-0.1.11-py3-none-any.whl
  • Upload date:
  • Size: 14.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.12.7

File hashes

Hashes for ims_envista-0.1.11-py3-none-any.whl
Algorithm Hash digest
SHA256 4919ded2c55d08bc52949aff767bd50aeb9998c0694975f4c6b48c42326dd781
MD5 7a975661e28ff9077ba18bf13a92467a
BLAKE2b-256 1a38250003cb9bf9bb8723bda688669232898080717b2d4d8214348c9209420c

See more details on using hashes here.

Supported by

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