--- title: AutoDoc emoji: 👀 colorFrom: red colorTo: pink sdk: gradio sdk_version: 5.20.1 app_file: app.py pinned: false license: mit short_description: Automatically add docstrings and comments to Python using AI --- # Automatic Python Documentation Generator Automatically add high-quality docstrings and comments to Python code using **Gemini** or **OpenAI**. Follows PEP 257 conventions. --- ## Features - Add docstrings and comments to Python code. - Supports **Gemini** and **OpenAI** APIs. - Execute and test code directly in the app. - Clean and user-friendly Gradio interface. --- ## How to Use 1. Enter your Python code in the **Original Python Code** box. 2. Select your preferred API (**Gemini** or **OpenAI**). 3. Click **Add Documentation** to generate docstrings and comments. 4. Run the original or documented code to see the output. --- ## Requirements - Python 3.8+ - Libraries: `gradio`, `google-generativeai`, `openai`, `python-dotenv` --- ## Setup 1. Clone the repository: ```bash git clone https://huggingface.co/spaces/ydvaidya23/AutoDoc 2. Install dependencies: ```bash pip install -r requirements.txt 4. Add your API keys to .env: ```bash GEMINI_API_KEY=your-gemini-api-key OPENAI_API_KEY=your-openai-api-key 6. Run the app: ```bash python app.py Check out the configuration reference at https://huggingface.co/docs/hub/spaces-config-reference