AeroPulse ingests live aircraft data from the OpenSky Network, lands it in a medallion lakehouse (bronze → silver → gold) built with dbt on DuckDB, flags anomalous flights with an Isolation Forest (scikit-learn), and serves it on an interactive Streamlit dashboard. It is built to demonstrate the full modern data-engineering lifecycle end to end.
Status: the batch analytics pipeline runs today with no external services — ingestion → DuckDB → dbt (silver + gold) → anomaly model → dashboard. Every layer is tested. A
seedgenerator builds a full bronze table offline, so the whole warehouse can be rebuilt on a fresh clone without touching the network. An optional streaming layer (Kafka + Spark + Airflow) is included for when a Docker environment is available.
Run streamlit run dashboard/app.py for an interactive page showing every
aircraft it has captured: a live dark map (points or density), a flight-phase
breakdown, an altitude-vs-speed flight envelope, busiest registration countries,
altitude distribution, and airborne traffic over time. The Capture live
snapshot button pulls a fresh moment from OpenSky and appends it — many
snapshots become a time series.
What it answers: where aircraft are right now, how many are airborne, how high/fast, how congested the sky is, and how traffic trends over time — situational awareness of the kind airlines, airports, air-traffic management, logistics, and flight-tracking products (FlightRadar24, FlightAware) rely on.
Region is configurable. The map defaults to the continental US, but the
bounding box in config.py (or .env) can watch Europe, Asia, or the globe.
Note that origin country is where each aircraft is registered (its flag),
not its route — so a US box still shows many nationalities of foreign carriers.
┌──────────────────────────────────────────────┐
│ AeroPulse │
└──────────────────────────────────────────────┘
OpenSky REST API
│ (live aircraft state vectors)
▼
┌───────────┐ ┌──────────┐ ┌──────────┐ ┌──────────┐
│ Ingestion │ ──► │ BRONZE │ ──► │ SILVER │ ──► │ GOLD │
│ (Python) │ │ raw │ │ clean │ │ marts │
└───────────┘ │ Parquet+ │ │ (dbt) │ │ (dbt) │
│ │ DuckDB │ └──────────┘ └────┬─────┘
│ └──────────┘ │
│ ┌────────────┴───────────┐
│ ▼ ▼
│ ┌────────────┐ ┌──────────────┐
│ │ Isolation │ │ Streamlit │
│ │ Forest │ │ dashboard │
│ └────────────┘ └──────────────┘
│
└───────── optional streaming layer (needs Docker) ──────────┐
Kafka (producer/consumer) → Spark Structured │
Streaming → same BRONZE, orchestrated by Airflow │
▼
- Bronze — raw data exactly as captured, append-only, never edited. The source of truth. If anything downstream breaks, we can always rebuild from here.
- Silver — cleaned and typed: valid coordinates, deduplicated, sensible units.
- Gold — business-ready aggregate tables ("marts") that dashboards and models read directly (e.g. flights per country, airborne count over time, congestion).
Separating capture from transformation is the core discipline of data engineering: keep the raw data safe, and every downstream mistake is fixable by re-running a transform.
| Layer | Tool | Role |
|---|---|---|
| Ingestion | Python + requests |
Pull live state vectors from OpenSky |
| Storage | DuckDB + Parquet | Local analytical warehouse (no server) |
| Transform | dbt | Version-controlled, tested SQL (silver + gold) |
| Modeling | scikit-learn (Isolation Forest) | Unsupervised anomaly detection |
| Serving | Streamlit + pydeck/plotly | Interactive map + charts |
| Streaming (optional) | Kafka + Spark + Airflow | Real-time ingestion + orchestration (Docker) |
# 1. Install dependencies
pip install -r requirements.txt
# 2. Capture a live snapshot of every aircraft over the US into bronze
PYTHONPATH=src python -m aeropulse.ingest
# 3. (or) keep capturing every 60 seconds to build a time series
PYTHONPATH=src python -m aeropulse.ingest --loop 60Data lands in data/ (a DuckDB file plus partitioned Parquet). Query it with SQL:
import duckdb
con = duckdb.connect("data/aeropulse.duckdb")
con.sql("select origin_country, count(*) from bronze.state_vectors "
"where on_ground = false group by 1 order by 2 desc limit 5").show()Configuration (bounding box, paths, optional OpenSky credentials) is in
src/aeropulse/config.py and overridable via environment variables — see
.env.example.
No live capture required — the seed generator writes a full, deterministic
bronze table (with a few deliberately impossible flights mixed in) so the whole
lakehouse rebuilds offline:
# 1. Seed bronze.state_vectors with synthetic-but-realistic traffic
PYTHONPATH=src python -m aeropulse.seed
# 2. Build silver + gold with dbt, running every schema test on the way
dbt build --project-dir dbt --profiles-dir dbt
# 3. Score the gold layer and write gold.flight_anomalies
PYTHONPATH=src python -m aeropulse.anomalydbt materialises silver.stg_state_vectors (a cleaned, unit-converted view) and
the gold marts fct_flights, traffic_by_snapshot, and busiest_countries,
enforcing not_null / unique / accepted_values tests at every hop. The
Isolation Forest then learns the normal flight envelope from gold.fct_flights
and ranks each aircraft by how far outside it sits — the seeded impossible
flights land at the top.
The OpenSky API is free. It meters usage with daily "credits" (a rate-limit
quota, not money). A /states/all request costs 1–4 credits depending on the
bounding-box area; the continental-US box costs 4. Free quotas:
| Tier | Credits/day | ≈ snapshots/day (US box) |
|---|---|---|
| Anonymous (default) | 400 | ~100 |
| Free account | 4,000 | ~1,000 |
Each run prints free credits left today: N so you can see your balance. For
continuous collection, poll every ~15 min (anonymous), shrink the box (a box
≤ 25 sq° costs only 1 credit), or register a free OpenSky account. Running out
returns 429 and simply waits for the daily refill — you are never charged.
- Phase 1 — Ingestion. OpenSky → typed bronze (Parquet + DuckDB).
- Phase 4 — Dashboard. Streamlit live map + analytics (built early for visibility).
- Phase 2 — Transform. dbt silver (clean/dedupe) + gold marts, with tests.
- Phase 3 — Model. Isolation Forest anomaly detection on the gold layer.
- Phase 5 — Streaming. Kafka producer/consumer + Spark + Airflow (Docker).
MIT — see LICENSE.
