tree-hugger icon indicating copy to clipboard operation
tree-hugger copied to clipboard

Addition of get_info() under Python Parser

Open reshinthadithyan opened this issue 4 years ago • 1 comments

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!

reshinthadithyan avatar Dec 19 '20 14:12 reshinthadithyan

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.

rcshubhadeep avatar Dec 20 '20 11:12 rcshubhadeep