# ๐ฅ UNFUCK - The Magical Python Error Fixer ๐ฅ
*Because life's too short to debug!*
[](https://www.python.org/downloads/)
[](LICENSE)
[](https://github.com/Sherin-SEF-AI)
[](https://www.linkedin.com/in/sherin-roy-deepmost/)
**Unfuck** is a magical Python tool that automatically fixes your code errors with a single command. When your Python script crashes, simply type `unfuck` and watch the magic happen! โจ
## ๐ Quick Start
```bash
# Install unfuck
pip install unfuck
# Run your script (it will probably break)
python my_script.py
# Unfuck it!
unfuck
# Your code is now working! ๐
```
## โจ Features
### ๐ฅ **Instant Error Fixing**
- Fixes 50+ common Python errors automatically
- Works in under 2 seconds
- Zero configuration required
- Creates backups before making changes
### ๐ค **AI-Powered Analysis**
- Uses local Ollama LLM for complex errors
- Learns from your mistakes
- Gets smarter over time
- Explains what went wrong
### ๐ญ **Personality Modes**
- **Encouraging**: "I got you! Let me fix that error..."
- **Sarcastic**: "This again? *sigh* fixing..."
- **Zen**: "Breathe... let me find the balance in your code..."
- **Professional**: "Error detected. Initiating repair sequence..."
- **Meme**: "TO THE MOON! (with your fixed code)"
### ๐ ๏ธ **Error Types Fixed**
| Error Type | Examples | Fix |
|------------|----------|-----|
| **Import Errors** | `ModuleNotFoundError`, `ImportError` | Install packages, fix typos |
| **Syntax Errors** | Missing colons, brackets, quotes | Add missing syntax elements |
| **Type Errors** | String + Integer, NoneType calls | Add type conversions, null checks |
| **Name Errors** | Undefined variables, scope issues | Define variables, fix scope |
| **Index/Key Errors** | List out of range, missing dict keys | Add bounds checking, use .get() |
| **Attribute Errors** | Wrong method calls, typos | Fix method names, add checks |
| **Value Errors** | Invalid conversions, empty sequences | Add validation, defaults |
| **File Errors** | Missing files, permission issues | Create files, fix paths |
| **Indentation Errors** | Mixed tabs/spaces, wrong levels | Fix indentation consistently |
## ๐ฏ Usage Examples
### Basic Usage
```bash
# Fix the last error
unfuck
# Fix with explanations
unfuck --explain
# Preview fixes without applying
unfuck --preview
# Use AI for complex errors
unfuck --ai
```
### Personality Modes
```bash
# Encouraging mode (default)
unfuck --mode encouraging
# Sarcastic mode
unfuck --mode sarcastic
# Zen mode
unfuck --mode zen
# Professional mode
unfuck --mode professional
# Meme mode
unfuck --mode meme
```
### Advanced Features
```bash
# Try harder fixes
unfuck --aggressive
# Show fix history
unfuck --history
# Show success statistics
unfuck --stats
# Undo last fix
unfuck --undo
# Fix everything possible (rampage mode!)
unfuck --rampage
```
## ๐ฎ Fun Commands
```bash
# Fix everything it can find
unfuck --rampage
# Add meditation comments to code
unfuck --zen
# Git blame with sarcastic comments
unfuck --blame
# Russian roulette - random fix from top options
unfuck --russian-roulette
```
## ๐ Achievement System
- ๐ **First Unfuck!** - Your first successful fix
- ๐ฅ **Unfuck Streak** - Fix 10 errors in a row
- ๐ **Unfuck Master** - Fix 100 errors
- ๐ **Unfuck Royalty** - Fix 500 errors
- ๐ **Unfuck Legend** - Fix 1000 errors
## ๐ค AI Integration
Unfuck can use local AI models via Ollama for complex error analysis:
```bash
# Install Ollama
curl -fsSL https://ollama.ai/install.sh | sh
# Pull a model
ollama pull llama2
# Use AI-powered unfucking
unfuck --ai --explain
```
## ๐ Statistics & Learning
Unfuck tracks your debugging journey:
```bash
# View your unfuck statistics
unfuck --stats
# View fix history
unfuck --history
# Export your unfuck story
unfuck --export-story
```
## ๐ง Configuration
Create `~/.unfuck/config.json` to customize:
```json
{
"ai_enabled": true,
"ai_model": "llama2",
"personality_mode": "encouraging",
"auto_backup": true,
"max_fix_attempts": 3,
"confidence_threshold": 0.6,
"show_animations": true,
"verbose_output": false
}
```
## ๐งช Testing
Try unfuck with these example broken scripts:
```bash
# Test import errors
python examples/test_imports.py
unfuck
# Test syntax errors
python examples/test_syntax.py
unfuck
# Test various errors
python examples/broken_script.py
unfuck
```
## ๐จ Screenshots
```
๐ฅ UNFUCK - The Magical Python Error Fixer ๐ฅ
๐ Error Analysis
โโโโโโโโโโโโโโโฌโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ Property โ Value โ
โโโโโโโโโโโโโโโผโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโค
โ Error Type โ ModuleNotFoundError โ
โ Message โ No module named 'numpy' โ
โ File โ /path/to/script.py โ
โ Line โ 3 โ
โโโโโโโโโโโโโโโดโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
๐ ๏ธ Fix Suggestions
โโโโโโโโฌโโโโโโโโโโโโโโโโโโโโโโโโโโฌโโโโโโโโโโโโโฌโโโโโโโโโโโ
โ Rank โ Description โ Confidence โ Type โ
โโโโโโโโผโโโโโโโโโโโโโโโโโโโโโโโโโโผโโโโโโโโโโโโโผโโโโโโโโโโโค
โ 1 โ Install missing module โ 95% โ install โ
โ 2 โ Fix typo in import name โ 80% โ typo โ
โโโโโโโโดโโโโโโโโโโโโโโโโโโโโโโโโโโดโโโโโโโโโโโโโดโโโโโโโโโโโ
๐ Unfucked! Your code is running!
๐ฅ You're on fire! 5 fixes in a row!
```
## ๐ค Contributing
We welcome contributions! Here's how to get started:
1. Fork the repository
2. Create a feature branch: `git checkout -b feature/amazing-feature`
3. Add your fix patterns to the database
4. Test with broken scripts
5. Submit a pull request
### Adding New Fix Patterns
```python
# Add to unfuck/core/pattern_database.py
FixPattern(
error_type="YourError",
error_pattern="error message pattern",
fix_type="your_fix_type",
fix_code="fix implementation",
confidence=0.9,
description="What this fix does",
examples=["example usage"]
)
```
## ๐ Roadmap
- [ ] JavaScript/TypeScript support
- [ ] VS Code extension
- [ ] Team collaboration features
- [ ] Cloud-based fix sharing
- [ ] Machine learning improvements
- [ ] Plugin system for custom fixes
## ๐ Bug Reports
Found a bug? We want to fix it! Please report issues with:
- The error that occurred
- What unfuck tried to do
- What actually happened
- Your Python version and OS
## ๐ License
This project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details.
## ๐ Acknowledgments
- The Python community for all the Stack Overflow questions that inspired this
- Ollama for making local AI accessible
- Rich for beautiful terminal output
- All the developers who've ever been frustrated by debugging
## ๐ Star History
[](https://star-history.com/#unfuck/unfuck&Date)
---
**Made with โค๏ธ by the unfuck team**
*"Because life's too short to debug"* ๐
[Website](https://unfuck.dev) โข [Documentation](https://docs.unfuck.dev) โข [Discord](https://discord.gg/unfuck) โข [Twitter](https://twitter.com/unfuck_python)
Raw data
{
"_id": null,
"home_page": "https://github.com/Sherin-SEF-AI/unfuck",
"name": "python-unfuck",
"maintainer": null,
"docs_url": null,
"requires_python": ">=3.8",
"maintainer_email": "Sherin Joseph <sherin.joseph2217@gmail.com>",
"keywords": "python, debug, error, fix, automation, tool",
"author": "Sherin Joseph",
"author_email": "Sherin Joseph <sherin.joseph2217@gmail.com>",
"download_url": "https://files.pythonhosted.org/packages/81/75/0da07928921d6279d7650dc1e523979e87b9009c5c0527420c182e4646bf/python_unfuck-1.0.2.tar.gz",
"platform": null,
"description": "# \ud83d\udd25 UNFUCK - The Magical Python Error Fixer \ud83d\udd25\n\n*Because life's too short to debug!*\n\n[](https://www.python.org/downloads/)\n[](LICENSE)\n[](https://github.com/Sherin-SEF-AI)\n[](https://www.linkedin.com/in/sherin-roy-deepmost/)\n\n**Unfuck** is a magical Python tool that automatically fixes your code errors with a single command. When your Python script crashes, simply type `unfuck` and watch the magic happen! \u2728\n\n## \ud83d\ude80 Quick Start\n\n```bash\n# Install unfuck\npip install unfuck\n\n# Run your script (it will probably break)\npython my_script.py\n\n# Unfuck it!\nunfuck\n\n# Your code is now working! \ud83c\udf89\n```\n\n## \u2728 Features\n\n### \ud83d\udd25 **Instant Error Fixing**\n- Fixes 50+ common Python errors automatically\n- Works in under 2 seconds\n- Zero configuration required\n- Creates backups before making changes\n\n### \ud83e\udd16 **AI-Powered Analysis**\n- Uses local Ollama LLM for complex errors\n- Learns from your mistakes\n- Gets smarter over time\n- Explains what went wrong\n\n### \ud83c\udfad **Personality Modes**\n- **Encouraging**: \"I got you! Let me fix that error...\"\n- **Sarcastic**: \"This again? *sigh* fixing...\"\n- **Zen**: \"Breathe... let me find the balance in your code...\"\n- **Professional**: \"Error detected. Initiating repair sequence...\"\n- **Meme**: \"TO THE MOON! (with your fixed code)\"\n\n### \ud83d\udee0\ufe0f **Error Types Fixed**\n\n| Error Type | Examples | Fix |\n|------------|----------|-----|\n| **Import Errors** | `ModuleNotFoundError`, `ImportError` | Install packages, fix typos |\n| **Syntax Errors** | Missing colons, brackets, quotes | Add missing syntax elements |\n| **Type Errors** | String + Integer, NoneType calls | Add type conversions, null checks |\n| **Name Errors** | Undefined variables, scope issues | Define variables, fix scope |\n| **Index/Key Errors** | List out of range, missing dict keys | Add bounds checking, use .get() |\n| **Attribute Errors** | Wrong method calls, typos | Fix method names, add checks |\n| **Value Errors** | Invalid conversions, empty sequences | Add validation, defaults |\n| **File Errors** | Missing files, permission issues | Create files, fix paths |\n| **Indentation Errors** | Mixed tabs/spaces, wrong levels | Fix indentation consistently |\n\n## \ud83c\udfaf Usage Examples\n\n### Basic Usage\n```bash\n# Fix the last error\nunfuck\n\n# Fix with explanations\nunfuck --explain\n\n# Preview fixes without applying\nunfuck --preview\n\n# Use AI for complex errors\nunfuck --ai\n```\n\n### Personality Modes\n```bash\n# Encouraging mode (default)\nunfuck --mode encouraging\n\n# Sarcastic mode\nunfuck --mode sarcastic\n\n# Zen mode\nunfuck --mode zen\n\n# Professional mode\nunfuck --mode professional\n\n# Meme mode\nunfuck --mode meme\n```\n\n### Advanced Features\n```bash\n# Try harder fixes\nunfuck --aggressive\n\n# Show fix history\nunfuck --history\n\n# Show success statistics\nunfuck --stats\n\n# Undo last fix\nunfuck --undo\n\n# Fix everything possible (rampage mode!)\nunfuck --rampage\n```\n\n## \ud83c\udfae Fun Commands\n\n```bash\n# Fix everything it can find\nunfuck --rampage\n\n# Add meditation comments to code\nunfuck --zen\n\n# Git blame with sarcastic comments\nunfuck --blame\n\n# Russian roulette - random fix from top options\nunfuck --russian-roulette\n```\n\n## \ud83c\udfc6 Achievement System\n\n- \ud83c\udf89 **First Unfuck!** - Your first successful fix\n- \ud83d\udd25 **Unfuck Streak** - Fix 10 errors in a row\n- \ud83d\udc8e **Unfuck Master** - Fix 100 errors\n- \ud83d\udc51 **Unfuck Royalty** - Fix 500 errors\n- \ud83c\udfc6 **Unfuck Legend** - Fix 1000 errors\n\n## \ud83e\udd16 AI Integration\n\nUnfuck can use local AI models via Ollama for complex error analysis:\n\n```bash\n# Install Ollama\ncurl -fsSL https://ollama.ai/install.sh | sh\n\n# Pull a model\nollama pull llama2\n\n# Use AI-powered unfucking\nunfuck --ai --explain\n```\n\n## \ud83d\udcca Statistics & Learning\n\nUnfuck tracks your debugging journey:\n\n```bash\n# View your unfuck statistics\nunfuck --stats\n\n# View fix history\nunfuck --history\n\n# Export your unfuck story\nunfuck --export-story\n```\n\n## \ud83d\udd27 Configuration\n\nCreate `~/.unfuck/config.json` to customize:\n\n```json\n{\n \"ai_enabled\": true,\n \"ai_model\": \"llama2\",\n \"personality_mode\": \"encouraging\",\n \"auto_backup\": true,\n \"max_fix_attempts\": 3,\n \"confidence_threshold\": 0.6,\n \"show_animations\": true,\n \"verbose_output\": false\n}\n```\n\n## \ud83e\uddea Testing\n\nTry unfuck with these example broken scripts:\n\n```bash\n# Test import errors\npython examples/test_imports.py\nunfuck\n\n# Test syntax errors \npython examples/test_syntax.py\nunfuck\n\n# Test various errors\npython examples/broken_script.py\nunfuck\n```\n\n## \ud83c\udfa8 Screenshots\n\n```\n\ud83d\udd25 UNFUCK - The Magical Python Error Fixer \ud83d\udd25\n\n\ud83d\udd0d Error Analysis\n\u250c\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u252c\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2510\n\u2502 Property \u2502 Value \u2502\n\u251c\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u253c\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2524\n\u2502 Error Type \u2502 ModuleNotFoundError \u2502\n\u2502 Message \u2502 No module named 'numpy' \u2502\n\u2502 File \u2502 /path/to/script.py \u2502\n\u2502 Line \u2502 3 \u2502\n\u2514\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2534\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2518\n\n\ud83d\udee0\ufe0f Fix Suggestions\n\u250c\u2500\u2500\u2500\u2500\u2500\u2500\u252c\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u252c\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u252c\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2510\n\u2502 Rank \u2502 Description \u2502 Confidence \u2502 Type \u2502\n\u251c\u2500\u2500\u2500\u2500\u2500\u2500\u253c\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u253c\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u253c\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2524\n\u2502 1 \u2502 Install missing module \u2502 95% \u2502 install \u2502\n\u2502 2 \u2502 Fix typo in import name \u2502 80% \u2502 typo \u2502\n\u2514\u2500\u2500\u2500\u2500\u2500\u2500\u2534\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2534\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2534\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2518\n\n\ud83c\udf89 Unfucked! Your code is running!\n\ud83d\udd25 You're on fire! 5 fixes in a row!\n```\n\n## \ud83e\udd1d Contributing\n\nWe welcome contributions! Here's how to get started:\n\n1. Fork the repository\n2. Create a feature branch: `git checkout -b feature/amazing-feature`\n3. Add your fix patterns to the database\n4. Test with broken scripts\n5. Submit a pull request\n\n### Adding New Fix Patterns\n\n```python\n# Add to unfuck/core/pattern_database.py\nFixPattern(\n error_type=\"YourError\",\n error_pattern=\"error message pattern\",\n fix_type=\"your_fix_type\",\n fix_code=\"fix implementation\",\n confidence=0.9,\n description=\"What this fix does\",\n examples=[\"example usage\"]\n)\n```\n\n## \ud83d\udcc8 Roadmap\n\n- [ ] JavaScript/TypeScript support\n- [ ] VS Code extension\n- [ ] Team collaboration features\n- [ ] Cloud-based fix sharing\n- [ ] Machine learning improvements\n- [ ] Plugin system for custom fixes\n\n## \ud83d\udc1b Bug Reports\n\nFound a bug? We want to fix it! Please report issues with:\n\n- The error that occurred\n- What unfuck tried to do\n- What actually happened\n- Your Python version and OS\n\n## \ud83d\udcc4 License\n\nThis project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details.\n\n## \ud83d\ude4f Acknowledgments\n\n- The Python community for all the Stack Overflow questions that inspired this\n- Ollama for making local AI accessible\n- Rich for beautiful terminal output\n- All the developers who've ever been frustrated by debugging\n\n## \ud83c\udf1f Star History\n\n[](https://star-history.com/#unfuck/unfuck&Date)\n\n---\n\n**Made with \u2764\ufe0f by the unfuck team**\n\n*\"Because life's too short to debug\"* \ud83d\ude80\n\n[Website](https://unfuck.dev) \u2022 [Documentation](https://docs.unfuck.dev) \u2022 [Discord](https://discord.gg/unfuck) \u2022 [Twitter](https://twitter.com/unfuck_python)\n",
"bugtrack_url": null,
"license": "MIT",
"summary": "\ud83d\udd25 The magical Python error fixing tool that automatically fixes your code with a single command! Features AI integration, 5 personality modes, and fixes 50+ common errors in under 2 seconds.",
"version": "1.0.2",
"project_urls": {
"Bug Tracker": "https://github.com/Sherin-SEF-AI/unfuck/issues",
"Documentation": "https://github.com/Sherin-SEF-AI/unfuck#readme",
"Homepage": "https://github.com/Sherin-SEF-AI/unfuck",
"LinkedIn": "https://www.linkedin.com/in/sherin-roy-deepmost/",
"Repository": "https://github.com/Sherin-SEF-AI/unfuck"
},
"split_keywords": [
"python",
" debug",
" error",
" fix",
" automation",
" tool"
],
"urls": [
{
"comment_text": null,
"digests": {
"blake2b_256": "db30bbc677e38d934849ab8b42daa312eff3497ae1fa64401908816de1d5736e",
"md5": "c73b3b399a11843e19958e0a833a94f2",
"sha256": "8fabcd5445fc1e7f032a10be69970a7886f701a80b199730b3de4f15e2e9a25f"
},
"downloads": -1,
"filename": "python_unfuck-1.0.2-py3-none-any.whl",
"has_sig": false,
"md5_digest": "c73b3b399a11843e19958e0a833a94f2",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": ">=3.8",
"size": 41936,
"upload_time": "2025-10-06T16:19:21",
"upload_time_iso_8601": "2025-10-06T16:19:21.866067Z",
"url": "https://files.pythonhosted.org/packages/db/30/bbc677e38d934849ab8b42daa312eff3497ae1fa64401908816de1d5736e/python_unfuck-1.0.2-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": null,
"digests": {
"blake2b_256": "81750da07928921d6279d7650dc1e523979e87b9009c5c0527420c182e4646bf",
"md5": "09da07d0a77f68452013db4f327b5b6b",
"sha256": "da9ffc68809a9d564d410798690b0ad23612afb523e541956588d18fe5d1cb4a"
},
"downloads": -1,
"filename": "python_unfuck-1.0.2.tar.gz",
"has_sig": false,
"md5_digest": "09da07d0a77f68452013db4f327b5b6b",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=3.8",
"size": 38676,
"upload_time": "2025-10-06T16:19:23",
"upload_time_iso_8601": "2025-10-06T16:19:23.844976Z",
"url": "https://files.pythonhosted.org/packages/81/75/0da07928921d6279d7650dc1e523979e87b9009c5c0527420c182e4646bf/python_unfuck-1.0.2.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2025-10-06 16:19:23",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "Sherin-SEF-AI",
"github_project": "unfuck",
"travis_ci": false,
"coveralls": false,
"github_actions": true,
"lcname": "python-unfuck"
}