awswrangler.dynamodb.put_json

awswrangler.dynamodb.put_json(path: Union[str, pathlib.Path], table_name: str, boto3_session: Optional[boto3.session.Session] = None) Any

Write all items from JSON file to a DynamoDB.

The JSON file can either contain a single item which will be inserted in the DynamoDB or an array of items which all be inserted.

Note

This function has arguments which can be configured globally through wr.config or environment variables:

Check out the Global Configurations Tutorial for details.

Parameters
  • path (Union[str, Path]) – Path as str or Path object to the JSON file which contains the items.

  • table_name (str) – Name of the Amazon DynamoDB table.

  • boto3_session (boto3.Session(), optional) – Boto3 Session. The default boto3 Session will be used if boto3_session receive None.

Returns

None.

Return type

None

Examples

Writing contents of JSON file

>>> import awswrangler as wr
>>> wr.dynamodb.put_json(
...     path='items.json',
...     table_name='table'
... )