Skip to main content

GitHub license Python Ruff pre-commit build GitHub version PyPI version codecov

PowerGAMA - Power Grid And Market Analysis

Introduction

PowerGAMA is an open-source Python package for power system grid and market analyses. It finds the least-cost dispatch of generation, energy storage and flexible demand on a linearised power flow model of the grid. It runs one timestep after another over a year or more, and reports power flows, nodal prices, storage use, load shedding and other characteristics.

Energy storage and flexible demand mean that the best decision in one timestep depends on the timesteps before it. The problem is therefore solved in sequence. Storage values give the stored energy a price that ensures realistic use of the storage.

PowerGAMA can be run in three modes:

  • Single-period (default): one optimisation per timestep, with the storage level carried forward. This is fast and suits long simulations of large systems.
  • Multi-period: a rolling horizon. Each optimisation looks a number of hours ahead (for example 24) and keeps only the first ones. With ramp limits, this imitates day-ahead market clearing.
  • Real-time (balancing): a second step after a day-ahead run. It re-dispatches the system for forecast errors or outages, with penalties for straying from the day-ahead schedule.

PowerGAMA is a deliberately simplified model. It assumes a perfect market with nodal pricing, where trade between areas can optionally be limited by transfer capacities (NTC). It does not model unit commitment, start-up costs or strategic bidding. As a result, it tends to overestimate how much variable renewable energy the system can take. Even so, it gives very useful information for planning grid developments and for broadly assessing the impact of new generation and new interconnections.

Documentation

  • Online user guide

  • HG Svendsen and OC Spro, PowerGAMA: A new simplified modelling approach for analyses of large interconnected power systems, applied to a 2030 Western Mediterranean case study, J. Renewable and Sustainable Energy 8 (2016), doi.org/10.1063/1.4962415

Install use-only version

Install latest PowerGAMA release from PyPi:

pip install powergama

Install development version

Prerequisites:

  • Poetry (used by CI and poetry.lock); uv also works
  • No separate LP solver is needed: HiGHS is included in the package and used by default. Gurobi (licence required) and other Pyomo-supported solvers can also be used, but are not tested.

Install

git clone git@github.com:powergama/powergama.git
cd powergama
poetry install                 # or: uv sync
poetry run pre-commit install  # or: uv run pre-commit install
poetry run pytest              # or: uv run pytest

GitHub Actions Pipelines

These pipelines are defined:

  1. Build: Building and testing on multiple OS and python versions. Triggered on any push to GitHub.
  2. Release: Create a release. Triggered when a version tag v* is created.
  3. Publish: Publish to PyPI. Triggered when a release is published

Contribute to the code

You are welcome to contribute to the improvement of the code.

  • Use Issues to describe and track needed improvements and bug fixes
  • Use branches for development and pull requests to merge into main
  • Use Pre-commit hooks

Contact

Harald G Svendsen
SINTEF Energy Research

Metadata

Release files for powergama 2.0.0

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

Source distribution (sdist)

Source distribution for powergama 2.0.0
File Size Uploaded Provenance Actions
powergama-2.0.0.tar.gz 142.0 kB With provenance Details for powergama-2.0.0.tar.gz

Built distribution (wheel)

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

Total release size: 300.5 kB

Release files / powergama-2.0.0.tar.gz

Download URL powergama-2.0.0.tar.gz
Size 142.0 kB
Tags Source
SHA-256 checksum
How to use checksums
3322dfd6fdd7a6a7ee1e7f1c9e249696f7040d1884b3bb73d705fce24b01dc83
BLAKE2b-256 checksum
How to use checksums
4e88f2d314e25b07b0a924a60e0fb6897c0ba3945b89d9a3d4d530193d481512
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

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.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 20, 2026.

Transparency log

Release files / powergama-2.0.0-py3-none-any.whl

Download URL powergama-2.0.0-py3-none-any.whl
Size 158.5 kB
Tags Python 3
SHA-256 checksum
How to use checksums
604a98cb56b9bc4a8b1f61e2a90984c0c1fbb4fe87ce6148c84d482152cf7103
BLAKE2b-256 checksum
How to use checksums
cff3a65edae2b2ea60695fc325d35b4ed955355dd954b6ed817b84561602bde6
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

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.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 20, 2026.

Transparency log

Security for powergama 2.0.0

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.

Full provenance

Both files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for powergama-2.0.0.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 20, 2026.

Transparency log

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