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_format(self, cim_model, **kwargs):
        ...

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.0a0

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.0a0
File Size Uploaded Provenance Actions
cimhub_core-2.0.0a0.tar.gz 49.7 kB With provenance Details for cimhub_core-2.0.0a0.tar.gz

Built distribution (wheel)

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

Total release size: 109.8 kB

Release files / cimhub_core-2.0.0a0.tar.gz

Download URL cimhub_core-2.0.0a0.tar.gz
Size 49.7 kB
Tags Source
SHA-256 checksum
How to use checksums
4eb7edeff747614172cb879af0b3026bb1dfad5a3793984f4bd0316edfc340cb
BLAKE2b-256 checksum
How to use checksums
cddadba7b513988b82fca48097b5f4389b76748877dd8c0ad866f14485e317d9
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.12

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 Jul 16, 2026.

Transparency log

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

Download URL cimhub_core-2.0.0a0-py3-none-any.whl
Size 60.1 kB
Tags Python 3
SHA-256 checksum
How to use checksums
d99e097f67e2b6649fa7f2c460672c881f9d16b44a3502599f16c4c325b4346a
BLAKE2b-256 checksum
How to use checksums
70e33f75276a9cb089b6db7a454c50a4e627e52f88520384bcd2021683f148eb
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.12

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 Jul 16, 2026.

Transparency log

Security for cimhub_core 2.0.0a0

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.0a0.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 Jul 16, 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