pyfactor
pyfactor copied to clipboard
Functionality to specify parsing root
I found this worked nicely when the target file was a collection of functions. When running pyfactor on a file which contains a class object I was hoping to see a graph of relations between the members and variables of the class but it seems this is not possible? Instead it just lists the class itself and relation to imported libraries or variables defined globally.
Thanks! This would be a good addition especially in combination with #5, giving a lot of flexibility to the analysis. Functions could also be the root node. I wonder if we could get away with just moving the class definition to the root, I'll have to test it. Anyways, this also calls for a change in the CLI. Having something like pyfactor file.py:Class would be in line with other tools that dive into source, but currently that means "output file named Class". Maybe some other delimiter?
It might make sense to support any multi-file advanced functionality by using a formatted text file. That way you can maintain a simple clean command line usuage by calling pyfactor configfile instead of some long complicated line. Maybe a JSON file? Have a dictionary like this: `{"files":[file.py, secondfile.py, ...], "root":"file.py/example_class", "exclude":"secondfile.py/function"}'?
That could be the way to go, although ideally the functionality would be available in clean cli options. JSON is a bit cumbersome to write but perhaps some other format!