I need to extract types and dependencies flow for python code.
E.g: for the following code -
x = 1 + 2
y = x
m = y.someFunc("123")
I want to say that:
x is a Number
y is dependent in x (hence it is a Number too)
m is dependent in y and in "123" (hence dependent in Number and String) and its type is y.someFunc return value which is unknown
I figured out that the best choice will probably be using the ast library to parse the code and then traverse it using the visitor pattern..
There is a tool \ implementation that does the same thing or something similar that i can adjust for my needs?
Thanks!