Is there a solution to extract function args signature from docstring?
Firstly, the parser should look for annotations and then fall back to docstring if there are no annotations. I found a similar question that works specifically for numpy docstring. I'd like to have a general solution that works for any docstring format. If you know how to do this with jedi, please let me know.
I'm also aware of typed_ast. But, once again, it tailored to the specific format of docstrings (rather a comment line).
Example.
def my_func(arg1):
"""
Parameters
----------
arg1: str
"""
return arg1 + "1"
The result of the parse should be smth like {'arg1': str}
.