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.3.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.3.0
File Size Uploaded Provenance Actions
gemspy-0.3.0.tar.gz 122.7 kB Without provenance Details for gemspy-0.3.0.tar.gz

Built distribution (wheel)

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

Total release size: 281.3 kB

Release files / gemspy-0.3.0.tar.gz

Download URL gemspy-0.3.0.tar.gz
Size 122.7 kB
Tags Source
SHA-256 checksum
How to use checksums
576fcf7a63bfd684b85dd9d3eeb67629944783957015e5afed0a83403290ed61
BLAKE2b-256 checksum
How to use checksums
35a7ce19623452136264adc004bdf343a1795b550907387e1c4b8876a20030d5
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.16

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

Download URL gemspy-0.3.0-py3-none-any.whl
Size 158.6 kB
Tags Python 3
SHA-256 checksum
How to use checksums
4143e56ec648dc415dfb66bc9dd8b3dcf5d1beba090a9217bd855b83279c06a6
BLAKE2b-256 checksum
How to use checksums
d278e4a8596884e3768c7f91716dbe404ad6e2a7c3d551cab58beaf055c71b89
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.16

Security for gemspy 0.3.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.

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