From a0b0953eb98cf430738cb004756829cb1181fb87 Mon Sep 17 00:00:00 2001 From: Prashii06 Date: Sat, 26 Jul 2025 00:08:38 +0530 Subject: [PATCH 1/2] Updated app.py to include wind speed as a factor --- app.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/app.py b/app.py index 82ed4e24..0c19f84e 100644 --- a/app.py +++ b/app.py @@ -34,10 +34,12 @@ if "error" in weather: st.error(weather["error"]) else: - col1, col2, col3 = st.columns(3) + col1, col2, col3,col4 = st.columns(4) col1.metric("Temperature (°C)", weather["temperature"]) col2.metric("Feels Like (°C)", weather["feels_like"]) col3.metric("Humidity (%)", weather["humidity"]) + #Added a factor wind speed and coverted m/s to km/hr + col4.metric("Wind Speed (km/hr)", round(weather["wind_speed"]*3.6, 2)) st.write(f"**Description:** {weather['description'].capitalize()}") st.image(f"http://openweathermap.org/img/wn/{weather['icon']}@2x.png") From 4ec5e6e02e9d69f1081e8225c4b09dcf8076f17b Mon Sep 17 00:00:00 2001 From: Prashii06 Date: Sat, 26 Jul 2025 00:09:09 +0530 Subject: [PATCH 2/2] Updated weather.py to include wind speed --- utils/weather.py | 1 + 1 file changed, 1 insertion(+) diff --git a/utils/weather.py b/utils/weather.py index bbbfa7f7..7021be86 100644 --- a/utils/weather.py +++ b/utils/weather.py @@ -19,6 +19,7 @@ def get_current_weather(city_name, lat, lon): "temperature": data["main"]["temp"], "feels_like": data["main"]["feels_like"], "humidity": data["main"]["humidity"], + "wind_speed": data["wind"]["speed"], "description": data["weather"][0]["description"].title(), "icon": data["weather"][0]["icon"] }