feat: weather client

This commit is contained in:
2026-09-16 02:04:08 +03:00
parent 96ea436a8f
commit 598242d615
2 changed files with 26 additions and 1 deletions
+14
View File
@@ -0,0 +1,14 @@
import os
from cnet import json
def get_weather(lat: str, lon: str):
base_url = os.getenv(
"WEATHER_API_BASE_URL", "https://api.openweathermap.org/data/2.5/forecast"
)
api_key = os.getenv("WEATHER_API_KEY", "no")
print(f"api_key: {api_key}")
url = f"{base_url}?lat={lat}&lon={lon}&appid={api_key}&units=metric&lang=ru"
return json(url)