Metadata-Version: 2.4
Name: so_buddy
Version: 0.1.0
Summary: Automatically find Stack Overflow solutions for your terminal errors.
Requires-Python: >=3.8
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: requests>=2.28.0
Dynamic: license-file

# 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:

```bash
pip install stackoverflowbuddy
```

## Usage

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

```python
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

```python
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](https://api.stackexchange.com/) for providing the data.
- The Python community for their support and contributions.
