awswrangler.dynamodb.put_csv¶
- awswrangler.dynamodb.put_csv(path: Union[str, Path], table_name: str, boto3_session: Optional[Session] = None, **pandas_kwargs: Any) Any ¶
Write all items from a CSV file to a DynamoDB.
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 CSV 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.
pandas_kwargs – KEYWORD arguments forwarded to pandas.read_csv(). You can NOT pass pandas_kwargs explicit, just add valid Pandas arguments in the function call and awswrangler will accept it. e.g. wr.dynamodb.put_csv(‘items.csv’, ‘my_table’, sep=’|’, na_values=[‘null’, ‘none’], skip_blank_lines=True) https://pandas.pydata.org/pandas-docs/stable/reference/api/pandas.read_csv.html
- Returns
None.
- Return type
None
Examples
Writing contents of CSV file
>>> import awswrangler as wr >>> wr.dynamodb.put_csv( ... path='items.csv', ... table_name='table' ... )
Writing contents of CSV file using pandas_kwargs
>>> import awswrangler as wr >>> wr.dynamodb.put_csv( ... path='items.csv', ... table_name='table', ... sep='|', ... na_values=['null', 'none'] ... )