Skip to content

About

Data-driven EV charging infrastructure analytics platform built with Python, Streamlit, SQL, Power BI, and Plotly to identify high-demand regions, infrastructure gaps, and priority investment opportunities across Europe.

Resources

Stars

5 stars

Watchers

0 watching

Forks

Latest commit

 

History

148 Commits

Folders and files

Repository files navigation

🔋 EV Charging Infrastructure Demand Analysis

Python Streamlit MySQL Plotly Status

An end-to-end EV infrastructure analytics project that analyzes charging demand, identifies priority investment cities, and visualizes infrastructure gaps across city-level EV markets

Live Demo • Features • Usage • Screenshots • Power BI Dashboard


Table of Contents


Introduction

EV Charging Infrastructure Demand Analysis is a premium dark-theme analytics project designed to study EV adoption, charging infrastructure adequacy, and investment priority across European city-level markets. The solution combines a Streamlit dashboard, MySQL database, SQL analytical views, CSV-based exploration, and a Jupyter notebook workflow to support smarter charging network expansion.

The project follows a practical analytics pipeline: EV data is loaded from CSV → cleaned and standardized → stored in MySQL → queried through reusable SQL views → presented in an interactive Streamlit dashboard with KPIs, filters, trends, maps, and downloadable insights.

Why This Project Stands

  • 14,120+ records in the provided EV dataset
  • 27 analytical fields covering EV demand, station density, coverage gap, growth, and priority score
  • 8 dashboard sections including overview, priority cities, trends, geography, feature intelligence, SQL insights, forecast, and about
  • 6 SQL analytical views for business-ready EV infrastructure insights
  • Premium NVIDIA-inspired UI with black + neon green theme styling
  • CSV export support for filtered records and priority city summaries
  • 4-page Power BI dashboard (Executive Overview, Infrastructure & Priority, Growth & Forecasting, Country Analysis) with a matching dark "EV Command" theme

Features

Core Features

Feature Description
Interactive Dashboard Streamlit dashboard with premium dark UI and interactive controls
Priority City Analysis Ranks cities using priority_score, coverage_gap, and EV demand indicators
Infrastructure Gap Detection Highlights underserved cities with charging shortages
Trend Analysis Tracks monthly and yearly EV growth patterns across countries
Geographic Visualization Interactive city-level map for EV and charging metrics
SQL Insights Layer Six analytical views transformed into dashboard-ready business insights
Forecast Support Optional forecast tab when compatible forecast files are available
Data Export Download filtered dataset and priority-city outputs as CSV

Dashboard Experience

  • Dark Premium Theme with black and neon-green design language
  • Executive KPI Cards for EV demand, infrastructure availability, and coverage gaps
  • Advanced Sidebar Filters for geography, timeline, city tier, infrastructure status, and EV-per-station stress
  • Map-based Analytics using latitude/longitude city points
  • Interactive Plotly Visuals including bar, line, pie, bubble, and map charts
  • Download Actions for quick export of filtered business insights

Analytical Highlights

  • Overview Analytics for market-level KPIs and infrastructure health
  • Priority Cities Ranking to identify top investment opportunities
  • Trend Monitoring for month-on-month and year-over-year EV growth
  • Feature Intelligence to understand demand-driving variables
  • SQL Business Questions answered through reusable database views
  • Forecast-ready Architecture for future-demand extension

Tech Stack

Backend / Analytics

  • Python 3.9+
  • Pandas / NumPy — data processing and transformation
  • Scikit-learn — feature intelligence and model-style analysis
  • SQLAlchemy — database engine integration
  • PyMySQL — MySQL connectivity
  • python-dotenv — environment variable management

Frontend / Visualization

  • Streamlit — interactive dashboard framework
  • Plotly — advanced charts and geo visualizations
  • Matplotlib / Seaborn — supporting visualization ecosystem
  • Custom HTML/CSS — premium dashboard cards and layout styling

Database

  • MySQL 8.0+ — EV analytics storage layer
  • SQL Views — reusable business insight layer

Business Intelligence

  • Power BI — 4-page executive dashboard (Overview, Infrastructure & Priority, Growth & Forecasting, Country Analysis) for stakeholder-facing storytelling alongside the Streamlit app

Notebook Workflow

  • Jupyter Notebook — exploratory analysis and experimentation
  • CSV Dataset Pipeline — direct local dataset support
  • Optional Forecast Inputs — extend dashboard with predictive visuals

Installation

Prerequisites

# Python 3.9+
python --version

# MySQL 8.0+
mysql --version

# pip
pip --version

Step 1: Clone the Repository

git clone https://github.com/yourusername/ev-charging-demand-analysis.git
cd ev-charging-demand-analysis

Replace the repository URL with your actual GitHub repository link.

Step 2: Create a Virtual Environment

# Windows
python -m venv venv
venv\Scripts\activate

# Linux / Mac
python3 -m venv venv
source venv/bin/activate

Step 3: Install Dependencies

pip install -r requirements.txt

Step 4: Keep Required Files in Project Root

app.py
db_connection.py
ev_charging_analysis.sql
europe_ev_dataset.csv
requirements.txt

Step 5: Configure Environment Variables

Create a .env file in the root directory.

MYSQL_HOST=localhost
MYSQL_PORT=3306
MYSQL_USER=root
MYSQL_PASSWORD=your_password_here
MYSQL_DATABASE=ev_charging_analysis

Step 6: Create Database Schema

mysql -u root -p < ev_charging_analysis.sql

Or initialize the schema using the Python helper functions from db_connection.py.

Step 7: Run the Streamlit App

streamlit run app.py

Configuration

Supported Files

The dashboard can work with the following files:

  • europe_ev_dataset.csv — main EV charging analysis dataset
  • forecast.csv — optional forecast file for future demand charts
  • models_summary.csv — optional model / evaluation summary

Dependency List

streamlit>=1.32.0
pandas>=2.0.0
numpy>=1.24.0
plotly>=5.18.0
matplotlib>=3.7.0
seaborn>=0.12.0
scikit-learn>=1.3.0
python-dotenv>=1.0.0
PyMySQL>=1.1.0
sqlalchemy>=2.0.0

Database Notes

  • The project uses PyMySQL for MySQL connectivity
  • Environment variables are loaded through python-dotenv
  • Default database name is ev_charging_analysis
  • The helper module can create schema and upload CSV data into MySQL

🎮 Usage

1. 📊 Overview

Use this section to monitor:

  • Total EV registrations
  • Total charging stations
  • Average coverage gap
  • Country-level infrastructure health

2. 🏙️ Priority Cities

Use this section to identify:

  • High-priority EV charging investment markets
  • Cities with strong demand pressure
  • Bubble comparison of EV demand vs infrastructure availability
  • Exportable priority-city summaries

3. 📈 Trends

Analyze:

  • Month-on-month EV growth
  • Year-over-year EV growth
  • Country-wise trend comparisons
  • Demand momentum across selected markets

4. 🗺️ Geography

Explore city-level EV infrastructure using:

  • EV registrations
  • Charging stations
  • Coverage gap
  • Demand and priority metrics

5. 🧠 Feature Intelligence

Understand which variables are most associated with EV registrations and demand patterns using feature-importance style analysis.

6. 🔍 SQL Insights

View reusable SQL-driven insights such as:

  • Top Priority Cities
  • Monthly MoM Growth
  • Infrastructure Status Profile
  • Charging Deserts
  • City Tier Gap
  • YoY Growth

7. 📉 Forecast

If forecast.csv is available, this tab can display:

  • Forecasted EV demand trends
  • Country-wise forecast comparison
  • Confidence interval style ranges

8. 👤 About

Summarizes project goal, dataset context, tech stack, and portfolio-ready value.


🔬 How It Works

End-to-End Workflow

CSV Dataset
   ↓
Data Cleaning / Standardization
   ↓
MySQL Database Table (`ev_data`)
   ↓
SQL Analytical Views
   ↓
Streamlit Dashboard
   ↓
Insights, Rankings, Filters, Maps, and Downloads

Processing Steps

1. Dataset Loading

The app loads EV data from the project directory and uses local CSV inputs as the primary source.

2. Standardization

Country labels, city tiers, and infrastructure status values are normalized for better filtering and chart consistency.

3. Interactive Filtering

Users can filter by country, year range, city tier, infrastructure status, and charging stress level.

4. SQL Analytics Layer

MySQL stores the data in ev_data, while SQL views answer recurring business questions.

5. Insight Generation

The dashboard builds country summaries, city rankings, growth views, map analytics, and feature intelligence outputs.

6. Export Layer

Filtered datasets and priority-city summaries can be exported directly from the dashboard.


📁 Project Structure

ev-charging-demand-analysis/
│
├── app.py
├── db_connection.py
├── ev_charging_analysis.sql
├── europe_ev_dataset.csv
├── EV_Charging_Analysis.ipynb
├── requirements.txt
├── .env
├── .gitignore
├── README.md
│
├── Screenshots/
│   ├── Project/
│   │   ├── overview.png
│   │   ├── priority-cities.png
│   │   ├── trends.png
│   │   ├── geography.png
│   │   ├── sql-insights.png
│   │   └── forecast.png
│
├── Power BI Dashboards/
│   ├── EV_Charging_Infrastructure_Power_BI_Dashboard.pbix
│   └── Screenshots/
│       ├── 1_Executive_Overview.png
│       ├── 2_Infrastructure___Priority_Analysis.png
│       ├── 3_Growth___Forecasting.png
│       └── 4_Country_Analysis.png
│
└── optional/
    ├── forecast.csv
    └── models_summary.csv

File Descriptions

File Description
app.py Main Streamlit dashboard application
db_connection.py MySQL helper for schema creation and CSV upload
ev_charging_analysis.sql Database schema and analytical SQL views
europe_ev_dataset.csv Main EV charging analysis dataset
EV_Charging_Analysis.ipynb Notebook for analysis and experimentation
requirements.txt Python dependencies
.env Local environment variables for MySQL
Screenshots/ Folder for Streamlit dashboard screenshots
Power BI Dashboards/ Power BI .pbix file and its dashboard screenshots

🗄️ Database & SQL Views

Main Table

ev_data

Stores city-level EV and infrastructure metrics such as:

  • Country / state / city
  • Year / month
  • Population and density
  • EV, BEV, and PHEV registrations
  • Charging stations and charging points
  • EV-per-station ratio
  • Coverage gap
  • Demand score
  • Priority score
  • Infrastructure status
  • City tier
  • EV market share and adoption stage

Analytical Views

View Purpose
v_top_priority_cities Finds cities with the highest average priority score
v_monthly_mom_growth Tracks month-over-month EV growth by country
v_infra_status_profile Profiles infrastructure groups by gap and priority
v_charging_deserts Highlights the most underserved charging markets
v_city_tier_gap Compares coverage gaps across city tiers
v_yoy_ev_growth Compares EV growth with charging station growth

Example Query

SELECT *
FROM v_top_priority_cities
ORDER BY avg_priority_score DESC
LIMIT 10;

🔌 Function Reference

db_connection.py

  • test_connection() — validates MySQL connectivity
  • get_engine() — returns a SQLAlchemy engine
  • ensure_schema(verbose=True) — creates the database, table, and analytical views
  • upload_csv_to_mysql(csv_path) — loads CSV data into MySQL after resetting the main table

app.py

  • Dataset loading from CSV-based sources
  • Country and city summary generation
  • Monthly trend aggregation
  • Feature intelligence / model-style insight support
  • Forecast preparation when optional files are present

📸 App Screenshots

Screenshots below are taken from the live Streamlit deployment. Click the Live Demo link above to explore the interactive dashboard.

🏠 Dashboard Home / Overview

Overview

🏙️ Priority Cities

Priority Cities

📈 Trends Analysis

Trends

🗺️ Geographic Analysis

Geography

🔍 SQL Insights

SQL Insights

📉 Forecast View

Forecast


📊 Power BI Dashboard

A 4-page, dark-themed Power BI companion dashboard — built around a consistent "EV Command" navigation console — gives stakeholders a click-and-filter BI experience alongside the Streamlit app. Every page shares the same sidebar (Executive Overview · Infrastructure & Priority Analysis · Growth & Forecasting · Country Analysis · Reports · Settings) and global filters for Year, Country, and City Tier.

File: EV_Charging_Infrastructure_Power_BI_Dashboard.pbix

Page What it shows
⚡ Executive Overview Market-wide KPIs — total EV registrations, cities, charging stations, average EVs per station, and average coverage gap — plus an infrastructure-priority callout, city-by-country and registration-by-country breakdowns, monthly registration trend, and an infrastructure-status donut
🏗️ Infrastructure & Priority Analysis A Bing map plotting every city colored by infrastructure status, the Top 10 priority cities ranked by priority score, coverage gap by infrastructure status, and average priority score by status
📈 Growth & Forecasting Latest EV growth %, station growth %, EVs-per-station, and registration KPIs, with 2021–2025 trend lines for charging infrastructure growth, EV growth rate by year, registration growth, and the EVs-per-station ratio over time
🌍 Country Analysis Country-level KPIs with Top 10 country rankings by registrations, charging stations, and coverage gap, average coverage gap by country, an infrastructure-status donut, and a sortable country performance summary table

⚡ Executive Overview

Tracks 792.53K total EV registrations across 227 cities and 9.13M charging stations, with an average of 56.05 EVs per station and a 35.57 average coverage gap. A priority callout flags that 75% of markets need infrastructure expansion, backed by city and registration breakdowns for Germany, the Netherlands, the UK, Spain, France, and Italy, a monthly registration trend line, and an infrastructure-status donut (Needs Attention 40.68% · Critical Gap 34.17% · Adequate 25.15%).

Executive Overview

🏗️ Infrastructure & Priority Analysis

An interactive map plots every city colored by infrastructure status (Adequate / Critical Gap / Needs Attention), paired with a Top 10 Priority Cities ranking (led by Brașov, Cluj-Napoca, and Iași), coverage gap by infrastructure status, and average priority score by status — cities marked Critical Gap average a priority score of 48, more than double Needs Attention (18) and Adequate (10).

Infrastructure & Priority Analysis

📈 Growth & Forecasting

Surfaces the latest momentum — 19.36% EV growth, 21.09% charging-station growth, 55.55 EVs per station, and 33.69K registrations — alongside 2021–2025 trends for charging infrastructure growth, year-over-year EV growth rate, registration growth, and a steadily declining EVs-per-station ratio, signaling that station rollout is starting to outpace demand.

Growth & Forecasting

🌍 Country Analysis

A country-level drill-down (filterable by City Tier, shown here for Tier 2) covering 279.02K registrations across 24 countries, with Top 10 country rankings by registrations, charging stations, and coverage gap, average coverage gap by country (Romania and Poland lead), an infrastructure-status donut, and a full country performance summary table.

Country Analysis


🚀 Future Enhancements

  • Add advanced forecast models and evaluation comparison
  • Add clustering for city segmentation
  • Add anomaly detection for infrastructure stress
  • Add PDF / report export
  • Add dashboard modularization for maintainability
  • Add unit tests and data validation checks
  • Add Docker and cloud deployment support
  • Add direct Power BI link integration

📞 Contact

Developer Information

Sumersing Patil

Project Links


Acknowledgments

  • Streamlit — interactive dashboard framework
  • Plotly — advanced charting and geo visualizations
  • MySQL — structured analytics storage layer
  • Pandas / NumPy / Scikit-learn — Python analytics ecosystem
  • Power BI — stakeholder-friendly BI storytelling

⭐ If you found this project useful, give it a star! ⭐

About

Data-driven EV charging infrastructure analytics platform built with Python, Streamlit, SQL, Power BI, and Plotly to identify high-demand regions, infrastructure gaps, and priority investment opportunities across Europe.

Resources

Stars

5 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages