Hello! I am relatively new to coding. I am trying to pull live weather data using import python_weather, but i am not sure how to call the API through the code. Here is what I have so far. Any help would be greatly appreciated!
import python_weather
import asyncio
import os
async def get_weather(city_name):
async with python_weather.Client(unit=python_weather.IMPERIAL) as client:
weather = await client.get(city_name)
return weather
def parse_command(command):
if "weather" in command:
weather_description = asyncio.run(get_weather("Chicago"))
query = "System information: " + str(weather_description)
print(query)
response = assist.ask_question_memory(query)
done = assist.TTS(response)