Skip to main content

cimhub-core

The shared layer of CIMHub, which converts power-system model formats to and from CIM (cim18v17 only). Core holds only what the format packages share and no upstream library provides: the .cimtbl import contract (CimtblImporter), the abstract reader, writer, importer and exporter classes, a typed store for native records (GraphModel), the export getters (cimhub_core.getters), canonical .cimtbl table shapes (cimhub_core/shapes/), derived-value helpers (cimhub_core.derived) and a test harness (cimhub_core.cimtbl_testing). You install it as a dependency of a format package; install it directly to write a new one.

pip install --pre cimhub-core

Python 3.11 or later.

Quickstart

Getters read one CIM concept and return plain floats in the unit you ask for. This example imports an OpenDSS deck (needs cimhub-opendss) and reads a load's power in kW and kVAr.

import cimprofiles.cim18.cim18v17 as cim

from cimhub_core.getters.load import get_phase_loads
from cimhub_opendss import DssReader, dss_to_cim

deck = "IEEE13Nodeckt.dss"   # copy the files in cimhub_opendss/tests/decks/IEEE/IEEE13_original/ next to it
network = dss_to_cim(DssReader(deck).read_all(), name="IEEE13")
consumer = next(iter(network.graph[cim.EnergyConsumer].values()))
print(consumer.name, get_phase_loads(consumer, "kW", "kVAr").total)   # 611 PhasePower(p=170.0, q=80.0)

What core provides

Module Purpose
cimhub_core.base FormatReader, FormatWriter, FormatImporter, CimtblImporter, FormatExporter
cimhub_core.graph_model GraphModel: indexed store for native LinkML dataclasses
cimhub_core.cimtbl mapper helpers: Field, fill_defaults, check_fields, fields_table, cimtbl_to_cim
cimhub_core.getters one getter per CIM concept (terminals, load, switch state, line impedance, tap changer, ...)
cimhub_core.names export naming: name, mrid or uri, chosen by argument or CIMHUB_NAME_SOURCE
cimhub_core.cimtbl_testing cim_scope, assert_matches_golden; CIMHUB_UPDATE_GOLDENS=1 regenerates goldens
cimhub_core.scaffold scaffold_package: generate a new format package
cimhub_core.time_points the Parquet sidecar of schedule time points beside the CIM XML: nc_schedule EnergyConnectionTimePoints and the RegularTimePoints of any RegularIntervalSchedule (write_time_points, read_time_points, rows_by_schedule, regular_time_points, add_regular_time_points, add_device_time_points; a group schedule's points through getters.load_schedule.get_schedule_points, a device's through getters.device_schedule.get_device_schedule); install cimhub-core[time-points]

Topology (spanning trees, islands, voltage zones) comes from cimtopology, not from core.

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_core 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_core 2.1.0
File Size Uploaded Provenance Actions
cimhub_core-2.1.0.tar.gz 149.6 kB Without provenance Details for cimhub_core-2.1.0.tar.gz

Built distribution (wheel)

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

Total release size: 274.0 kB

Release files / cimhub_core-2.1.0.tar.gz

Download URL cimhub_core-2.1.0.tar.gz
Size 149.6 kB
Tags Source
SHA-256 checksum
How to use checksums
16e6f1be3f2ca0fabb91df5965def266558505a99b57d9e0412a1ac17483f113
BLAKE2b-256 checksum
How to use checksums
6f0b867ce54475f89042eaf703f720f7eb7d0a04c61ed781b9b5b29f5a6b263f
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_core-2.1.0-py3-none-any.whl

Download URL cimhub_core-2.1.0-py3-none-any.whl
Size 124.5 kB
Tags Python 3
SHA-256 checksum
How to use checksums
b8c8ca2134a1c58a4a61014769ab3c8d4cd969ccca885ed1a6750ad19f573fcb
BLAKE2b-256 checksum
How to use checksums
66401ee1356bc4e2156213954f30523f5220ebf44e59b571999cf31441c9bd19
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_core 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