Tools/Sumolib

sumolib is a set of python modules for working with sumo networks, simulation output and other simulation artefacts. For a detailed list of available functions see the pydoc generated documentation. You can [browse the code here].

importing sumolib in a script
To use the library, the /tools directory must be on the python load path. This is typically done with a stanza like this:

import os, sys if 'SUMO_HOME' in os.environ: tools = os.path.join(os.environ['SUMO_HOME'], 'tools') sys.path.append(tools) else: sys.exit("please declare environment variable 'SUMO_HOME'")

usage example
import sumolib net = sumolib.net.readNet('myNet.net.xml') print net.getNode('myNodeID').getCoord