A Python module for prettier (and far more useful) stack traces.
source | documentation
$ pip install --upgrade git+https://github.com/ShineyDev/pretty.git@main
If you wish to hook pretty.traceback into all Python sessions, set the PYTHONPRETTYTRACEBACK environment variable to a truthy value.
$ export PYTHONPRETTYTRACEBACK=1
If you wish to hook pretty.traceback into a single Python session, call pretty.traceback.hook().
>>> import pretty
>>> pretty.traceback.hook()
If you wish to use a formatter directly, initialize a new PrettyTracebackFormatter or DefaultTracebackFormatter, or build your own implementation on TracebackFormatter.
>>> import pretty
>>>
>>> formatter = pretty.traceback.PrettyTracebackFormatter()
>>>
>>> try:
>>> 1 / 0
>>> except Exception as e:
>>> formatter.print_current_exception()