here_location_services.destination_weather_api module
This module contains classes for accessing HERE Destination Weather API.
- class here_location_services.destination_weather_api.DestinationWeatherApi(api_key=None, auth=None, proxies=None, country='row')[source]
Bases:
here_location_services.apis.ApiA class for accessing HERE routing APIs.
- Parameters
api_key (Optional[str]) –
auth (Optional[here_location_services.platform.auth.Auth]) –
proxies (Optional[dict]) –
country (str) –
- __init__(api_key=None, auth=None, proxies=None, country='row')[source]
- Parameters
api_key (Optional[str]) –
auth (Optional[here_location_services.platform.auth.Auth]) –
proxies (Optional[dict]) –
country (str) –
- get_dest_weather(products, at=None, query=None, zipcode=None, hourly_date=None, one_observation=None, language=None, units=None)[source]
Retrieves weather reports, weather forecasts, severe weather alerts and moon and sun rise and set information.
See further information Here Destination Weather API <https://developer.here.com/documentation/destination-weather/dev_guide/topics/overview.html>_.
- Parameters
products (List[str]) – List of
DestWeatherProductidentifying the type of report to obtain.at (Optional[List]) – A list of
latitudeandlongitudespecifying the area covered by the weather report.query (Optional[str]) – Free text query. Examples: “125, Berliner, berlin”, “Beacon, Boston”
zipcode (Optional[str]) – ZIP code of the location. This parameter is supported only for locations in the United States of America.
hourly_date (Optional[Union[datetime.date, datetime.datetime]]) – Date for which hourly forecasts are to be retrieved. Can be either a date or datetime object
one_observation (Optional[bool]) – Boolean, if set to true, the response only includes the closest location. Only available when the product parameter is set to DEST_WEATHER_PRODUCT.observation.
language (Optional[str]) – Defines the language used in the descriptions in the response.
units (Optional[str]) – Defines whether units or imperial units are used in the response.
- Returns
requests.Responseobject.- Raises
ApiError – If
status_codeof API response is not 200.
- get_weather_alerts(geometry, start_time, id=None, weather_severity=None, weather_type=None, country=None, end_time=None, width=None)[source]
Retrieves weather reports, weather forecasts, severe weather alerts and moon and sun rise and set information.
See further information Here Destination Weather API <https://developer.here.com/documentation/destination-weather/dev_guide/topics/overview.html>_.
- Parameters
geometry (Union[geojson.geometry.Point, geojson.geometry.LineString]) – Point or LineString defining the route or a single location
start_time (datetime.datetime) – Start time of the event
id (Optional[str]) – Unique weather alert id.
weather_severity (Optional[int]) – Defines the severity of the weather event as defined in
WeatherSeverity.weather_type (Optional[str]) – Defines the type of the weather event as defined in
WeatherType.country (Optional[str]) – String for ISO-3166-1 2-letter country code.
end_time (Optional[datetime.datetime]) – End time of the event. If not present, warning is valid until it is not removed from the feed by national weather institutes (valid until warning is present in the response)
width (Optional[int]) – int
- Returns
requests.Responseobject.- Raises
ApiError – If
status_codeof API response is not 200.