Dexc
Dexc is a Python exception formatter. It supports Python 3.11 and later.
Features
- Context displayed in addition to the main line of each frame
- Truncated trace lines when there are too many
- Colorized stack trace obeying the the NO_COLOR environment variable
- Minimization of frames when they are not part of the user code
- Support for exception groups
- Highlighting of re-raises i.e. when an exception is caught and re-raised with more than a simple
raise, causing two stack traces to be concatenated without separation - Handling of unraisable exceptions e.g. raised in a destructor
- Support for syntax errors
- Support for exception notes
- Support for warnings
- Collapse of repeated frames or groups of frames
- Disabling using the
DEXC_DISABLE=1environment variable - Support for allocation tracebacks occurring when a resource (such as a file object) is leaked or a coroutine is never awaited, given
-X tracemalloc=Nis set - Detection of repeated frames or frame groups
- Support for IPython cells
Caveats
Dexc should not be used in production code or to format untrusted exceptions. Because it relies on certain CPython-specific APIs, it may break on other runtimes or if your code displays exotic behavior, such as modifying sys.modules or updating source files while the program is running.
Furthermore, Dexc may produce incorrect output if your code or exception messages contain non-ASCII characters.
Installation
$ pip install dexc
Usage
import dexc
dexc.install()
# Or:
import dexc.autoinstall
Related work
| Name | Local lookup | Notes |
|---|---|---|
| backtrace | no | One line per frame |
| better-exceptions | yes | Same layout as the default |
| colored-traceback | no | Adds color to the default traceback |
| friendly-traceback | no | Provides error explanations |
| frosch | yes | |
| IPython ultratb | no | Same layout as the default |
| Pretty Traceback | no | One line per frame |
| pretty-errors | yes | |
| ptb | no | |
| Rich tracebacks | no | See also this article |
| rich-traceback | no | |
| stackprinter | yes | |
| TBVaccine | yes | Same layout as the default; includes .pth |
Metadata
Release files for dexc-autoinstall 1.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| dexc_autoinstall-1.1-py3-none-any.whl | Python 3 | none | any | Details for dexc_autoinstall-1.1-py3-none-any.whl |
Release files / dexc_autoinstall-1.1-py3-none-any.whl
| Download URL | dexc_autoinstall-1.1-py3-none-any.whl |
|---|---|
| Size | 6.1 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
354ac26cf83766987bc208f4c8b9c55771848a908cff277d16d0c3a702dbf6d3
|
|
BLAKE2b-256 checksum How to use checksums |
a24f594b1538fce4bbc6ad87577011c063f52b82ac4f0bf11cda12f8d85383bd
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.7
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Oct 27, 2025.
Transparency logSecurity for dexc-autoinstall 1.1
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
Full provenance
1 file in this release has been uploaded with provenance metadata.
Attestation for dexc_autoinstall-1.1-py3-none-any.whl
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Oct 27, 2025.
Transparency logA note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.