这是我的 JSON 数据
[
{
"id":1,
"name":"abc",
"phone": "12345",
"Charecteristics": [
{
"id":1,
"name":"Good Looking",
"rating": "Average",
}
{
"id":2,
"name":"Smart",
"rating": "Excellent",
}
]
},
{ ... },
{ ... }
]
我在 Python 中有两个类
class Character(object):
id = 0
name = ""
rating = ""
class Person(object):
id = 0
name = ""
phone = ""
Characteristics = []
我需要解析 JSON 数据并实例化适当的类。这些类是不言自明的:即 Person 有一个 Character 类的数组。
如何实例化这些并适当地存储数据?
另外,我将如何访问特定的个人数据?即人的详细信息和特征