Skip to main content

Automatically find Stack Overflow solutions for your terminal errors.

Project description

StackOverflowBuddy

StackOverflowBuddy is a Python library that hooks into Python's error handling to automatically fetch Stack Overflow solutions when a script crashes. It is designed to help developers quickly find relevant solutions to their coding problems.

Features

  • Colored Terminal Output: Highlights error messages, links, and headings for better readability.
  • Auto-Open Browser: Allows users to open Stack Overflow links directly in their default browser.
  • Offline Mode Handling: Gracefully handles network errors and provides informative messages when offline.

Installation

You can install StackOverflowBuddy using pip:

pip install stackoverflowbuddy

Usage

To enable StackOverflowBuddy in your Python script, simply add the following lines:

from so_buddy.core import StackOverflowBuddy

buddy = StackOverflowBuddy()
buddy.enable()

Once enabled, StackOverflowBuddy will automatically search for solutions on Stack Overflow whenever an unhandled exception occurs.

Example

from so_buddy.core import StackOverflowBuddy

buddy = StackOverflowBuddy()
buddy.enable()

# Example code that raises an exception
def divide(a, b):
    return a / b

divide(10, 0)

When the above script is run, StackOverflowBuddy will:

  1. Display the error message with colored output.
  2. Search Stack Overflow for relevant solutions.
  3. Display the top 3 results with links and scores.
  4. Allow you to open a link in your browser by typing its number.

Contributing

Contributions are welcome! If you'd like to add new features or fix bugs, please fork the repository and submit a pull request.

License

This project is licensed under the MIT License. See the LICENSE file for details.

Acknowledgments

  • Stack Exchange API for providing the data.
  • The Python community for their support and contributions.

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

so_buddy-0.1.0.tar.gz (4.0 kB view details)

Uploaded Source

Built Distribution

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

so_buddy-0.1.0-py3-none-any.whl (4.5 kB view details)

Uploaded Python 3

File details

Details for the file so_buddy-0.1.0.tar.gz.

File metadata

  • Download URL: so_buddy-0.1.0.tar.gz
  • Upload date:
  • Size: 4.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.7

File hashes

Hashes for so_buddy-0.1.0.tar.gz
Algorithm Hash digest
SHA256 68bc8d93d371cfcdd0b18e8ffee62369588b2ab4e1ff921221d9c93580e7fe06
MD5 219cdf43fbc4b2fe107a9e20ee9c093f
BLAKE2b-256 1c7c79cff2e3ac2d4abc1e32868cc5ebce17df87351fa5b275b07a6f5a728246

See more details on using hashes here.

File details

Details for the file so_buddy-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: so_buddy-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 4.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.7

File hashes

Hashes for so_buddy-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 e8cf2a70c97ca85018b1340a1847aaf3385305a98fd4a1a7c5573878d34a2740
MD5 fd6eeef070f596d21aca3e5b740540c2
BLAKE2b-256 d2cae872721893afe30d67d371c84f99ac50e67d2e14614d9ae8ced118dcf038

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