GTFS4EV is an open-source Python tool designed to support the planning of public bus electrification. By leveraging the standardized General Transit Feed Specification (GTFS), it allows planners and researchers to quickly simulate bus operations and explore electrification scenarios without requiring proprietary or vehicle-level operational data.
- 📖 Full Documentation: Full user guide, API, and methodology
- 💻 Project GitHub: Source code, examples
- 🐍 Language: Python 3.12
The model allows to quickly simulate bus operations and explore electrification scenarios using GTFS data as the main input. It bridges the gap between detailed agent-based simulators and simplified first-order calculators, providing a modular workflow for GTFS data pre-processing, fleet operation and charging simulation, and ex-post analysis of electrification impacts (CO2 savings, reduction of exposure to air pollution, fuel cost savings) and the potential integration of photovoltaic energy.
The core functionality of GTFS4EV spans three main dimensions, which together form also the high-level simulation workflow:
- GTFS data pre-processing: GTFS data validation and cleaning.
- Fleet operation simulation: Data-based simulation of bus fleet operations, estimating the number of vehicles in operation and their travel patterns.
- Scenario-based charging: Spatio-temporal charging demand, scenario feasibility, and infrastructure requirements (required number of chargers, required bus battery capacities) under user-defined electrification scenarios (i.e., available charging powers, charging strategy, and electric bus energy consumption)
We recommend using Miniconda:
- Install Miniconda and create a virtual environment:
conda create --name evpv-env python=3.12
conda activate gtfs4ev-envpip install gtfs4ev- Copy and adapt the cli_basic.py example configuration file
- Make sure you have GTFS data that contains all the files required by GTFS4EV
gtfs4evThen enter the path to your config file when prompted.
- Use absolute paths or launch the terminal in the config file directory
- Recommended: Start by running the example to familiarize yourself with inputs and outputs
Import GTFS4EV modules into your own scripts:
from gtfs4ev.core.gtfsmanager import GTFSManager
from gtfs4ev.core.fleetsimulator import FleetSimulator
from gtfs4ev.core.chargingsimulator import ChargingSimulatorAll classes are described in the API Reference of the full documentation.
- GTFS data filtering (e.g. suppression of specific services) or enrichment (e.g. addition of extra idle times at stops or terminals).
- PV integration potential: Assess charging demand alignment with local solar PV generation.
- Ex-post impact analysis (CO₂ savings, spatial air pollution reduction, and fuel cost savings).
- Flexible charging strategy support: Includes built-in charging strategies with also the option for users to implement custom strategies.
- Supports multiple charging strategies applied in sequence. The model starts with the first strategy and falls back to the next one if charging needs are not met. This approach allows building a complex charging logic by layering simpler strategies without needing to rewrite or duplicate code.
- Spatial visualization of transport network and charging demand as HTML maps
- Dual usage: Use as a CLI or as a modular Python library for advanced analysis.
Check our Questions & Answers page for common issues and guidance.
Distributed under the GNU GPLv3. Originally developed under the lead of EPFL PV-LAB (Switzerland). Authors involved: Jérémy Dumoulin, Alejandro Peña-Bello, Noémie Jeannin, Nicolas Wyrsch. Now under the maintenance of the African Energy Modelling Network.