Home | Trees | Indices | Help |
---|
|
Read graphs in GML format. See http://www.infosun.fim.uni-passau.de/Graphlet/GML/gml-tr.html for format specification.
Example graphs in GML format: http://www-personal.umich.edu/~mejn/netdata/
Author: Aric Hagberg (hagberg@lanl.gov)
|
|||
|
|||
|
|||
|
|||
|
|||
|
|
|||
graph = None
|
|
Read graph in GML format from path. Returns an XGraph or XDiGraph. This doesn't implement the complete GML specification for nested attributes for graphs, edges, and nodes. |
Parse GML format from string or iterable. Returns an XGraph or XDiGraph. This doesn't implement the complete GML specification for nested attributes for graphs, edges, and nodes. |
pyparser tokenizer for GML graph format This doesn't implement the complete GML specification for nested attributes for graphs, edges, and nodes. |
Write the graph G in GML format to the file or file handle path. >>> write_gml(G,"file.gml") path can be a filehandle or a string with the name of the file. >>> fh=open("file.gml") >>> write_multiline_adjlist(G,fh) Filenames ending in .gz or .bz2 will be compressed. >>> write_multiline_adjlist(G,"file.gml.gz") The output file will use the default text encoding on your system. It is possible to write files in other encodings by opening the file with the codecs module. See doc/examples/unicode.py for hints. >>> import codecs >>> fh=codecs.open("file.edgelist",encoding='iso8859-1')# use iso8859-1 >>> write_edgelist(G,fh) GML specifications indicate that the file should only use 7bit ASCII text encoding.iso8859-1 (latin-1). Only a single level of attributes for graphs, nodes, and edges, is supported. |
Home | Trees | Indices | Help |
---|
Generated by Epydoc 3.0beta1 on Sun Aug 17 12:04:44 2008 | http://epydoc.sourceforge.net |