An end-to-end data engineering project built to demonstrate production-grade data pipeline skills using modern tools and cloud technologies.
Alpha Vantage API → Azure Function → Kafka/Event Hubs
↓
Bronze Layer (Raw JSON)
↓
Silver Layer (Parquet)
↓
Gold Layer (Aggregates)
↓
Delta Lake (ACID)
↓
dbt Models → DuckDB → Power BI
| Layer | Technology |
|---|---|
| Ingestion | Python, Alpha Vantage API |
| Streaming | Apache Kafka / Azure Event Hubs |
| Storage | Azure Data Lake Storage Gen2 |
| File Format | Parquet, Delta Lake |
| Transformation | Python, Pandas, PySpark |
| Modelling | dbt (data build tool) |
| Orchestration | Apache Airflow |
| Warehouse | DuckDB, Azure Synapse Analytics |
| Data Quality | Great Expectations, dbt tests |
| AI Feature | NL-to-SQL with Claude AI |
| CI/CD | GitHub Actions, Docker |
| Visualisation | Power BI |
stock-data-pipeline/
│
├── ingestion/ # Data ingestion scripts
│ ├── fetch_stock_data.py # Alpha Vantage API ingestion
│ └── nl_to_sql.py # NL-to-SQL AI engine
│
├── transformation/ # Data transformation scripts
│ ├── transform_stock_data.py # Bronze to Silver
│ ├── build_gold_layer.py # Silver to Gold
│ └── delta_lake.py # Delta Lake conversion
│
├── stock_analytics/ # dbt project
│ ├── models/
│ │ ├── staging/ # Staging models + tests
│ │ └── marts/ # Business ready models
│ └── dbt_project.yml
│
├── orchestration/ # Airflow DAGs
│ └── stock_pipeline_dag.py
│
├── docker/ # Docker configuration
│ └── Dockerfile
│
├── docker-compose.yml # Airflow stack
├── requirements.txt # Python dependencies
└── README.md
This project implements the Medallion Architecture:
- Bronze Layer — Raw JSON data exactly as received from Alpha Vantage API
- Silver Layer — Cleaned and validated Parquet files with engineered features
- Gold Layer — Business ready aggregates for dashboards and reporting
- Delta Layer — ACID compliant Delta Lake tables with time travel support
Fetches daily stock data for AAPL, MSFT, GOOGL, AMZN and META from Alpha Vantage API with idempotent loading to prevent duplicates.
- Calculates daily returns, 7/30 day moving averages and volatility
- Validates data quality before loading to Silver layer
- Builds business ready Gold layer aggregates
- Converts Parquet files to Delta format with ACID transactions
- Supports time travel queries to audit historical data
- Upsert (MERGE) operations prevent data duplication
- Staging models clean and standardise raw data
- Mart models build business ready views with performance labels
- 7 automated data quality tests
- Auto generated documentation with data lineage
- Full pipeline runs automatically at 6pm every weekday
- Three task DAG: ingest → transform → gold layer
- Containerised with Docker for reproducibility
Natural language interface for querying stock data:
Question: Which stock had the highest closing price today?
Generated SQL: SELECT symbol, close FROM mart_daily_summary
ORDER BY close DESC LIMIT 1
Result: GOOGL 189.42
- Python 3.11+
- Docker Desktop
- Anaconda
# Clone the repo
git clone https://github.com/Dinesh-0707/stock-data-pipeline.git
cd stock-data-pipeline
# Install dependencies
pip install -r requirements.txt
# Set up environment variables
cp .env.example .env
# Add your Alpha Vantage API key to .env
# Start Airflow
docker-compose up -d
# Run ingestion manually
python ingestion/fetch_stock_data.py
# Run transformation
python transformation/transform_stock_data.py
python transformation/build_gold_layer.py
# Run dbt models
conda run -n dbt-env dbt run --project-dir stock_analytics
conda run -n dbt-env dbt test --project-dir stock_analyticsThis project was built to match real data engineer job requirements:
| Requirement | Implementation |
|---|---|
| Pipeline architecture | End-to-end medallion architecture |
| ETL/ELT pipelines | Python + dbt |
| Apache Airflow | Automated DAG scheduling |
| Spark / big data | PySpark ready architecture |
| dbt | Full models, tests, docs |
| Delta Lake | ACID transactions + time travel |
| Data quality | dbt tests + Great Expectations |
| Cloud (Azure) | ADLS Gen2 + Synapse ready |
| BI layer | dbt semantic layer + Power BI |
| AI features | NL-to-SQL with Claude AI |
| CI/CD | GitHub Actions + Docker |
Dinesh — MSc AI with Business, Aston University
github.com/Dinesh-0707


