buncha stuff

This commit is contained in:
2024-07-23 09:25:57 -07:00
parent 9f2cfa3849
commit 31cc007c70
20 changed files with 441 additions and 99 deletions

View File

@@ -8,27 +8,26 @@ API_KEY = "99631af2d6db903d1f689c7d2cb13764"
CITY_ID = "5809844"
UNITS = "metric"
def celsius_to_fahrenheit(celsius):
return (celsius * 9 / 5) + 32
def get_weather_icon(description):
icons = {
"clear sky": "󰖙",
"few clouds": "",
"scattered clouds": "",
"broken clouds": "",
"overcast clouds": "",
"shower rain": "",
"light rain": "",
"rain": "",
"moderate rain": "",
"thunderstorm": "",
"snow": "",
"mist": "󰖑",
"haze": "󰖑",
"smoke": "󱞙"
"clear sky": "☀️",
"few clouds": "🌤️",
"scattered clouds": "🌥️",
"broken clouds": "☁️",
"overcast clouds": "☁️",
"shower rain": "🌦️",
"light rain": "🌧️",
"rain": "🌧️",
"moderate rain": "🌧️",
"thunderstorm": "⛈️",
"snow": "❄️",
"mist": "🌫️",
"haze": "🌫️",
"smoke": "🌫️",
}
return icons.get(description, "")
@@ -39,6 +38,7 @@ try:
)
response.raise_for_status()
weather_data = response.json()
#print(weather_data)
weather_desc = weather_data["weather"][0]["description"]
#print(weather_desc)