[Community] Dependency graphing
kai.hanninen at mbconcert.fi
Sat Mar 25 14:47:20 EET 2006
I was playing with some nice scripts today from
which make it easy to generate graphs of dependencies in python modules.
Naturally I was interested to see how our projects -- PCL, ZCO and
PrimaGIS -- would look like when turned into such graphs.
There's a sample of a graph generated for cartography.data.postgis module at
to get an idea what they look like.
If you'd like to generate the graphs for yourself, download the
following scripts from the depgraph website:
and install graphviz (http://www.research.att.com/sw/tools/graphviz/)
unless you have it already.
Now you can use the following (all in one line) shell command to
generate the graphs for our projects.
for f in $(find $SRCPATH -name '*.py'); do python2.4 py2depgraph.py
$f | python2.4 depgraph2dot.py | dot -T png -o $(echo $f|sed s#$(echo
$SRCPATH|sed s'#\(.*\)/\(.*\)#\1#')/##|sed 's#/#-#g').png; done
Before running the above one-liner you must set the SRCPATH environment
variable to let it know which files to generate the graphs for. I used
which you should modify to match your system. Make sure there is no
trailing slash at the end of the path. It may take a while to generate
I didn't anylyze the graphs in detail yet, but it is nice to confirm
that zope.interface is a fairly isolated and small addition to PCL and
definitely not the monster that a full Zope system is. Just compare
plain sizes of the graphs for PCL and ZCO/PrimaGIS to see what I mean.
Kai Hänninen +358-50-558-7935
Software engineer www.mbconcert.fi
MB Concert Ky kai.hanninen at mbconcert.fi
More information about the Community