Automatically generates Google-style docstrings for Python code using AST parsing and LLM analysis.
# Create virtual environment
python -m venv venv
# Activate (Windows)
venv\Scripts\activate
# Install dependencies
pip install -r requirements.txtFor macOS/Linux:
source venv/bin/activatepython quick_run.py- 📂 Input files →
app/ - 📂 Output files →
documented_app/(with generated docstrings)
doc/
├── app/ # Input Python files
├── documented_app/ # Output files with generated docstrings
├── venv/ # Virtual environment (optional)
├── quick_run.py # Main runner (sets API key automatically)
├── config.py # API configuration
├── models.py # LLM interaction layer
├── tools.py # AST parsing & docstring insertion
├── agents.py # Core processing logic
└── requirements.txt # Project dependencies
- 🔍 Smart Analysis -- Uses AST parsing for accurate code structure detection
- 📝 Google-Style Docstrings -- Clean and standardized documentation format
- 🛡 Safe Processing -- Reverse-order insertion prevents code corruption
- 📂 Batch Processing -- Recursively processes entire folders
- ⚠ Error Handling -- Safely skips invalid or broken files
- ⚡ Automatic API Setup -- GROQ API key handled in
quick_run.py
- Parse Python files using AST
- Extract functions, classes, methods, and parameters
- Generate docstrings using the GROQ LLM
- Insert docstrings safely into the original source code
- Save documented files to the output directory
- Functions
- Async Functions
- Classes
- Class Methods
- Property Methods
- One-line Functions (auto-expanded)
- Nested Folder Structures
- Python 3.7+
- Internet connection (required for GROQ API)
- Valid GROQ API key (configured in
quick_run.py)
venv\Scripts\activate
pip install -r requirements.txtMake sure the virtual environment is activated.
- Ensure Python files exist inside the
app/directory - Verify that files contain valid Python syntax
- Check for errors in the terminal output
- Confirm internet connectivity
- Ensure the GROQ API key is valid
- Verify the API key is correctly set in
quick_run.py
def add(a, b):
return a + bdef add(a, b):
"""Adds two numbers together.
Args:
a: First number to add.
b: Second number to add.
Returns:
The sum of a and b.
"""
return a + b