Created
November 9, 2020 10:53
-
-
Save graphomania/f0723b6af5f8db1cd33beab90a179106 to your computer and use it in GitHub Desktop.
pyowm weather status to unicode emoji function
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def weather_status_to_emoji(status: str) -> str: | |
if status == "Clouds": | |
return u'\U00002601' | |
if status == "Clear": | |
return u'\U00002600' | |
if status == "Rain": | |
return u'\U00002614' | |
if status == "Extreme": | |
return u'\U0001F300' | |
if status == "Snow": | |
return u'\U00002744' | |
if status == "Thunderstorm": | |
return u'\U000026A1' | |
if status == "Mist": | |
return u'\U0001F32B' | |
if status == "Haze": | |
return u'\U0001F324' | |
if status == "notsure": | |
return u'\U0001F648' | |
else: | |
raise ValueError(f"Wrong status: {status}") |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment