Create a relationship diagram between modules for refactoring. I want to draw a module dependency diagram in Python or [Python dependencies inside a package](http://stackoverflow.com/questions/20829697/python-dependencies- According to inside-a-package) snakefood seemed to be good, so I tried using it.
snakefood Can be installed with pip.
$ pip install snakefood
Some commands are provided,
You can parse with sfood
and write out a dot file for Graphviz with stood-graph
.
If the root of the package you want to parse is ROOT
$ sfood ROOT | sfood-graph > graph.dot
Since graph.dot
is created with, the rest is plotted appropriately.
$ dot -Tjpg graph.dot -o graph.jpg -Gdpi=800
If there are many modules, the resolution (-Gdpi
option value) must be set large or it will be crushed and unreadable.
If you want to output other than jpg, you can use -Tpng
etc.
If you add the -i
option to sfood
, you can omit the external package.
For reference, the results of the trial at selenium are posted.
According to How to read pyreverse results and how to use options, pyreverse It seems that you can also use a tool called /pyreverse/0.5.1).
Recommended Posts