LOGISTICS & DATA ENGINEERING · BY GUSTAVO

Logistics
Analytics

I became interested in logistics because delivery delays and transport costs turn data into practical decisions. This project processes 20,000 shipment records with Python and PostgreSQL, validates their quality, and produces metrics for delivery reliability, duration overruns and fuel expense across routes and transport modes.

Explore the results
Data after validation20K

Accepted shipments
18 required fields checked

Delivery reliability50%

Shipments on time
10,000 of 20,000 records

Average delay17.0h

For delayed shipments
Based on 10,000 delayed records

Weighted fuel expense$1.705

Per kilometre travelled
Total fuel expense ÷ total distance

The Reporting Layer Must Agree Before Decisions Follow

I built the validation, transformation and PostgreSQL reporting path so the same shipment produces the same metric in Python and SQL. The included snapshot has 20,000 accepted records and no rejects. Its 50% on-time rate is an observed dataset result, not a measured improvement in a company’s delivery performance.

Repeat Loads Preserve Facts and Reporting Consistency

01

Validate before publication

Check 18 required fields, ranges, IDs and status/duration agreement. Invalid rows keep their source row and failure reasons. The default quality gate allows zero rejected records.

02

Load in one transaction

Upsert shipment facts and dimensions, then refresh six materialized views. Unchanged inputs preserve fact counts and load timestamps; changed records update by shipment ID.

03

Verify the failure paths

Integration tests compare all six SQL views with Python KPIs and exercise rollback, repeat loads and changed records. CI also executes three notebooks on Python 3.11 and 3.12.

Transaction and publication design · Validation and test scope

Delivery Reliability, Travel Time and Fuel Expense

Select a transport mode.
Compare time, expense and routes.

01 / DELIVERY RELIABILITYShare of shipments

Half of Recorded Shipments Arrive on Time

Rail, ship and truck all sit close to 50% on time. The gap between the highest and lowest mode is less than one percentage point, so mode alone does not identify a strong reliability advantage in this snapshot.

On timeDelayed

Delivery reliability by transport mode

10,000 on time · 10,000 delayed · 20,000 shipments
Select a mode to inspect its shipment counts. Each bar represents 100% of that mode's records. View source
02 / TRAVEL TIMESAverage hours

Trips Average 7.52 Hours Longer Than Planned

Actual duration averages 79.56 hours versus 72.04 hours planned: a 7.52-hour gap, calculated before rounding. This average includes on-time and delayed shipments; the 17.01-hour delay figure uses only the 10,000 delayed records.

PlannedActual

Planned and actual shipment duration

All modes · Planned 72.0h · Actual 79.6h
Average durations include all accepted shipments. The 17.0-hour delay metric above uses delayed shipments only. View source
03 / FUEL EXPENSEUSD per kilometre

Fuel Ratios Differ by Less Than $0.02 per Kilometre

Weighted fuel expense ranges from $1.695/km for ship to $1.714/km for rail; truck is $1.701/km. The ratio divides each mode’s total fuel expense by its total distance, rather than averaging individual trip ratios.

Weighted fuel expense per kilometre

All modes · $1.705 per kilometre

The small spread does not justify a mode-switch recommendation by itself. Review comparable routes, distance and shipment mix first. These figures cover fuel expense only, not total operating cost or profit.

Ratios use total fuel expense divided by total distance. They cover fuel expense, excluding other operating costs. View source
04 / ROUTE REVIEWSix leading routes

Route Volume and Delay Rates Guide Review

Switch between shipment volume and delayed share to distinguish busy routes from high-rate routes. Every displayed route has at least 100 records; a high percentage alone does not show how many shipments are affected.

Shipments per route

Shipment volume and delayed share by route

Each displayed route has at least 100 shipments. These patterns help direct a review; they do not explain the cause of delays. View source

A Reproducible Reporting Pipeline, with a Clear Data Boundary

I built atomic Parquet publication, quarantined rejects, transaction-safe database loads and consistent Python/SQL metrics. The manifest records input checksum, row counts and whether the database phase ran. Source dates, carrier identities, revenue and leg-level sequence are absent, so the next extension requires better source fields before monthly trends or delay prediction.

18 required fieldsZero-rejection quality gate6 KPI tablesRepeat loads without duplicates
Explore on GitHub

Reviewed 22 October 2026 against the project README and linked evaluation reports. Figures describe the documented dataset or test run.

BEHIND THE EXECUTIVE SUMMARY

Technical details