Skip to main content

PowerIO

PowerIO format and matrix flow

PowerIO parses power system data into typed Rust models. Readers cover balanced transmission cases, multiconductor distribution cases, display files, and directory datasets. Writers, matrix builders, package tools, and problem instance builders consume those models.

Writing a case back to the format it was read from returns the original file bytes whenever the reader kept them. Converting to a different format writes what the target format can hold and reports every dropped field in Conversion::warnings.

.pio.json saves a parsed model together with the record of how it was parsed: schema versions, the source file and row each element came from, parser warnings, validation results, and optional operating points. Files for other tools stay in the format the tool reads: MATPOWER, PSS/E, OpenDSS, or any other supported format.

The Rust workspace also builds the command line interface, the Python package, and the C ABI. PowerIO.jl uses the C ABI.

Formats

Supported formats:

Distribution networks are supported in wire coordinates via powerio-dist:

If a required format is missing, open an issue with a sample file and its specification or submit a reader or writer.

Packages

Each workspace crate owns one layer:

powerio          # parser, Network model, source retaining writers, converters
powerio-matrix   # generic sparse matrices, sensitivity factors, graph projections
powerio-prob     # complete problem instances; optional matrix projections
powerio-dist     # multiconductor distribution model, dss/PMD/BMOPF converters
powerio-pkg      # .pio.json document metadata and model JSON
powerio-cli      # the `powerio` command and ratatui TUI
powerio-py       # PyO3 extension for the Python `powerio` package
powerio-capi     # C ABI for C, C++, Julia, and other foreign function interfaces
PowerIO.jl       # Julia bindings over the C ABI

The powerio Rust crate keeps parsing and conversion separate from matrix, TUI, and data frame dependencies. The Python package has no required third party packages; matrix and graph helpers use optional extras.

Docs site: https://powerio.dev. Language API map: languages guide.

Install

cargo add powerio
cargo add powerio-matrix
cargo add powerio-prob
cargo install powerio-cli

pip install powerio
pip install 'powerio[all]'     # scipy, numpy, networkx, polars extras
pip install 'powerio[gridfm]'  # polars for Parquet inspection
pip install 'powerio[pandas]'  # pandas, pyarrow compatibility reads (Python 3.10+)

julia -e 'using Pkg; Pkg.add(url="https://github.com/eigenergy/PowerIO.jl")'

Use

Rust

use powerio::{TargetFormat, parse_file};

let parsed = parse_file("case14.m", None)?;
let net = parsed.network;
let conv = net.to_format(TargetFormat::PowerModelsJson)?;

for warning in &conv.warnings {
    eprintln!("conversion warning: {warning}");
}

std::fs::write("case14.json", conv.text)?;

Python

import powerio as pio

case = pio.parse_file("case9.m")
bprime = case.bprime()            # MATPOWER Bp, scipy.sparse, needs powerio[matrix]
display = pio.parse_display_file("case.pwd")
raw, warnings = pio.convert_file("case9.m", "psse")

Julia

using PowerIO

case = parse_file("case9.m")
text = to_matpower(case)
json, warnings = to_format(case, "powermodels-json")

Command line interface (CLI)

powerio convert tests/data/case14.m --to psse35 -o case14.raw
powerio convert tests/data/case14.m --to pandapower-json -o case14.pp.json
powerio convert tests/data/case14.m --to pypsa-csv -o pypsa_case
powerio convert pypsa_case --from pypsa-csv --to matpower -o case14.m
powerio convert case.epc --from pslf --to matpower -o case.m
powerio convert case.surge.json --from surge-json --to matpower -o case.m
powerio convert goc3_case.json --from goc3-json --to matpower -o case.m
powerio convert example_0.json --from opfdata-json --to matpower -o solved_case.m
powerio package tests/data/case14.m -o case14.pio.json
powerio package goc3_case.json --from goc3-json -o goc3_case.pio.json
powerio verify tests/data/case30.m --kind bdoubleprime
powerio dcopf tests/data/case30.m -o out
powerio sensitivities tests/data/case30.m -o out --solver auto --drop-tolerance 1e-10
powerio gridfm tests/data/case14.m -o out
powerio

Features

Current Format Fidelity

Every network reader lowers to Network. The table separates writing back to the original file type from converting to a different file type.

file type read write writing back to the original file type converting to another file type
MATPOWER .m yes yes byte exact retained source canonical MATPOWER blocks; warnings for fields MATPOWER cannot carry
PowerModels JSON yes yes byte exact retained source per unit structured data checked against PowerModels.jl
PSS/E .raw yes yes byte exact only when writing the source revision power flow core; revision downgrade and unsupported records are warned
PowerWorld .aux yes yes byte exact retained source power flow core; PowerWorld only fields are projected or warned
PowerWorld .pwb yes no n/a read only binary case; decoded core converts through every text writer
PSLF .epc yes yes byte exact retained source power flow core; unsupported EPC sections are read warnings
egret JSON yes yes byte exact retained source ModelData shape checked against egret and PowerModels.jl
pandapower JSON yes yes byte exact retained source pandapower import validator checks counts and Y_bus
PyPSA CSV folder yes yes directory output without text echo PyPSA import validator checks the exported static components
GO Challenge 3 JSON yes source echo only byte exact retained source first interval maps to the static power flow core; .pio.json documents retain time series as operating points
Surge JSON yes yes byte exact retained source versioned JSON network body; unsupported source sections stay in retained source or warnings
DeepMind OPFData JSON yes source echo only byte exact retained source each extracted FullTop or N-1 document maps to a solved snapshot with element counts read from that document; source-only initial values and omitted identifiers/defaults are warned
GridFM Parquet yes yes directory output, lossy read recovers the power flow core for conversion back to classical formats

PowerWorld .pwd carries display data rather than a network case, so it is outside this conversion table and uses parse_display_file / parse_display_bytes. The decoded vintages and per field evidence are maintainer notes at powerio/src/format/powerworld/FORMAT.md.

The distribution matrix (dss, PMD JSON, BMOPF JSON, per fixture) is generated under powerio-dist/docs/. Vendored test data keeps its own licenses next to the fixtures under tests/data/dist/.

Known limits for every format are documented in the format fidelity guide.

Matrices

powerio-matrix derives an IndexedNetwork with dense bus indices and builds:

  • MATPOWER Bp/Bpp FDPF matrices
  • DC bus susceptance matrix L = A diag(b) A^T and flow map matrices
  • Nodal admittance matrix
  • LACPF block matrix
  • Signed incidence matrix
  • PTDF and LODF sensitivity matrices, with dense and iterative solver paths
  • Streamed CLI PTDF/LODF writes for iterative sensitivity exports
  • Adjacency matrix and petgraph graph output

powerio-prob builds matrix free problem instances: DC OPF and AC OPF input data plus the GOC3 SCOPF instance. Its optional matrix feature adds sparse projections and DC OPF Matrix Market bundles.

Current conventions for signs, taps, phase shifts, per unit scaling, reference buses, and line parameters are documented in the matrices guide.

Normalized Form

Network::to_normalized returns a derived solver view:

  • powers use per unit;
  • voltage phase angles use radians;
  • inactive elements are removed;
  • tap == 0 becomes 1;
  • surviving buses keep their source bus IDs;
  • bus types reflect generator placement and reference buses.

The normalized copy carries no retained source text, so writing it emits the derived model rather than the original file.

Python exposes the normalized form as case.to_normalized(), the C ABI as pio_normalize, and Julia as to_normalized(case).

C ABI

powerio-capi exposes parse, query, conversion, JSON transport, normalization, .pio.json document handles, and numeric table extraction through pio_* functions. The public header is powerio-capi/include/powerio.h. Build with --features arrow to enable pio_to_arrow over the Arrow C Data Interface, and add --features matrix for sparse matrix COO tables. Matrix Arrow ABI v1 is COO plus explicit matrix_bus and matrix_branch axis map tables; language bindings assemble native sparse matrix types on their side. The optional prob feature exposes matrix free SCOPF problem instances.

PowerAgent

The optional MCP server exposes conversion, saving, summaries, parsing, normalization, matrix outputs, and display data.

pip install 'powerio[mcp]'
powerio-mcp

MCP clients can keep a case in .pio.json document JSON through the package transport:

parsed = parse(path="case9.m", transport="package")
pkg = parsed["package_json"]
summary(package_json=pkg)
matrix("bprime", package_json=pkg)
save(out_path="case9.raw", to_format="psse", package_json=pkg)
diagnostics(pkg)

PowerMCP bundles these tools with simulator servers and bridge tools.

.pio.json documents

.pio.json documents carry one balanced or multiconductor model payload with metadata: provenance, source maps, diagnostics, validation, summaries, lowering history, optional derived metadata, optional operating_points, and optional study commits. A GO Challenge 3 document stores the static first interval in model and the full replayable time series in operating_points; materializing one point returns a static document with the updates applied and the series cleared.

Rust uses powerio_pkg::NetworkPackage, Python uses the powerio.Package class, the C ABI uses pio_package_*, and the CLI writes documents with powerio package.

GridFM

The gridfm command writes Parquet datasets used by the LF Energy GridFM project:

powerio gridfm <case> -o <dir>

The command writes the tables consumed by gridfm-datakit and gridfm-graphkit under <dir>/<case>/raw/. Compatible cases can be stacked by scenario ID.

read_gridfm_dataset in powerio-matrix and pio.read_gridfm in Python reconstruct a Network from a dataset. The reconstructed network can be written to any supported balanced case format:

powerio convert out/case14/raw --from gridfm --to matpower -o case14.m

The --from gridfm path is lossy. The format fidelity guide lists the recovered fields and warnings.

Validation

The Rust test suite covers parsers, writers, format conversion, matrix builders, and normalization; the C ABI crate carries its own tests, and pytest covers the Python bindings. The benchmark validation suite compares selected outputs against PowerModels.jl, egret, ExaPowerIO.jl, and pandapower, and imports PowerIO's PyPSA CSV folders with PyPSA. Install the oracle stack from benchmarks/requirements.txt into the same Python 3.11+ venv that holds the local powerio wheel.

cargo fmt --all --check
cargo test
cargo test -p powerio-capi
bash scripts/ci-clippy.sh
pytest python/tests
bash benchmarks/run_validation.sh

Benchmark method, environment, and current tables are documented in the performance guide.

License

PowerIO is distributed under either of:

PowerIO logo

Download files

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

Source Distribution

powerio-0.8.3.tar.gz (896.0 kB view details)

Uploaded Source

Built Distributions

If you're not sure about the file name format, learn more about wheel file names.

powerio-0.8.3-cp39-abi3-win_amd64.whl (5.1 MB view details)

Uploaded CPython 3.9+Windows x86-64

powerio-0.8.3-cp39-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (4.8 MB view details)

Uploaded CPython 3.9+manylinux: glibc 2.17+ x86-64

powerio-0.8.3-cp39-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl (4.3 MB view details)

Uploaded CPython 3.9+manylinux: glibc 2.17+ ARM64

powerio-0.8.3-cp39-abi3-macosx_11_0_arm64.whl (4.3 MB view details)

Uploaded CPython 3.9+macOS 11.0+ ARM64

powerio-0.8.3-cp39-abi3-macosx_10_12_x86_64.whl (4.7 MB view details)

Uploaded CPython 3.9+macOS 10.12+ x86-64

File details

Details for the file powerio-0.8.3.tar.gz.

File metadata

  • Download URL: powerio-0.8.3.tar.gz
  • Upload date:
  • Size: 896.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/7.0.0 CPython/3.13.14

File hashes

Hashes for powerio-0.8.3.tar.gz
Algorithm Hash digest
SHA256 16cef0ba1026cf5bf73a5107db75fdb3830b28203f32fa08070e7f0fdfe0c5a2
MD5 20047907887c1596266048e583eb3125
BLAKE2b-256 cb6a9a3b3218e11fd15bad208984e18e83a75b8ec11cc5f2783dcd838b0488ac

See more details on using hashes here.

Provenance

The following attestation bundles were made for powerio-0.8.3.tar.gz:

Publisher: python.yml on eigenergy/powerio

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file powerio-0.8.3-cp39-abi3-win_amd64.whl.

File metadata

  • Download URL: powerio-0.8.3-cp39-abi3-win_amd64.whl
  • Upload date:
  • Size: 5.1 MB
  • Tags: CPython 3.9+, Windows x86-64
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/7.0.0 CPython/3.13.14

File hashes

Hashes for powerio-0.8.3-cp39-abi3-win_amd64.whl
Algorithm Hash digest
SHA256 b95e6da0c762fa0513693907e85a04069a53821e9515a4705a7c042a745b3208
MD5 874aa1337788808e4a617e967754d184
BLAKE2b-256 45a4edc74ecba0969488d41dcac144c3b5f649c7b01717792579b9cf25c8aa7e

See more details on using hashes here.

Provenance

The following attestation bundles were made for powerio-0.8.3-cp39-abi3-win_amd64.whl:

Publisher: python.yml on eigenergy/powerio

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file powerio-0.8.3-cp39-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for powerio-0.8.3-cp39-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 e80e89662a5a07bda2809ea09979469acf10fd0b92311cddeb5ba237e0219297
MD5 28bc2ad7422c70280486a8d9054a902f
BLAKE2b-256 aae9ab73def3b649820fe59be16a67b33dd311f8b329685180ee7b94a53b6078

See more details on using hashes here.

Provenance

The following attestation bundles were made for powerio-0.8.3-cp39-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl:

Publisher: python.yml on eigenergy/powerio

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file powerio-0.8.3-cp39-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl.

File metadata

File hashes

Hashes for powerio-0.8.3-cp39-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 084ac69966c8e29c872fa634d453712a0ef371df306aa827780ed70e44c1f742
MD5 45e235578a439ea18f48f4e1f483a04a
BLAKE2b-256 78a18f782d0582a2634a08fcffc48f14bdf329929a4082d6d1239aeee35f155a

See more details on using hashes here.

Provenance

The following attestation bundles were made for powerio-0.8.3-cp39-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl:

Publisher: python.yml on eigenergy/powerio

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file powerio-0.8.3-cp39-abi3-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for powerio-0.8.3-cp39-abi3-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 e4e9b4cd6bb23777f8323e35016af5f591d0e924f468a1c0b83ea59f7f280bf8
MD5 6ffaf8b6dbc3269494f6bd9297487b9a
BLAKE2b-256 9c6c73934ed1bc902a29c6095c5e787c61d9a5886eec47adca92dcae044d7aa1

See more details on using hashes here.

Provenance

The following attestation bundles were made for powerio-0.8.3-cp39-abi3-macosx_11_0_arm64.whl:

Publisher: python.yml on eigenergy/powerio

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file powerio-0.8.3-cp39-abi3-macosx_10_12_x86_64.whl.

File metadata

File hashes

Hashes for powerio-0.8.3-cp39-abi3-macosx_10_12_x86_64.whl
Algorithm Hash digest
SHA256 11b414f7bba8180114d140f746eaba65f83cf96e6154759185f90e31ee72fcbf
MD5 64cbccecf9617142aa547d44fbde838c
BLAKE2b-256 a6f6d05b1a58eebd9c7ebad062e8ed905ad0b3fa45b464f94c7e1867dcc8726c

See more details on using hashes here.

Provenance

The following attestation bundles were made for powerio-0.8.3-cp39-abi3-macosx_10_12_x86_64.whl:

Publisher: python.yml on eigenergy/powerio

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Release history Release notifications | RSS feed

0.11.2

6 files

0.11.1

6 files

0.11.0

6 files

0.10.0

6 files

0.9.0

6 files

This release

0.8.3 This release

6 files

0.8.2

6 files

0.8.1

6 files

0.7.3

6 files

0.7.2

6 files

0.7.1

6 files

0.7.0

6 files

0.6.3

6 files

0.6.2

6 files

0.6.1

6 files

0.6.0

6 files

0.5.1

6 files

0.5.0

6 files

0.4.0

6 files

0.3.3

6 files

0.3.2

6 files

0.3.1

6 files

0.3.0

6 files

0.2.4

6 files

0.2.3

6 files

0.2.2

6 files

0.2.1

6 files

0.2.0

6 files

0.1.1

6 files

0.1.0

6 files

0.0.1

6 files

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