frosch - Runtime Error Debugger
Better runtime error messages
Are you also constantly seeing the runtime error message the python interpreter is giving you? It lacks some color and more debug information!
Get some good looking error tracebacks and beautifuly formatted last line with all its last values before you crashed the program.
Installation
$ pip install frosch
Usage
Call the hook function at the beginning of your program.
from frosch import hook
hook()
x = 3 + "String"
Print Exceptions
You can also easily print your catched exceptions to stdout
from frosch import print_exception
try:
x = [0, 1]
x[3]
except IndexError as error:
print_exception(error)
Configuration
Themes
frosch allows to use different themes for styling the output:
| Themes | |||||
|---|---|---|---|---|---|
| abap | bw | igor | native | rrt | trac |
| algol | colorful | inkpot | paraiso_dark | sas | vim |
| algol_nu | default | lovelace | paraiso_light | solarized | vs |
| arduino | emacs | manni | pastie | stata_dark | xcode |
| autumn | friendly | monokai | perldoc | stata_light | |
| borland | fruity | murphy | rainbow_dash | tango |
Usage:
from frosch import hook
hook(theme="vim")
Custom Themes
You can also define custom themes by by subclassing Style (which is just a thin wrapper around pygments styles) and pass it to the hook. For more information please use the pygments docs.
from frosch import hook
from frosch.style import Style
from frosch.style.token import Keyword, Name, Comment, String, Error, \
Number, Operator, Generic
class CustomStyle(Style):
default_style = ""
styles = {
Comment: 'italic #888',
Keyword: 'bold #005',
Name: '#f00',
Name.Function: '#0f0',
Name.Class: 'bold #0f0',
String: 'bg:#eee #111'
}
hook(theme=CustomStyle)
OS Notifications
But wait there is more!
Running longer scripts in the background?
Just add a title and/or message to the hook and it will you give a notification when your program is crashing.
from frosch import hook
hook(
theme="vs", # VSCode Theme
title="I crashed!",
message="Run Number #1444 is also crashing..."
)
This works on MacOS (osascript), Linux (notify-send) and Windows (powershell).
Contribution
frosch uses poetry for build and dependency
management, so please install beforehand.
Setup
$ git clone https://github.com/HallerPatrick/frosch.git
$ poetry install
Run tests
$ python -m pytest tests
Metadata
Release files for frosch 0.1.9
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| frosch-0.1.9.tar.gz | 12.8 kB | Without provenance | Details for frosch-0.1.9.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| frosch-0.1.9-py3-none-any.whl | Python 3 | none | any | Details for frosch-0.1.9-py3-none-any.whl |
Total release size: 27.8 kB
Release files / frosch-0.1.9.tar.gz
| Download URL | frosch-0.1.9.tar.gz |
|---|---|
| Size | 12.8 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
b8c1c4160a4e6af9f60f05702e9b1ea115318475ed580a48a4e980885fc2cc82
|
|
BLAKE2b-256 checksum How to use checksums |
1364f75dd56296517f48600c743705955eaf790a9f1c50f20dd639f50e181bdb
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.6.0 importlib_metadata/4.8.2 pkginfo/1.8.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.9.9
|
Release files / frosch-0.1.9-py3-none-any.whl
| Download URL | frosch-0.1.9-py3-none-any.whl |
|---|---|
| Size | 15.0 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
2bbdff6930538d0822472923939b1576ce79eb256373bb58b2a4629dd07775bb
|
|
BLAKE2b-256 checksum How to use checksums |
fddbb2b4386857ac0c9b797f2447d5a8ae8728c5f3a07c75e6d4437998553962
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.6.0 importlib_metadata/4.8.2 pkginfo/1.8.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.9.9
|
Security for frosch 0.1.9
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.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A 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.