File size: 670 Bytes
a9814b6
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
import asyncio
from services.location_service import get_location_details
from services.weather_service import fetch_current_weather


async def debug():
    try:
        query = "New York"
        print(f"Resolving location for {query}...")
        location = await get_location_details(query)
        print(f"Location: {location}")

        print(f"Fetching weather for {location.lat}, {location.lon}...")
        weather = await fetch_current_weather(float(location.lat), float(location.lon))
        print(f"Weather: {weather}")
    except Exception as e:
        import traceback

        traceback.print_exc()


if __name__ == "__main__":
    asyncio.run(debug())