rustworkx.from_node_link_json_file#
- from_node_link_json_file(path, graph_attrs=None, node_attrs=None, edge_attrs=None)#
Parse a node-link format JSON file to generate a graph
- Parameters:
str (path) – The path to the JSON file to load
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: