power-grid-model
Python/C++ library for distribution power system analysis
What it is and what it does
Power Grid Model is a production-grade library for analyzing electrical distribution networks. The core is implemented in C++ for performance, with a Python interface for ease of use. It handles three main types of steady-state power system calculations: power flow (determining voltages and currents), state estimation (inferring grid state from measurements), and short circuit analysis (computing fault currents). The library depends only on numpy and is distributed as pre-compiled wheels for most platforms, making installation straightforward despite its compiled nature.
Developers use it to model and analyze distribution grids—the lower-voltage networks that deliver power to neighborhoods and industrial sites. It's aimed at researchers, engineers, and developers working on grid planning, operation, or optimization. The project is actively maintained under the LF Energy umbrella and includes documentation and examples for common workflows.
Use it for:
- Run power flow studies to determine steady-state voltages and currents in a distribution network
- Perform state estimation to infer grid conditions from real-world measurement data
- Analyze short circuit faults to size protective equipment and validate grid resilience
- Validate input data and export results for integration with other grid analysis tools
- Build grid optimization or planning workflows that require repeated steady-state calculations
Worth the install?
AI-flagged interpretation of the facts on this page — verify before relying
Power Grid Model is a Python/C++ library for steady-state distribution power system analysis, supporting power flow, state estimation, and short circuit calculations.
Yes, if you work on power system analysis. The library is production-stable, actively maintained, has no known vulnerabilities, and solves a specialized but well-defined problem. Medium install friction is manageable given pre-compiled wheels for common platforms. The copyleft license (MPL-2.0) is a consideration only if you plan to distribute modified versions of the library itself; using it as-is in proprietary applications is permitted.
Install
power-grid-model on PyPI
pip
pip install power-grid-modeluv
uv add power-grid-modelpoetry
poetry add power-grid-modelInstalling power-grid-model
Before you install
Medium install friction due to compiled C++ bindings; wheels are available for macOS (arm64, x86_64), Linux (aarch64, x86_64), and Windows, reducing build complexity. Requires Python 3.12 or later. Active maintenance with a recent release.
License in practice
Licensed under MPL-2.0 (copyleft). Derivative works and modifications must be distributed under the same license; proprietary applications can link to the library but must disclose modifications to the library itself.
Quickstart
pip install power-grid-model
import power_grid_model
# Create and analyze a power grid network using the library's API
Requires Python 3.12 or later; compiled wheels are available for common platforms but source builds require a C++ compiler.
Verify before relying
- Specific API surface and ease of use for common power flow scenarios
- Performance characteristics for large-scale grid models
- Integration patterns with external grid data formats or tools
Package facts
| License | MPL-2.0 (copyleft) |
| Python support | supports the current Python release (>=3.12) |
| Install friction | medium — platform-specific wheel |
| Runtime dependencies | 1 — numpy |
| Maintenance | actively maintained — 0 days since the last release |
| First released | |
| Downloads | 152,047/month — #10,912 on PyPI (30-day window, as of 2026-08-14) |
| Known vulnerabilities | none known (OSV.dev, checked 2026-08-14) |
Evidence: power_grid_model-1.13.142-py3-none-macosx_13_0_arm64.whl; power_grid_model-1.13.142-py3-none-macosx_13_0_x86_64.whl; power_grid_model-1.13.142-py3-none-manylinux_2_24_aarch64.manylinux_2_28_aarch64.whl; power_grid_model-1.13.142-py3-none-manylinux_2_26_x86_64.manylinux_2_28_x86_64.whl; power_grid_model-1.13.142-py3-none-musllinux_1_2_aarch64.whl; power_grid_model-1.13.142-py3-none-musllinux_1_2_x86_64.whl; power_grid_model-1.13.142-py3-none-win_amd64.whl
Tags
More Physics packages
NetworkX provides data structures and…
permissive · top 1,000 on PyPI
sympySymPy is a Python library for symbolic…
permissive · top 1,000 on PyPI
pydicomPydicom reads, modifies, and writes DICOM…
permissive · top 5,000 on PyPI
albumentationsAlbumentations applies image transformations to…
permissive · top 5,000 on PyPI
CoolPropCoolProp provides thermodynamic and transport…
permissive · top 5,000 on PyPI
pyquaternionProvides quaternion representation,…
permissive · top 5,000 on PyPI
pandapowerpandapower automates power system modeling,…
permissive · top 15,000 on PyPI
gridstatusgridstatus provides a unified Python API to…
unclear · top 15,000 on PyPI
pypsaPyPSA is a Python framework for optimizing and…
permissive · top 15,000 on PyPI
opowerFetches historical and forecasted energy usage…
permissive · top 15,000 on PyPI
pvlibSimulates photovoltaic energy system…
permissive · top 5,000 on PyPI
ansys-dpf-coreProvides a Python interface to Ansys Data…
permissive · top 15,000 on PyPI
gpluginsGplugins provides a plugin system for…
unclear · top 15,000 on PyPI
powershapPowershap performs feature selection by testing…
permissive · top 15,000 on PyPI
PySpicePySpice provides a Python interface to Ngspice…
copyleft · top 15,000 on PyPI
lscsoft-glueLSCSoft-GLUE provides utilities and grid access…
copyleft · top 15,000 on PyPI