title: How to run batch query against DynamoDB with boto3 given a list of primary keys
body: <p>Given a variable length list of items in Python containing primary keys (e.g. <code>itemList = ["item1","item2","item3"]</code>), how can I use boto3 to translate this list into the proper format for a dynamodb batch query?</p>
  
  <p>I'm able to successfully run a query by manually formatting the request but my problem is how to elegantly translate a python list into this format. I've tried the serializer function in boto3 which seems to be the right direction, but I am missing some piece of the puzzle.</p>
  
  <pre class="lang-py prettyprint-override"><code>import boto3
  
  dynamodb = boto3.resource('dynamodb', region_name='us-west-2')
  
  response = dynamodb.batch_get_item(
      RequestItems={
          "dynamodb-table-name": {
              "Keys": [
                  {
                      'pk': {
                          'S': 'item1'
                      },
                      'sk': {
                          'S': 'ITEM'
                      }
                  },
                  {
                      'pk': {
                          'S': 'item2'
                      },
                      'sk': {
                          'S': 'ITEM'
                      }
                  }
              ]
          }
      }
  )
  </code></pre>
  
  <p>If I create a serializer <code>serializer = boto3.dynamodb.types.TypeSerializer()</code> and use it on my list, I'm returned with <code>{'L': [{'S': 'item1'}, {'S': 'item2'}]}</code></p>