Tried using json_normalize() , flatten module as well. But looking for a generic function which would be able to convert any nested JSON file to CSV.
eg. JSON file ::
{
"Response": "Success",
"Message": "",
"HasWarning": false,
"Type": 100,
"RateLimit": {},
"Data": {
"Aggregated": false,
"TimeFrom": 1234567800,
"TimeTo": 1234567900,
"Data": [
{
"id": 11,
"symbol": "AAA",
"time": 1234567800,
"block_time": 123.282828282828,
"block_size": 1212121,
"current_supply": 10101010
},
{
"id": 12,
"symbol": "BBB",
"time": 1234567900,
"block_time": 234.696969696969,
"block_size": 1313131,
"current_supply": 20202020
},
]
}
}
What I have tried:
Tried using json_normalize() , flatten module as well. But looking for a generic function which would be able to convert any nested JSON file to CSV.
But json_normalize and flaten modules only provide a single row at the end with all the column data in it.
Looking for a all column data in a tabular format { not only for this example } , but if we can have such Python function to generically convert a nested JSON file to CSV, that will be very helpful