skillfed

power-grid-model

Python/C++ library for distribution power system analysis

power-grid-model v1.13.142 152.0K downloads/30d#10,912 on PyPI
Copyleft license MPL-2.0 Active released

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-model

uv

uv add power-grid-model

poetry

poetry add power-grid-model

Installing 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

Development Status :: 5 - Production/StableIntended Audience :: DevelopersIntended Audience :: Science/ResearchOperating System :: MacOSOperating System :: Microsoft :: WindowsOperating System :: POSIX :: LinuxProgramming Language :: C++Programming Language :: Python :: 3Programming Language :: Python :: Implementation :: CPythonTopic :: Scientific/Engineering :: Physics

Tags

power flow calculationelectrical grid analysisstate estimation power systemsshort circuit analysisdistribution network solverpower system simulationgrid modeling library
power-systemsgrid-analysisscientific-computing

More Physics packages