Skip to main content

GemsPy

A Python interpreter for GEMS — modelling and simulating complex energy systems under uncertainty.

CI PyPI version Python versions License: MPL-2.0 Documentation Code style: black

📖 Documentation • 🚀 Getting Started • GEMS framework • 💬 Issues


✨ Why GemsPy

  • 🧠 Low-code modelling — describe energy-system components in a high-level language close to mathematical syntax, minimal Python required.
  • 🗂️ YAML-first workflow — read, edit and create case studies as plain YAML files, or build them programmatically from Python.
  • ⚙️ Solver-agnostic — generates optimisation problems and delegates to off-the-shelf solvers.
  • 🎲 Built for uncertainty — first-class support for time-dependent and scenario-dependent data.
  • 🧪 Production-grade Python API — self-supporting, fully tested package, independent from any simulator binary.

📦 Installation

With uv (recommended):

uv add gemspy

Or with pip:

pip install gemspy

🚀 Quick start

Given a study directory containing your library.yml, system.yml and timeseries files (see the Getting started guide):

from pathlib import Path
from gems_craft.study.folder import load_study
from gems_runner.session import SimulationSession
from gems_craft.optim_config import load_optim_config

study = load_study(Path("my_study"))
optim_config = load_optim_config(Path("my_study/input/optim-config.yml"))

session = SimulationSession(study=study, optim_config=optim_config)
results = session.run()

Or, in a single call:

from pathlib import Path
from gems_runner.study.runner import run_study

run_study(Path("my_study"))

The GEMS framework

GEMS introduces a novel approach to modelling and simulating energy systems, centred around a simple principle: getting models out of the code.

To develop and test new models of energy-system components, writing software code should not be a prerequisite. This is where GEMS excels, offering users a low-code modelling experience with unparalleled versatility.

The framework consists of two pieces:

  • 📝 a high-level modelling language, close to mathematical syntax;
  • 🗃️ a data structure for describing energy systems.

🐍 The GemsPy package

GemsPy ships a generic interpreter of GEMS capable of generating optimisation problems from any study case that adheres to the modelling language syntax, then solving them with off-the-shelf solvers.

The Python API lets you:

  • read case studies stored in YAML format,
  • modify existing studies,
  • or create new ones from scratch by scripting.

The Getting started page of the online documentation walks you through the GEMS input file format and the basics of the GemsPy API.


GemsPy is part of the Antares project, but its implementation is completely independent from the Antares Simulator software. It was initially designed to prototype the next features of Antares, but its structuring and development practices have produced a high-quality, self-supporting codebase. It is now maintained to bring the flexibility of the GEMS modelling language and interpreter to Python users, and to keep exploring its potential.


📚 Documentation

Full documentation is hosted on Read the Docs: gemspy.readthedocs.io.

📄 License

Distributed under the Mozilla Public License 2.0. See LICENSE for details.

Metadata

Release files for gemspy 0.2.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 gemspy 0.2.0
File Size Uploaded
gemspy-0.2.0.tar.gz 102.8 kB Details

Built distribution (wheel)

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

Total release size: 237.2 kB

Release files / gemspy-0.2.0.tar.gz

Download URL gemspy-0.2.0.tar.gz
Size 102.8 kB
Tags Source
SHA-256 checksum
How to use checksums
c64a8abc6ce27ad8c8fa24ccb178f66a97c4367f7253936b4f4498c2641fac9e
BLAKE2b-256 checksum
How to use checksums
9c6c233bc4095f2f6c706a01d2cbc51789862aad8fdf66789156b9c78b5a67e4
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.14

Release files / gemspy-0.2.0-py3-none-any.whl

Download URL gemspy-0.2.0-py3-none-any.whl
Size 134.4 kB
Tags Python 3
SHA-256 checksum
How to use checksums
6699f86bfb25fa9e256e4d2d5daf7bc335e921f191eca3c398482eb5e90b44e1
BLAKE2b-256 checksum
How to use checksums
7866c71e92b95ccc10bcdedd7c409a8939c2dece7100f5536bae1fe984221bf3
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.14

Release history Release notifications | RSS feed

This release

0.2.0 This release

2 release files

0.1.3

2 release files

0.1.2

2 release files

0.1.1

2 release files

0.1.0

2 release files

0.0.6

2 release files

0.0.5

2 release files

0.0.4

2 release files

0.0.2

2 release files

0.0.1

2 release files

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