Skip to main content
Pre-release

This release is a pre-release and may not be stable for production use.

CIM-Builder

CIM-Builder is a Python library from Pacific Northwest National Laboratory, developed under the Grid Atlas and MAPLE LEAF projects, for building IEC CIM power system models from scratch. Other CIM tooling converts an existing source, such as an OpenDSS, PSS/E or GIS model; CIM-Builder writes the CIM objects directly, one call per piece of equipment or per substation. It can:

  1. create new node-breaker substations from API calls,
  2. insert existing CIM distribution feeders into those substations,
  3. add new equipment and measurements to an existing model, and
  4. insert aggregate feeder data into an existing CIM transmission model.

Everything lands in a cim-graph model, ready to save as CIM RDF/XML or JSON-LD.

Documentation: https://pnnl-cim-tools.github.io/CIM-Builder/

Installation

CIM-Builder needs Python 3.10 or newer. It is installed as cim-builder and imported as cimbuilder:

pip install --pre cim-builder

--pre is needed while CIM-Builder's dependencies, cim-tables, cim-graph and cim-profiles, are pre-releases. With uv: uv add --prerelease allow cim-builder.

Example

A 115 kV ring bus substation with four sections and a branch on each:

from cimgraph.utils import write_xml
from cimtables.units import Qty

from cimbuilder.network import new_feeder_model
from cimbuilder.object_builder import BaseVoltageBuilder
from cimbuilder.substation_builder import RingBusSubstationBuilder

network = new_feeder_model(authority="https://example.com/models", model="demo", Feeder="fdr_demo")
BaseVoltageBuilder(network, network.container).create(mRID="bv_115kV", nominalVoltage=Qty(115, "kV"))

builder = RingBusSubstationBuilder(network, network.container)
substation = builder.create(mRID="sub_ring", name="Ring bus")
substation, voltage_level = builder.add_voltage_level(substation, mRID="vl_115", BaseVoltage="bv_115kV")
voltage_level, busbars, ring = builder.add_buses(voltage_level, sections=4)
for section in (1, 2, 3, 4):
    builder.add_branch(voltage_level, section=section, node=f"line_{section}")

write_xml(network, "ring_bus.xml")  # 4 busbars, 4 breakers, 12 disconnectors

The builder writes every ConnectivityNode, Terminal, BusbarSection, breaker and disconnector of the layout, with consistent mRIDs, in the right VoltageLevel with its BaseVoltage.

What is in the package

Substation builders: cimbuilder.substation_builder

One builder per node-breaker layout. Each has add_buses for the busbars and bus ties, and add_branch for the switches between a bus and a branch node:

Builder add_buses options add_branch connection point
SingleBusSubstationBuilder number
SectionalizedBusSubstationBuilder sections=2 section, number
MainAndTransferSubstationBuilder number
DoubleBusSingleBreakerSubstationBuilder number, bus=1
RingBusSubstationBuilder sections=4 section
BreakerAndHalfSubstationBuilder diameters=2 diameter, side

add_branch(..., node=...) creates the branch node if it does not exist yet. Given the head node of a distribution feeder already loaded into the same graph, it connects the substation to that feeder instead.

Object builders: cimbuilder.object_builder

One builder per CIM class: lines, switches, transformers, regulators and tap changers, loads and shunt capacitors, sources, generators and inverters, measurements and operational limits. Each builder creates the object, then fills it in one CIM profile part at a time:

line_builder = ACLineSegmentBuilder(network, container)
line = line_builder.create(mRID="line_1", name="line 1")
line_builder.add_connectivity(
    line, node1="bus_1", node2="bus_2", phases="ABC", length=Qty(1.2, "km"), BaseVoltage="bv_12_47kV"
)
line_builder.add_electrical(line, r=Qty(0.3, "ohm"), x=Qty(0.6, "ohm"))

Other objects are referred to by mRID, nodes are created as they are first used, and values can be given in any unit as a Qty.

Aggregate feeders: cimbuilder.feeder_builder

new_aggregate_feeder adds a whole distribution feeder to a transmission model as one head breaker, one aggregate load, aggregate behind-the-meter and front-of-the-meter PV and wind, and the feeder-head measurements an under-frequency load shedding study reads.

Development

git clone https://github.com/PNNL-CIM-Tools/CIM-Builder.git -b develop
cd CIM-Builder
uv sync
uv run pytest

See the developer docs for how the builders are put together and how to build the documentation, and Contributing before opening a pull request.

Attribution and Disclaimer

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.

Reference herein to any specific commercial product, process, or service by trade name, trademark, manufacturer, or otherwise does not necessarily constitute or imply its endorsement, recommendation, or favoring by the United States Government or any agency thereof, or Battelle Memorial Institute. The views and opinions of authors expressed herein do not necessarily state or reflect those of the United States Government or any agency thereof.

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

Metadata

Release files for cim-builder 0.1.1a4

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

Source distribution (sdist)

Source distribution for cim-builder 0.1.1a4
File Size Uploaded Provenance Actions
cim_builder-0.1.1a4.tar.gz 3.6 MB With provenance Details for cim_builder-0.1.1a4.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for cim-builder 0.1.1a4
File Interpreter ABI Platform Actions
cim_builder-0.1.1a4-py3-none-any.whl Python 3 none any Details for cim_builder-0.1.1a4-py3-none-any.whl

Total release size: 3.7 MB

Release files / cim_builder-0.1.1a4.tar.gz

Download URL cim_builder-0.1.1a4.tar.gz
Size 3.6 MB
Tags Source
SHA-256 checksum
How to use checksums
0aa874461a0f70900d61a1373f8df072cda8cba9b6743d0a36f6cde6d5a6a683
BLAKE2b-256 checksum
How to use checksums
2397fabdbd4c869abe5998110690ebf8ac41cbd4eed0a2b559c53c5b15976ef2
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

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.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 30, 2026.

Transparency log

Release files / cim_builder-0.1.1a4-py3-none-any.whl

Download URL cim_builder-0.1.1a4-py3-none-any.whl
Size 113.7 kB
Tags Python 3
SHA-256 checksum
How to use checksums
4ad5cb76c1d1a48ce13ab6906ab29472b545f78825c3185b606c6db575ef90a2
BLAKE2b-256 checksum
How to use checksums
6561bd84b95092d09b49abd5f5e539e45e203837904be4cdadaba2343f7a5f16
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

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.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 30, 2026.

Transparency log

Security for cim-builder 0.1.1a4

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.

Full provenance

Both files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for cim_builder-0.1.1a4.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 30, 2026.

Transparency log

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