formatted_json = json.dumps(obj, sort_keys=True, indent=4)
from pygments import highlight, lexers, formatters
colorful_json = highlight(str(formatted_json, 'UTF-8'), lexers.
    JsonLexer(), formatters.TerminalFormatter())
print(colorful_json)
Coloring JSON output in python