Skip to main content

PowerIO

Rust Python Julia binding crates.io docs.rs PyPI MSRV 1.88 License: MIT OR Apache-2.0

PowerIO format and matrix flow

PowerIO reads power system data into typed values, writes those values back out in the formats other tools read, and builds the sparse matrices and graph data that solvers consume. The core is Rust, and the Python package, the Julia package PowerIO.jl, and the C ABI expose the same operations under the same names.

A parse returns a PioModule, which is one typed value together with its sources, diagnostics, source map, and history. Depending on what the source declares, the value is a network, a calculation instance, a solution, a time series, a scenario set, or a geographic layer.

Install

cargo add powerio                 # parsing, emission, PowerIO IR
cargo add powerio -F matrix       # and sparse matrices, sensitivities, graph data
pip install powerio               # pip install 'powerio[all]' adds SciPy, NetworkX, Polars
julia -e 'using Pkg; Pkg.add("PowerIO")'
cargo install powerio-cli         # the powerio command

Parse and emit

The examples use case9.m, the nine-bus MATPOWER case included in this repository. Save it in your working directory first, or replace "case9.m" with the path to your own case.

Rust:

use powerio::{PioValue, emit, parse};

fn main() -> Result<(), Box<dyn std::error::Error>> {
    let module = parse("case9.m")?;
    let PioValue::BalancedNetwork(network) = module.value() else {
        panic!("expected a balanced network");
    };
    assert_eq!(network.buses().len(), 9);
    emit(&module, "matpower", "copy.m")?;   // the source bytes, unchanged
    let result = emit(&module, "psse", "case9.raw")?;
    for finding in result.diagnostics() {
        eprintln!("{}", finding.code());    // what PSS/E cannot carry
    }
    Ok(())
}

Python:

import powerio

module = powerio.parse("case9.m")
network = module.value
assert isinstance(network, powerio.BalancedNetwork)
module.diagnostics                          # the reader's findings
powerio.emit(module, "matpower", "copy.m")  # the source bytes, unchanged
result = powerio.emit(module, "psse")       # text in memory plus findings

Julia:

using PowerIO

module_ = parse("case9.m")            # PioModule{BalancedNetwork}
net = module_.value
length(net.buses)                     # 9
module_.diagnostics
emit(module_, "matpower", "copy.m")

Command line:

powerio convert case9.m --to psse -o case9.raw
powerio serialize case9.m -o case9.pio.json
powerio verify case9.m --kind bdoubleprime
powerio sensitivities case9.m -o out

If you write an unchanged module back to its own format, you get the source back byte for byte. If you write it to another format, PowerIO keeps what that format can represent and reports each loss as a diagnostic with a stable code, so you can see what the conversion dropped. serialize and deserialize write and read PowerIO IR, the JSON document that stores a complete module for another PowerIO consumer to read back. It preserves the typed data and its history; retained source bytes stay in the running process. After deserialization, emit writes fresh output from the stored value.

Upgrading from 0.10? Start with the migration guide. PowerIO 0.11.1 keeps PowerIO IR generation 2 and C ABI 7; these version numbers describe separate interfaces.

Formats

Format Token Read Write
MATPOWER .m matpower yes yes
PSS/E RAW psse, psse34, psse35 revisions 32 to 35 33, 34, 35
PSS/E RAWX psse-rawx revision 35 35
PowSybl XIIDM xiidm 1.0 to 1.17 1.17
PowSybl JIIDM jiidm 1.0 to 1.17 1.17
CIM CGMES profile set cgmes 2.4.15, 3.0 3.0
ENTSO-E UCTE-DEF .uct ucte 2003.09.01, 2007.05.01 2007.05.01
PowerWorld .aux powerworld yes yes
PowerWorld .pwb pwb yes no
PowerWorld .pwd display powerworld-pwd as a geographic layer no
GE PSLF .epc pslf yes yes
IEEE Common Data Format ieee-cdf yes no
PowerModels JSON powermodels-json yes yes
Egret JSON egret-json yes yes
pandapower JSON pandapower-json yes yes
PyPSA CSV directory pypsa-csv yes yes
Surge JSON surge-json yes yes
GridFM Parquet directory gridfm yes yes
DOE GO Challenge 3 JSON goc3-json problem, or problem with solution a complete solution
DeepMind OPFData JSON opfdata-json yes no
OpenDSS .dss dss yes yes
PowerModelsDistribution engineering JSON pmd-json yes yes
BMOPF JSON bmopf-json 0.1.0, 0.2.0 0.2.0
Geographic layer .geo.json geo-json yes yes

The balanced transmission formats parse to BalancedNetwork, and OpenDSS, PMD, and BMOPF parse to MulticonductorNetwork. A GO Challenge 3 problem parses to AcScucInstance, a problem with its solution to AcScucSolution, an OPFData file to AcOpfSolution, a GridFM dataset to ScenarioSet<BalancedNetwork>, and a PyPSA directory with several snapshots to a TimeSeries. The format guide says what each reader keeps, what each writer reports, and how each is checked against its reference implementation.

Packages

Start with powerio in an application. The component crates let libraries depend on just the layer they use.

Crate Provides
powerio PioValue, parse, emit, serialize, deserialize
powerio-core Source, PioModule, diagnostics, collections, destinations
powerio-tx BalancedNetwork and balanced format readers and writers
powerio-dist MulticonductorNetwork and OpenDSS, PMD, BMOPF converters
powerio-prob Operating points, updates, calculation instances and solutions
powerio-matrix Sparse matrices, sensitivities, DC OPF bundles and graph data
powerio-cli The powerio command and its terminal interface
powerio-py The native extension used by the Python package
powerio-capi C ABI 7, used by Julia and other FFI bindings

powerio-tx and powerio-dist share powerio-core and nothing else, so a distribution consumer pulls in no transmission code. powerio-prob is matrix free. The powerio facade re-exports the component crates, with powerio-matrix behind its matrix feature.

Documentation

License

Apache License 2.0 or MIT License, at your option.

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.11.2.tar.gz (1.9 MB view details)

Uploaded Source

Built Distributions

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

powerio-0.11.2-cp39-abi3-win_amd64.whl (9.9 MB view details)

Uploaded CPython 3.9+Windows x86-64

powerio-0.11.2-cp39-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (9.3 MB view details)

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

powerio-0.11.2-cp39-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl (8.2 MB view details)

Uploaded CPython 3.9+manylinux: glibc 2.17+ ARM64

powerio-0.11.2-cp39-abi3-macosx_11_0_arm64.whl (8.0 MB view details)

Uploaded CPython 3.9+macOS 11.0+ ARM64

powerio-0.11.2-cp39-abi3-macosx_10_12_x86_64.whl (9.0 MB view details)

Uploaded CPython 3.9+macOS 10.12+ x86-64

File details

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

File metadata

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

File hashes

Hashes for powerio-0.11.2.tar.gz
Algorithm Hash digest
SHA256 cfbbc56d92971f804b6c86a04246a82105963dfdbd6e289037c3dd4821417793
MD5 99a7018768746fa4610a449f5a019eea
BLAKE2b-256 e63d0938475255b2431d74db35b45181b25ebb8f26a2f0dd098d4e2d4c3c35d3

See more details on using hashes here.

Provenance

The following attestation bundles were made for powerio-0.11.2.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.11.2-cp39-abi3-win_amd64.whl.

File metadata

  • Download URL: powerio-0.11.2-cp39-abi3-win_amd64.whl
  • Upload date:
  • Size: 9.9 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.11.2-cp39-abi3-win_amd64.whl
Algorithm Hash digest
SHA256 4b3b23d8431f9a0f5be1a565d8d384439fe2ea7abf7c15989705ad33500a009d
MD5 464233389a97a2ffb5f2a04d5af6f993
BLAKE2b-256 c9a393d9a23d271df9b7e783c1f920087c9e0a93e34adeedfbb68eb98f10b1fd

See more details on using hashes here.

Provenance

The following attestation bundles were made for powerio-0.11.2-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.11.2-cp39-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for powerio-0.11.2-cp39-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 3cbd889ebbfa2dc498ff1ab12c5ac7d6e0aaa8d4ad39df9682968e23ff0ea6db
MD5 923eb68b066dedf24865fc8d6a029881
BLAKE2b-256 caac55f9c4c697695376afff8d21a8b445d5d6c4c1aa0edee75635fc55b82ead

See more details on using hashes here.

Provenance

The following attestation bundles were made for powerio-0.11.2-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.11.2-cp39-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl.

File metadata

File hashes

Hashes for powerio-0.11.2-cp39-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 060c85d614a259353a45cb7d4c8fe093033475477d9d8e9b8a97e087f07aafa6
MD5 8244b1b0e87119d10bc4b2e8bd2eb808
BLAKE2b-256 f2e2ce5d01199cfb3cb130083ce22df286d3c22f350fc9fa073da3cd69e7156d

See more details on using hashes here.

Provenance

The following attestation bundles were made for powerio-0.11.2-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.11.2-cp39-abi3-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for powerio-0.11.2-cp39-abi3-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 22e5fa12ca4563aef4e672848a50a40d61f3185c9d495b559f9cdd6b82c6e875
MD5 03e23ddcea8a80ff77b59ef26f96b84b
BLAKE2b-256 63728fb5304b624951b9c96de48c0aab49a68ea2908cdea4ff80f47caa231cb7

See more details on using hashes here.

Provenance

The following attestation bundles were made for powerio-0.11.2-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.11.2-cp39-abi3-macosx_10_12_x86_64.whl.

File metadata

File hashes

Hashes for powerio-0.11.2-cp39-abi3-macosx_10_12_x86_64.whl
Algorithm Hash digest
SHA256 c50eff85e1f5e1e40e902db86df40f2e171653bdc0c0683c877db488d6902dd8
MD5 9cfdfdbb01710822cbec34688dcdff78
BLAKE2b-256 e7f84da310a739c21f20b8166384596b788035bea30fb3ae026868fed5d932c3

See more details on using hashes here.

Provenance

The following attestation bundles were made for powerio-0.11.2-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

This release

0.11.2 This release

6 files

0.11.1

6 files

0.11.0

6 files

0.10.0

6 files

0.9.0

6 files

0.8.3

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