Skip to main content

A TUI frontend for pdb

Project description

NicerPDB

A terminal frontend for Python's pdb debugger, powered by rich.

Install

pip install git+https://github.com/Hedwyn/nicerpdb.git

Features

  • Syntax-highlighted code display
  • Improved variable inspection
  • Enhanced stack traces
  • Pretty-printed expressions

Usage

As an entrypoint

Simply substitute pdb by nicerpdb:

python -m nicerpdb <script_path>

Invoke automatically on breakpoint

If you want nicerpdb to be invoked on a breakpoint() without using it explicitly as entyrypoint, you can set the PYTHONBREAKPOINT environment variable which allows customizing the debugger called on breakpoint:

  • Set it persistently in your current session with:
export PYTHONBREAKPOINT=nicerpdb.set_trace
  • Or for a single command using the usual environement variable syntax:
PYTHONBREAKPOINT=nicerpdb.set_trace python <script_path>

Invoke automatically on test failure with pytest

pytest provides the --pdb option to invoke automatically pdb in post-mortem mode on test failure. nicerpdb provides a pytest plugin to provide the same functionality; replace --pdb by the following flags -p nicerpdb -s (-p loads a pytest plugin, -s disables output capturing so that the debugger can interact with the terminal).

Extensions to PDB

Additional commands

  • l / list: support passing an integer defining the number of lines to show.
  • sh / shell: runs a shell command and display the output within the debugger session. There are a few variants:
    • psh/ prettyshell: uses syntax highlighting on the output.
    • fsh / fshell: allows expanding variables from current Python frame's locals or globals into the shell command. The syntax is %variable_name. Please mind that $ syntax (e.g. $variable_name) is already used for PDB's builtin convenience variables.
    • pfsh / fpsh / fprettyshell: enables all of the above.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

nicerpdb-0.3.0.tar.gz (7.9 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

nicerpdb-0.3.0-py3-none-any.whl (8.3 kB view details)

Uploaded Python 3

File details

Details for the file nicerpdb-0.3.0.tar.gz.

File metadata

  • Download URL: nicerpdb-0.3.0.tar.gz
  • Upload date:
  • Size: 7.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for nicerpdb-0.3.0.tar.gz
Algorithm Hash digest
SHA256 254ee85fd7c079c69c3f5281d0a411d54091a4851a4eb6feebb7c8b6474d4a31
MD5 ab8e62027da94641bfb446d0d5b469f1
BLAKE2b-256 7b69668f9a313d3fc984811d43be6ef8a676ec87ffdb382617f1d5d3ca146e1f

See more details on using hashes here.

Provenance

The following attestation bundles were made for nicerpdb-0.3.0.tar.gz:

Publisher: publish-to-pypi.yml on Hedwyn/nicerpdb

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file nicerpdb-0.3.0-py3-none-any.whl.

File metadata

  • Download URL: nicerpdb-0.3.0-py3-none-any.whl
  • Upload date:
  • Size: 8.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for nicerpdb-0.3.0-py3-none-any.whl
Algorithm Hash digest
SHA256 8c8df069e2e90ce87dce11c22407969a8d2048ae13a33f7bbcfc4c910f5351d6
MD5 80aef9d3b4b5af92c8e261f7a3a1afe5
BLAKE2b-256 4a85959bd030c5c4967fe7c49042488b44acaeed710841cab47581ee54cd0ffb

See more details on using hashes here.

Provenance

The following attestation bundles were made for nicerpdb-0.3.0-py3-none-any.whl:

Publisher: publish-to-pypi.yml on Hedwyn/nicerpdb

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page