Skip to content

Instantly share code, notes, and snippets.

@graphomania
Created November 9, 2020 10:53
Show Gist options
  • Save graphomania/f0723b6af5f8db1cd33beab90a179106 to your computer and use it in GitHub Desktop.
Save graphomania/f0723b6af5f8db1cd33beab90a179106 to your computer and use it in GitHub Desktop.
pyowm weather status to unicode emoji function
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