Display JSON


# Import library
import json

Create String With JSON Data

_string = '{"data": {"title": "Machine Learning With Python Cookbook","author": {"name": "Chris Albon","biography": {"eduation": {"phd": "UC Davis","masters": "UC Davis","undergraduate": "Univ. Of Miami","acronym": "CRA","full name": "Christopher Albon","favorites": {"food": "Steak","sport": ["baseball", "basketball"]},"dissertation": "Health Systems During And After Civil WarS"}}}}}'

Convert String To JSON

json_data = json.loads(_string)

Display JSON

print(json.dumps(json_data, indent=2))
  "data": {
    "title": "Machine Learning With Python Cookbook",
    "author": {
      "name": "Chris Albon",
      "biography": {
        "eduation": {
          "phd": "UC Davis",
          "masters": "UC Davis",
          "undergraduate": "Univ. Of Miami",
          "acronym": "CRA",
          "full name": "Christopher Albon",
          "favorites": {
            "food": "Steak",
            "sport": [
          "dissertation": "Health Systems During And After Civil WarS"