Skip to main content
Pre-release

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

cimhub_core

Shared foundation for all CIMHub converter packages. Provides the base classes, data model, and utilities that every spoke in the hub-and-spoke architecture depends on.

What's in here

Module Purpose
base.py ABCs: FormatReader, FormatWriter, FormatImporter, FormatExporter
graph_model.py GraphModel — typed in-memory store for LinkML dataclasses
registry.py ConverterRegistry — decorator-based dispatch for import/export functions
scaffold.py Code generator that scaffolds a new converter package from a template
serialization.py Shared serialization helpers (CSV, YAML round-trips)
connectivity/ Topology helpers (bus lookups, connectivity node resolution)
transformations/ CIM-to-CIM geometry transforms (wire spacings, coordinate systems)
get_utils/ get_or_create helpers for common CIM objects (BaseVoltage, Substation, etc.)
mcp/ MCP server tools for LLM-assisted model introspection

Architecture

Every CIMHub converter follows the same four-layer pipeline:

LinkML YAML schemas   →   Generated dataclasses   →   GraphModel   →   FormatReader / FormatWriter
                                                            ↕
                                                    FormatImporter / FormatExporter
                                                    (native ↔ CIM conversion)

cimhub_core owns the bottom two layers (GraphModel + ABCs). Each spoke package owns its own LinkML schema, generated dataclasses, and converter implementations.

GraphModel

The central data container. A sorted dictionary keyed by class then by identifier.

from cimhub_core import GraphModel

model = GraphModel()
model.add_to_graph(obj)

# Retrieve all objects of a class (sorted by identifier)
buses = model.list_by_class(schema.BusRecord)

# Search by attribute value
gen = model.find_by_attribute(schema.GeneratorRecord, "bus_number", 101)

# Counts and membership
model.count(schema.BusRecord)
schema.BusRecord in model
len(model)

Converter ABCs

from cimhub_core import FormatImporter, FormatExporter

class MyImporter(FormatImporter):
    def to_cim(self, source, **kwargs):
        ...

class MyExporter(FormatExporter):
    def to_model(self, network, **opts):
        """Return a GraphModel of native-format objects. No file I/O."""
        ...

See cimhub_core/src/cimhub_core/development/CONVERTER_API.md for the full contract.

Development Docs

The development/ directory contains the canonical references for all converter authors:

Doc What it covers
CONVERTER_API.md Public API every converter must expose
READER_WRITER_GUIDE.md FormatReader / FormatWriter implementation guide
LINKML_TEMPLATE.md How to write LinkML schemas for native formats
UNITS.md CIMUnit usage — never manually multiply by 1e3/1e6
STYLE_GUIDE.md Coding rules (KISS → DRY → Readable → Maintainable)
ARCHITECTURE.md Full sub-package architecture diagram
TEST_FIXTURE_ARCHITECTURE.md 4-tier test strategy
CONDUCTOR_GEOMETRY_ANTI_PATTERNS.md Line/cable geometry export rules

Metadata

Release files for cimhub_core 2.0.0a2

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.0.0a2
File Size Uploaded Provenance Actions
cimhub_core-2.0.0a2.tar.gz 63.8 kB With provenance Details for cimhub_core-2.0.0a2.tar.gz

Built distribution (wheel)

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

Total release size: 138.7 kB

Release files / cimhub_core-2.0.0a2.tar.gz

Download URL cimhub_core-2.0.0a2.tar.gz
Size 63.8 kB
Tags Source
SHA-256 checksum
How to use checksums
ab123fa1552911f7c83fa6e91f8dcc008cdc9cccef9a15141aadaa7f223bd3c1
BLAKE2b-256 checksum
How to use checksums
0e1b934a271b28c17fb52b8460bc976f656c58d1341971e2c5d9f4dfb71c7eb6
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

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 Aug 17, 2026.

Transparency log

Release files / cimhub_core-2.0.0a2-py3-none-any.whl

Download URL cimhub_core-2.0.0a2-py3-none-any.whl
Size 74.9 kB
Tags Python 3
SHA-256 checksum
How to use checksums
226dc4b55098b75f56642f6e4f14463bc7b4d8c74cc7c4229e0078c18299ece7
BLAKE2b-256 checksum
How to use checksums
435375e5ead7c4607fe868428f24f9fe9b553abf0074d4ee62d47c79c90cec58
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

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 Aug 17, 2026.

Transparency log

Security for cimhub_core 2.0.0a2

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 cimhub_core-2.0.0a2.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 Aug 17, 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