GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — GitHub - Gideon-Felt/charmed_traceback: Traceback intercept hook, providing applying Jetbrains style traceback highlighting, providing much easier debugging and log searching.

BranchesTags
Open more actions menu

Latest commit

 

History

8 Commits
8 Commits

Folders and files

NameName
Last commit message
Last commit date
charmed_traceback
charmed_traceback
 
 
.gitignore
.gitignore
 
 
MANIFEST.in
MANIFEST.in
 
 
README.md
README.md
 
 
poetry.lock
poetry.lock
 
 
pyproject.toml
pyproject.toml
 
 

Repository files navigation

Charmed Traceback

JetBrains style Tracebacks everywhere.
Automatically apply traceback styling akin to Jetbrains Traceback highlighting, providing much easier debugging and log searching, as-well as feel more at home away from PyCharm

Installation

Through pip:

pip install charmed-traceback

Build with poetry:

pip install Poetry
poetry build

Usage

Charmed Traceback can be executed as a module:

python -m charmed_traceback somefile.py

Charmed Traceback also works well within a script or even directly in the interpreter REPL. Standard usage will re-stylize the output, unless it's being redirected to a pipe:

import charmed_traceback
charmed_traceback.add_hook()

If want to retain the charmed style even when stderr is being piped, tack on an always=True argument:

import charmed_traceback
charmed_traceback.add_hook(always=True)

There are also a couple of convenience imports, which get the footprint down to one line:

# Same as add_hook()
import charmed_traceback.auto

# Same as add_hook(always=True)
import charmed_traceback.always

When implementing with a project that alternates between having access to development dependencies and not having those dependencies, it would be most convenient to provide a context manager to use this Charmed Tracebacks:

import contextlib

def dev_charm_traceback_handler() -> None:
    with contextlib.suppress(ImportError):
        import charmed_traceback.auto

# This call can be left in a project regaurdless of the presence of Charmed Traceback package.
dev_charm_traceback_handler()

About

Traceback intercept hook, providing applying Jetbrains style traceback highlighting, providing much easier debugging and log searching.

Resources

Readme
Activity

Stars

0 stars

Watchers

1 watching

Forks

0 forks
Report repository

Releases

Packages

Used by

Contributors

Languages

You are visitor 01402775 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.