-2

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

James Z
  • 12,209
  • 10
  • 24
  • 44
Amol
  • 336
  • 3
  • 5
  • 17
  • _...readable format_, what do you mean, what do you expect ? Did you look at [pprint](https://docs.python.org/3/library/pprint.html) ? – Maurice Meyer Sep 13 '22 at 12:44
  • Readable format means we need output in tabular format – Amol Sep 13 '22 at 12:50
  • Parsing and printing something in a pretty format are different tasks. You should really clarify what exactly you're trying to accomplish -- and preferably also include what happened with your attempts. – James Z Sep 13 '22 at 17:25

1 Answers1

0

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.