An advanced, portable, telemetric battery capacity and State of Health (SOH) analyzer for electric vehicles. It estimates usable capacity trajectories, applies Gaussian local weighted regression with 95% uncertainty confidence bands, and generates an executive-grade interactive HTML/PDF assessment report.
Works seamlessly:
- As a standalone CLI utility on Linux, macOS, and Windows.
- As an installable Python package (
pip install .oruv pip install -e .). - Within Google Antigravity via its built-in skill and agent persona.
- Within any AI Agent framework (Claude Code, Cursor, AutoGPT, OpenAI Assistants).
ev-battery-experts/
βββ main.py # CLI executable entry point
βββ analyzer.py # Statistical engine, LOWESS regression, Plotly & Jinja2 report generator
βββ chemistries.py # Multi-chemistry battery database & vehicle pack catalog (LFP, NMC, NCA, Na-Ion)
βββ parsers.py # Polymorphic data ingestion (TeslaMate, ScanMyTesla, Tronity, Generic)
βββ pdf_certificate.py # Official signed PDF inspection certificate generator (ReportLab + QR Code)
βββ crypto_signer.py # ECDSA P-256 + SHA-256 cryptographic signing & key management engine
βββ verifier.py # Offline certificate verification & authenticity validator
βββ web_app.py # Standalone FastAPI web application with OpenAPI 3.1 & REST API
βββ db.py # SQLite database models, bcrypt salted password hashing & JWT auth
βββ templates/ # HTML5 & Tailwind CSS responsive UI templates (Public, Admin, Results)
βββ mcp_server.py # Model Context Protocol (MCP) server for AI assistants
βββ Dockerfile # Multi-stage lightweight production container
βββ docker-compose.yml # Local Docker Compose setup with persistent data volumes
βββ portainer-stack.yml # Portainer stack deployment template using GHCR image
βββ pyproject.toml # Standard PEP 517/621 packaging configuration
βββ LICENSE # BSD 3-Clause License
βββ docs/ # π Documentation
β βββ INSTALLATION.md # Installation guide (Linux, macOS, Windows, Docker, uv, pip)
β βββ USAGE.md # Practical guide, CLI options, REST API, Portainer & CSV formats
β βββ METHODOLOGY.md # Physical principles & mathematical modeling
βββ skills/
β βββ ev-battery-soh/
β βββ SKILL.md # Universal Agent Skill definition
βββ agents/
β βββ ev-battery-expert.md # AI Agent Persona specification
βββ README.md
- Installation Guide: Detailed step-by-step setup on Linux, macOS, and Windows.
- User Manual: CLI syntax, column mapping options, supported CSV formats, and PDF export.
- Scientific Methodology: Physical telemetry principles, discretization noise handling, and statistical confidence intervals.
Requires Python 3.9 or higher.
git clone https://github.com/smilebob/ev-battery-experts.git cd ev-battery-experts # Using standard pip: pip install -e . # Or using uv: uv pip install -e .
# English report (default) ev-battery-soh /path/to/charging_logs.csv -o battery_report.html # French report (FranΓ§ais) ev-battery-soh /path/to/charging_logs.csv --lang fr -o rapport_fr.html # Spanish report (EspaΓ±ol) ev-battery-soh /path/to/charging_logs.csv --lang es -o informe_es.html
For CSV files with non-standard column headers:
ev-battery-soh custom_export.csv \ --mapping date=Timestamp energy_added=NetKwh soc_start=InitialSoC soc_end=FinalSoC odometer=MileageKm \ -o battery_report.html
ev-battery-soh charges.csv --min-delta 30 -o battery_report.html
Generate a sealed inspection certificate for vehicle resale signed with ECDSA P-256 and verified via QR-Code:
ev-battery-soh charges.csv --vin XP7YGCEK7PB123456 --pdf-certificate inspection_certificate.pdf
Launch the interactive web UI and Admin panel:
# Locally: uvicorn web_app:app --host 0.0.0.0 --port 8000 # Or via Docker: docker compose up -d
Then visit http://localhost:8000 (or http://localhost:8000/docs for the interactive Swagger OpenAPI documentation).
The generated interactive HTML report provides:
-
Executive Scorecard: Current SOH with 95% margin of error (
$\pm X%$ ), current usable capacity ($\pm X\text{ kWh}$ ), baseline capacity$C_0$ , and cumulative loss. - Chart 1: Usable Capacity Trajectory & Projections (kWh) with 95% confidence interval band and future predictive cone.
- Chart 2: State of Health (SOH %) & Multi-Year Forecast over time.
- Chart 3: Degradation vs Odometer Mileage.
- Section 4: Electrochemical Degradation Forecast Table: Explicit breakdown (+1 yr, +2 yr, +3 yr) with projected dates, mileage, capacity, and SOH.
- Section 5: Certified Quarterly Breakdown Table: Median, standard deviation, and reliability star ratings (β ).
-
Native Print-to-PDF: Pre-styled for direct executive PDF exports via your browser (
Ctrl+P/Cmd+P).
- Google Antigravity: The skill is registered under
skills/ev-battery-soh/SKILL.mdand can be invoked directly by Antigravity agents. - Claude Code / Cursor / OpenAI: Point the agent to
skills/ev-battery-soh/SKILL.mdto grant autonomous battery telemetry assessment capabilities.
This project is licensed under the BSD 3-Clause License - see the LICENSE file for details.