File size: 600 Bytes
5194558
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
#!/usr/bin/env python3
"""Fetch and cache 30 years of Tokyo daily weather data."""

from __future__ import annotations

import sys
from pathlib import Path

sys.path.insert(0, str(Path(__file__).resolve().parents[1]))

from weatherpred.config import HISTORY_CSV_PATH, HISTORY_JSON_PATH
from weatherpred.data import fetch_historical_weather, save_history


def main() -> None:
    history = fetch_historical_weather()
    save_history(history)
    print(f"Wrote {len(history):,} rows to {HISTORY_CSV_PATH}")
    print(f"Wrote JSON copy to {HISTORY_JSON_PATH}")


if __name__ == "__main__":
    main()