Python Dynamo DB扫描查询以获取JSON格式的输出文件

Python Dynamo DB扫描查询以获取JSON格式的输出文件,python,amazon-dynamodb,Python,Amazon Dynamodb,我对使用boto3的Dynamo DB还很陌生。我想:获取Dynamo DB中所有行的扫描,并将其以JSON格式存储在一个文件中,以便进行额外的数据处理 我目前正在使用下面显示的脚本获取详细信息(将涉及分页): 这为我提供了5000行的示例输出: {"info": {"rating": 6.5}, "year": 2004, "title": "The Polar Express"} {"info": {"rating": 5.7}, "year": 2004, "title": "The Pr

我对使用boto3的Dynamo DB还很陌生。我想:获取Dynamo DB中所有行的扫描,并将其以
JSON
格式存储在一个文件中,以便进行额外的数据处理

我目前正在使用下面显示的脚本获取详细信息(将涉及分页):

这为我提供了5000行的示例输出:

{"info": {"rating": 6.5}, "year": 2004, "title": "The Polar Express"}
{"info": {"rating": 5.7}, "year": 2004, "title": "The Prince & Me"}
{"info": {"rating": 5.3}, "year": 2004, "title": "The Princess Diaries 2: Royal Engagement"}
{"info": {"rating": 6.3}, "year": 2004, "title": "The Punisher"}
{"info": {"rating": 6.8}, "year": 2004, "title": "The SpongeBob SquarePants Movie"}
我无法获得所需格式的输出(如下所示)。我在这里等文件

[
    {"info": {"rating": 6.5}, "year": 2004, "title": "The Polar Express"},
    {"info": {"rating": 5.7}, "year": 2004, "title": "The Prince & Me"},
    {"info": {"rating": 5.3}, "year": 2004, "title": "The Princess Diaries 2: Royal Engagement"},
    {"info": {"rating": 6.3}, "year": 2004, "title": "The Punisher"},
    {"info": {"rating": 6.8}, "year": 2004, "title": "The SpongeBob SquarePants Movie"}
]

有谁能给我一些关于如何进一步调查的提示或指点吗?

回复['Items']不是你要找的列表吗?Response是一个包含列表的词汇表,它只能是一个子集,所以如果需要,您需要迭代多个响应

参考:

[
    {"info": {"rating": 6.5}, "year": 2004, "title": "The Polar Express"},
    {"info": {"rating": 5.7}, "year": 2004, "title": "The Prince & Me"},
    {"info": {"rating": 5.3}, "year": 2004, "title": "The Princess Diaries 2: Royal Engagement"},
    {"info": {"rating": 6.3}, "year": 2004, "title": "The Punisher"},
    {"info": {"rating": 6.8}, "year": 2004, "title": "The SpongeBob SquarePants Movie"}
]