feat(app): add html weather view

This commit is contained in:
2024-07-25 15:51:27 +03:00
parent 234a2b7b0e
commit b3d88997eb
22 changed files with 393 additions and 34 deletions

25
gismeteo/mock/__init__.py Normal file
View File

@@ -0,0 +1,25 @@
import json
from pathlib import Path
from typing import List
import dateparser
from gismeteo.api import WeatherValue
class MockData:
@property
def html(self) -> str:
return (Path(__file__).parent / "data/weather.html").read_text()
@property
def values(self) -> List[WeatherValue]:
data = json.loads((Path(__file__).parent / "data/weather.json").read_text())
return [
WeatherValue(**{**item, "date": dateparser.parse(item["date"])})
for item in data
]
MOCK_DATA = MockData()