.. _getting_started:

===============
Getting Started
===============

Cim2BusBranch is ment to be a connection between `PyCIM <http://pycim.org/>`_
and `PYPOWER <http://pypower.org>`_.

It transform a dict of CIM objects into the bus/branch model which can be used
for load flow analyses with e.g. PYPOWER (or virtually any other tool that is
based on a bus/branch topology).

Installation
============

pip install cim2busbranch


Basic Usage
===========

A first example:

    >>> import cim2busbranch, PyCIM, pypower.api as pypower
    >>> cim_topo = PyCIM.cimread('example.rdf')
    >>> bb_topo = cim2busbranch.transform(cim_topo)
    >>> pypower.runpf(bb_topo.to_pypower())

The examples above can be written even shorter:

    >>> import cim2busbranch as c2bb, pypower.api as pypower
    >>> pypower.runpf(c2bb.transform_to_pypower('example.xml'))

Of course, you can also do some more complex things with Cim2BusBranch. The
next chapters cover some of the more advanced use cases.
