networkx 2.8.2 Pypi GitHub Homepage
Other Docs
NotesParametersReturns
read_gexf(path, node_type=None, relabel=False, version='1.2draft')

"GEXF (Graph Exchange XML Format) is a language for describing complex networks structures, their associated data and dynamics" .

Notes

This implementation does not support mixed graphs (directed and undirected edges together).

Parameters

path : file or string

File or file name to read. File names ending in .gz or .bz2 will be decompressed.

node_type: Python type (default: None) :

Convert node ids to this type if not None.

relabel : bool (default: False)

If True relabel the nodes to use the GEXF node "label" attribute instead of the node "id" attribute as the NetworkX node label.

version : string (default: 1.2draft)
Version of GEFX File Format (see http://gexf.net/schema.html) :

Supported values: "1.1draft", "1.2draft"

Returns

graph: NetworkX graph

If no parallel edges are found a Graph or DiGraph is returned. Otherwise a MultiGraph or MultiDiGraph is returned.

Read graph in GEXF format from path.

Examples

See :

Local connectivity graph

Hover to see nodes names; edges to Self not shown, Caped at 50 nodes.

Using a canvas is more power efficient and can get hundred of nodes ; but does not allow hyperlinks; , arrows or text (beyond on hover)

SVG is more flexible but power hungry; and does not scale well to 50 + nodes.

All aboves nodes referred to, (or are referred from) current nodes; Edges from Self to other have been omitted (or all nodes would be connected to the central node "self" which is not useful). Nodes are colored by the library they belong to, and scaled with the number of references pointing them


GitHub : /networkx/readwrite/gexf.py#136
type: <class 'function'>
Commit: