Created
June 19, 2022 07:39
-
-
Save cromyhector/5376e5a398236905e212ea29eb86a419 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import boto3 | |
import json | |
dynamodb = boto3.resource('dynamodb', region_name='us-east-1') | |
table = dynamodb.Table('LUDreamCar') | |
with open("dreamcardata.json") as json_file: | |
dreamcardata = json.load(json_file) | |
for dreamcar in dreamcardata: | |
brand = dreamcar['brand'] | |
model = dreamcar['model'] | |
color = dreamcar['color'] | |
print("Adding car:", brand, model,color) | |
table.put_item( | |
Item={ | |
'brand': brand, | |
'model': model, | |
'color': color |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment