Navigation
← All projects

Vienna Transit Pipeline

A late train. A question worth exploring.

Was the train late because of the weather, or was it just coincidence? I built a daily process that collects Vienna transport and weather data and brings them together for analysis.

Independent project · Collecting, organising and checking data each day with Python, Airflow, BigQuery and dbt.

The starting point

It started with a late U-Bahn.

Waiting for a delayed train in Vienna, I wondered whether the weather had something to do with it or whether it was simply coincidence. That everyday question became a data project: bring transit and weather observations together so the relationship could be explored.

Could weather and transit delays be related?

The problem behind it

The observations come from different sources, with different identifiers and collection times. Before investigating a relationship, the records need a dependable way to meet.

Project walkthrough

From a station to a weather-enriched record

  1. Connect locations

    I use the official route and stop files to identify locations, then match each stop to its nearest configured weather station. Saving that mapping avoids repeating the same work.

  2. Collect the observations

    Python requests transport and weather updates and stores them in BigQuery. The transport code reads the first listed line and departure and calculates delay where both planned and actual times are available.

  3. Keep missing information visible

    I match the observations by weather station and collection hour. When no weather record matches, the transport record remains. A missing value is more useful than quietly losing the whole observation.

  4. Repeat the process each day

    Airflow collects the data, runs the preparation steps and then checks the results. Failed tasks can be retried twice. Missed days are not automatically filled in.

Vienna Transit Pipeline

Project overview · Architecture illustration

Decision

Match the right station to the right weather

Station names alone are not enough to connect the sources. I use the official route and stop identifiers, then choose the nearest weather station from the configured locations. Python collects the data and retries requests when a service does not respond.

View the code ↗

Decision

Keep the journey, even when weather is missing

I keep the original observations in BigQuery, then use dbt and SQL to organise them for comparison. Transport and weather records are matched by location and the hour they were collected. If weather data is missing, the transport record stays in the table so that gap remains visible.

View the code ↗

Decision

Run the work in the right order

Airflow runs the daily sequence: collect the data, prepare the tables, then run the checks. Four tests look for missing required values. I also document what the fields mean so another reader can understand the output.

View the code ↗

Governance

Explain how the records are connected.

The report connects records by station and collection hour. Transport observations stay in the result even when weather is missing. Written field descriptions and four checks for missing values help another person understand and review the data.

Related governance examples

Evidence

Recorded project results

Recorded BigQuery output

Recorded daily orchestration

Source-to-mart model lineage

What to keep in mind

What the evidence establishes

This prepares data for investigating the weather question; it does not establish that weather caused a delay. Records are matched by collection hour rather than the exact time of each event. Missed daily runs are not filled in automatically. A next improvement is to make collection failures stop the run clearly instead of only logging some errors.

← More projectsDiscuss this project ↗