powfacpy

1 Introduction

powfacpy is a wrapper around the Python API of PowerFactory© (software for power system simulation by DIgSILENT). You can automate almost anything in PowerFactory© with the native API, but the syntax can be verbose. Therefore, powfacpy provides features and interface classes to make your life easier.

For example, setting attributes of an object in the PowerFactory© database requires several lines of code with the native API. With the API of powfacpy, this is only one line:

set_attr(r"Network Model\Network Data\Grid\Terminal MV",{"uknom":33,"outserv":0})

Here we have set two attributes (uknom, outserv) of the object specified under the path Network Mod….

Plotting also requires many lines with the native API (you need to add the variable to the monitored variables, create a plot page, add the curve,..). Using powfacpy the syntax is succinct and similar to matplotlib. Just activate a plot and then plot variables of an object:

set_active_plot("Active power","§ PV plant")
plot(r"Network Model\Network Data\Grid\PV", "m:Psum:bus1")

powfacpy will save you time and make your code more readable. Get started with the Tutorials or search the API Documentation if you look for specific functionality.

2 Why use powfacpy?

There are a number of reasons why you should consider using powfacpy:

  • Increase productivity
  • Write more readable code
  • Avoid running into similar problems, errors and obscurities as other users of the python interface of PowerFactory did before you
  • Having a standard way of doing things in your organization (e.g. a standard format for simulation result export)
  • Steep learning curve for PowerFactory beginners (helpful tutorials)

3 Installation

Using pip:

pip install powfacpy

A few features rely on optional dependencies that are not installed by default:

Extra Installs Needed for
powfacpy[pandapower] pandapower powfacpy.applications.pandapower_interface (network matrices / pandapower export)
powfacpy[comtrade] comtraderecord Plots.plot_from_pandas_using_comtrade
powfacpy[docs] markdown powfacpy.applications.dynamic_model_docs (HTML model documentation)
powfacpy[parstudy] parstudy powfacpy.applications.parameter_studies (parameter sweeps), and the eigenvalue-sweep/sensitivity helpers in dynamic_modal_analysis
powfacpy[dynamic_modal_analysis] scipy powfacpy.applications.dynamic_modal_analysis (ModalAnalysis - eigenvalues, damping ratios, participation factors)
powfacpy[tutorials] jupyter, PyQt6, deepdiff running the tutorial notebooks yourself
powfacpy[all] all of the above running every tutorial
pip install powfacpy[pandapower]

4 Contact

simon.eberlein@iee.fraunhofer.de or open an issue.

5 Contribute

Contributions (new features, bug reports, feature requests, etc.) are very welcome on Github. If you want to contribute to the code base, please have a look at How to contribute.

6 Disclaimer

PowerFactory and DIgSILENT are trademarks of DIgSILENT GmbH. powfacpy is an independent, community-maintained open source project and is not affiliated with, endorsed by, or sponsored by DIgSILENT GmbH. Using powfacpy requires your own valid PowerFactory license and installation.

Back to top