"""날씨 안내 계약. 관측값과 분리하고, 확인되지 않은 시설·영업시간은 쓰지 않는다.""" import json from functools import lru_cache from pathlib import Path @lru_cache(maxsize=1) def _templates() -> dict: return json.loads(Path(__file__).with_name("weather_notes.json").read_text(encoding="utf-8")) def weather_notes() -> dict: templates = _templates() sky = {key: list(lines) for key, lines in templates["sky"].items()} temperature = {key: list(lines) for key, lines in templates["temperature"].items()} return { "notes": {key: lines[0] for key, lines in sky.items()}, "tempNotes": {key: lines[0] for key, lines in temperature.items()}, "noteSets": sky, "tempNoteSets": temperature, }