Creating Dependency Graphs in Python [closed]

  • Usually “dependency” is defined for module / package import.
  • What you are looking for is a visualizing call flow.

    • http://pycallgraph.slowchop.com/
  • You can still not guarantee that you will not break functionality 🙂

  • My experience and solution:

    Many a times, I found the call flow data overwhelming and the diagram too complex.
    So what i usually do is trace call flow partially for the function, I am interested in.

    This is done by utilizing the sys.settrace(…) function. After generating the call flows as textual data, I generate a call graph using graphviz.

    • http://docs.python.org/library/sys.html
    • On call tracing
    • For generating graphs, use graphviz solutions from networkX.

[Edit: based on comments]

Then my piecemeal solution works better. Just insert the code and use the decorator on a function that you want to trace. You will see gaps where deferred comes into picture but that can be worked out. You will not get the complete picture directly.

I have been trying to do that and made a few post that works on that understanding.

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)