Skip to content

gaia-charge/evdb

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

854 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

EVDB - Open Electric Vehicle Database

License: CC BY-SA 4.0 Validate YAML Build Database

A comprehensive, open-source database of electric vehicles with detailed specifications, built with YAML + JSON Schema + Datasette + Streamlit.

πŸ—οΈ Architecture

YAML Source Files β†’ JSON Schema Validation β†’ SQLite Database β†’ Datasette API + Streamlit Dashboards

Why This Stack?

  • YAML: Human-readable, git-friendly source format with comments
  • JSON Schema: Industry-standard validation ensures data quality
  • SQLite: Single-file database, portable, fast, perfect for datasets
  • Datasette: Instant API and web UI for SQLite databases
  • Streamlit: Python-native dashboards for data visualization

πŸ“Š Data Structure

Four Core Entities

manufacturers/
  └─ tesla.yaml
  └─ volkswagen.yaml

vehicle-models/
  └─ tesla-model-3.yaml (base info)
  └─ volkswagen-id4.yaml

vehicle-variants/
  β”œβ”€ tesla-model-3-rwd-2024.yaml (detailed specs)
  β”œβ”€ tesla-model-3-long-range-awd-2024.yaml
  └─ volkswagen-id4-pure-2024.yaml

market-availability/
  β”œβ”€ tesla-model-3-rwd-2024-germany.yaml (pricing)
  β”œβ”€ tesla-model-3-rwd-2024-usa.yaml
  └─ volkswagen-id4-pure-2024-poland.yaml

Why This Separation?

  • Manufacturer - Company info (name, country, website)
  • Vehicle Model - Base model (dimensions, seating, body style)
  • Vehicle Variant - Specific trim with full specs (battery, range, charging, performance)
  • Market Availability - Region-specific pricing and options

This structure handles:

  • βœ… Multiple trims/versions per model
  • βœ… Market-specific variants
  • βœ… Changes over time (model years)
  • βœ… Missing/incomplete data gracefully

πŸš€ Features

  • Comprehensive Specs: Battery, range, charging, performance, dimensions
  • Real-World Data: Actual consumption, charging curves, not just claimed specs
  • Market Specifics: Pricing, incentives, availability by country
  • Data Quality Tracking: Every field marked with source and confidence level
  • Version History: Track changes across model years
  • SQL Queryable: Complex queries via Datasette
  • Visual Dashboards: Interactive comparisons via Streamlit
  • API Access: JSON API for developers
  • Open License: CC BY-SA 4.0 - free to use, share, and build upon

πŸ“‹ Current Status

Progress: 92% Complete - Ready for Deployment! πŸš€
Vehicles: 63 variants across 41 models from 19 manufacturers
Markets: Germany (primary), France, USA, Poland, Italy
Next Milestone: Continue vehicle expansion + Deploy Streamlit app
Target Public Launch: 2026-02-15

What's Working Now βœ…

  • βœ… 220+ vehicle variants with comprehensive specifications across 28+ manufacturers
  • βœ… Full validation pipeline - All YAML files validated with JSON Schema
  • βœ… SQLite database - Automated builds via GitHub Actions
  • βœ… GitHub Releases - Pre-built database downloadable from every push
  • βœ… Datasette API - 11 canned queries + full SQL access
  • βœ… 5 Datasette plugins - Maps, charts, GraphQL, exports, search
  • βœ… Streamlit dashboard - 6 complete pages (Home, Browse, Compare, Analytics, Data Explorer, Documentation)
  • βœ… CI/CD pipeline - GitHub Actions for validation, builds, and releases
  • βœ… Comprehensive docs - API docs, contributing guide, FAQ

πŸ“₯ Download the Database

The latest pre-built SQLite database is available from GitHub Releases:

# Download latest database
wget https://github.com/gaia-charge/evdb/releases/latest/download/evdb.db

# Or with curl
curl -L -o evdb.db https://github.com/gaia-charge/evdb/releases/latest/download/evdb.db

πŸ› οΈ Development Setup

Prerequisites

  • Python 3.10+
  • pip

Installation

# Clone repository
git clone https://github.com/gaia-charge/evdb.git
cd evdb

# Create virtual environment
python3 -m venv venv
source venv/bin/activate  # On Windows: venv\Scripts\activate

# Install dependencies
pip install -r requirements.txt

# Install pre-commit hooks (optional)
pre-commit install

Validate YAML Files

python scripts/validate.py --directory data/

Build SQLite Database

python scripts/build-sqlite.py --input-dir data/ --output evdb.db

Run Datasette

datasette evdb.db --metadata metadata.json
# Open http://localhost:8001

Run Streamlit Dashboard

streamlit run streamlit_app.py
# Open http://localhost:8501

Features:

  • 🏠 Home - Database statistics and quick search
  • πŸ” Browse Vehicles - Advanced filtering with 7 filters and 8 sort modes
  • βš–οΈ Compare - Side-by-side comparison of 2-4 vehicles with visualizations
  • πŸ“Š Analytics - Interactive charts for range, charging, price, and market analysis
  • πŸ’Ύ Data Explorer - SQL query interface with 8 example queries
  • πŸ“š Documentation - Embedded API docs, contributing guide, and FAQ

πŸ“– Documentation

🀝 Contributing

We need your help! Contributions welcome:

  • πŸš— Vehicle specifications - Battery, range, charging, performance
  • πŸ“Š Real-world data - Actual consumption and range tests
  • πŸ’° Market pricing - Regional pricing and options
  • 🌍 New markets - UK, Norway, China, Japan, Australia
  • πŸ”§ Code improvements - Scripts, validation, features
  • πŸ“– Translations - Help internationalize the database

Quick Start Guide

See CONTRIBUTING.md for the complete guide including:

  • πŸ“ How to add a vehicle (step-by-step)
  • βœ… Validation and testing workflow
  • πŸ“‹ Data quality standards
  • πŸ”€ Pull request process
  • 🎯 Priority vehicles we need

TL;DR:

  1. Fork β†’ Clone β†’ Create branch
  2. Copy template from templates/
  3. Fill in specs (see CONTRIBUTING.md)
  4. Validate: python scripts/validate.py --file your-file.yaml
  5. Submit pull request

All contributions must include source attribution. Data is licensed under CC BY-SA 4.0.

πŸ“‚ Repository Structure

evdb/
β”œβ”€β”€ data/                       # YAML source files
β”‚   β”œβ”€β”€ manufacturers/
β”‚   β”œβ”€β”€ vehicle-models/
β”‚   β”œβ”€β”€ vehicle-variants/
β”‚   β”œβ”€β”€ market-availability/
β”‚   └── reference/
β”‚       β”œβ”€β”€ connectors.yaml
β”‚       └── platforms.yaml
β”œβ”€β”€ schemas/                    # JSON Schema validation
β”‚   β”œβ”€β”€ manufacturer.schema.json
β”‚   β”œβ”€β”€ vehicle-model.schema.json
β”‚   β”œβ”€β”€ vehicle-variant.schema.json
β”‚   └── market-availability.schema.json
β”œβ”€β”€ scripts/                    # Build and validation tools
β”‚   β”œβ”€β”€ validate.py
β”‚   β”œβ”€β”€ build-sqlite.py
β”‚   └── import-yaml.py
β”œβ”€β”€ templates/                  # YAML templates for contributors
β”œβ”€β”€ streamlit_app.py           # Streamlit dashboard (6 pages)
β”œβ”€β”€ docs/                       # Documentation
β”œβ”€β”€ .github/workflows/          # CI/CD pipelines
β”œβ”€β”€ metadata.json              # Datasette configuration
└── requirements.txt           # Python dependencies

πŸ”Œ API Examples

Get All Manufacturers

curl https://evdb.gaiacharge.com/manufacturers.json

Find Vehicles by Range

curl "https://evdb.gaiacharge.com/vehicle-variants.json?range_real_world_combined_km__gte=500"

SQL Query

curl "https://evdb.gaiacharge.com/evdb.json?sql=\
SELECT m.name as manufacturer, vm.name as model, vv.variant_name, \
       vv.battery_usable_capacity_kwh, vv.range_real_world_combined_km \
FROM vehicle_variants vv \
JOIN vehicle_models vm ON vv.vehicle_model_id = vm.id \
JOIN manufacturers m ON vm.manufacturer_id = m.id \
WHERE vv.model_year = 2024 \
ORDER BY vv.range_real_world_combined_km DESC \
LIMIT 10"

πŸ“Š Example Queries

Compare Charging Speeds

SELECT 
  m.name as manufacturer,
  vm.name as model,
  vv.variant_name,
  vv.charging_dc_max_charge_power_kw as max_dc,
  vv.charging_dc_charge_time_10_80_minutes as charge_time,
  vv.charging_dc_charge_speed_kmh as km_per_hour
FROM vehicle_variants vv
JOIN vehicle_models vm ON vv.vehicle_model_id = vm.id
JOIN manufacturers m ON vm.manufacturer_id = m.id
WHERE vv.charging_dc_max_charge_power_kw >= 150
ORDER BY vv.charging_dc_charge_speed_kmh DESC
LIMIT 20;

Find Budget EVs

SELECT 
  m.name, vm.name, vv.variant_name,
  ma.pricing_base_price, ma.pricing_currency,
  vv.range_real_world_combined_km
FROM vehicle_variants vv
JOIN vehicle_models vm ON vv.vehicle_model_id = vm.id
JOIN manufacturers m ON vm.manufacturer_id = m.id
JOIN market_availability ma ON vv.id = ma.variant_id
WHERE ma.market = 'germany'
  AND ma.pricing_base_price < 40000
  AND vv.range_real_world_combined_km > 300
ORDER BY vv.range_real_world_combined_km DESC;

πŸ“œ License

πŸ”— Links

πŸ’‘ Inspiration

Inspired by comprehensive EV databases like ev-database.org, but with a focus on:

  • Open data (not proprietary)
  • Git-based workflow (trackable changes)
  • API-first design (easy integration)
  • Community contributions (crowdsourced accuracy)

πŸ“ž Contact


Built with ❀️ for the EV community

Data is power. Open data is power for everyone.