This is my JSON data.
[
{
"id":1,
"name":"abc",
"phone": "12345",
"Charecteristics": [
{
"id":1,
"name":"Good Looking",
"rating": "Average",
}
{
"id":2,
"name":"Smart",
"rating": "Excellent",
}
]
},
{ ... },
{ ... }
]
I have two classes in Python
class Character(object):
id = 0
name = ""
rating = ""
class Person(object):
id = 0
name = ""
phone = ""
Characteristics = []
I need to parse the JSON data and create the corresponding classes. Classes require no explanation: for example, a person has an array of character classes.
How to create and store data properly?
Also, how can I access specific Person data? that is, the data and characteristics of a person.
source
share