pip install pypowsybl
Defaulting to user installation because normal site-packages is not writeable Looking in indexes: https://devin-depot.rte-france.com/repository/pypi-all/simple Requirement already satisfied: pypowsybl in /home/kuleszahug/.local/lib/python3.8/site-packages (1.4.0.dev1) Requirement already satisfied: prettytable in /home/kuleszahug/.local/lib/python3.8/site-packages (from pypowsybl) (2.0.0) Requirement already satisfied: numpy>=1.20.0 in /home/kuleszahug/.local/lib/python3.8/site-packages (from pypowsybl) (1.24.3) Requirement already satisfied: networkx in /home/kuleszahug/.local/lib/python3.8/site-packages (from pypowsybl) (3.1) Requirement already satisfied: pandas>=1.3.5 in /home/kuleszahug/.local/lib/python3.8/site-packages (from pypowsybl) (2.0.3) Requirement already satisfied: python-dateutil>=2.8.2 in /home/kuleszahug/.local/lib/python3.8/site-packages (from pandas>=1.3.5->pypowsybl) (2.8.2) Requirement already satisfied: pytz>=2020.1 in /home/kuleszahug/.local/lib/python3.8/site-packages (from pandas>=1.3.5->pypowsybl) (2023.3) Requirement already satisfied: tzdata>=2022.1 in /home/kuleszahug/.local/lib/python3.8/site-packages (from pandas>=1.3.5->pypowsybl) (2023.3) Requirement already satisfied: setuptools in /home/kuleszahug/.local/lib/python3.8/site-packages (from prettytable->pypowsybl) (69.1.1) Requirement already satisfied: wcwidth in /home/kuleszahug/.local/lib/python3.8/site-packages (from prettytable->pypowsybl) (0.2.6) Requirement already satisfied: six>=1.5 in /home/kuleszahug/.local/lib/python3.8/site-packages (from python-dateutil>=2.8.2->pandas>=1.3.5->pypowsybl) (1.16.0) DEPRECATION: distro-info 0.23ubuntu1 has a non-standard version number. pip 24.1 will enforce this behaviour change. A possible replacement is to upgrade to a newer version of distro-info or contact the author to suggest that they release a version with a conforming version number. Discussion can be found at https://github.com/pypa/pip/issues/12063 DEPRECATION: python-debian 0.1.36ubuntu1 has a non-standard version number. pip 24.1 will enforce this behaviour change. A possible replacement is to upgrade to a newer version of python-debian or contact the author to suggest that they release a version with a conforming version number. Discussion can be found at https://github.com/pypa/pip/issues/12063 Note: you may need to restart the kernel to use updated packages.
import pypowsybl as pp
Load a node/breaker test network
n = pp.network.create_four_substations_node_breaker_network()
Get substation data frame
substations = n.get_substations()
Print substation data frame
substations
name | TSO | geo_tags | country | |
---|---|---|---|---|
id | ||||
S1 | ||||
S2 | ||||
S3 | ||||
S4 |
Generate a single line diagram SVG from substation S1
sld = n.get_single_line_diagram('S1')
Display the single line diagram SVG
sld