DiTTo is an open-source tool developed by NREL's Distribution Suites team for converting and modifying electrical distribution system models. It enables seamless conversion between different distribution network formats, with the primary domain being substations to customers.
Flexible representations for power system components are defined in Grid-Data-Models (GDM) format. DiTTo implements a many-to-one-to-many parsing framework, making it modular and robust. The reader modules parse data files of distribution system format (e.g. OpenDSS) and create an object for each electrical component. These objects are stored in a GDM DistributionSystem instance. The writer modules are then used to export the data stored in memory to a selected output distribution system format (e.g. OpenDSS) which are written to disk.
- Multi-format Support: Read and write models from OpenDSS, CIM/IEC 61968-13, and more
- Robust Architecture: Many-to-one-to-many parsing framework ensures modularity and extensibility
- GDM Integration: Built on Grid-Data-Models (GDM) for flexible power system component representation
- Validation: Thorough model validation during conversion
- Serialization: Full JSON serialization/deserialization support for converted models
DiTTo implements a many-to-one-to-many parsing framework:
┌─────────────┐ ┌─────────────┐ ┌─────────────┐
│ OpenDSS │ │ │ │ OpenDSS │
├─────────────┤ │ GDM │ ├─────────────┤
│ CIM/IEC │ ──▶ │ Distribution│ ──▶ │ CYME │
├─────────────┤ │ System │ ├─────────────┤
│ CYME │ │ │ │ JSON │
└─────────────┘ └─────────────┘ └─────────────┘
READERS INTERMEDIATE WRITERS
- Readers parse distribution system files and create component objects
- All components are stored in a GDM DistributionSystem instance (intermediate format)
- Writers export the data to the desired output format
pip install nrel-dittogit clone https://github.com/NREL-Distribution-Suites/ditto.git
cd ditto
pip install -e .# For documentation building
pip install nrel-ditto[doc]
# For development (includes pytest, ruff)
pip install nrel-ditto[dev]from pathlib import Path
from ditto.readers.opendss.reader import Reader
# Read an OpenDSS model
opendss_file = Path("path/to/IEEE13NODE.dss")
reader = Reader(opendss_file)
system = reader.get_system()
# Access components
print(f"Loaded {len(list(system.get_buses()))} buses")from pathlib import Path
from ditto.readers.cim_iec_61968_13.reader import Reader
from ditto.writers.opendss.write import Writer
# Read CIM model
cim_reader = Reader("path/to/ieee13_cim.xml")
cim_reader.read()
system = cim_reader.get_system()
# Write to OpenDSS format
writer = Writer(system)
writer.write(
output_path=Path("./output"),
separate_substations=False,
separate_feeders=False
)from pathlib import Path
from ditto.readers.opendss.reader import Reader
# Read and serialize
reader = Reader(Path("IEEE13NODE.dss"))
system = reader.get_system()
system.to_json(Path("IEEE13NODE.json"), overwrite=True)from pathlib import Path
from gdm import DistributionSystem
# Deserialize a saved model
system = DistributionSystem.from_json(Path("IEEE13NODE.json"))| Format | Status | Description |
|---|---|---|
| OpenDSS | ✅ Complete | Full support for OpenDSS models |
| CIM/IEC 61968-13 | ✅ Complete | Common Information Model support |
| CYME | 🚧 In Progress | CYME network models |
| Format | Status | Description |
|---|---|---|
| OpenDSS | ✅ Complete | Full DSS file generation |
| JSON/GDM | ✅ Complete | Serialized GDM format |
DiTTo handles a comprehensive set of distribution system components:
- Network: Buses, Lines/Branches, Cables, Conductors
- Transformers: Distribution transformers with multiple windings
- Loads: Various load types (constant power, impedance, ZIP)
- Generation: PV systems, Voltage sources
- Protection: Fuses, Regulators with controllers
- Storage: Battery/energy storage systems
- Capacitors: Shunt capacitors
- Time-Series: Load shapes and profiles
ditto/
├── src/ditto/
│ ├── readers/ # Format parsers
│ │ ├── opendss/ # OpenDSS reader
│ │ ├── cim_iec_61968_13/ # CIM reader
│ │ └── cyme/ # CYME reader
│ ├── writers/ # Format exporters
│ │ └── opendss/ # OpenDSS writer
│ └── enumerations.py # Shared enumerations
├── tests/ # Test suite
├── docs/ # Documentation
└── pyproject.toml # Project configuration
- Architecture Guide - System design and components
- API Reference - Reader and writer documentation
- Examples - Detailed usage examples
- Contributing Guide - How to contribute
- Python 3.10, 3.11, or 3.12
- Dependencies are automatically installed:
grid-data-models- GDM intermediate representationopendssdirect.py- OpenDSS interfacerdflib- RDF/XML parsing for CIMNREL-altdss-schema- DSS output schema
DiTTo is an open-source project and contributions are welcome! Whether it's a typo fix, bug report, or a new parser, we appreciate your help.
- Fork the repository
- Create a feature branch (
git checkout -b feature/amazing-feature) - Make your changes
- Run tests (
pytest) - Submit a Pull Request
See CONTRIBUTING.md for detailed guidelines.
- Issues: GitHub Issues
- Questions: Contact Tarek Elgindy
This project is licensed under the MIT License - see the LICENSE file for details.
DiTTo is developed and maintained by the NREL Distribution Suites team at the National Renewable Energy Laboratory.