Weather Data
Extension Description
Get the weather data of any place on the earth with open weather API.
- Available in: Block Coding, Python Coding
- Mode: Stage Mode
- WiFi Required: Yes
- Compatible Hardware in Block Coding: evive, Quarky, Arduino Uno, Arduino Mega, Arduino Nano, ESP32, T-Watch, Boffin, micro:bit, TECbits, LEGO EV3, LEGO Boost, LEGO WeDo 2.0, Go DFA, None
- Compatible Hardware in Python: Quarky, None
- Object Declaration in Python: weather = WeatherData()
- Extension Catergory: Other
Introduction
The Weather Data extension allows users to get the weather data of the majority of locations on the earth using the latitude or longitude of the location.
It uses Open Weather Map API to fetch the data. Thus it requires an active internet to perform the result.
The following data is available for the user:
- Weather: Group of weather parameters (Rain, Snow, Extreme, etc.)
- Temperature:
- Current in Celcius
- Max in Celcius: Maximum temperature at the moment. This is the maximal currently observed temperature (within large megalopolises and urban areas).
- Min in Celcius: Minimum temperature at the moment. This is the minimal currently observed temperature (within large megalopolises and urban areas).
- Current in Fahrenheit
- Max in Fahrenheit
- Min in Fahrenheit
- Pressure: Atmospheric pressure (on the sea level, if there is no sea_level or grnd_level data), hPa
- Humidity: %
- Wind Speed: Wind speed. Unit Default: meter/sec
- Wind Direction: Wind direction, degrees (meteorological)
- Latitude: City geolocation, latitude
- Longitude: City geolocation, longitude
- Time
- Data Capture:
- Sunrise
- Sunset
- City
Read More
PictoBlox Blocks
All articles loaded
No more articles to load
Python Functions
The function runs an API call to get the weather data of the location specified with the Longitude and Latitude.
Syntax: getweather(latitude = 23.02, longitude = 72.57)
The function returns the weather parameters (Rain, Snow, Extreme, etc.) of the location.
Syntax: weather()
The function returns the temperature, minumun, and maximum temperature of the location.
Syntax: temp(temp_type = “C”)
The function returns the atmospheric pressure (on the sea level, if there is no sea_level or grnd_level data), in hPa of the location.
Syntax: pressure()
The function returns the humidity in % of the location.
Syntax: humidity()
The function returns the wind speed (Unit Default: meter/sec) of the location.
Syntax: windspeed()
The function returns the wind direction (in degrees – meteorological) of the location.
Syntax: winddirection()
The function returns the latitude of the location.
Syntax: latitude()
The function returns the longitude of the location.
Syntax: longitude()
The function returns the time data of the location when data capture, sunrise, or sunset happens.
Syntax: time(capture_time = “sunrise”)
The function returns the city name of the location.
Syntax: city()
The function set the API keys for the Open Weather Map API calls.
Syntax: setAPI(openweathermap_API)
All articles loaded
No more articles to load
Table of Contents