Skip to content

Latest commit

 

History

History
48 lines (42 loc) · 1.18 KB

README.md

File metadata and controls

48 lines (42 loc) · 1.18 KB

Introspect

This is script that is is useful to draw the inheritance diagram of a module. This helps in understanding the codebase at the start. It uses python introspective features to draw the class diagram. Rememeber that this is not a perfect class diagram it does not show any compositional features

Import the script and just call the function introspect with first argument with module object for which you want to see class diagram,second argument where the diagram is stored

import introspect
introspect(module,filename)
class A(object):
    def __init__(self,boo):
    def a(self):
        pass
    def b(self):
        pass
class B(object):
    def __init__(self,boo):
        pass
    def c(self):
        pass
    def d(self):
        pass
class c(object):
    def __init__(self,boo):
        pass
    def e(self):
        pass
    def f(self):
        pass
class D(A,B):
    def __init__(self,boo):
        pass
    def g(self):
        pass
    def b(self):
        pass

The class diagram generated for the above code is

![Alt text](/img/testfile.png?raw=true "inheritance diagram")