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.2.0.tar.gz (7.1 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.2.0-py3-none-any.whl (7.4 kB view details)

Uploaded Python 3

File details

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

File metadata

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

File hashes

Hashes for nicerpdb-0.2.0.tar.gz
Algorithm Hash digest
SHA256 43159e8e2f94a515d0b9f2378673ca69662119ed030cb33113f4099c84cdd33a
MD5 44227e146a91e27942552c7dc720cfdc
BLAKE2b-256 15dfee0bcde0f563e53b46dc599588d8f8ae78af394b0bbc70802b6872e7dc0f

See more details on using hashes here.

Provenance

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

File metadata

  • Download URL: nicerpdb-0.2.0-py3-none-any.whl
  • Upload date:
  • Size: 7.4 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.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 18e39a9f0309a4c444d2c8348c40fc0f2226fa258cef5bd6e7c0e7f3706fa42d
MD5 07dc645d4d6b7953f9d3eaef457c300b
BLAKE2b-256 af6e65ce9a39d7c1224c63c557cba64ec7ef18167f2b66f238a1d451732ea45a

See more details on using hashes here.

Provenance

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