Auto generate docstring from type-hints for python functions and class methods.
gendocs_new file.py
gendocs_new mydir/
--style
- Docstring style [numpy, google, rest]. [default: numpy]
- when adding
$<num>
into your docstring these will then be replaced with parameter at this index - Example:
from typing import List
def foo(val_a: int, val_b: List[int]):
"""
Lorem ipsum dolor sit amet, consetetur sadipscing elitr,
sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam
$1 Lorem ipsum dolor sit amet
$2 nonumy eirmod tempor invidun
"""
will become (here with numpy style)
from typing import List
def foo(val_a: int, val_b: List[int]):
"""
Lorem ipsum dolor sit amet, consetetur sadipscing elitr,
sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam
Parameters
----------
val_a : argument of type int
Lorem ipsum dolor sit amet
val_b : argument of type List(int)
nonumy eirmod tempor invidun
"""
- nothing if all stays the same, changed parameter descriptions will be ignored only changes of the function header will be used
- An example can be found under examples
- pip install docstring-generator
- this extension is the heart of this project and written with pybind11 (c++)
- For the versions available, see the tags on this repository.
- Felix Eisenmenger
- MIT License (MIT)