For a given Python script in a repository foobar, how can I see all the functions called that are within foobar? Trace functions and profilers give me all calls, whereas I only want to see how the program traverses the repository.
A few notes:
- The repo is mostly Python with a few cython and C++ files
- I'm aware of questions like How do I print functions as they are called that recommend
sys
trace functions - pycallgraph would be awesome if it were limited to the functions defined within my repo foobar.
UPDATE:
I've done this with python -m trace --listfuncs my_script.py
, and then filtering the output for files that are on the directory path. This is okay, but I would prefer a cleaner way of traversing the call structure of the repo's functions.