{"id":16805136,"url":"https://github.com/mdmintz/pdbp","last_synced_at":"2025-04-07T13:05:30.557Z","repository":{"id":63882300,"uuid":"571290206","full_name":"mdmintz/pdbp","owner":"mdmintz","description":"pdbp (Pdb+): A drop-in replacement for pdb and pdbpp. To replace \"pdb\", add \"import pdbp\" to an \"__init__.py\" file.","archived":false,"fork":false,"pushed_at":"2024-08-11T04:06:47.000Z","size":75,"stargazers_count":69,"open_issues_count":1,"forks_count":2,"subscribers_count":4,"default_branch":"master","last_synced_at":"2024-10-14T09:47:10.286Z","etag":null,"topics":["debugger","debugging","debugging-tool","pdb","python-debugger","seleniumbase","stacktrace","traceback"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/mdmintz.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":"SECURITY.md","support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2022-11-27T18:58:33.000Z","updated_at":"2024-10-04T05:29:25.000Z","dependencies_parsed_at":"2024-08-11T05:36:39.109Z","dependency_job_id":null,"html_url":"https://github.com/mdmintz/pdbp","commit_stats":{"total_commits":41,"total_committers":2,"mean_commits":20.5,"dds":"0.024390243902439046","last_synced_commit":"820e591edb8377f353dbdc10529484e8002fe57b"},"previous_names":[],"tags_count":25,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mdmintz%2Fpdbp","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mdmintz%2Fpdbp/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mdmintz%2Fpdbp/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mdmintz%2Fpdbp/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/mdmintz","download_url":"https://codeload.github.com/mdmintz/pdbp/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247657276,"owners_count":20974344,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["debugger","debugging","debugging-tool","pdb","python-debugger","seleniumbase","stacktrace","traceback"],"created_at":"2024-10-13T09:47:16.837Z","updated_at":"2025-04-07T13:05:30.527Z","avatar_url":"https://github.com/mdmintz.png","language":"Python","readme":"# pdbp (Pdb+) [![](https://img.shields.io/pypi/v/pdbp.svg)](https://pypi.python.org/pypi/pdbp)\n\n\u003cimg width=\"680\" alt=\"Pdb+ Advanced Python Console Debugger\" src=\"https://github.com/mdmintz/pdbp/assets/6788579/221038fd-df12-465e-958d-88eb9436a92d\"\u003e\u003cbr /\u003e\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\u003cp\u003e\u003cb\u003epdbp (Pdb+)\u003c/b\u003e makes Python debugging a lot easier (and more fun!)\u003c/p\u003e\n\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 \u003cscript.py\u003e\n```\n\n--------\n\nBasic **``Pdb+``** console commands:\n``n``, ``c``, ``s``, ``u``, ``d`` =\u003e ``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: (\u003ci\u003eShown below are the default settings.\u003c/i\u003e)\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\u003cimg width=\"760\" alt=\"Pdb+ commands\" src=\"https://user-images.githubusercontent.com/6788579/232948402-8700033f-a1b2-45f6-82e5-6b1a83d3d6c4.png\"\u003e\n\n\n### Post Mortem Debug Mode:\n\n\u003cimg width=\"640\" alt=\"Pdb+ Post Mortem Debug Mode\" src=\"https://user-images.githubusercontent.com/6788579/232537816-0b9e9048-724f-48cb-81e3-5cc403109de9.png\"\u003e\n\n\n### The ``where`` / ``w`` command, which displays the current stack:\n\n\u003cimg width=\"870\" alt=\"Example of the 'where' command\" src=\"https://user-images.githubusercontent.com/6788579/232962807-2d469603-a1d0-4891-8d0e-f03a4e1d0d00.png\"\u003e\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\u003e **Sticky Mode:**\n\n\u003cimg width=\"600\" alt=\"Pdb+ Stick Mode\" src=\"https://user-images.githubusercontent.com/6788579/204890148-53d2567b-9a56-4243-a7d7-66100a284312.png\"\u003e\n\n\u003e **Non-Sticky Mode:**\n\n\u003cimg width=\"600\" alt=\"Pdb+ Non-Sticky Mode\" src=\"https://user-images.githubusercontent.com/6788579/204890164-8465bc22-0f20-43f1-8ab7-b4316718a4c6.png\"\u003e\n\n--------\n\n### Tab completion:\n\n\u003cimg width=\"584\" alt=\"Pdb+ Tab Completion\" src=\"https://user-images.githubusercontent.com/6788579/254074593-31fcd816-7a3f-445d-82e9-fc2c8d4d873c.png\"\u003e\n\n--------\n\n### Multi-layer highlighting in the same stack:\n\n\u003cimg width=\"536\" alt=\"Pdb+ Advanced Python Console Debugger\" src=\"https://user-images.githubusercontent.com/6788579/207925754-4d4ffce5-be6c-44b6-b614-ae0e800a93d8.png\"\u003e\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\u003cimg width=\"650\" alt=\"Pdb+ Advanced Python Console Debugger\" src=\"https://user-images.githubusercontent.com/6788579/234669562-30dae4ad-1207-47e4-8327-fbd5662c8b9c.png\"\u003e\n\n--------\n\n(**Pdb+** is maintained by the [SeleniumBase Dev Team](https://github.com/seleniumbase/SeleniumBase))\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmdmintz%2Fpdbp","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmdmintz%2Fpdbp","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmdmintz%2Fpdbp/lists"}