Metadata-Version: 2.4
Name: philosopherror
Version: 0.1.0
Summary: A Python library that provides philosophical wisdom when errors occur
Author-email: Not a Real Programmer <notarealprogrammer010@gmail.com>
License: MIT
Project-URL: Homepage, https://github.com/notarealprogrammer001/philosopherror
Project-URL: Bug Tracker, https://github.com/notarealprogrammer001/philosopherror/issues
Keywords: philosophy,error,exception,debug,wisdom
Classifier: Development Status :: 3 - Alpha
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: MIT License
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.7
Classifier: Programming Language :: Python :: 3.8
Classifier: Programming Language :: Python :: 3.9
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Topic :: Software Development :: Libraries :: Python Modules
Classifier: Topic :: Software Development :: Debuggers
Requires-Python: >=3.7
Description-Content-Type: text/markdown
License-File: LICENSE
Dynamic: license-file
Dynamic: requires-python

# philosopherror

A silly yet insightful Python library that provides philosophical wisdom when errors and warnings occur.

## Overview

`philosopherror` enriches your debugging experience by adding philosophical quotes from both Eastern and Western philosophers whenever exceptions are raised or warnings are shown. It maps different error types to relevant philosophers, ensuring that the wisdom you receive is somewhat relevant to the error you're encountering.

## Features

* Automatically adds philosophical quotes to exceptions and warnings
* Maps specific error types to relevant philosophers
* Provides a decorator for adding philosophical wisdom to function errors
* Includes a direct API for accessing philosophical wisdom
* Can be enabled/disabled at runtime
* Contains genuine quotes from philosophers (no hallucinations)

## Installation

```bash
pip install philosopherror
```

## Usage

### Basic Usage

Simply import the library at the top of your script:

```python
import philosopherror
```

That's it! Now when errors occur, you'll get philosophical wisdom alongside them.

### Error Type Mapping

Different error types are mapped to philosophers whose wisdom might be relevant:

* Syntax errors: Wittgenstein, Confucius, Lao Tzu
* Logic errors: Aristotle, Kant, Plato
* Runtime errors: Seneca, Epictetus, Rumi
* System/IO errors: Marcus Aurelius, Rabindranath Tagore, Confucius

### Decorator

You can use the decorator to add philosophical wisdom to specific functions:

```python
@philosopherror.exception_handler
def risky_function():
    # This function might raise exceptions
    int("not a number")
```

### Direct API

```python
# Get wisdom from a specific philosopher
print(philosopherror.wisdom_from("Nietzsche"))

# Get random wisdom
print(philosopherror.random_wisdom())

# List all available philosophers
philosophers = philosopherror.list_philosophers()
```

### Enable/Disable

You can enable or disable the philosophical error messages at runtime:

```python
# Disable philosophical errors
philosopherror.disable()

# Re-enable philosophical errors
philosopherror.enable()
```

## Philosophers Included

### Western Philosophy
* Socrates, Plato, Aristotle
* Marcus Aurelius, Epictetus, Seneca
* Nietzsche, Kant, Wittgenstein
* Sartre, Camus

### Eastern Philosophy
* Confucius, Lao Tzu, Buddha
* Zhuangzi, Sun Tzu
* Rumi, Rabindranath Tagore, Alan Watts

### Indian Philosophy
* Swami Vivekananda, Sri Ramakrishna, Sri Aurobindo
* J. Krishnamurti, Ramana Maharshi, Adi Shankaracharya
* Paramahansa Yogananda, Kabir, Chanakya
* Thiruvalluvar, Jaggi Vasudev (Sadhguru)

## Example Output

```
Traceback (most recent call last):
  File "example.py", line 10, in <module>
    int("not a number")
ValueError: invalid literal for int() with base 10: 'not a number'

"The only true wisdom is in knowing you know nothing."
— Socrates
```

## Contributing

Feel free to contribute additional philosophers and quotes by submitting a pull request.

## License

MIT License
