CoolFace
Apppublic

ishaAtif/python-code-reviewer

sourceHugging Faceupdated 6mo agoView on Hugging Face
0likes
README.md69 linesDownload Raw Back to root
1---2title: Python Code Reviewer3emoji: ๐Ÿ4colorFrom: purple5colorTo: pink6sdk: docker7sdk_version: "3.10"8app_file: app.py9pinned: false10---11 12# ๐Ÿ Python Code Reviewer13 14An AI-powered Python code review tool that analyses your code across four dimensions.15 16![Python](https://img.shields.io/badge/Python-3.10+-blue)17![Streamlit](https://img.shields.io/badge/Built%20with-Streamlit-ff4b4b)18![Claude](https://img.shields.io/badge/Powered%20by-Claude%20AI-blueviolet)19 20## โœจ Features21 22- ๐Ÿ› **Bug Detection** โ€” Finds bugs, edge cases and risky patterns with line numbers23- โฑ๏ธ **Complexity Analysis** โ€” Time and space complexity with plain English explanation24- ๐Ÿ—๏ธ **OOP Suggestions** โ€” Design improvement recommendations25- โœจ **Auto Rewrite** โ€” Clean, improved version of your code26 27## ๐Ÿš€ Live Demo28 29๐Ÿ‘‰ [Try it on HuggingFace Spaces](https://huggingface.co/spaces/ishaAtif/python-code-reviewer)30 31## ๐Ÿ› ๏ธ Tech Stack32 33| Tool | Purpose |34|---|---|35| Python | Core language |36| Streamlit | Web interface |37| Claude API (Haiku) | AI code review |38| python-dotenv | Environment variable management |39 40## โš™๏ธ Run Locally41```bash42# Clone the repo43git clone https://github.com/isha-atif-dev/python-code-reviewer.git44cd python-code-reviewer45 46# Install dependencies47pip install -r requirements.txt48 49# Add your Claude API key50echo "ANTHROPIC_API_KEY=your_key_here" > .env51 52# Run the app53streamlit run app.py54```55 56## ๐Ÿ“ Project Structure57```58python-code-reviewer/59โ”œโ”€โ”€ app.py            # Streamlit frontend60โ”œโ”€โ”€ reviewer.py       # Claude API logic61โ”œโ”€โ”€ prompts.py        # Prompt templates62โ”œโ”€โ”€ requirements.txt  # Dependencies63โ”œโ”€โ”€ Dockerfile        # HuggingFace deployment64โ””โ”€โ”€ .gitignore        # Ignores .env file65```66 67## ๐Ÿ”’ Note68 69Never commit your `.env` file. Your API key is protected via `.gitignore`.