## Weather Data ETL Project
This project collects, processes, and loads historical weather data for multiple cities into a PostgreSQL database. It allows analysis of daily and monthly weather patterns by city and region.

## Features
  Fetches daily weather data from **Open-Meteo API** for 2 years.
  Processes data:
    Handles missing values and duplicates
    Calculates average temperature, temperature range, and rain days
    Converts temperatures to Fahrenheit
    Aggregates data by city and region per month
  Loads data into **PostgreSQL** with upsert functionality
  Provides SQL queries for analysis:
    Total rows and city counts
    Top cities by precipitation
    Regional monthly statistics
    Last 30-day city temperature stats

## Data Structure
### Daily Weather (`weather_daily`)
| Column         | Description |
|----------------|-------------|
| date           | Date of observation |
| city           | City name |
| country        | Country code |
| region         | Geographic region |
| lat, lon       | Coordinates |
| tmax_c, tmin_c, tavg_c | Temperatures in Celsius |
| temp_range_c   | Max-min temperature |
| precip_mm      | Precipitation sum in mm |
| windmax_kmh    | Max wind speed in km/h |
| is_rain_day    | 1 if rain occurred, 0 otherwise |
| tmax_f, tmin_f, tavg_f | Temperatures in Fahrenheit |

### Monthly Aggregates
  `city_month_agg` - by city
  `region_month_agg` - by region

## Requirements
  Python 3.9+
  pandas
  requests
  tqdm
  SQLAlchemy
  psycopg2-binary
