- Sign up or login to OpenAI.
- Go to your API keys page.
- Create a new secret key and copy it.
- In a terminal shell, run:
export OPENAI_TOKEN='xxxxxxxxxxx'
- Install the required packages.
pip install openai tqdm
- Now you can use the
auto_docstring.py
script to automatically generate elaborate docstrings for your Python files by running:
python auto_docstring.py -f demo.py -t "$OPENAI_TOKEN"