We will first discuss how to batch-load data into DynamoDB from a comma-separated values (CSV) file called sample_data/dynamodb-sample-data.txt. Rather than insert an individual statement for each item, this is a much more efficient process, as the data file is decoupled from the Python code:
Add another method, called update_dynamo_event_counter(), that updates DynamoDB records using the DynamoRepository class.
Here are the contents of the serverless-microservice-data-api/aws_dynamo/dynamo_insert_items_from_file.py Python script:
from boto3 import resource ...