A simple yet powerful web app that uses Google's Gemini AI to refactor, explain, or add comments to your Python code — instantly.
🧼 Refactor Code
Improve code readability and follow Python best practices (like PEP8).💬 Add Comments
Auto-generate inline comments and docstrings for better code documentation.🧠 Explain Code
Get a step-by-step explanation of what a Python function or snippet does.
- Next.js (App Router) – Full-stack framework (API + frontend in one)
- Tailwind CSS – For fast, modern styling
- Google Gemini API – For code generation and understanding
- Prism.js – For Python syntax highlighting
- Vercel – Hosting and deployment
git clone https://github.com/Leon8M/Python-Refactor.git
cd python-refactor-ainpm installCreate a .env.local file in the root directory:
GEMINI_API_KEY=your_gemini_api_key_herenpm run devVisit http://localhost:3000 to use the app locally.
defcalculate_sum_and_product(numbers_list):
s=0p=1forninnumbers_list:
s+=np*=nreturn [s, p]defcalculate_sum_and_product(numbers):
total=sum(numbers)
product=1fornuminnumbers:
product*=numreturn [total, product]After working on Learn-With-AI, I wanted to sharpen my skills further by integrating AI into more practical tools — and this project was the result.
Next.js keeps winning me over with its full-stack power in a single place.
This project is open-source under the MIT License.
Have suggestions or want to contribute?
Feel free to open an issue or pull request!