Note

This is the documentation for the current state of the development branch of rustworkx. The documentation or APIs here can change prior to being released.

rustworkx.read_graphml#

read_graphml(path, /, compression=None)#

Read a list of graphs from a file in GraphML format.

GraphML is a comprehensive and easy-to-use file format for graphs. It consists of a language core to describe the structural properties of a graph and a flexible extension mechanism to add application-specific data.

For more information see: http://graphml.graphdrawing.org/

Note

This implementation does not support mixed graphs (directed and unidirected edges together), hyperedges, nested graphs, or ports.

Note

GraphML attributes with graph domain are stored in attrs field.

Parameters:

path (str) – The path of the input file to read.

Returns:

A list of graphs parsed from GraphML file.

Return type:

list[Union[PyGraph, PyDiGraph]]

Raises:

RuntimeError – when an error is encountered while parsing the GraphML file.