pdbr
pdbr is intended to make the PDB results more colorful. it uses Rich library to carry out that.
Installing
Install with pip or your favorite PyPi package manager.
pip install pdbr
Breakpoint
In order to use breakpoint(), set PYTHONBREAKPOINT with "pdbr.set_trace"
import os
os.environ["PYTHONBREAKPOINT"] = "pdbr.set_trace"
or just import pdbr
import pdbr
New commands
vars(v)
it is used to get the local variables list.
inspect(i) / inspectall(ia)
In order to use rich.inspect as commands.
Config
Style
In order to use Rich's traceback, style, and theme, set setup.cfg.
[pdbr]
style = yellow
use_traceback = True
theme = friendly
History
store_history setting is used to keep and reload history, even the prompt is closed and opened again.
[pdbr]
...
store_history=.pdbr_history
Celery
In order to use Celery remote debugger with pdbr, use celery_set_trace as below sample. For more information see the Celery user guide.
from celery import Celery
app = Celery('tasks', broker='pyamqp://guest@localhost//')
@app.task
def add(x, y):
import pdbr; pdbr.celery_set_trace()
return x + y
Vscode user snippet
To create or edit your own snippets, select User Snippets under File > Preferences (Code > Preferences on macOS), and then select python.json.
Place the below snippet in json file for pdbr.
{
...
"pdbr": {
"prefix": "pdbr",
"body": "import pdbr; pdbr.set_trace()",
"description": "Code snippet for pdbr debug"
},
}
For Celery debug.
{
...
"rdbr": {
"prefix": "rdbr",
"body": "import pdbr; pdbr.celery_set_trace()",
"description": "Code snippet for Celery pdbr debug"
},
}
Samples
Traceback
Metadata
Release files for pdbr 0.3.2
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 |
|---|---|---|---|---|
| pdbr-0.3.2.tar.gz | 5.5 kB | Without provenance | Details for pdbr-0.3.2.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| pdbr-0.3.2-py3-none-any.whl | Python 3 | none | any | Details for pdbr-0.3.2-py3-none-any.whl |
Total release size: 11.4 kB
Release files / pdbr-0.3.2.tar.gz
| Download URL | pdbr-0.3.2.tar.gz |
|---|---|
| Size | 5.5 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
e30f863895d9b56037d9a9a9d237de04af6c44abcb9062be3fdf6531fff4441a
|
|
BLAKE2b-256 checksum How to use checksums |
1a8355689faf1cbc5f1d4a1dd821f7a97a0c3fdf4ac523f34a97564be952efa7
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
poetry/1.1.1 CPython/3.6.12 Linux/5.4.0-1025-azure
|
Release files / pdbr-0.3.2-py3-none-any.whl
| Download URL | pdbr-0.3.2-py3-none-any.whl |
|---|---|
| Size | 5.8 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
a555b776806bdab7daf38434ce279055d1cabcec716e480c0c03b799f15a30b4
|
|
BLAKE2b-256 checksum How to use checksums |
914ec160b9af9fe9dcc2f1eebf6b4df0a82e1f29a089bb004516afea9cad70da
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
poetry/1.1.1 CPython/3.6.12 Linux/5.4.0-1025-azure
|
Security for pdbr 0.3.2
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.