GVGlue: Simple class to generate graphviz dot files
By Sebastien Tricaud on Tuesday, May 8 2007, 20:20 - Permalink
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

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...
Comments
ya peut etre aussi un projet qui s'appelle peak qui fait dans le meme genre http://peak.telecommunity.com/DevCe...
can you tell me all what i need to install so scapy can work on my windows i really need a complete package thanks
issa, I am not a windows user, so I won't be able to help. The least I know is that you will need to install python to run scapy, then programs scapy uses, such as nmap or tcpdump.