【发布时间】:2023-04-10 00:45:01
【问题描述】:
我想用 python 3 将 JSON 解析为 mysql 数据库。 假设我有来自 www.test.com/api/students 的 JSON 包含学生列表,
{
contents: [
{
id:"a",
name:"rey"
},
{
id:"b",
name:"rio"
},
{
id:"c",
name:"ramy"
},
]
}
我有一个名为“student”的数据库,表 MSStudent 包含“student_id”和“student_name”。
如何解析这个 JSON 并将其传递到我的数据库,以及如何在 python 上将其查询到模型中?
谢谢。
【问题讨论】:
标签: mysql json python-3.x