awswrangler.dynamodb.put_items¶
- awswrangler.dynamodb.put_items(items: list[dict[str, Any]] | list[Mapping[str, Any]], table_name: str, boto3_session: Session | None = None, use_threads: bool | int = True) None¶
Insert all items to the specified DynamoDB table.
- Parameters:
items (
list[dict[str,Any]] |list[Mapping[str,Any]]) – List which contains the items that will be inserted.table_name (
str) – Name of the Amazon DynamoDB table.boto3_session (
Session|None) – Boto3 Session. The default boto3 Session will be used if boto3_session receive None.use_threads (
bool|int) – Used for Parallel Write requests. True (default) to enable concurrency, False to disable multiple threads. If enabled os.cpu_count() is used as the max number of threads. If integer is provided, specified number is used.
- Return type:
None
Examples
Writing items
>>> import awswrangler as wr >>> wr.dynamodb.put_items( ... items=[{'key': 1}, {'key': 2, 'value': 'Hello'}], ... table_name='table' ... )