PyGraphviz
http://networkx.lanl.gov/pygraphviz/
import pygraphviz as pgv
g = pgv.AGraph()
g.add_node(nn, label=label.encode("utf-8"), shape="box", URL=rdfnode(row['doc']))
g.add_edge(nn, onn)
g.draw(path="output.svg", format="svg", prog="fdp")
See Graphviz