Skip to main content

Turn Python stack traces into cleaner, more readable output

Project description

philiprehberger-stacktrace

Tests PyPI version License

Turn Python stack traces into cleaner, more readable output.

Installation

pip install philiprehberger-stacktrace

Usage

Global Install

from philiprehberger_stacktrace import install

install()  # replaces sys.excepthook

Manual Formatting

from philiprehberger_stacktrace import format_exception

try:
    risky_operation()
except Exception as e:
    report = format_exception(e)
    print(report.short())     # one-line summary
    print(report.detailed())  # colored with source context

API

Function / Class Description
install(color=True, context=2, hide_stdlib=True) Replace sys.excepthook
format_exception(exc) Returns ExceptionReport
report.short() One-line summary
report.detailed(color, context, hide_stdlib) Full formatted output

Development

pip install -e .
python -m pytest tests/ -v

License

MIT

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

philiprehberger_stacktrace-0.1.6.tar.gz (5.2 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

philiprehberger_stacktrace-0.1.6-py3-none-any.whl (5.0 kB view details)

Uploaded Python 3

File details

Details for the file philiprehberger_stacktrace-0.1.6.tar.gz.

File metadata

File hashes

Hashes for philiprehberger_stacktrace-0.1.6.tar.gz
Algorithm Hash digest
SHA256 4adb59abf83b7bba876cc7d785e89f08ac714fe2c61fac6f0cea8f8bb9b851f5
MD5 5fadfef36ca0e80e4748997c3f78ef54
BLAKE2b-256 777fd5d33052dfde19fe4c58db0091b5b79f84fe4f3322b2be16d6c6afcf4aab

See more details on using hashes here.

File details

Details for the file philiprehberger_stacktrace-0.1.6-py3-none-any.whl.

File metadata

File hashes

Hashes for philiprehberger_stacktrace-0.1.6-py3-none-any.whl
Algorithm Hash digest
SHA256 76ba6c2a117100f61d73cfa43c002ae4ad0a4424ccb0cecd5d58c6c9eebec86e
MD5 4d5968c40385a11119eceaebd385932c
BLAKE2b-256 7bac488d55ea8be87e612c8b28520b7bade7e9f2bbcec2c3c6ca8ab7fd49d460

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page