๐ŸŒ
Real Python
realpython.com โ€บ python-pretty-print
Prettify Your Data Structures With Pretty Print in Python โ€“ Real Python
October 4, 2022 - You can work with it for debugging data structures and increasing the readability of your output. In this tutorial, you'll find that pprint is both straightforward to use and also highly customizable.
๐ŸŒ
Python
docs.python.org โ€บ 3 โ€บ library โ€บ pprint.html
pprint โ€” Data pretty printer
Return the formatted representation of object as a string. indent, width, depth, compact, sort_dicts and underscore_numbers are passed to the PrettyPrinter constructor as formatting parameters and their meanings are as described in the documentation above.
๐ŸŒ
TutorialsPoint
tutorialspoint.com โ€บ python_text_processing โ€บ python_pretty_prints.htm
Python Text Processing - Pretty Printing
The python module pprint is used for giving proper printing formats to various data objects in python. Those data objects can represent a dictionary data type or even a data object containing the JSON data.
๐ŸŒ
DigitalOcean
digitalocean.com โ€บ community โ€บ tutorials โ€บ python-pretty-print-json
How to Pretty Print JSON in Python | DigitalOcean
September 16, 2025 - Learn how to pretty print JSON in Python using built-in tools like json.dumps() and pprint to improve readability and debug structured data efficiently.
๐ŸŒ
freeCodeCamp
freecodecamp.org โ€บ news โ€บ how-to-pretty-print-json-in-python
How to Pretty Print JSON in Python
April 14, 2023 - Pretty printing JSON in Python is an important skill to have for anyone working with JSON data. In this tutorial, we learned how to use the json module in Python to pretty print JSON as well as the pprint module.
๐ŸŒ
GeeksforGeeks
geeksforgeeks.org โ€บ pprint-data-pretty-printer-python
pprint : Data pretty printer in Python - GeeksforGeeks
This article provides a quick way to pretty How to Print Dictionary in Python that has a dictionary as values. This is required many times nowadays with the advent of NoSQL databases.
Published ย  October 6, 2023
๐ŸŒ
Real Python
realpython.com โ€บ lessons โ€บ pretty-print
Pretty Print (Video) โ€“ Real Python
In the previous lesson, I talked about how print() has changed between Python 2 and Python 3. In this lesson, Iโ€™ll be talking about the pprint() (pretty print) function out of the pprint (pretty print) library. In addition to the built-in print(โ€ฆ
Published ย  May 5, 2020
๐ŸŒ
Better Programming
betterprogramming.pub โ€บ how-to-pretty-print-in-python-9b1d8764d151
How To Pretty Print in Python. Start using the pprint library | by Jonathan Hsu | Better Programming
December 5, 2019 - Short for Pretty Printer, pprint is a native Python library that allows you to customize the formatting of your output. Refer to the official documentation for a full list of library and all properties available. In this tutorial weโ€™ll go over basic usage of the pprint() method and PrettyPrinter() class.
๐ŸŒ
Python Module of the Week
pymotw.com โ€บ 2 โ€บ pprint
pprint โ€“ Pretty-print data structures - Python Module of the Week
... pprint contains a โ€œpretty printerโ€ for producing aesthetically pleasing representations of your data structures. The formatter produces representations of data structures that can be parsed correctly by the interpreter, and are also easy for a human to read.
Find elsewhere
๐ŸŒ
PyTutorial
pytutorial.com โ€บ print-python-dictionary-pretty-guide
PyTutorial | Print Python Dictionary Pretty Guide
January 27, 2026 - First, use pretty printing during development. It helps you inspect data structures quickly. It can replace many debug print statements. Second, adjust the indent. A 4-space indent is common.
๐ŸŒ
seenode blog
seenode.com โ€บ blog โ€บ how-to-use-python-pretty-print-pprint
How to Use Python Pretty Print (pprint) for Cleaner Python Output | seenode blog
May 19, 2025 - For example, if you want to work with JSON data from an API, or parsing log files, or debug Python objects with lots of levels, pprint should be your first choice that will save time. Firstly, you need to import the pprint module. ... You can use the pprint() method or instantiate your pprint object with PrettyPrinter().
๐ŸŒ
Rich
rich.readthedocs.io โ€บ en โ€บ latest โ€บ pretty.html
Pretty Printing โ€” Rich 14.1.0 documentation
Run the following command to see an example of pretty printed output: python -m rich.pretty ยท Note how the output will change to fit within the terminal width. The pprint() method offers a few more arguments you can use to tweak how objects are pretty printed.
๐ŸŒ
Kanaries
docs.kanaries.net โ€บ topics โ€บ Python โ€บ pretty-print-dictionary-python
How to Use Pretty Print for Python Dictionaries โ€“ Kanaries
June 7, 2023 - A comprehensive guide to pretty printing Python dictionaries. Enhance readability, efficiency, and aesthetics of your code.
๐ŸŒ
Reddit
reddit.com โ€บ r/python โ€บ new protocol for pretty printing
r/Python on Reddit: New Protocol for Pretty Printing
June 10, 2021 -

I've recently documented a protocol in Rich to add pretty printing to arbitrary objects.

The problem was that containers like dicts, lists, sets etc could be formatted over multiple lines, but custom classes are limited to a string that can be generated from __repr__. The new protocol in Rich adds a __rich_repr__ method which allows an object to declare how it should be pretty printed.

Looking for feedback. Here are the docs.

Here's an example of a __rich_repr__ method.

And here's what it looks like when you pretty print a Bird instance:

๐ŸŒ
Python
peps.python.org โ€บ pep-0813
PEP 813 โ€“ The Pretty Print Protocol | peps.python.org
March 4, 2026 - Classes can implement a new dunder method, __pprint__() which if present, generates parts of their instanceโ€™s pretty printed representation. This augments __repr__() which, prior to this proposal, was the only method used to generate a custom representation of the object.
๐ŸŒ
Spark By {Examples}
sparkbyexamples.com โ€บ home โ€บ python โ€บ how to pretty print a json file in python?
How to Pretty Print a JSON file in Python? - Spark By {Examples}
May 31, 2024 - Post category:Python / Python Tutorial ... difficult to read and understand, pretty printing is a technique that formats JSON data with indentation and line breaks to make it more human-readable....
๐ŸŒ
Finxter
blog.finxter.com โ€บ home โ€บ learn python blog โ€บ python pprint โ€“ a simple guide to pretty printing
Python pprint - A Simple Guide to Pretty Printing - Be on the Right Side of Change
October 18, 2022 - So letโ€™s learn how to manipulate our data to simplify the analysis. To pretty print a list, use the pprint() function from the pprint module that comes with the Python standard library and doesnโ€™t need to be installed manually.