tree-hugger
tree-hugger copied to clipboard
Addition of get_info() under Python Parser
Motivation
As discussed, given a .py file, can we get an overall mapping of the given code file. As of now, added the skeleton in the Parser Class as get_info().
get_info()
This function get_info() will return a dictionary of the following structure.
{ "functions":[ "func1" : { "doc_string":[ 'corresponding doc_string'],"body":[ 'corresponding doc_string']"}, "func2" : {...........}, } "classes":[ "class1": { "doc_string":[ 'corresponding doc_string']}, "class2": {........}, } }
Conclusion
We'll review the structure if needed. Thanks!
This is a nice and welcome addition. @reshinthadithyan thanks. Do you think you can add similar to other parser classes and also write some tests for this use-case? That would be great for this PR.
Please let me know.