Skip to main content

cimhub-opendss

OpenDSS converter for CIMHub: OpenDSS .dss decks to and from CIM (cim18v17). DssReader parses a deck into native records. DssImporter maps them to .cimtbl text (one file per DSS class, values copied verbatim in the deck's units), and cimtables builds the CIM model from that text. DssExporter reads a CIM model through the cimhub-core getters and DssWriter writes a deck that DssReader and the importer read back.

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

Python 3.11 or later.

Quickstart

from cimhub_opendss import DssReader, cim_to_dss, dss_to_cim

# IEEE13Nodeckt.dss and IEEELineCodes.dss: cimhub_opendss/tests/decks/IEEE/IEEE13_original/ in the repository
network = dss_to_cim(DssReader("IEEE13Nodeckt.dss").read_all(), name="IEEE13", artifact_dir="ieee13_cimtbl")
cim_to_dss(network, "ieee13_export.dss")
  • dss_to_cim(model, *, name, authority=..., length_unit=None, device_geometry="point", network=None, artifact_dir=None, time_points=None) returns the CIM network. name is the model name and the master file stem. Without artifact_dir the .cimtbl files go to a temporary directory that is removed after loading. length_unit is the per-length unit of impedances that give no units: a LineCode with none on the code or its lines, and a line's own inline values with none on the line. It replaces the magnitude guess; a code or line with its own units keeps them. device_geometry draws a two-terminal device's coordinates as a "point" midway between its buses or a "linestring" from bus to bus. time_points is a dict that receives the yearly shapes' time points (loads' and devices'); without it they are dropped with a warning.
  • cim_to_dss(network, destination, *, per_class=False, time_points=None, **opts) writes the deck. per_class=True writes one file per DSS class beside the master, which Redirects them; time_points is the dict of time point tables the yearly shapes are read from. opts go to DssExporter.to_model: name_source ('name', 'mrid' or 'uri'; default $CIMHUB_NAME_SOURCE, else 'mrid'), circuit_source, the EnergySource to write as New Circuit when the model has several, and switch_state ('actual', the default, or 'normal').

What is supported

DSS class Import Export
Circuit / Vsource yes yes
Line (matrix, sequence and geometry impedance), LineCode, LineGeometry, LineSpacing, WireData, CNData, TSData yes yes
Switches (Line with Switch=y, Fuse, Recloser, SwtControl) yes yes
Transformer, XfmrCode, RegControl yes yes
Load, LoadShape (yearly), Capacitor, CapControl yes yes
PVSystem, Storage, Generator yes yes
Reactor yes yes
Bus coordinates yes yes

The master .cimtbl lists, in a comment, every DSS class in the deck that no mapper reads yet, with its record count. The exporter raises, naming the classes and counts, when the CIM model holds conducting equipment of a class it does not export. Unknown fields, unmapped enumerations and unresolved references raise on import. A deck without a New Circuit, or with a second one, raises.

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_opendss 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_opendss 2.1.0
File Size Uploaded Provenance Actions
cimhub_opendss-2.1.0.tar.gz 413.6 kB Without provenance Details for cimhub_opendss-2.1.0.tar.gz

Built distribution (wheel)

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

Total release size: 820.0 kB

Release files / cimhub_opendss-2.1.0.tar.gz

Download URL cimhub_opendss-2.1.0.tar.gz
Size 413.6 kB
Tags Source
SHA-256 checksum
How to use checksums
846b87344f148ae9b8d0a1f78f345931c36215bca241166c138293a7f5a2bd98
BLAKE2b-256 checksum
How to use checksums
a9575b1235ed280b2cb8be038e27810e0c372f2ff201ba525941c7dc860e3ba4
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_opendss-2.1.0-py3-none-any.whl

Download URL cimhub_opendss-2.1.0-py3-none-any.whl
Size 406.4 kB
Tags Python 3
SHA-256 checksum
How to use checksums
74b8452c1a6262861273d8ca15899396cfa1c474a802e345cbc15b740304a88c
BLAKE2b-256 checksum
How to use checksums
3bdcde60ea5e215230109bfd4ef40c760859c99aba2f10c49721a319299f86df
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_opendss 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