Is there a way to monitor which functions and methods in a directory of Python packages get called? I'm working with a large library of custom Python modules, and for code cleanup purposes I'm curious how many of the functions are actually being used.
I know I can see what code is run from a given command using Coverage.py, but I want to know how the code is used in the real world. If no one is calling the script that calls foo
, I'd prefer to get rid of foo
instead of maintaining it.
I would prefer a solution with low overhead, so as to not impact the runtime of the modules.