Fleet Dashboard

A Python-powered GPS tracking dashboard that transforms CSV fleet data into an interactive, real-time visualization. Monitor 30+ devices across Australia with status indicators, battery levels, and geographic mapping.

Python Data Visualization Leaflet.js CSV Processing
Active
18
Idle
6
Offline
4
Low Battery
2
πŸ“ 30 Devices Tracked
30+
GPS Devices
4
Status Types
20+
Cities Covered
100%
Pure Python

Key Features

Comprehensive fleet management capabilities built with Python and modern web technologies

πŸ—ΊοΈ

Interactive Map

Real-time geographic visualization using Leaflet.js with color-coded markers for each device status. Hover tooltips and click popups for detailed information.

πŸ“Š

Live Status Dashboard

Instant overview of fleet health with summary cards showing Active, Idle, Offline, and Low Battery counts. Visual battery level indicators with color-coded bars.

πŸ”‹

Battery Monitoring

Track device battery levels with visual progress bars. Color-coded system (green/yellow/red) for quick identification of devices needing attention.

πŸ“

Location Tracking

GPS coordinates mapped to Australian cities. See device distribution across Sydney, Melbourne, Brisbane, Perth, Adelaide, and 15+ other locations.

⏱️

Last Seen Timestamps

Human-readable "time ago" format (e.g., "5 min ago", "2 days ago") with full timestamp on hover. Quickly identify stale or offline devices.

πŸ§ͺ

Testing Mode

Built-in data injection for stress testing. Add edge cases like negative battery, null coordinates, duplicates, and off-map positions with CLI flags.

Tech Stack

Zero external dependencies - built entirely with Python standard library and modern web APIs

Python 3.6+
Core language, CSV parsing, datetime processing
CSV Module
Read and write fleet status data from CSV files
JSON Module
Serialize device data for JavaScript consumption
Pathlib
Cross-platform file path handling
Leaflet.js 1.9
Interactive map with markers, popups, and tooltips
CARTO Basemaps
Clean, minimal map tiles for professional look
HTML/CSS/JS
Responsive dashboard with CSS Grid and modern styling
CLI Arguments
--inject and --reset flags for testing workflows
# Fleet GPS Dashboard Generator import csv import json from pathlib import Path # Read CSV and process device data with CSV_PATH.open(newline="") as f: devices = list(csv.DictReader(f)) # Generate interactive HTML dashboard html = generate_dashboard(devices) OUT_PATH.write_text(html)

How It Works

Simple three-step process from raw data to interactive dashboard

1

Read CSV Data

Python script parses fleet_status.csv containing device IDs, names, status, battery levels, GPS coordinates, timestamps, and location names.

2

Process & Transform

Data is cleaned, types converted (ints, floats, datetimes), time-ago calculations performed, and status summary aggregated. JSON data prepared for frontend.

3

Generate HTML

Self-contained HTML file created with embedded CSS, JavaScript, and device data. Leaflet.js renders interactive map with color-coded markers and popups.

Data Structure

CSV format with comprehensive device tracking information

Column Type Description Example
device_id String Unique device identifier GPS-001
name String Human-readable device name Fleet Alpha
status Enum active, idle, offline, or low_battery active
battery_pct Integer Battery level (0-100) 95
lat Float Latitude coordinate -33.780734
lon Float Longitude coordinate 151.51943
last_seen DateTime Timestamp (YYYY-MM-DD HH:MM:SS) 2026-05-27 07:30:00
location String City or area name Sydney

Ready to Explore?

View the live dashboard or check out the source code to see how it all works