Skip to main content

Powerworld COM wrapper for Python

Project description


==== OVERVIEW ====

pypowerworld provides a class as a user-friendly wrapper for the PowerWorld COM object. It initializes a class object with a loadflow case. If the case fails to open, the program does not error out but prints an error and proceeds without a case. The ‘open_case’ method may be used to attempt to open the PowerWorld case again.


pypowerworld requires COM which means it must be run on a Windows operating system. It also requires the user to have PowerWorld and SimAuto licenses. Any PowerWorld tools which require additional license are also necessary.

==== INPUT ====

The inputs are labeled similarly to the PowerWorld Auxiliary File documentation. The inputs can either be method parameters or attributes used to set data or get data from the PowerWorld program.

==== OUPUT ====

Data output is sent in dataframe format and set to the ‘output’ attribute. This is true only when the get data method is run. For all other operations, this attribute will be set to None.


If an error occurs, the ‘error’ attribute is set to True and the ‘error_message’ attribute is set to an error string value explaining the error. If an error is not encountered, the ‘error’ attribute is set to False and the ‘error_message’ is set to an empty string.


from pypowerworld import PowerWorld
case_path = r'somepathsomecase.pwb'
pw = PowerWorld(case_path)
script_cmd = 'SolvePowerFlow(RECTNEWT);'
if pw.run_script(script_cmd):
print("The case was solved using the Newton-Raphson method.")
print("Error encountered solving power flow: %s" % pw.error_message)

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Files for pypowerworld, version 0.4.1
Filename, size File type Python version Upload date Hashes
Filename, size pypowerworld-0.4.1.tar.gz (6.2 kB) File type Source Python version None Upload date Hashes View

Supported by

Pingdom Pingdom Monitoring Google Google Object Storage and Download Analytics Sentry Sentry Error logging AWS AWS Cloud computing DataDog DataDog Monitoring Fastly Fastly CDN DigiCert DigiCert EV certificate StatusPage StatusPage Status page