A real-time weather data pipeline that extracts live weather data from an API, transforms it using dbt, stores it in PostgreSQL, and visualizes it in Apache Superset — all orchestrated by Apache Airflow and containerized with Docker.
Live Data API --> Extract (Python) --> Transform (dbt) --> Load (PostgreSQL) --> Report (Superset)
^ ^
| |
Orchestrate & Automate (Apache Airflow)
Containerize (Docker)
Pipeline steps:
- Extract — Python script fetches current weather data for Baku from the Weatherstack API
- Transform — dbt cleans, deduplicates, and models the raw data into staging and mart layers
- Load — Transformed data is stored in PostgreSQL
- Report — Apache Superset visualizes the weather metrics (temperature, wind speed, visibility, feels like)
- Orchestrate — Apache Airflow runs the pipeline every 50 minutes automatically
- Containerize — The entire stack runs with Docker Compose
data_weather_project/
├── api_request/
│ ├── api_request.py # Fetches weather data from Weatherstack API
│ └── insert_records.py # Connects to PostgreSQL and inserts records
├── airflow/
│ └── dags/
│ └── orchestrator.py # Airflow DAG: fetch → transform (every 50 min)
├── dbt/
│ ├── profiles.yml
│ └── my_project/
│ └── models/
│ ├── sources/ # Raw source definition
│ ├── staging/ # stg_weather_data (deduplicated)
│ └── mart/ # daily_average, weather_report
├── docker/
│ ├── docker-bootstrap.sh
│ ├── docker-init.sh
│ ├── superset_config.py
│ └── .env
├── postgres/
│ ├── airflow_init.sql
│ └── superset_init.sql
└── docker-compose.yaml
| Tool | Purpose |
|---|---|
| Python | Extract weather data from API |
| PostgreSQL | Store raw and transformed data |
| dbt | Data transformation and modeling |
| Apache Airflow | Pipeline orchestration & scheduling |
| Apache Superset | Data visualization & dashboards |
| Docker & Docker Compose | Containerization of all services |
| Model | Type | Description |
|---|---|---|
stg_weather_data |
Table | Deduplicates raw records, converts UTC offset |
daily_average |
Table | Daily average temperature and wind speed per city |
weather_report |
Table | Clean weather report with all key metrics |
Fields tracked: temperature, feelslike, visibility, wind_speed, weather_descriptions, city, time
| Service | Port |
|---|---|
| PostgreSQL | 5000 |
| Apache Airflow | 8000 |
| Apache Superset | 8088 |
| Redis | 6379 |
- Docker & Docker Compose installed
- Weatherstack API key (weatherstack.com)
git clone https://github.com/RashadHummatov85/Data_weather_project.git
cd Data_weather_projectAdd your API key to api_request/api_request.py:
api_key = "your_weatherstack_api_key"Start all services:
docker-compose up -dAccess the UIs:
- Airflow: http://localhost:8000
- Superset: http://localhost:8088
The Superset dashboard tracks real-time weather metrics for Baku:
- Average Temperature
- Average Wind Speed
- Sum of Visibility
- Feels Like temperature