Skip to content

Using SMS++ from Python

Donato Meoli edited this page Jun 18, 2026 · 2 revisions

SMS++ is a C++ framework, but you don't have to write C++ to use it. Two Python packages let you build, run and post-process SMS++ models from Python, which is often the quickest way to get started.

These packages are developed and maintained by the SPSUnipi group; their documentation always reflects their latest version, so we link it directly instead of duplicating it here.

pySMSpp — build and run SMS++ models in Python

pySMSpp is a Python interface to create SMS++ models with a simple, Pythonic API. It supports reading/writing SMS++ models from/to netCDF4 files, adding/editing model components, running SMS++ and reading the results back. It is also shipped as the pySMSpp submodule of this project.

Install it with pip install pysmspp and follow the docs above.

pypsa2smspp — turn PyPSA networks into SMS++ models

pypsa2smspp bridges PyPSA — the widely used energy-system modelling framework — and SMS++: it converts a PyPSA network into the corresponding SMS++ instance, so you can model an energy system in PyPSA and solve it with SMS++'s structure-exploiting algorithms.

Which one should I use?

  • Start from pySMSpp if you want to assemble an SMS++ model directly (Blocks, variables, constraints) from Python.
  • Start from pypsa2smspp if you already describe your energy system in PyPSA and want SMS++ to solve it.

Once you are comfortable, the Getting started guide shows the same concepts from the C++ side.

Clone this wiki locally