Untitled
unknown
json
9 months ago
412 B
5
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