Skip to main content

No project description provided

Project description

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

  1. Visit the Google AI Studio
  2. Create or select a project
  3. 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.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

please_help_me_solve-0.2.tar.gz (3.0 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

please_help_me_solve-0.2-py3-none-any.whl (3.4 kB view details)

Uploaded Python 3

File details

Details for the file please_help_me_solve-0.2.tar.gz.

File metadata

  • Download URL: please_help_me_solve-0.2.tar.gz
  • Upload date:
  • Size: 3.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.11.3

File hashes

Hashes for please_help_me_solve-0.2.tar.gz
Algorithm Hash digest
SHA256 4971368d56d239c53c79dc3b6b9aed6b23d3e3bffd9ac18cd76e09a539110ed4
MD5 2909403a87d043b5032921f347171fe2
BLAKE2b-256 4788cd92b52ef688953ca3a2485ce801df759e59697eb5438076acc527a7f2ac

See more details on using hashes here.

File details

Details for the file please_help_me_solve-0.2-py3-none-any.whl.

File metadata

File hashes

Hashes for please_help_me_solve-0.2-py3-none-any.whl
Algorithm Hash digest
SHA256 e80795c0216807cf5cd57233453e2a0778817fe3d34a083cf60edd25d5d95df7
MD5 b47533eb7675d14811eccd32b8a6495a
BLAKE2b-256 df29ea09e5a879abd0e6e1b52a9b7b473f6e3eee81ec731089d92e93b3f26ac4

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page