As an intensive graphviz user, I was willing to have a powerful and easy to use class for latter use in my applications to generate dot files.

I wrote the GVGlue class available here. Every graphviz details are hidden (unless you need complex stuff, that are allowed anyway).

Download it, and then you can use it like this:

#!/usr/bin/env python

from gvglue import *

if __name__ == "__main__":
	gvg = GvGlue()
	
	radin = gvg.newItem("Picsou")
	maladroit = gvg.newItem("Donald", radin)
	fils1 = gvg.newItem("Riri", maladroit)
	fils2 = gvg.newItem("Fifi", maladroit)
	fils3 = gvg.newItem("Loulou", maladroit)

	gvg.subgraph_properties_defaults_add(radin)
	gvg.subgraph_properties_defaults_add(maladroit)
	gvg.subgraph_property_add(maladroit, "color", "#FF3300")

	mangedufromage = gvg.newItem("Souris")
	malentendant = gvg.newItem("Mickey", mangedufromage)
	safemmequihabitedansuneautremaison = gvg.newItem("Minnie", mangedufromage)

	gvg.subgraph_properties_defaults_add(mangedufromage)

	gvg.newLink(fils1, fils2)
	gvg.newLink(fils1, fils2)
	gvg.newLink(fils1, fils3)
	gvg.newLink(fils2, malentendant)

	gvg.terminate()

	for line in gvg.get():
		print line

Run it, then use graphviz tools to generate a png:

dot -Tpng generated.dot > disney.png

gvglue-test.png

As you can see, when two nodes have the same target, instead of adding an other line and arrow, I simply increase the current line and arrow width. I will write some documentation latter. For now on, just read the simple example.

Enjoy, comments welcome, public license, etc...