ERACS Python Interface Introduction

This section describes the ERACS Python Interface, an API that has been developed for communication with ERACS’ calculation modules. With the Interface it’s possible to run Loadflow, Fault, Harmonic Impedance, and Harmonic Injection studies outside of ERACS using exported network (i.e. single-line diagram) data and the Python programming language.


The ERACS Python Interface is still in early stages of development. All bugs should be reported to the ERACS Team for fixing.

API Usage

The Interface provides low-level, direct access to the functions exported by the ERACS calculation modules as well as a much simpler, higher-level interface that provides indirect access to the calculation modules. This can be seen in the diagram below, showing how a typical user may use the high-level API, which in turn uses the low-level API to interact with the necessary calculation module. Each calculation module is a DLL that contains programming code that can be used by more than one program at the same time e.g. the ERACS Graphical User Interface and a separate user-authored Python script.

digraph {

   subgraph cluster_0 {
      node [style=filled,color=white];
      "High-Level API" -> "Low-Level API";

   "User" [shape=rectangle];
   "Experienced User" [shape=rectangle];
   "ERACS\nCalculation\nDLL" [shape=diamond];

   "User" -> "High-Level API";
   "Low-Level API" -> "ERACS\nCalculation\nDLL";
   "Experienced User" -> "Low-Level API";

ERACS Python Interface usage

The low-level access is designed for the experienced user who is familiar with Python, ERACS, and the Interface. The high-level access is designed for the occasional user or those who would like to quickly perform a calculation using a dataset that has been exported from ERACS. The remainder of this documentation defines the calling conventions for all methods and procedures this Interface provides.

Module structure

The figure below shows the overall structure of all modules that make up the ERACS Python Interface. The main modules which should be used are Data for loading up network data from files exported from ERACS, and Loadflow / Fault / Impedance / Injection for running studies. This is described further in the next section.


ERACS Python Interface modules overview (click to expand)