BatchGetItem.py 383 B

123456789101112131415161718192021
  1. #!/usr/bin/env python
  2. import boto3
  3. import json
  4. TABLE_NAME_1='elaborate_employee_table'
  5. TABLE_NAME_2='simple_employee_table'
  6. client = boto3.client('dynamodb')
  7. response = client.batch_get_item(
  8. RequestItems = {
  9. TABLE_NAME_1: {
  10. 'Keys': [
  11. {'id': {'N': '111'}},
  12. {'id': {'N': '112'}}
  13. ]
  14. }
  15. }
  16. )
  17. print(json.dumps(response['Responses'], indent=4))