BenzaTracker · Multi-Interface Automotive Fuel & Cost Analytics
Comprehensive vehicle fuel consumption and Total Cost of Ownership (TCO) analytics system written in Python. Features a shared SQLite relational backend accessible simultaneously through an interactive Command-Line Interface, a native Desktop GUI, and a responsive Flask web dashboard, with automated executive PDF report generation via ReportLab.
Real-World Automotive Fuel Economy & Cost Telemetry
On-board vehicle trip computers routinely overestimate fuel efficiency by 5% to 9% compared to physical pump measurements. [BenzaTracker](https://github.com/FrancescoCastaldi/BenzaTracker) was engineered to maintain an exact full-to-full refueling ledger, computing real-world `km/L`, `L/100km`, rolling average fuel prices (`€/L`), and kilometric operating costs.
Multi-Interface Architecture Matrix
| Subsystem Layer | Technology Stack | Primary Use Case | Key Output |
|---|---|---|---|
| Core Storage & Analytics | Python 3, SQLite3, Pandas | ACID refueling ledger & full-to-full delta math | Rolling `km/L`, seasonal thermal variance, `€/km` |
| Web Dashboard | Flask, Jinja2, Chart.js | Mobile & LAN browser logging at the fuel station | Interactive consumption & fuel price time-series |
| Desktop & CLI Interfaces | Tkinter GUI & Rich CLI | Rapid workstation inspection and batch CSV import | Instant terminal summaries and anomaly flags |
| Executive Reporting | ReportLab & Matplotlib | Annual tax/accounting & fleet audit export | Multi-page vector PDF dossier with embedded charts |
*Table 1: BenzaTracker Multi-Interface Architectural Layers*
# Python: Full-to-full refueling efficiency and kilometric cost calculation
def compute_refuel_metrics(prev_odometer_km: float, curr_odometer_km: float, liters: float, total_euro: float) -> dict:
delta_km = curr_odometer_km - prev_odometer_km
if delta_km <= 0 or liters <= 0:
raise ValueError("Invalid odometer delta or fuel volume")
km_per_liter = delta_km / liters
liters_per_100km = (liters / delta_km) * 100.0
cost_per_km = total_euro / delta_km
return {
"delta_km": round(delta_km, 1),
"km_per_l": round(km_per_liter, 2),
"l_100km": round(liters_per_100km, 2),
"euro_per_km": round(cost_per_km, 4),
}Key Takeaways
- Thermal Efficiency Correlation: Tracks seasonal hybrid efficiency variations (winter cold-start enrichment vs summer optimal hybrid battery operation). - Automated PDF Dossiers: Generates publication-ready statistical reports with a single command.
