Untitled
unknown
json
a year ago
412 B
11
Indexable
jsonData = json.load(response.json())
jsonItems = jsonData['data']['beverageDescriptionCollection']['items']
with open('beverageDescriptionCollection.csv', 'w', newline='') as csvFile:
fieldNames = jsonItems[0].keys()
writer = csv.writer(csvFile)
writer.writerow(fieldNames)
for jsonItem in jsonItems:
writer.writerow(jsonItems.values())
csvFile.close()Editor is loading...
Leave a Comment