pdbplus


Namepdbplus JSON
Version 1.5.0 PyPI version JSON
download
home_pagehttps://github.com/mdmintz/pdbp
Summarypdbp (Pdb+): A drop-in replacement for pdb and pdbpp.
upload_time2023-09-08 20:11:17
maintainerMichael Mintz
docs_urlNone
authorMichael Mintz
requires_python>=3.7
licenseMIT
keywords
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            **[<img src="https://img.shields.io/badge/pypi-pdbplus-22AAEE.svg" alt="pypi" />](https://pypi.python.org/pypi/pdbplus) is a proxy for installing [<img src="https://img.shields.io/badge/pypi-pdbp-22AAEE.svg" alt="pypi" />](https://pypi.python.org/pypi/pdbp) (Pdb+).**
****

<!-- Pdb+ Docs -->

# pdbp (Pdb+) [![](https://img.shields.io/pypi/v/pdbp.svg)](https://pypi.python.org/pypi/pdbp)

<img width="680" alt="Pdb+ Advanced Python Console Debugger" src="https://user-images.githubusercontent.com/6788579/247826485-d782911e-d817-4ea6-86dd-215991d7b8ea.png">

--------

**[pdbp (Pdb+)](https://github.com/mdmintz/pdbp)** is an advanced console debugger for Python. It can be used as a drop-in replacement for [pdb](https://docs.python.org/3/library/pdb.html) and [pdbpp](https://github.com/pdbpp/pdbpp).

<p><b>pdbp (Pdb+)</b> makes Python debugging a lot easier (and more fun!)</p>

--------

<img width="650" alt="Pdb+" src="https://user-images.githubusercontent.com/6788579/234679015-b1daa50f-94a8-4ef2-b3f5-3157b7a3733b.png">


## Installation:

```bash
pip install pdbp
```

Then add ``import pdbp`` to an ``__init__.py`` of your project, which will automatically make **``Pdb+``** the default debugger at breakpoints:

```python
import pdbp
```

(If using ``flake8`` for code-linting, you may want to add ``# noqa`` to that line):

```python
import pdbp  # noqa
```

You can also make ``pdbp`` the default debugger by setting an environmental variable:

```bash
PYTHONBREAKPOINT=pdbp.set_trace
```

## Usage:

To trigger a breakpoint in your code with ``pytest``, add ``--trace`` (to start tests with a breakpoint) or ``--pdb`` (to trigger a breakpoint if a test fails).

To trigger a breakpoint from a pure ``python`` run, use:

```bash
python -m pdbp <script.py>
```

--------

Basic **``Pdb+``** console commands:
``n``, ``c``, ``s``, ``u``, ``d`` => ``next``, ``continue``, ``step``, ``up``, ``down``

(To learn more **Pdb+** console commands, type ``help`` in the **Pdb+** console and press ``Enter/Return``.)

--------

**``pdbp`` (Pdb+)** makes improvements to ``pdbpp`` so that it works in all environments. It also includes other bug-fixes. "Sticky" mode is the default option, which shows multiple lines of code while letting you see where you're going (while typing ``n`` + ``Enter``).

If you somehow reset ``pdb`` to Python's built-in version, you can always replace ``pdb`` with **``pdbp``** again as the default debugger by running this:

```python
import pdb
import pdbp
for key in pdbp.__dict__.keys():
    pdb.__dict__[key] = pdbp.__dict__[key]
```

Here's how to customize **``pdbp``**/``pdb`` options if you don't like the default settings: (<i>Shown below are the default settings.</i>)

```python
import pdb
if hasattr(pdb, "DefaultConfig"):
    pdb.DefaultConfig.filename_color = pdb.Color.fuchsia
    pdb.DefaultConfig.line_number_color = pdb.Color.turquoise
    pdb.DefaultConfig.truncate_long_lines = False
    pdb.DefaultConfig.sticky_by_default = True
```

You can also trigger **``Pdb+``** activation like this:

```python
import pdbp
pdbp.set_trace()
```


### pdbp (Pdb+) commands:

<img width="760" alt="Pdb+ commands" src="https://user-images.githubusercontent.com/6788579/232948402-8700033f-a1b2-45f6-82e5-6b1a83d3d6c4.png">


### Post Mortem Debug Mode:

<img width="640" alt="Pdb+ Post Mortem Debug Mode" src="https://user-images.githubusercontent.com/6788579/232537816-0b9e9048-724f-48cb-81e3-5cc403109de9.png">


### The ``where`` / ``w`` command, which displays the current stack:

<img width="870" alt="Example of the 'where' command" src="https://user-images.githubusercontent.com/6788579/232962807-2d469603-a1d0-4891-8d0e-f03a4e1d0d00.png">

--------

### Sticky Mode vs Non-Sticky Mode:

The default mode (``sticky``) lets you see a lot more lines of code from the debugger when active. In Non-Sticky mode, only one line of code is shown at a time. You can switch between the two modes by typing ``sticky`` in the **Pdb+** console prompt and pressing ``Enter/Return``.

> **Sticky Mode:**

<img width="600" alt="Pdb+ Stick Mode" src="https://user-images.githubusercontent.com/6788579/204890148-53d2567b-9a56-4243-a7d7-66100a284312.png">

> **Non-Sticky Mode:**

<img width="600" alt="Pdb+ Non-Sticky Mode" src="https://user-images.githubusercontent.com/6788579/204890164-8465bc22-0f20-43f1-8ab7-b4316718a4c6.png">

--------

### Tab completion:

<img width="584" alt="Pdb+ Tab Completion" src="https://user-images.githubusercontent.com/6788579/254074593-31fcd816-7a3f-445d-82e9-fc2c8d4d873c.png">

--------

### Multi-layer highlighting in the same stack:

<img width="536" alt="Pdb+ Advanced Python Console Debugger" src="https://user-images.githubusercontent.com/6788579/207925754-4d4ffce5-be6c-44b6-b614-ae0e800a93d8.png">


### More examples:

**``Pdb+``** is used by packages such as **``seleniumbase``**:

* https://pypi.org/project/seleniumbase/
* https://github.com/seleniumbase/SeleniumBase

--------

<img width="650" alt="Pdb+ Advanced Python Console Debugger" src="https://user-images.githubusercontent.com/6788579/234669562-30dae4ad-1207-47e4-8327-fbd5662c8b9c.png">

--------

(**Pdb+** is maintained by the [SeleniumBase Dev Team](https://github.com/seleniumbase/SeleniumBase))

            

Raw data

            {
    "_id": null,
    "home_page": "https://github.com/mdmintz/pdbp",
    "name": "pdbplus",
    "maintainer": "Michael Mintz",
    "docs_url": null,
    "requires_python": ">=3.7",
    "maintainer_email": "",
    "keywords": "",
    "author": "Michael Mintz",
    "author_email": "mdmintz@gmail.com",
    "download_url": "https://files.pythonhosted.org/packages/9e/7d/1f2c3f8cf7131b3b78c1fa4fcb09cb675f1e68eb4abc156248b6e48d2a6b/pdbplus-1.5.0.tar.gz",
    "platform": "Windows",
    "description": "**[<img src=\"https://img.shields.io/badge/pypi-pdbplus-22AAEE.svg\" alt=\"pypi\" />](https://pypi.python.org/pypi/pdbplus) is a proxy for installing [<img src=\"https://img.shields.io/badge/pypi-pdbp-22AAEE.svg\" alt=\"pypi\" />](https://pypi.python.org/pypi/pdbp) (Pdb+).**\n****\n\n<!-- Pdb+ Docs -->\n\n# pdbp (Pdb+) [![](https://img.shields.io/pypi/v/pdbp.svg)](https://pypi.python.org/pypi/pdbp)\n\n<img width=\"680\" alt=\"Pdb+ Advanced Python Console Debugger\" src=\"https://user-images.githubusercontent.com/6788579/247826485-d782911e-d817-4ea6-86dd-215991d7b8ea.png\">\n\n--------\n\n**[pdbp (Pdb+)](https://github.com/mdmintz/pdbp)** is an advanced console debugger for Python. It can be used as a drop-in replacement for [pdb](https://docs.python.org/3/library/pdb.html) and [pdbpp](https://github.com/pdbpp/pdbpp).\n\n<p><b>pdbp (Pdb+)</b> makes Python debugging a lot easier (and more fun!)</p>\n\n--------\n\n<img width=\"650\" alt=\"Pdb+\" src=\"https://user-images.githubusercontent.com/6788579/234679015-b1daa50f-94a8-4ef2-b3f5-3157b7a3733b.png\">\n\n\n## Installation:\n\n```bash\npip install pdbp\n```\n\nThen add ``import pdbp`` to an ``__init__.py`` of your project, which will automatically make **``Pdb+``** the default debugger at breakpoints:\n\n```python\nimport pdbp\n```\n\n(If using ``flake8`` for code-linting, you may want to add ``# noqa`` to that line):\n\n```python\nimport pdbp  # noqa\n```\n\nYou can also make ``pdbp`` the default debugger by setting an environmental variable:\n\n```bash\nPYTHONBREAKPOINT=pdbp.set_trace\n```\n\n## Usage:\n\nTo trigger a breakpoint in your code with ``pytest``, add ``--trace`` (to start tests with a breakpoint) or ``--pdb`` (to trigger a breakpoint if a test fails).\n\nTo trigger a breakpoint from a pure ``python`` run, use:\n\n```bash\npython -m pdbp <script.py>\n```\n\n--------\n\nBasic **``Pdb+``** console commands:\n``n``, ``c``, ``s``, ``u``, ``d`` => ``next``, ``continue``, ``step``, ``up``, ``down``\n\n(To learn more **Pdb+** console commands, type ``help`` in the **Pdb+** console and press ``Enter/Return``.)\n\n--------\n\n**``pdbp`` (Pdb+)** makes improvements to ``pdbpp`` so that it works in all environments. It also includes other bug-fixes. \"Sticky\" mode is the default option, which shows multiple lines of code while letting you see where you're going (while typing ``n`` + ``Enter``).\n\nIf you somehow reset ``pdb`` to Python's built-in version, you can always replace ``pdb`` with **``pdbp``** again as the default debugger by running this:\n\n```python\nimport pdb\nimport pdbp\nfor key in pdbp.__dict__.keys():\n    pdb.__dict__[key] = pdbp.__dict__[key]\n```\n\nHere's how to customize **``pdbp``**/``pdb`` options if you don't like the default settings: (<i>Shown below are the default settings.</i>)\n\n```python\nimport pdb\nif hasattr(pdb, \"DefaultConfig\"):\n    pdb.DefaultConfig.filename_color = pdb.Color.fuchsia\n    pdb.DefaultConfig.line_number_color = pdb.Color.turquoise\n    pdb.DefaultConfig.truncate_long_lines = False\n    pdb.DefaultConfig.sticky_by_default = True\n```\n\nYou can also trigger **``Pdb+``** activation like this:\n\n```python\nimport pdbp\npdbp.set_trace()\n```\n\n\n### pdbp (Pdb+) commands:\n\n<img width=\"760\" alt=\"Pdb+ commands\" src=\"https://user-images.githubusercontent.com/6788579/232948402-8700033f-a1b2-45f6-82e5-6b1a83d3d6c4.png\">\n\n\n### Post Mortem Debug Mode:\n\n<img width=\"640\" alt=\"Pdb+ Post Mortem Debug Mode\" src=\"https://user-images.githubusercontent.com/6788579/232537816-0b9e9048-724f-48cb-81e3-5cc403109de9.png\">\n\n\n### The ``where`` / ``w`` command, which displays the current stack:\n\n<img width=\"870\" alt=\"Example of the 'where' command\" src=\"https://user-images.githubusercontent.com/6788579/232962807-2d469603-a1d0-4891-8d0e-f03a4e1d0d00.png\">\n\n--------\n\n### Sticky Mode vs Non-Sticky Mode:\n\nThe default mode (``sticky``) lets you see a lot more lines of code from the debugger when active. In Non-Sticky mode, only one line of code is shown at a time. You can switch between the two modes by typing ``sticky`` in the **Pdb+** console prompt and pressing ``Enter/Return``.\n\n> **Sticky Mode:**\n\n<img width=\"600\" alt=\"Pdb+ Stick Mode\" src=\"https://user-images.githubusercontent.com/6788579/204890148-53d2567b-9a56-4243-a7d7-66100a284312.png\">\n\n> **Non-Sticky Mode:**\n\n<img width=\"600\" alt=\"Pdb+ Non-Sticky Mode\" src=\"https://user-images.githubusercontent.com/6788579/204890164-8465bc22-0f20-43f1-8ab7-b4316718a4c6.png\">\n\n--------\n\n### Tab completion:\n\n<img width=\"584\" alt=\"Pdb+ Tab Completion\" src=\"https://user-images.githubusercontent.com/6788579/254074593-31fcd816-7a3f-445d-82e9-fc2c8d4d873c.png\">\n\n--------\n\n### Multi-layer highlighting in the same stack:\n\n<img width=\"536\" alt=\"Pdb+ Advanced Python Console Debugger\" src=\"https://user-images.githubusercontent.com/6788579/207925754-4d4ffce5-be6c-44b6-b614-ae0e800a93d8.png\">\n\n\n### More examples:\n\n**``Pdb+``** is used by packages such as **``seleniumbase``**:\n\n* https://pypi.org/project/seleniumbase/\n* https://github.com/seleniumbase/SeleniumBase\n\n--------\n\n<img width=\"650\" alt=\"Pdb+ Advanced Python Console Debugger\" src=\"https://user-images.githubusercontent.com/6788579/234669562-30dae4ad-1207-47e4-8327-fbd5662c8b9c.png\">\n\n--------\n\n(**Pdb+** is maintained by the [SeleniumBase Dev Team](https://github.com/seleniumbase/SeleniumBase))\n",
    "bugtrack_url": null,
    "license": "MIT",
    "summary": "pdbp (Pdb+): A drop-in replacement for pdb and pdbpp.",
    "version": "1.5.0",
    "project_urls": {
        "Bug Tracker": "https://github.com/mdmintz/pdbp/issues",
        "Changelog": "https://github.com/mdmintz/pdbp/releases",
        "Download": "https://pypi.org/project/pdbp/#files",
        "Homepage": "https://github.com/mdmintz/pdbp",
        "PyPI": "https://pypi.org/project/pdbp/",
        "Source": "https://github.com/mdmintz/pdbp"
    },
    "split_keywords": [],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "92a9dfeec8bab207201dabd93a9edc8892a5597c9b8f666cc51f0b5602a43671",
                "md5": "cf94f0060bfc7f4bd8db0900926e45c0",
                "sha256": "723e5c96f5feee1ffc76fe9c95c0aae4246ee8a487ad8f843b55bffba2d894cc"
            },
            "downloads": -1,
            "filename": "pdbplus-1.5.0-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "cf94f0060bfc7f4bd8db0900926e45c0",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.7",
            "size": 3531,
            "upload_time": "2023-09-08T20:11:15",
            "upload_time_iso_8601": "2023-09-08T20:11:15.836814Z",
            "url": "https://files.pythonhosted.org/packages/92/a9/dfeec8bab207201dabd93a9edc8892a5597c9b8f666cc51f0b5602a43671/pdbplus-1.5.0-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "9e7d1f2c3f8cf7131b3b78c1fa4fcb09cb675f1e68eb4abc156248b6e48d2a6b",
                "md5": "d38e62a911162e7cfcfc7c686c826481",
                "sha256": "b4315f43fa4feb5cc43d46c2508046c351becc929d256500e76864343c84dd69"
            },
            "downloads": -1,
            "filename": "pdbplus-1.5.0.tar.gz",
            "has_sig": false,
            "md5_digest": "d38e62a911162e7cfcfc7c686c826481",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.7",
            "size": 4883,
            "upload_time": "2023-09-08T20:11:17",
            "upload_time_iso_8601": "2023-09-08T20:11:17.207945Z",
            "url": "https://files.pythonhosted.org/packages/9e/7d/1f2c3f8cf7131b3b78c1fa4fcb09cb675f1e68eb4abc156248b6e48d2a6b/pdbplus-1.5.0.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2023-09-08 20:11:17",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "mdmintz",
    "github_project": "pdbp",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": false,
    "requirements": [],
    "lcname": "pdbplus"
}
        
Elapsed time: 0.10782s