How parse nested json using python

Viewed 41

We have below nested json , how to parse using python?

{
    "id": "205",
    "version": "205.36",
    "title": "Honda Group",
    "type": "object",
    "description": "",
    "definitions": {
        "customFields": {
            "properties": {
                "<holder>": {
                    "type": "object",
                    "properties": {
                        "ID3": {
                            "properties": {
                                "Mumbai": {
                                    "required": [],
                                    "type": "string",
                                    "description": "Dombivali Status",
                                    "title": "splendor",
                                    "MDType": "string"
                                },
                                "Pune1": {
                                    "required": [],
                                    "type": "string",
                                    "title": "Splendor",
                                    "MDType": "string"
                                },
                                "Pune2": {
                                    "required": [],
                                    "type": "string",
                                    "title": "Activa",
                                    "MDType": "string"
                                },
                                "Pune3": {
                                    "required": [],
                                    "type": "string",
                                    "description": "kothrud",
                                    "title": "Splendor",
                                    "MDType": "string"
                                },
                                "Nagar": {
                                    "required": [],
                                    "type": "string",
                                    "description": "",
                                    "title": "Splendor",
                                    "MDType": "string"
                                }
                            },
                            "required": [],
                            "type": "object",
                            "title": "InternationHondaGroup",
                            "MDType": "object",
                            "description": "UK Group",
                            "note": ""
                        },
                        "MasterID": {
                            "properties": {
                                "Cashflow": {
                                    "required": [],
                                    "type": "integer",
                                    "title": "Price",
                                    "MDType": "int"
                                }
                            },
                            "required": [],
                            "type": "object",
                            "title": "Internation_overview",
                            "MDType": "object"
                        }
                    },
                    "MDType": "object",
                    "required": ["hondaID"]
                }
            }
        }
    },
    "allOf": [{
        "ref": "https://data_all",
        "type": "object",
        "MDType": "object"
    }],
    "extensible": true,
    "abstract": true,
    "Extend": [],
    "MDType": "object"
}

I have tried various method to parse this json but not getting output in readable format

1 Answers

Pythons json library what you're looking for. It provides methods to parse json from different formats and to dump it as string. I suggest first reading the documentation and then updating in case you still have specific problems.

Related