An open API service indexing awesome lists of open source software.

https://github.com/mannasoumya/py-docstring-generator

Auto Generate Python Docstrings
https://github.com/mannasoumya/py-docstring-generator

docs-generator docstring docstring-generator docstrings documentation python python3

Last synced: 9 months ago
JSON representation

Auto Generate Python Docstrings

Awesome Lists containing this project

README

          

# Auto Generate Python Docstrings

## Quick Start

```console
$ python3 docstring_generator_auto.py test.py

Function `hello1`
Params ['a:str', 'b:list', 'c']
Do you want to write docstring for `hello1` ? (y/n) y
Enter function summary: This is first hello
Are you sure? (y/n) y

a : str
Enter parameter summary: first param
Are you sure? (y/n) y

b : list
Enter parameter summary: second param
Are you sure? (y/n) y

c :
Enter parameter summary: third param
Are you sure? (y/n) y

No explicit return type found for function `hello1`
Enter return summary: Returns None
Are you sure? (y/n) y

Function `hello2`
Params ['a:tuple']
Do you want to write docstring for `hello2` ? (y/n) y
Enter function summary: This is second hello
Are you sure? (y/n) y

a : tuple
Enter parameter summary: tuple param
Are you sure? (y/n) y

No explicit return type found for function `hello2`
Enter return summary: Returns None
Are you sure? (y/n) y

Function `hello3` has no parameters
Do you want to write docstring for `hello3` ? (y/n) y
Enter function summary: This is third hello
Are you sure? (y/n) y

Return type of function `hello3` is `str`
Enter return summary: Returns hello3
Are you sure? (y/n) y

New file with docstings saved at : `test_docstrings.py`
```

#### When all docstrings are added, skip all functions
```console
$ python3 docstring_generator_auto.py test.py

Function `hello1`
Params ['a:str', 'b:list', 'c']
Do you want to write docstring for `hello1` ? (y/n) n

Function `hello2`
Params ['a:tuple']
Do you want to write docstring for `hello2` ? (y/n) n

Function `hello3` has no parameters
Do you want to write docstring for `hello3` ? (y/n) n

No docstrings to save... Exiting
```
**New file with docstring is generated at **