Annotate Python scripts with docstrings using AI.
TL, DR: Clone the code and see the help message.
Long version:
First, clone this code:
git clone https://github.com/Dandelight/ainnotate.gitThen, set environment variables OPENAI_API_KEY and (optionally) OPENAI_BASE_URL.
This file depends on openai and astor. You can install them with
pip install openai astorIt is recommended to install the dependencies in a virtual environment.
Finally, run
python ainnotate.py [path]where [path] should be replaced with the path to the Python code you want to annotate.
Reminder: in the command line, if your path contains
spaces, don't forget to surround it with quotation marks.