get_current_weather

support.weather.get_current_weather(lat, lon, mode='json')

Get the weather at a certain latitude and longitude

Examples:

from support.weather import get_current_weather

# longitude and latitude in Abu Dhabi, UAE
lat_ad, lon_ad = 24.523338, 54.433461
resp = get_current_weather(lat_ad, lon_ad)
print(resp.json())
Parameters
  • lat (str/float) – latitude

  • lon (str/float) – longitude

  • mode (str, optional) – data type to request. Accepts “json” or “xml”

Returns

call the json method to get a dictionary

with weather data.

Return type

requests.Response