semvec/pypi-packages huggingface dataset:
traceplus 0.1.0
Modern enhanced Python traceback formatting with friendly error messages
License: MIT
Requires Python: >=3.7

# T+

T+ (TPlus) is a modern Python library that enhances error tracebacks with friendly messages, helpful fix suggestions, and beautiful terminal formatting using Rich.

## Features

```
- Friendly, custom error descriptions for common Python exceptions.
- Neatly formatted traceback panels with colored, bordered sections.
- Try/catch-style execution wrappers: `proceed` (try) and `fetch` (catch).
- Easy to extend with new error types and fix hints.
```

## Installation

pip install rich

*Note: T+ depends on the Rich library for terminal formatting.*

## Usage

The usage is provided as followed:

```
from tplus import proceed, fetch, Error

code_snippet = '''def div(a, b):
return a / b

result = div(10, 0)'''

def div(a, b):
return a / b

Using proceed (raises Error)
try:
proceed(div, 10, 0, code_snippet=code_snippet)
except Error as e:
print(e)

Using fetch (returns error)
result, error = fetch(div, 5, 0, code_snippet=code_snippet)
if error:
print(error)
else:
print("Result:", result)
```

## License

MIT License