Spaces:
Runtime error
Runtime error
updated Readme
Browse files
README.md
CHANGED
|
@@ -8,6 +8,53 @@ sdk_version: 5.20.1
|
|
| 8 |
app_file: app.py
|
| 9 |
pinned: false
|
| 10 |
license: mit
|
|
|
|
| 11 |
---
|
| 12 |
|
| 13 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 8 |
app_file: app.py
|
| 9 |
pinned: false
|
| 10 |
license: mit
|
| 11 |
+
short_description: Automatically add docstrings and comments to Python using AI
|
| 12 |
---
|
| 13 |
|
| 14 |
+
# Automatic Python Documentation Generator
|
| 15 |
+
|
| 16 |
+
Automatically add high-quality docstrings and comments to Python code using **Gemini** or **OpenAI**. Follows PEP 257 conventions.
|
| 17 |
+
|
| 18 |
+
---
|
| 19 |
+
|
| 20 |
+
## Features
|
| 21 |
+
- Add docstrings and comments to Python code.
|
| 22 |
+
- Supports **Gemini** and **OpenAI** APIs.
|
| 23 |
+
- Execute and test code directly in the app.
|
| 24 |
+
- Clean and user-friendly Gradio interface.
|
| 25 |
+
|
| 26 |
+
---
|
| 27 |
+
|
| 28 |
+
## How to Use
|
| 29 |
+
1. Enter your Python code in the **Original Python Code** box.
|
| 30 |
+
2. Select your preferred API (**Gemini** or **OpenAI**).
|
| 31 |
+
3. Click **Add Documentation** to generate docstrings and comments.
|
| 32 |
+
4. Run the original or documented code to see the output.
|
| 33 |
+
|
| 34 |
+
---
|
| 35 |
+
|
| 36 |
+
## Requirements
|
| 37 |
+
- Python 3.8+
|
| 38 |
+
- Libraries: `gradio`, `google-generativeai`, `openai`, `python-dotenv`
|
| 39 |
+
|
| 40 |
+
---
|
| 41 |
+
|
| 42 |
+
## Setup
|
| 43 |
+
1. Clone the repository:
|
| 44 |
+
```bash
|
| 45 |
+
git clone https://huggingface.co/spaces/ydvaidya23/AutoDoc
|
| 46 |
+
|
| 47 |
+
2. Install dependencies:
|
| 48 |
+
```bash
|
| 49 |
+
pip install -r requirements.txt
|
| 50 |
+
|
| 51 |
+
4. Add your API keys to .env:
|
| 52 |
+
```bash
|
| 53 |
+
GEMINI_API_KEY=your-gemini-api-key
|
| 54 |
+
OPENAI_API_KEY=your-openai-api-key
|
| 55 |
+
|
| 56 |
+
6. Run the app:
|
| 57 |
+
```bash
|
| 58 |
+
python app.py
|
| 59 |
+
|
| 60 |
+
Check out the configuration reference at https://huggingface.co/docs/hub/spaces-config-reference
|