Package networkx :: Package readwrite :: Module gpickle
[hide private]
[frames] | no frames]

Module gpickle

source code

Read and write NetworkX graphs.

Note that NetworkX graphs can contain any hashable Python object as node (not just integers and strings). So writing a NetworkX graph as a text file may not always be what you want: see write_gpickle and gread_gpickle for that case.

This module provides the following :

Python pickled format: Useful for graphs with non text representable data.

write_gpickle(G, path) read_gpickle(path)



Date:  

Author: Aric Hagberg (hagberg@lanl.gov) Dan Schult (dschult@colgate.edu)

Functions [hide private]
 
write_gpickle(G, path)
Write graph object in Python pickle format.
source code
 
read_gpickle(path)
Read graph object in Python pickle format
source code
 
_test_suite() source code
Variables [hide private]
  __credits__ = ''
  __revision__ = '$$'
Function Details [hide private]

write_gpickle(G, path)

source code 

Write graph object in Python pickle format.

This will preserve Python objects used as nodes or edges.

>>> write_gpickle(G,"file.gpickle")

See cPickle.

read_gpickle(path)

source code 

Read graph object in Python pickle format

>>> G=read_gpickle("file.gpickle")

See cPickle.