Boto3 Extensions

raw JSON →
0.23.0 verified Fri May 01 auth: no python

A collection of extensions and utilities for boto3, the AWS SDK for Python. Version 0.23.0 supports Python 3.8-3.11. It provides simplified interfaces for common AWS operations, such as S3 multipart uploads, DynamoDB transactions, and pagination helpers.

pip install boto3-extensions
error ModuleNotFoundError: No module named 'boto3_extensions'
cause Library not installed or installed under a different name.
fix
Run pip install boto3-extensions and ensure import uses underscores: import boto3_extensions.
error TypeError: S3MultipartUpload.__init__() missing 1 required positional argument: 'key'
cause Using old API with only bucket name; new version requires key argument.
fix
Update instantiation: S3MultipartUpload(client, bucket, key)
breaking In v0.23.0, the S3MultipartUpload constructor changed from accepting a single 'bucket' parameter to requiring a bucket and key. Code written for v0.22.x will break.
fix Update constructor calls to include both bucket and key: S3MultipartUpload(client, bucket, key)
gotcha DynamoDBTransactWrite requires existing DynamoDB table. Does not auto-create tables.
fix Ensure table exists before using transact write operations.
deprecated The 'paginate_all' function in paginators is deprecated in favor of 'paginate' with 'all_pages=True'.
fix Replace paginate_all(...) with paginate(..., all_pages=True)

Initialize boto3 client, then use S3MultipartUpload for large file uploads.

import boto3
from boto3_extensions.s3 import S3MultipartUpload

s3_client = boto3.client('s3', region_name='us-east-1')
multipart = S3MultipartUpload(s3_client, 'my-bucket', 'large-file.bin')
multipart.upload('local-file.bin')