if isinstance(val, dict):
    pretty(val, indent + '  ')
elif isinstance(val, str):
    print('"{}",'.format(val))
else:
    print('{},'.format(val))
print(indent + '},')
req = urllib.request.Request('http://coinabul.com/api.php', headers={'User-Agent':
    'Mozilla/5.0'})
page = urllib.request.urlopen(req)
parsed = json.load(page)
pretty(parsed)
Pretty-printing JSON with ASCII color in python