Skip to main content

GridForge

GridForge Logo

GridForge provides a small, explicit Python API for preparing standard PYPOWER/MATPOWER cases for power-system studies. It keeps the familiar case tables, gives them readable column names, preserves real bus IDs, and adds a few domain operations that are error-prone with raw NumPy arrays. You can directly use its output to formulate power system optimization problems.

Installation

Install the released package from PyPI:

pip install powergridforge

For development:

git clone https://github.com/xuwkk/gridforge.git
cd gridforge
python -m venv .venv
source .venv/bin/activate
pip install -e ".[dev]"

To preview or check the documentation from the repository root:

python -m mkdocs serve
python -m mkdocs build --strict

The docs workflow publishes documentation changes from master to gh-pages. For first-time setup, choose Deploy from a branch and gh-pages under GitHub Settings → Pages.

Quick Start

import gridforge as gf
import pandas as pd

case = gf.load_case("case14")
bus = case["bus"]
solar = pd.DataFrame({"BUS_IDX": [2, 6], "PG": [20.0, 30.0]})
case.add_component("solar", solar)
solar_by_bus_mw = case.connection_matrix("solar") @ case["solar"]["PG"].to_numpy()
dc = case.dc_model()
ac = case.ac_model()
print(solar_by_bus_mw, dc.ptdf.shape, ac.Ybus.shape)

For a complete example, see the worked tutorial. The API reference lists the public operations; Cases and Tables defines what each file format preserves. The documentation site covers matrix axes, units, and AC/DC conventions.

GridForge is distributed under the MIT License.

Metadata

Release files for powergridforge 2.0.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for powergridforge 2.0.1
File Size Uploaded Provenance Actions
powergridforge-2.0.1.tar.gz 1.6 MB Without provenance Details for powergridforge-2.0.1.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for powergridforge 2.0.1
File Interpreter ABI Platform Actions
powergridforge-2.0.1-py3-none-any.whl Python 3 none any Details for powergridforge-2.0.1-py3-none-any.whl

Total release size: 1.6 MB

Release files / powergridforge-2.0.1.tar.gz

Download URL powergridforge-2.0.1.tar.gz
Size 1.6 MB
Tags Source
SHA-256 checksum
How to use checksums
659a192dad76e80a031b4527c1f5ec4a5a29effb4b0e6f4cf5d28517c6dd7a5b
BLAKE2b-256 checksum
How to use checksums
49b706a787c8d19226550e65d83386dca24bd32a57f960ad64055e1bb4e605cd
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.12.13

Release files / powergridforge-2.0.1-py3-none-any.whl

Download URL powergridforge-2.0.1-py3-none-any.whl
Size 31.5 kB
Tags Python 3
SHA-256 checksum
How to use checksums
9fe655316e3a97a1d8e828d190b3fccc5601a60b7d4e76bdcb07ea58ed85d5ee
BLAKE2b-256 checksum
How to use checksums
232f651ad235e9a2cdd735fa53a97137b7124bf2fff54aac8bb630878e0cb591
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.12.13

Security for powergridforge 2.0.1

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page