tracerite


Nametracerite JSON
Version 1.1.1 PyPI version JSON
download
home_pagehttps://github.com/sanic-org/tracerite
SummaryHuman-readable HTML tracebacks for Python exceptions
upload_time2023-11-12 07:36:30
maintainer
docs_urlNone
authorSanic Community
requires_python
license
keywords
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # Nicer error messages for Python

Other languages such as C++ have gotten quite useful error messages and
diagnostics with tips on how the fix the problems but Python is still stuck
with the bare stacktraces that are very intimidating and often not very helpful.

![TraceRite](https://raw.githubusercontent.com/sanic-org/tracerite/master/docs/with-tracerite.webp)
**TraceRite backtrace shows where the user has terminated the program.**

TraceRite hides the irrelevant IPython/notebook internals and concisely shows
what happened (the program was interrupted) and where that happened. This could
further be improved by converting the KeyboardInterrupt message into something
more suitable, like "You stopped the program", but what you see above is just
the default handling that never considered this particular error.

Although IPython and Google Colab developers have done their tweaks to improve
backtraces, it is all too apparent that much remains to be done:

![Colab](https://raw.githubusercontent.com/sanic-org/tracerite/master/docs/without-tracerite.webp)
**Standard backtrace from Google Colab.**

Even for the experienced programmer, it is tedious to read through the wall of
text to find the relevant details of what went wrong.

In more complex situations where one might get many screenfuls of standard
traceback, TraceRite produces scrollable outputs that concentrate on the relevant
details but also provide variable inspectors on each frame where it may be
relevant:

![Nested exceptions](https://raw.githubusercontent.com/sanic-org/tracerite/master/docs/nested.webp)
**TraceRite output with nested exceptions.**


## Usage

At the beginning of your Notebook:

```ipython
%pip install tracerite
%load_ext tracerite
```

## Background

This project is a proof of concept, showing a modern way to format error
messages in a human-readable manner. Heuristics are used to hide (by default)
irrelevant stack frames and show the actual location of the problem. Since it
would otherwise be impossible to find out the variable contents after the program
has crashed, a variable inspector built into each stack frame quickly reveals
problems with the variables mentioned at the source of error. Care is taken to
add revelant details such as notebook input field numbers and class names not
normally present in Python tracebacks, while hiding overly long paths and other
clutter.

All output is in HTML and as such only works in Jupyter notebooks and other
browser-based systems (this should be useful for web development frameworks as
well). This allows interactivity and much better layout than that of the text
console.

## License

Public Domain or equivalent.

## Help wanted

I won't be able to maintain this all by myself. If you like the idea of nicer
tracebacks, please offer your help in development! Pull requests are welcome
but it would be even better if you could pick up the whole project as your own.

As of now, this project is in no way properly polished for release. Yet, it is
useful enough to such a degree that I always use it in my notebooks, and it
really makes Python development a much smoother experience.

            

Raw data

            {
    "_id": null,
    "home_page": "https://github.com/sanic-org/tracerite",
    "name": "tracerite",
    "maintainer": "",
    "docs_url": null,
    "requires_python": "",
    "maintainer_email": "",
    "keywords": "",
    "author": "Sanic Community",
    "author_email": "tronic@noreply.users.github.com",
    "download_url": "https://files.pythonhosted.org/packages/b3/82/9372199dd72b02e8f3cf3143096ed453f010668a8e2cbe9cd59b116da3de/tracerite-1.1.1.tar.gz",
    "platform": null,
    "description": "# Nicer error messages for Python\n\nOther languages such as C++ have gotten quite useful error messages and\ndiagnostics with tips on how the fix the problems but Python is still stuck\nwith the bare stacktraces that are very intimidating and often not very helpful.\n\n![TraceRite](https://raw.githubusercontent.com/sanic-org/tracerite/master/docs/with-tracerite.webp)\n**TraceRite backtrace shows where the user has terminated the program.**\n\nTraceRite hides the irrelevant IPython/notebook internals and concisely shows\nwhat happened (the program was interrupted) and where that happened. This could\nfurther be improved by converting the KeyboardInterrupt message into something\nmore suitable, like \"You stopped the program\", but what you see above is just\nthe default handling that never considered this particular error.\n\nAlthough IPython and Google Colab developers have done their tweaks to improve\nbacktraces, it is all too apparent that much remains to be done:\n\n![Colab](https://raw.githubusercontent.com/sanic-org/tracerite/master/docs/without-tracerite.webp)\n**Standard backtrace from Google Colab.**\n\nEven for the experienced programmer, it is tedious to read through the wall of\ntext to find the relevant details of what went wrong.\n\nIn more complex situations where one might get many screenfuls of standard\ntraceback, TraceRite produces scrollable outputs that concentrate on the relevant\ndetails but also provide variable inspectors on each frame where it may be\nrelevant:\n\n![Nested exceptions](https://raw.githubusercontent.com/sanic-org/tracerite/master/docs/nested.webp)\n**TraceRite output with nested exceptions.**\n\n\n## Usage\n\nAt the beginning of your Notebook:\n\n```ipython\n%pip install tracerite\n%load_ext tracerite\n```\n\n## Background\n\nThis project is a proof of concept, showing a modern way to format error\nmessages in a human-readable manner. Heuristics are used to hide (by default)\nirrelevant stack frames and show the actual location of the problem. Since it\nwould otherwise be impossible to find out the variable contents after the program\nhas crashed, a variable inspector built into each stack frame quickly reveals\nproblems with the variables mentioned at the source of error. Care is taken to\nadd revelant details such as notebook input field numbers and class names not\nnormally present in Python tracebacks, while hiding overly long paths and other\nclutter.\n\nAll output is in HTML and as such only works in Jupyter notebooks and other\nbrowser-based systems (this should be useful for web development frameworks as\nwell). This allows interactivity and much better layout than that of the text\nconsole.\n\n## License\n\nPublic Domain or equivalent.\n\n## Help wanted\n\nI won't be able to maintain this all by myself. If you like the idea of nicer\ntracebacks, please offer your help in development! Pull requests are welcome\nbut it would be even better if you could pick up the whole project as your own.\n\nAs of now, this project is in no way properly polished for release. Yet, it is\nuseful enough to such a degree that I always use it in my notebooks, and it\nreally makes Python development a much smoother experience.\n",
    "bugtrack_url": null,
    "license": "",
    "summary": "Human-readable HTML tracebacks for Python exceptions",
    "version": "1.1.1",
    "project_urls": {
        "Homepage": "https://github.com/sanic-org/tracerite"
    },
    "split_keywords": [],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "4e71127927fdd41dd577fd946c319cf9c012366f3ff9f048d0b0689dc72819ef",
                "md5": "f96dc3458e0c2e100a9878f6452acf0a",
                "sha256": "3a787a9ecb1a136ea9ce17e6328e414ec414a4f644130af4e1e330bec2dece29"
            },
            "downloads": -1,
            "filename": "tracerite-1.1.1-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "f96dc3458e0c2e100a9878f6452acf0a",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": null,
            "size": 12301,
            "upload_time": "2023-11-12T07:36:28",
            "upload_time_iso_8601": "2023-11-12T07:36:28.503498Z",
            "url": "https://files.pythonhosted.org/packages/4e/71/127927fdd41dd577fd946c319cf9c012366f3ff9f048d0b0689dc72819ef/tracerite-1.1.1-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "b3829372199dd72b02e8f3cf3143096ed453f010668a8e2cbe9cd59b116da3de",
                "md5": "9607c48c37079856fae7269777d3830b",
                "sha256": "6400a35a187747189e4bb8d4a8e471bd86d14dbdcc94bcad23f4eda023f41356"
            },
            "downloads": -1,
            "filename": "tracerite-1.1.1.tar.gz",
            "has_sig": false,
            "md5_digest": "9607c48c37079856fae7269777d3830b",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": null,
            "size": 269462,
            "upload_time": "2023-11-12T07:36:30",
            "upload_time_iso_8601": "2023-11-12T07:36:30.897568Z",
            "url": "https://files.pythonhosted.org/packages/b3/82/9372199dd72b02e8f3cf3143096ed453f010668a8e2cbe9cd59b116da3de/tracerite-1.1.1.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2023-11-12 07:36:30",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "sanic-org",
    "github_project": "tracerite",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": true,
    "lcname": "tracerite"
}
        
Elapsed time: 0.35433s