Please Help Me Solve
A Python package that leverages Google's Gemini AI to help developers quickly analyze and fix code errors. This tool provides intelligent error analysis and suggests fixes for your code issues.
Features
- Automatic error message analysis
- AI-powered solution suggestions
- Optional code context inclusion for more accurate fixes
- Clear and concise fix explanations
Installation
Install the package using pip:
pip install please_help_me_solve
Setup
1. Get Your Gemini API Key
- Visit the Google AI Studio
- Create or select a project
- Generate an API key
2. Set Up Environment Variable
Set up the GOOGLE_API_KEY environment variable with your Gemini API key:
Windows
Command Prompt:
set GOOGLE_API_KEY=your-api-key-here
PowerShell:
$env:GOOGLE_API_KEY="your-api-key-here"
macOS/Linux
Bash:
export GOOGLE_API_KEY=your-api-key-here
To make it permanent, add it to your shell profile (~/.bashrc, ~/.zshrc, etc.):
echo 'export GOOGLE_API_KEY=your-api-key-here' >> ~/.bashrc # for bash
# or
echo 'export GOOGLE_API_KEY=your-api-key-here' >> ~/.zshrc # for zsh
Usage
Basic Usage
from please_help_me_solve import please_help_me_solve
try:
# Your code that might raise an exception
result = 10 / 0
except Exception as e:
# Get AI-powered fix suggestions
please_help_me_solve(str(e))
Including Code Context
For more accurate fix suggestions, you can include the code context:
from please_help_me_solve import please_help_me_solve
try:
# Your code that might raise an exception
result = 10 / 0
except Exception as e:
# Get AI-powered fix suggestions with code context
please_help_me_solve(str(e), provide_code=True)
Example Output
ERROR IS: [division by zero]
FIX BY AI: The error occurs because you're trying to divide by zero, which is mathematically undefined. To fix this, ensure the denominator is not zero before performing the division.
FIXED CODE:
# Add a check for zero before division
denominator = 0
if denominator != 0:
result = 10 / denominator
else:
print("Cannot divide by zero")
Contributing
Contributions are welcome! Please feel free to submit a Pull Request.
License
This project is licensed under the MIT License - see the LICENSE file for details.
Metadata
Release files for please-help-me-solve 0.2
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| please_help_me_solve-0.2.tar.gz | 3.0 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| please_help_me_solve-0.2-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 6.4 kB
Release files / please_help_me_solve-0.2.tar.gz
| Download URL | please_help_me_solve-0.2.tar.gz |
|---|---|
| Size | 3.0 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
4971368d56d239c53c79dc3b6b9aed6b23d3e3bffd9ac18cd76e09a539110ed4
|
|
BLAKE2b-256 checksum How to use checksums |
4788cd92b52ef688953ca3a2485ce801df759e59697eb5438076acc527a7f2ac
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.1.0 CPython/3.11.3
|
Release files / please_help_me_solve-0.2-py3-none-any.whl
| Download URL | please_help_me_solve-0.2-py3-none-any.whl |
|---|---|
| Size | 3.4 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
e80795c0216807cf5cd57233453e2a0778817fe3d34a083cf60edd25d5d95df7
|
|
BLAKE2b-256 checksum How to use checksums |
df29ea09e5a879abd0e6e1b52a9b7b473f6e3eee81ec731089d92e93b3f26ac4
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.1.0 CPython/3.11.3
|