This project is an end-to-end ETL pipeline that automatically fetches, processes, stores, and analyzes foreign exchange (FX) rates using the Frankfurter API. It leverages Apache Airflow for orchestration, Docker for containerization, and PostgreSQL as the storage layer. Additionally, the pipeline includes basic exploratory data analysis and volatility monitoring using Python and Jupyter.
- Apache Airflow: Workflow orchestration
- Docker: Containerized development
- PostgreSQL: Relational database
- pandas: Data manipulation
- SQLAlchemy: Python SQL toolkit
- Frankfurter API: Currency data source
- matplotlib: Visualization
- Extract: Daily FX rates are fetched from the Frankfurter API.
- Transform: The JSON response is parsed and converted to a structured pandas DataFrame.
- Load: Cleaned data is inserted into the
exchange_ratestable in PostgreSQL using SQLAlchemy. - Schedule: Airflow executes the ETL DAG once per day.
Each row includes:
amount: Always 1 (base value)base_currency: e.g., EURtarget_currency: e.g., USD, GBP, TRYrate: Daily FX ratedate: Corresponding date of the rate
The Jupyter notebook (analysis_fx_rates.ipynb) connects directly to PostgreSQL and performs several visual analyses:
EUR vs USD, GBP, and TRY plotted over time:
Helps spot sudden fluctuations in EUR/TRY rates:
Comparative view of daily volatility across currencies:
Tracks short-term vs long-term volatility:
![]()
Automated_FX_Tracker\airflow-docker
docker compose up --buildAccess the Airflow UI: http://localhost:8080
Default login:
- Username:
airflow - Password:
airflow
You can analyze the data independently with SQLAlchemy:
from sqlalchemy import create_engine
import pandas as pd
db_url = "postgresql+psycopg2://airflow:airflow@localhost:5433/airflow"
engine = create_engine(db_url)
query = "SELECT * FROM exchange_rates ORDER BY date DESC"
df = pd.read_sql(query, con=engine)This project is open-source and licensed under the MIT License. Intended for educational use.