PyPESOL: The Python P2P Energy Sharing Optimization Library
Paper in proceeding, 2025

We present the first public release of PyPESOL: the Python P2P Energy Sharing Optimization Library. PyPESOL is a lightweight, modular, and flexible framework designed for cost optimization in peer-to-peer energy sharing scenarios. It supports both single-user optimization and multi-user coordination, including automatic group formation. Users provide input data such as (forecasted or historical) electricity consumption, time-varying prices, solar generation profiles, and battery or PV capacities. Based on configurable system models (including different tariff schemes and loss assumptions), PyPESOL computes optimal battery usage decisions for individuals or groups. To enable scalable group formation, the library implements efficient greedy algorithms to partition users into energy communities. To the best of our knowledge, PyPESOL is the first publicly available framework that combines flexibility, efficiency, and scalability for P2P energy sharing optimization. Importantly, PyPESOL is also open-source: https://github.com/dcs-chalmers/pypesol.

Solar energy

Group formation

Peer-to-peer energy sharing

Battery schedul- ing

Smart grid

Energy optimization

Python library

Author

Romaric Duvignau

Chalmers, Computer Science and Engineering (Chalmers), Computer and Network Systems

Vincenzo Massimiliano Gulisano

Chalmers, Computer Science and Engineering (Chalmers), Computer and Network Systems

Marina Papatriantafilou

Chalmers, Computer Science and Engineering (Chalmers), Computer and Network Systems

E-Energy '25: Proceedings of the 16th ACM International Conference on Future and Sustainable Energy Systems


979-8-4007-1125-1 (ISBN)

16th ACM International Conference on Future and Sustainable Energy Systems, E-Energy '25
Rotterdam, Netherlands,

SESBC TANDEM: InTelligent Energy DAta MaNagement and Online DEcision Making

Swedish Energy Agency (SESBC,TANDEM), 2022-09-01 -- 2026-12-21.

Subject Categories (SSIF 2025)

Computer Sciences

Energy Systems

DOI

10.1145/3679240.3734691

ISBN

9798400711251

More information

Latest update

10/3/2025