Pretty-Print JSON and Move It to the Command Line

Building a Pretty Print Program
In Python, pretty-printing is very straight forward. It only needs the use of the built-in JSON library and the use of the dumps method. Given any data, the following code can format and sort the keys of JSON and print it to the console.
import json
json.dumps(json_data, indent=4, sort_keys=True)
Creating Work-Flow
To this single line, we need to add the argsparse code so that it can take input parameters and add a help function as well.

Link: https://dzone.com/articles/pretty-print-json-and-move-it-to-command-line?utm_medium=feed&utm_source=feedpress.me&utm_campaign=Feed%3A+dzone%2Fwebdev