Package: ditto.py
DiTTo is theDistribution Transformation Tool. It is an open source
tool to convert and modify electrical distribution system models. The
most common domain of electrical distribution systems is from
substations to customers.How it WorksFlexible representations for power system components are defined in the
ditto models definedhereDiTTo
implements amany-to-one-to-manyparsing framework which makes it
modular and robust. Thereader
modulesparse data files of distribution system format (e.g. OpenDSS) and create
an object for each electrical component. These objects are stored in aStoreinstance. Thewriter
modulesare
then used to export the data stored in memory to a selected output
distribution system format (e.g. Gridlab-D) which are written to disk.Additional functionality can be found in the documentationhere.Quick StartInstall DiTTopipinstallditto.pyThis will install the basic version of ditto with limited dependencies.
Because ditto supports conversion between many multiple formats,
dependencies can be specified during installation For example:pipinstall"ditto.py[extras,opendss,gridlabd]"will install the required dependencies to convert between opendss and
gridlab-dTo install the full dependency list run:pipinstall"ditto.py[all]"which is the same aspipinstall"ditto.py[extras,opendss,cyme,dew,ephasor,synergi,gridlabd]"# same as `pip install "ditto.py[all]"`Basic UsageThe most basic capability of DiTTo is the conversion of a distribution
system from one format to another. To convert a cyme model represented
in ASCII format with network.txt, equipment.txt and load.txt files, the
following python script can be run to perform the conversionfromditto.storeimportStorefromditto.readers.cyme.readimportReaderfromditto.writers.opendss.writeimportWriterstore=Store()reader=Reader(data_folder_path='.',network_file='network.txt',equipment_file='equipment.txt',load_file='load.txt')reader.parse(store)writer=Writer(output_path='.')writer.write(store)The required input files for each reader format are defined in the
folder of each readerCommand Line InterfaceDitto can also be run as a command line tool to perform basic
conversion. The CLI accepts only one input file whatever the format. If
we have a gridlabd model entirely stored in a file called model.glm we
can use:$ditto-cliconvert--fromglm--input./model.glm--tocymeFor formats like CYME where multiple input files are needed, a simple
JSON configuration file is supplied:{"data_folder_path":".","network_filename":"network.txt","equipment_filename":"equipment.txt","load_filename":"load.txt"}A default configuration file is found each reader folder. So to convert
the cyme files described in the python program above, the following
command would be used:$ditto-cliconvert--fromcyme--input./config.json--todssDocumentation on converting other formats can be foundhere.ContributingDiTTo is an open source project and contributions are welcome! Either
for a simple typo, a bugfix, or a new parser you want to integrate, feel
free to contribute.To contribute to Ditto in 3 steps: - Fork the repository (button in the
upper right corner of the DiTTo GitHub page). - Create a feature branch
on your local fork and implement your modifications there. - Once your
work is ready to be shared, submit a Pull Request on the DiTTo GitHub
page. See the official GitHub documentation on how to do thathereGetting HelpIf you are having issues using DiTTo, feel free to open an Issue on
GitHubhereAll contributions are welcome. For questions about collaboration please
emailTarek Elgindy