py-air-sviva-api
Python async API wrapper for the Israeli Ministry of Environmental Protection air quality monitoring system (air.sviva.gov.il).
This library provides a clean, type-safe interface to the Envista air quality API.
Features
- Async-first — built on
aiohttpfor non-blocking HTTP - Fully typed — all API responses deserialized into dataclass models via
mashumaro - No login required — the API uses a public token generation endpoint
- Comprehensive endpoint coverage — regions, stations, pollutants, air quality index, historical averages, and more
Installation
pip install air-sviva-api
Or install directly from the repository:
pip install git+https://github.com/GuyKh/py-air-sviva-api.git
Quick Start (5 lines)
import asyncio, aiohttp
from air_sviva_api.client import SvivaAirClient
async def main():
async with aiohttp.ClientSession() as s:
c = SvivaAirClient(s)
await c.generate_token()
print(await c.get_stations_latest_index())
asyncio.run(main())
API Methods
Regions & Stations
| Method | Parameters | Description |
|---|---|---|
get_regions() |
— | All monitoring regions with stations |
get_regions_latest_data(region_ids, hours_back=4) |
region_ids: list[int], hours_back: int |
Latest readings per region |
get_stations_latest_index(hours_back=24) |
hours_back: int |
Latest air quality index |
get_station_average(station_id, channel_id=None, from_date=None, to_date=None, timebase=5, from_timebase=5, to_timebase=5) |
station_id: int, channel_id: int?, from_date: date?, to_date: date?, timebase: int, from_timebase: int, to_timebase: int |
Historical averages (5-min intervals by default) |
get_station_index_fast(station_id, from_date=None, to_date=None) |
station_id: int, from_date: date?, to_date: date? |
Fast index data |
get_station_missing_days(station_id, days_back=180) |
station_id: int, days_back: int |
Missing data dates |
get_station_images(station_id) |
station_id: int |
Station images |
find_nearest_stations(lat, lon, limit=10) |
lat: float, lon: float, limit: int |
Nearest stations to coordinates |
Reference Data
| Method | Parameters | Description |
|---|---|---|
get_pollutants() |
— | All tracked pollutants |
get_units() |
— | Measurement units |
get_data_statuses() |
— | Data status codes |
get_manual_stations() |
— | Manual monitoring stations |
get_manual_pollutants() |
— | Manual measurement pollutants |
get_index_pollutants(index_type) |
index_type: int |
Index pollutant factors |
get_thresholds() |
— | Pollutant thresholds |
get_advisories() |
— | Active advisories |
Config & Metadata
| Method | Parameters | Description |
|---|---|---|
get_config_index() |
— | System config |
get_index_configuration(index_type) |
index_type: int |
Index calculation config |
get_station_terminology() |
— | Station classifications |
get_widget_config() |
— | Widget config |
get_guest_map_view() |
— | Guest map view |
Map Layers
| Method | Parameters | Description |
|--------|--|
| get_layer_mng(platform, access_level) | Map layer management |
| get_layer_queries(layer_id) | Layer feature queries |
| get_layer_filtered_stations(layer_id) | Filtered stations |
Other
| Method | Parameters | Description |
|---|---|---|
get_server_time() |
— | Server time |
get_interpolation_mng() |
— | Interpolation data |
get_vineyard_location(location_id) |
location_id: int |
Agricultural weather data |
Development
git clone https://github.com/GuyKh/py-air-sviva-api.git
cd py-air-sviva-api
pip install -e ".[dev]"
pytest tests/ -v
Code Quality
ruff check . # Linting
mypy . # Type checking
pytest tests/ -v # Tests
Support
If you find this library useful, consider buying me a coffee ☕
License
MIT License - see LICENSE file for details.
Built with ❤️ for the Israeli air quality monitoring community.
Metadata
Release files for air-sviva-api 0.0.4
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| air_sviva_api-0.0.4.tar.gz | 133.1 kB | Without provenance | Details for air_sviva_api-0.0.4.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| air_sviva_api-0.0.4-py3-none-any.whl | Python 3 | none | any | Details for air_sviva_api-0.0.4-py3-none-any.whl |
Total release size: 161.1 kB
Release files / air_sviva_api-0.0.4.tar.gz
| Download URL | air_sviva_api-0.0.4.tar.gz |
|---|---|
| Size | 133.1 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
e2ffc6fb058368b941013e1d3fa3e3e689844a6a7569d960f8b8c9545f5183be
|
|
BLAKE2b-256 checksum How to use checksums |
e28302b0c22e93a6647043385da2b391cc7467a6543fe897c5e61d40fb63880c
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
uv/0.11.25 {"installer":{"name":"uv","version":"0.11.25","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}
|
Release files / air_sviva_api-0.0.4-py3-none-any.whl
| Download URL | air_sviva_api-0.0.4-py3-none-any.whl |
|---|---|
| Size | 28.0 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
1ac6823db31ea5182814b0b25cc6fc738bc7b67218bc33d6df4115bf2010b3ae
|
|
BLAKE2b-256 checksum How to use checksums |
8dd83b7812a522f4722f582e6c752ff2691e3fd9ea7221208a791bfdecadc514
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
uv/0.11.25 {"installer":{"name":"uv","version":"0.11.25","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}
|
Security for air-sviva-api 0.0.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.
To learn more about protecting yourself from malicious actors, visit our package security documentation.