Network.from_xml

classmethod Network.from_xml(file: str, return_dict: bool = False, **kwargs) paminco.net.network.Network[source]

Read network from XML.

Parameters
datastr, file, ElementTree or Element
Initialize object from xml file by passing
  • filename as str,

  • file object that contains XML data,

  • the XML ElementTree,

  • or the root Element of the ElementTree.

return_dictbool, default=False,

If True, the data is returned as a dict with entries edge_data, node_data, demand_data and cost_data. If False (default), a Network object created from this data is returned

Returns
netNetwork or dict

The network read from the data. If return_dict is True, a dict with the raw data is returned.

See also

xml.etree.ElementTree
from_xml()

from_xml method of Edges class

from_xml()

from_xml method of Nodes class

from_xml()

from_xml method of NetworkCost class