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.parse_node_link_json#
- parse_node_link_json(data, graph_attrs=None, node_attrs=None, edge_attrs=None)#
Parse a node-link format JSON str to generate a graph
- Parameters:
str (data) – The JSON str to parse
graph_attrs – An optional callable that will be passed a dictionary with string keys and string values and is expected to return a Python object to use for
attrs
attribute of the output graph. If not specified the dictionary with string keys and string values will be used as the value forattrs
.node_attrs – An optional callable that will be passed a dictionary with string keys and string values representing the data payload for each node in the graph and is expected to return a Python object to use for the data payload of the node. If not specified the dictionary with string keys and string values will be used for the nodes’ data payload.
edge_attrs – An optional callable that will be passed a dictionary with string keys and string values representing the data payload for each edge in the graph and is expected to return a Python object to use for the data payload of the node. If not specified the dictionary with string keys and string values will be used for the edge’ data payload.
- Returns:
The graph represented by the node link JSON
- Return type: