This project is a fully automated ETL data pipeline built using Apache Airflow 2.9+, PostgreSQL, and the public NASA Astronomy Picture of the Day (APOD) API.
The pipeline fetches NASA’s daily image metadata, processes it, and stores it in a Postgres database for analytics and downstream use.
The goal of this pipeline is simple:
-
Extract Fetch latest APOD data using NASA API.
-
Transform Parse JSON response and clean required fields.
-
Load Store final dataset into a PostgreSQL table.
The pipeline runs every day using Airflow’s modern scheduling system (schedule="@daily").
-
Apache Airflow 2.9+
-
PostgreSQL
-
Docker / Docker Compose
-
Airflow Providers
apache-airflow-providers-httpapache-airflow-providers-postgres
-
Python 3.12
-
Requests library
.
├── dags/
│ └── etl.py
├── docker-compose.yml
├── requirements.txt
└── README.md
| Task | Description |
|---|---|
| extract_apod | Calls NASA API (HTTP GET) |
| transform_apod | Cleans and prepares JSON fields |
| load_apod | Inserts cleaned row into Postgres |
Add these in .env or Airflow UI → Variables:
NASA_API_KEY=your_api_key_here
POSTGRES_CONN_ID=postgres_default
git clone https://github.com/your-username/nasa-apod-airflow.git
cd nasa-apod-airflowpip install -r requirements.txt
docker compose up -dGo to: http://localhost:8080
Enable the DAG → watch the ETL pipeline run.
CREATE TABLE nasa_apod (
date DATE PRIMARY KEY,
title TEXT,
explanation TEXT,
media_type TEXT,
url TEXT
);
| date | title | media_type | url |
|---|---|---|---|
| 2025-01-02 | Galaxy View | image | https://apod.nasa.gov/... |
✔ Real ETL workflow ✔ Scheduling + automation ✔ API → Airflow → Postgres pipeline ✔ Industry-standard stack ✔ Recruiter-friendly, perfect for Data Engineer intern roles
Feel free to fork this project and improve the transformations, add logging, or build Dash/Streamlit dashboards on top of the dataset.
MIT License
Just tell me and I’ll add it!