Logo Lanfrica

Benness001/weather-etl-pipeline

Record type:

software
Creator:
Ben
Host:
Automated hourly ETL pipeline for Lagos, Nigeria weather data β€” Python, SQL, Apache Airflow, Snowflake & Databricks # 🌀️Lagos Weather ETL Pipeline An automated data engineering pipeline that extracts real-time weather data for Lagos, Nigeria, transforms it into a structured format, and loads it into Snowflake β€” orchestrated hourly with Apache Airflow. --- ## Architecture OpenWeatherMap API β†’ Python ETL β†’ Apache Airflow β†’ Snowflake --- ## πŸ› οΈ Tech Stack | Layer | Tool | |----------------|-------------------------| | Data Source | OpenWeatherMap API | | Language | Python 3.12 | | Orchestration | Apache Airflow 2.9.1 | | Data Warehouse | Snowflake | | Environment | Ubuntu/WSL | --- ## πŸ“ Project Structure ``` weather_pipeline/ β”œβ”€β”€ airflow/ β”‚ └── dags/ β”‚ └── weather_dag.py # Airflow DAG β€” orchestrates ETL hourly β”œβ”€β”€ notebooks/ β”‚ └── weather_etl_databricks.py # Databricks notebook version β”œβ”€β”€ scripts/ β”‚ β”œβ”€β”€ __init__.py β”‚ β”œβ”€β”€ extract.py # Pulls data from OpenWeatherMap API β”‚ β”œβ”€β”€ transform.py # Cleans and structures raw data β”‚ └── load.py # Loads data into Snowflake β”œβ”€β”€ snowflake/ β”‚ └── weather_table.sql # Snowflake table setup script β”œβ”€β”€ .env.example # Credentials template β”œβ”€β”€ .gitignore # Ignores .env and sensitive files β”œβ”€β”€ requirements.txt # Python dependencies β”œβ”€β”€ test_pipeline.py # Manual end-to-end test script └── README.md ``` --- ## βš™οΈ Setup Instructions ### 1. Clone the repo ```bash git clone github.com cd weather-pipeline ``` ### 2. Create and activate virtual environment ```bash python3 -m venv weather_venv source weather_venv/bin/activate ``` ### 3. Install dependencies ```bash pip install -r requirements.txt ``` ### 4. Create your `.env` file ```bash cp .env.example .env # Fill in your API keys and Snowflake credentials ``` ### 5. Set up Snowflake table Run the SQL in ` …