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.4.0.tar.gz (8.4 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.4.0-py3-none-any.whl (8.7 kB view details)

Uploaded Python 3

File details

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

File metadata

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

File hashes

Hashes for nicerpdb-0.4.0.tar.gz
Algorithm Hash digest
SHA256 aaee061213d0e52e284b7943029421ec6b5b9e6c73908532c41d454fe4c8a422
MD5 fa29e5f9d7d3915309337578879b0f4b
BLAKE2b-256 266323dae85d93fff8b562572f7a41dff23e5e8db614eff43391199e13da5e03

See more details on using hashes here.

Provenance

The following attestation bundles were made for nicerpdb-0.4.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.4.0-py3-none-any.whl.

File metadata

  • Download URL: nicerpdb-0.4.0-py3-none-any.whl
  • Upload date:
  • Size: 8.7 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.4.0-py3-none-any.whl
Algorithm Hash digest
SHA256 1c42548f553a3ea9a13a9820c816b50c28ba8a056ae8c23d35c54e3f963d6a05
MD5 71f998794a4bc69bfd28898eb9107183
BLAKE2b-256 6f8665d92866ee726dba35fddaa26b9254a8eacae01b173124b3e6098600ce42

See more details on using hashes here.

Provenance

The following attestation bundles were made for nicerpdb-0.4.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