Skip to main content

MobEV

MobEV logo

Python PyPI uv

MobEV turns weekly geolocated car-trip templates into electric-vehicle charging sessions, battery state-of-charge traces, and timestep demand profiles for distribution-network studies. It helps users connect mobility assumptions to where and when vehicles draw electricity.

The simulation follows three mandatory stages: prepare weekday/weekend trips → build a fleet and charging scenario → simulate battery use and charging decisions. Optional analysis aggregates and visualizes results for selected vehicles, locations, or the whole population. External-grid connection assigns stations to nearby eligible electricity buses using station capacity and voltage level. It limits combined LV station capacity per bus and permits restricted MV fallback, without load-flow analysis.

Python 3.13 or newer is required. Install with:

python -m pip install mobev

Simulation workflow

1. Prepare trip inputs

Provide a directory containing two geolocated trip templates:

example/trips/
├── weekday_trips.gpkg
└── weekend_trips.gpkg

Each GeoPackage describes car trips with departure and arrival times, activity locations and purposes, and a declared coordinate reference system. MobEV repeats weekday and weekend templates over the simulation dates. See the input schemas and the Getting Started example for a small runnable dataset.

2. Create the configuration file

Define simulation dates, fleet and battery assumptions, charger availability and capacity, charging behavior, and tariffs in a YAML file. Start with the minimal example configuration, saved as example/config.yaml, and use the configuration reference to adapt it to your study.

3. Add weather when needed

Weather is required only when battery.consumption_mode is temperature. Provide a separate CSV or Parquet file with datetime and air_temperature columns, covering every simulation hour. Temperatures are in degrees Celsius; timestamps use UTC or are converted to UTC. Pass its path as weather_file when creating the pipeline. Other consumption modes do not require weather. See the weather input example.

4. Run the pipeline

The pipeline prepares trips, builds the fleet and charging scenario, then simulates battery use and charging decisions:

from mobev import SimulationPipeline

pipeline = SimulationPipeline.from_yaml(
    config_path="example/config.yaml",
    trip_source_dir="example/trips",
    # weather_file="example/weather.csv",  # Required for temperature mode.
)
results = pipeline.run()

print(results.charging_simulation.charging_sessions_df.head())
print(results.charging_simulation.charging_stations_df.head())

Results contain prepared trips, scenario inputs, battery state-of-charge traces, charging decisions and sessions, timestep charging profiles, and station capacity summaries. The installed mobev command also runs the pipeline and saves tables and analysis outputs; see the workflow and CLI guide.

5. Analyze results

Aggregation is a separate step after run(). Sum charging demand across the population, inspect indicators, or select locations for a more focused analysis:

total = pipeline.aggregate(by="total")
print(total.aggregated_profiles_df.head())
print(total.build_indicators("indicators"))
total.save_csv("indicators", "example/indicators.csv")
total.save_parquet("aggregated_profiles_df", "example/total.parquet")
total.plot(category="charger_capacity_kw", save_path="example/charging_by_capacity.png")

homes = pipeline.aggregate(by="location_type", location_types=["home"])
print(homes.charging_stations_df.head())
homes.plot(save_path="example/home_charging.png")

Each call returns an independent aggregation. Charging profiles report actual power in kW; station capacity describes the assumed maximum power available. The plot below illustrates charging demand split by nominal charger capacity from a larger simulation. Save each aggregation frame by using the save apis, attribute name and output paths.

Weekly charging demand split by nominal charger capacity

For an external-grid study, optionally connect station results to nearby buses through pipeline.connect_to_grid(). See the grid connection guide for required bus inputs, LV capacity allocation, and MV fallback.

Use the documentation links below for input schemas, configuration constraints, CLI options, result meanings, and API details.

Metadata

Release files for mobev 0.6.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for mobev 0.6.1
File Size Uploaded Provenance
mobev-0.6.1.tar.gz 234.6 kB Without provenance Details

Built distribution (wheel)

Table of built distributions (wheels) for mobev 0.6.1
File Interpreter ABI Platform
mobev-0.6.1-py3-none-any.whl Python 3 none any Details

Total release size: 408.8 kB

Release files / mobev-0.6.1.tar.gz

Download URL mobev-0.6.1.tar.gz
Size 234.6 kB
Tags Source
SHA-256 checksum
How to use checksums
932aa3f15c8b1b8e2f1a4af920d438c1d5ace74f5e7b05758c5fbff81a794f69
BLAKE2b-256 checksum
How to use checksums
d021cf46c680c913d5a211d70f47902025c05a7035e4933d3c6aa304dde1988d
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.13.5 {"installer":{"name":"uv","version":"0.13.5","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Debian GNU/Linux","version":"13","id":"trixie","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

Release files / mobev-0.6.1-py3-none-any.whl

Download URL mobev-0.6.1-py3-none-any.whl
Size 174.3 kB
Tags Python 3
SHA-256 checksum
How to use checksums
a549e2959619ac79f600d108e1f0541803523ff7950b0c73600499607fd070fa
BLAKE2b-256 checksum
How to use checksums
90ede21d630a39e2964b19b341bd9fc0c6802bf281c6415ca8d1994edfdf5520
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.13.5 {"installer":{"name":"uv","version":"0.13.5","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Debian GNU/Linux","version":"13","id":"trixie","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

Security for mobev 0.6.1

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page