convert-network

The convert-network command is used to import a network from a file and to export it to another file, in the specified format. The format of the input file is automatically detected where as the format of the output file must be specified in the command line.

Usage

$> usage: itools [OPTIONS] convert-network [-E <property=value>]
          [--export-parameters <EXPORT_PARAMETERS>] [--help] [-I <property=value>]
          [--import-parameters <IMPORT_PARAMETERS>] --input-file <INPUT_FILE>
          --output-file <OUTPUT_FILE> --output-format <OUTPUT_FORMAT>
   
   Available options are:
       --config-name <CONFIG_NAME>   Override configuration file name
   
   Available arguments are:
    -E <property=value>                          use value for given exporter
                                                 parameter
       --export-parameters <EXPORT_PARAMETERS>   the exporter configuration file
       --help                                    display the help and quit
    -I <property=value>                          use value for given importer
                                                 parameter
       --import-parameters <IMPORT_PARAMETERS>   the importer configuation file
       --input-file <INPUT_FILE>                 the input file
       --output-file <OUTPUT_FILE>               the output file
       --output-format <OUTPUT_FORMAT>           the output file format
   
   Where OUTPUT_FORMAT is one of [AMPL, CGMES, UCTE, XIIDM]

Required parameters

input-file

Use the --input-file parameter to specify the path of the input file.

output-file

Use the --output-file parameter to specify the path of the output file.

output-format

Use the --output-format parameter to specify the exporter to use for the export

Optional parameters

export-parameters

Use the --export-parameters parameter to specify the path of the configuration file of the exporter. It is possible to overload one or many parameters using the -E property=value parameter. The properties depend on the output format. Refer to the documentation page of each exporter to know their specific configuration.

import-parameters

Use the --import-parameters parameter to specify the path of the configuration file of the importer. It is possible to overload one or many parameters using the -I property=value parameter. The properties depend on the input format. Refer to the documentation page of each importer to know their specific configuration.

Examples

This example shows how to convert a UCTE-DEF file to a XIIDM file:

$> itools convert-network --input-file $HOME/case-file.uct --output-format XIIDM --output-file $HOME/case-file.xiidm

This example shows how to overload the exporter’s configuration:

$> itools convert-network --input-file $HOME/case-file.uct --output-format XIIDM --output-file $HOME/case-file.xiidm --export-parameters $HOME/XIIDMExporter.properties -E iidm.export.xml.indent=false

Maven configuration

To use the convert-network command, add the following dependencies to the pom.xml file:

<dependency>
    <groupId>com.powsybl</groupId>
    <artifactId>powsybl-iidm-converter-api</artifactId>
    <version>${powsybl.version}</version>
</dependency>

Read the importer and exporter documentation pages to learn more about supported formats and their configuration.

Learn more

Read the groovy post processor documentation page to learn how to modify the imported network once it has been loaded.