Skip to main content

cimhub-raw

PSS/E RAW v34 importer and exporter for CIMHub: RAW cases to and from CIM (cim18v17). Raw34Reader parses a case into native records. RawImporter maps them to .cimtbl text (one file per RAW table, values copied verbatim in the case's units), and cimtables builds the CIM model from that text. RawExporter reads a CIM network through the core getters and returns RAW records, which Raw34Writer writes as a .raw file (cim_to_raw(network, path) does both).

pip install --pre cimhub-raw      # also installs cimhub-core

Python 3.11 or later. Version 2.1 is in alpha.

Quickstart

import cimprofiles.cim18.cim18v17 as cim

from cimhub_raw.importer.raw_to_cimtbl import raw_to_cim
from cimhub_raw.raw34_reader import Raw34Reader
from cimhub_raw.raw34_writer import Raw34Writer

# IEEE_14_bus.raw: cimhub_raw/tests/cases/IEEE14/ in the repository
model = Raw34Reader("IEEE_14_bus.raw").read_all()
network = raw_to_cim(model, name="IEEE14", artifact_dir="ieee14_cimtbl")
print(len(network.graph[cim.TopologicalNode]), "buses")   # 14 buses
Raw34Writer().write(model, "ieee14_copy.raw")

from cimhub_raw.exporter.cim_to_raw import cim_to_raw
cim_to_raw(network, "ieee14_from_cim.raw")                # CIM back to RAW

raw_to_cim(model, *, name, authority=..., network=None, artifact_dir=None) returns the CIM network. Without artifact_dir the .cimtbl files go to a temporary directory. name is the model name and the master file stem.

What is supported

RAW data Import
Case identification, system-wide data, zones, areas, interarea transfers, owners yes (owners are untranscribed: CIM has no home for them)
Buses, substations and node-breaker data (nodes, switching devices, equipment terminals) yes
Branches, system switching devices, multi-section lines yes
Loads, fixed shunts, switched shunts yes
Generators (including renewable models and implicit step-up transformers) yes
Two- and three-winding transformers, phase shifters, impedance correction tables yes
Two-terminal DC lines, VSC DC lines, FACTS devices yes
Multi-terminal DC lines, GNE devices, induction machines raise NotImplementedError when the case has any

Raw34Writer raises for a multi-terminal DC or GNE section; induction machines are read and written, and only the importer raises on them. Blank or missing fields take the schema's default and are listed on the row comment (# defaulted: ...).

The repository carries three public cases: IEEE 14 bus, IEEE 118 bus (with four node-breaker substations) and the WECC 240 bus case. Other cases are not distributed.

Documentation

BSD 3-Clause. Source and issues: https://github.com/PNNL-CIM-Tools/CIMHub.

License and attribution

BSD 3-Clause. See LICENSE. Contributors are listed in AUTHORS.

This software was created under a project sponsored by the U.S. Department of Energy's Office of Electricity, an agency of the United States Government. Neither the United States Government nor the United States Department of Energy, nor Battelle, nor any of their employees, nor any jurisdiction or organization that has cooperated in the development of these materials, makes any warranty, express or implied, or assumes any legal liability or responsibility for the accuracy, completeness, or usefulness or any information, apparatus, product, software, or process disclosed, or represents that its use would not infringe privately owned rights.

PACIFIC NORTHWEST NATIONAL LABORATORY
operated by BATTELLE
for the UNITED STATES DEPARTMENT OF ENERGY
under Contract DE-AC05-76RL01830

Metadata

Release files for cimhub_raw 2.1.0

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

Source distribution (sdist)

Source distribution for cimhub_raw 2.1.0
File Size Uploaded Provenance Actions
cimhub_raw-2.1.0.tar.gz 197.2 kB Without provenance Details for cimhub_raw-2.1.0.tar.gz

Built distribution (wheel)

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

Total release size: 405.9 kB

Release files / cimhub_raw-2.1.0.tar.gz

Download URL cimhub_raw-2.1.0.tar.gz
Size 197.2 kB
Tags Source
SHA-256 checksum
How to use checksums
8b511b7b35aefa092ad4bccb6ed09a22847e289524f6a5b0e68ba64eee1babc2
BLAKE2b-256 checksum
How to use checksums
5da32ecb58a247942b7d76c9eef794113a6b135774bc78e370ab168bfa56e7f3
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via uv/0.13.10 {"installer":{"name":"uv","version":"0.13.10","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"26.04","id":"resolute","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

Release files / cimhub_raw-2.1.0-py3-none-any.whl

Download URL cimhub_raw-2.1.0-py3-none-any.whl
Size 208.7 kB
Tags Python 3
SHA-256 checksum
How to use checksums
767538252535b67b879581a414cb1364866690e8efd974acaa6d921f546c163a
BLAKE2b-256 checksum
How to use checksums
531f4b22ea367286a9f8b17d1ed93f607277c823280f62ce36e0261838b4372c
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via uv/0.13.10 {"installer":{"name":"uv","version":"0.13.10","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"26.04","id":"resolute","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

Security for cimhub_raw 2.1.0

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