Skip to main content

Automatic installation of Rich's traceback handler

Project description

rich-tracebacks

rich-tracebacks automates the installation of Rich's traceback handler in Python programs. Compared to Rich's own sanctioned method of automatically installing its traceback handler, rich-tracebacks is markedly simpler and agnostic to your virtual environment.

Installation

pip install rich-tracebacks

Usage

Enabling

Set the RICH_TRACEBACKS environment variable. The value of the variable doesn't matter, but we'll use 1 as an example.

export RICH_TRACEBACKS=1

That's it. Rich's traceback handler will be automatically installed each time you run your program.

[!IMPORTANT] If you use PyCharm, you may notice that rich-tracebacks doesn't work when using PyCharm's debugger. You can fix this by setting the RICH_TRACEBACKS_PYCHARM environment variable to any value.

Disabling

Unset the RICH_TRACEBACKS environment variable.

unset RICH_TRACEBACKS

Configuration

You can configure the traceback handler with its supported options by creating an rt_config.py file at your project's root. The file should contain a dictionary named config that maps option names to their intended values. For example:

# rt_config.py

config = {
    "show_locals": True,
    "width": 120,
    "theme": "monokai",
    ...
}

Options that are not defined in rt_config.py will fall back to their default values. If rt_config.py does not exist, all options will fall back to their default values.

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

rich_tracebacks-2.0.0.tar.gz (2.6 kB view details)

Uploaded Source

Built Distribution

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

rich_tracebacks-2.0.0-py3-none-any.whl (3.6 kB view details)

Uploaded Python 3

File details

Details for the file rich_tracebacks-2.0.0.tar.gz.

File metadata

  • Download URL: rich_tracebacks-2.0.0.tar.gz
  • Upload date:
  • Size: 2.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: uv/0.9.18 {"installer":{"name":"uv","version":"0.9.18","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

File hashes

Hashes for rich_tracebacks-2.0.0.tar.gz
Algorithm Hash digest
SHA256 4a77644c37ca839be6ff396f014a9c08af3af9fc60f1c75653c01e4bc712c690
MD5 09915e8736f2a7e9743cf04c9fba66b6
BLAKE2b-256 1bfdc0f6aed727eecf8abd706341eca1844316cf2abd6f8bfbd17b392ff1c627

See more details on using hashes here.

File details

Details for the file rich_tracebacks-2.0.0-py3-none-any.whl.

File metadata

  • Download URL: rich_tracebacks-2.0.0-py3-none-any.whl
  • Upload date:
  • Size: 3.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: uv/0.9.18 {"installer":{"name":"uv","version":"0.9.18","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

File hashes

Hashes for rich_tracebacks-2.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 8a2dfb5b0fda53839e395d05468972dc22b3c1775c859f1b73f97194bab468e9
MD5 55b4b2c1080e9244b3cc623d49422585
BLAKE2b-256 481ad2cf1475f726eb19a67f0e4b3b462a08cec2025e051affb58326f22a8c51

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