pprint

Support to pretty-print lists, tuples, & dictionaries recursively.

Very simple, but useful, especially in debugging data structures.

Classes

PrettyPrinter()
Handle pretty-printing operations onto a stream using a configured set of formatting parameters.

Functions

pformat()
Format a Python object into a pretty-printed representation.
pprint()
Pretty-print a Python object to a stream [default is sys.stdout].
saferepr()
Generate a ‘standard’ repr()-like value, but protect against recursive data structures.

Functions

isreadable(object) Determine if saferepr(object) is readable by eval().
isrecursive(object) Determine if object requires a recursive representation.
pformat(object[, indent, width, depth]) Format a Python object into a pretty-printed representation.
pprint(object[, stream, indent, width, depth]) Pretty-print a Python object to a stream [default is sys.stdout].
saferepr(object) Version of repr() which can handle recursive data structures.

Classes

PrettyPrinter([indent, width, depth, stream])