Manual

Everything you need to know about pdit

Getting Started

Quickstart

pip install pdit
pdit --demo

With uv:

uvx --with "pdit[demo]" pdit --demo

Installation

pip install pdit
pdit example.py

Output

Plots

Matplotlib figures display inline. Call plt.show() when you're ready to emit a plot.

import matplotlib.pyplot as plt

plt.figure()
plt.plot(x, y)
plt.show()

DataFrames

Pandas and Polars DataFrames render as interactive tables automatically.

Markdown

Top-level strings render as Markdown, including f-strings for dynamic content.

"""
# Static heading
"""

name = "pdit"
f"Welcome to **{name}**"

HTML

Rich HTML output is supported for objects that implement _repr_html_(); see note: IPython.display.display.

IPython display

IPython display objects render inline; see IPython.display for details.

Streaming output

Stdout and stderr stream inline while a statement runs, so long-running loops can show live progress.

import time

for i in range(3):
    print(f"step {i + 1}")
    time.sleep(1)

How-to

Suppress output with a trailing semicolon

Like IPython, pdit suppresses inline output if a statement ends with ;.

import pandas as pd
df = pd.read_csv("data.csv");