reverse-tb


Namereverse-tb JSON
Version 0.0.4 PyPI version JSON
download
home_pagehttps://github.com/ababino/reverse_tb
Summaryreverse_tb is a jupyter notebook magic that reverses the order of the traceback, making it easier to see the most relevant information at the top of the cell output.
upload_time2023-03-31 00:10:22
maintainer
docs_urlNone
authorAndres Babino
requires_python>=3.7
licenseApache Software License 2.0
keywords nbdev jupyter notebook python
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            reverse_tb
================

<!-- WARNING: THIS FILE WAS AUTOGENERATED! DO NOT EDIT! -->

> reverse_tb is a jupyter notebook magic that reverses the order of the
> traceback, making it easier to see the most relevant information at
> the top of the cell output.

## Install

``` sh
pip install reverse_tb
```

## How to use

``` python
from reverse_tb.core import reverse_tb
```

``` python
def foo():
    return bar()

def bar():
    return baz()

def baz():
    try:
        qux()
    except KeyError as e:
        raise Exception
    return qux()

def qux():
    d = {}
    return d['key']
```

``` python
foo()
```

``` python
---------------------------------------------------------------------------
KeyError                                  Traceback (most recent call last)
Cell In[2], line 9, in baz()
      8 try:
----> 9     qux()
     10 except KeyError as e:

Cell In[2], line 16, in qux()
     15 d = {}
---> 16 return d['key']

KeyError: 'key'

During handling of the above exception, another exception occurred:

Exception                                 Traceback (most recent call last)
Cell In[3], line 1
----> 1 foo()

Cell In[2], line 2, in foo()
      1 def foo():
----> 2     return bar()

Cell In[2], line 5, in bar()
      4 def bar():
----> 5     return baz()

Cell In[2], line 11, in baz()
      9     qux()
     10 except KeyError as e:
---> 11     raise Exception
     12 return qux()

Exception: 
```

``` python
%%reverse_tb
foo()
```

``` python
---------------------------------------------------------------------------
KeyError                                  Traceback (last call first)
KeyError: 'key'
Cell In[2], line 16, in qux()
     15 d = {}
---> 16 return d['key']
        d = {}

Cell In[2], line 9, in baz()
      8 try:
----> 9     qux()
     10 except KeyError as e:


During handling of the above exception, another exception occurred:

Exception                                 Traceback (last call first)
Exception: 
Cell In[2], line 11, in baz()
      9     qux()
     10 except KeyError as e:
---> 11     raise Exception
     12 return qux()

Cell In[2], line 5, in bar()
      4 def bar():
----> 5     return baz()

Cell In[2], line 2, in foo()
      1 def foo():
----> 2     return bar()

Cell In[4], line 1
----> 1 foo()
```

``` python
from reverse_tb.on import *
foo()
```

``` python
---------------------------------------------------------------------------
KeyError                                  Traceback (last call first)
KeyError: 'key'
Cell In[2], line 16, in qux()
     15 d = {}
---> 16 return d['key']
        d = {}

Cell In[2], line 9, in baz()
      8 try:
----> 9     qux()
     10 except KeyError as e:


During handling of the above exception, another exception occurred:

Exception                                 Traceback (last call first)
Exception: 
Cell In[2], line 11, in baz()
      9     qux()
     10 except KeyError as e:
---> 11     raise Exception
     12 return qux()

Cell In[2], line 5, in bar()
      4 def bar():
----> 5     return baz()

Cell In[2], line 2, in foo()
      1 def foo():
----> 2     return bar()

Cell In[4], line 1
----> 1 foo()
```

``` python
reverse_tb_off()
foo()
```

``` python
---------------------------------------------------------------------------
KeyError                                  Traceback (most recent call last)
Cell In[2], line 9, in baz()
      8 try:
----> 9     qux()
     10 except KeyError as e:

Cell In[2], line 16, in qux()
     15 d = {}
---> 16 return d['key']

KeyError: 'key'

During handling of the above exception, another exception occurred:

Exception                                 Traceback (most recent call last)
Cell In[3], line 1
----> 1 foo()

Cell In[2], line 2, in foo()
      1 def foo():
----> 2     return bar()

Cell In[2], line 5, in bar()
      4 def bar():
----> 5     return baz()

Cell In[2], line 11, in baz()
      9     qux()
     10 except KeyError as e:
---> 11     raise Exception
     12 return qux()

Exception: 
```

            

Raw data

            {
    "_id": null,
    "home_page": "https://github.com/ababino/reverse_tb",
    "name": "reverse-tb",
    "maintainer": "",
    "docs_url": null,
    "requires_python": ">=3.7",
    "maintainer_email": "",
    "keywords": "nbdev jupyter notebook python",
    "author": "Andres Babino",
    "author_email": "ababino@gmail.com",
    "download_url": "https://files.pythonhosted.org/packages/18/fd/5023a4f5fc073402a309bafbbf81c8b59273a1fa885c8de790570b79654d/reverse_tb-0.0.4.tar.gz",
    "platform": null,
    "description": "reverse_tb\n================\n\n<!-- WARNING: THIS FILE WAS AUTOGENERATED! DO NOT EDIT! -->\n\n> reverse_tb is a jupyter notebook magic that reverses the order of the\n> traceback, making it easier to see the most relevant information at\n> the top of the cell output.\n\n## Install\n\n``` sh\npip install reverse_tb\n```\n\n## How to use\n\n``` python\nfrom reverse_tb.core import reverse_tb\n```\n\n``` python\ndef foo():\n    return bar()\n\ndef bar():\n    return baz()\n\ndef baz():\n    try:\n        qux()\n    except KeyError as e:\n        raise Exception\n    return qux()\n\ndef qux():\n    d = {}\n    return d['key']\n```\n\n``` python\nfoo()\n```\n\n``` python\n---------------------------------------------------------------------------\nKeyError                                  Traceback (most recent call last)\nCell In[2], line 9, in baz()\n      8 try:\n----> 9     qux()\n     10 except KeyError as e:\n\nCell In[2], line 16, in qux()\n     15 d = {}\n---> 16 return d['key']\n\nKeyError: 'key'\n\nDuring handling of the above exception, another exception occurred:\n\nException                                 Traceback (most recent call last)\nCell In[3], line 1\n----> 1 foo()\n\nCell In[2], line 2, in foo()\n      1 def foo():\n----> 2     return bar()\n\nCell In[2], line 5, in bar()\n      4 def bar():\n----> 5     return baz()\n\nCell In[2], line 11, in baz()\n      9     qux()\n     10 except KeyError as e:\n---> 11     raise Exception\n     12 return qux()\n\nException: \n```\n\n``` python\n%%reverse_tb\nfoo()\n```\n\n``` python\n---------------------------------------------------------------------------\nKeyError                                  Traceback (last call first)\nKeyError: 'key'\nCell In[2], line 16, in qux()\n     15 d = {}\n---> 16 return d['key']\n        d = {}\n\nCell In[2], line 9, in baz()\n      8 try:\n----> 9     qux()\n     10 except KeyError as e:\n\n\nDuring handling of the above exception, another exception occurred:\n\nException                                 Traceback (last call first)\nException: \nCell In[2], line 11, in baz()\n      9     qux()\n     10 except KeyError as e:\n---> 11     raise Exception\n     12 return qux()\n\nCell In[2], line 5, in bar()\n      4 def bar():\n----> 5     return baz()\n\nCell In[2], line 2, in foo()\n      1 def foo():\n----> 2     return bar()\n\nCell In[4], line 1\n----> 1 foo()\n```\n\n``` python\nfrom reverse_tb.on import *\nfoo()\n```\n\n``` python\n---------------------------------------------------------------------------\nKeyError                                  Traceback (last call first)\nKeyError: 'key'\nCell In[2], line 16, in qux()\n     15 d = {}\n---> 16 return d['key']\n        d = {}\n\nCell In[2], line 9, in baz()\n      8 try:\n----> 9     qux()\n     10 except KeyError as e:\n\n\nDuring handling of the above exception, another exception occurred:\n\nException                                 Traceback (last call first)\nException: \nCell In[2], line 11, in baz()\n      9     qux()\n     10 except KeyError as e:\n---> 11     raise Exception\n     12 return qux()\n\nCell In[2], line 5, in bar()\n      4 def bar():\n----> 5     return baz()\n\nCell In[2], line 2, in foo()\n      1 def foo():\n----> 2     return bar()\n\nCell In[4], line 1\n----> 1 foo()\n```\n\n``` python\nreverse_tb_off()\nfoo()\n```\n\n``` python\n---------------------------------------------------------------------------\nKeyError                                  Traceback (most recent call last)\nCell In[2], line 9, in baz()\n      8 try:\n----> 9     qux()\n     10 except KeyError as e:\n\nCell In[2], line 16, in qux()\n     15 d = {}\n---> 16 return d['key']\n\nKeyError: 'key'\n\nDuring handling of the above exception, another exception occurred:\n\nException                                 Traceback (most recent call last)\nCell In[3], line 1\n----> 1 foo()\n\nCell In[2], line 2, in foo()\n      1 def foo():\n----> 2     return bar()\n\nCell In[2], line 5, in bar()\n      4 def bar():\n----> 5     return baz()\n\nCell In[2], line 11, in baz()\n      9     qux()\n     10 except KeyError as e:\n---> 11     raise Exception\n     12 return qux()\n\nException: \n```\n",
    "bugtrack_url": null,
    "license": "Apache Software License 2.0",
    "summary": "reverse_tb is a jupyter notebook magic that reverses the order of the traceback, making it easier to see the most relevant information at the top of the cell output.",
    "version": "0.0.4",
    "split_keywords": [
        "nbdev",
        "jupyter",
        "notebook",
        "python"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "f2fa03360c08e1f1b1afa4605e12c7496e81d1eee66cae78ade9098bd2a6d08d",
                "md5": "c05df9415ba4e3338f66be0703bd7ade",
                "sha256": "d3a2a6027a2d1755d9027dbdea6f0b7fad632c6e9fa9d84fbba30e9c32f88bb5"
            },
            "downloads": -1,
            "filename": "reverse_tb-0.0.4-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "c05df9415ba4e3338f66be0703bd7ade",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.7",
            "size": 8138,
            "upload_time": "2023-03-31T00:10:19",
            "upload_time_iso_8601": "2023-03-31T00:10:19.889976Z",
            "url": "https://files.pythonhosted.org/packages/f2/fa/03360c08e1f1b1afa4605e12c7496e81d1eee66cae78ade9098bd2a6d08d/reverse_tb-0.0.4-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "18fd5023a4f5fc073402a309bafbbf81c8b59273a1fa885c8de790570b79654d",
                "md5": "16abf2d5c5462ad7a1cbb69d6ea024ad",
                "sha256": "8f103e5e2bb797f42707ecc59983480e92458d75a109bd95a1244a6f66e8603b"
            },
            "downloads": -1,
            "filename": "reverse_tb-0.0.4.tar.gz",
            "has_sig": false,
            "md5_digest": "16abf2d5c5462ad7a1cbb69d6ea024ad",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.7",
            "size": 8489,
            "upload_time": "2023-03-31T00:10:22",
            "upload_time_iso_8601": "2023-03-31T00:10:22.795576Z",
            "url": "https://files.pythonhosted.org/packages/18/fd/5023a4f5fc073402a309bafbbf81c8b59273a1fa885c8de790570b79654d/reverse_tb-0.0.4.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2023-03-31 00:10:22",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "github_user": "ababino",
    "github_project": "reverse_tb",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": true,
    "lcname": "reverse-tb"
}
        
Elapsed time: 0.06390s