Skip to content

Instantly share code, notes, and snippets.

@cromyhector
Created June 19, 2022 07:39
Show Gist options
  • Save cromyhector/5376e5a398236905e212ea29eb86a419 to your computer and use it in GitHub Desktop.
Save cromyhector/5376e5a398236905e212ea29eb86a419 to your computer and use it in GitHub Desktop.
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