-
Notifications
You must be signed in to change notification settings - Fork 1.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Feature Request: Helper functions for boto3 efficiency #4470
Comments
Hi @FrcMoya, thanks for reaching out. Boto3 actually does have some handwritten methods going beyond the 1:1 mapping to AWS APIs. Mostly, these are for S3 and DynamoDB. However, if you have any particular features you'd like supported for a client, that'd be a great thing to submit as a feature request. Do you have any specifics? Thanks! |
Hello @RyanFitzSimmonsAK . Thanks for your interest in this feature! For example, in the case of Kinesis, it would be useful to have a managed class or function that wraps the put_records API call. This class could automatically handle AWS limits—such as 500 records per request, 1MiB per record, and 5MiB per batch—and send the batch automatically when a limit is reached. A good reference is OpenSearchPy, which has streaming_bulk and bulk functions that work similarly. These functions consume an iterator and automatically send chunks when size or count limits are reached. To optimize my own use case, I built a wrapper class that buffers requests and only sends them when needed:
This allows for optimized usage like this:
I think this feature would help users optimize batch requests without manually handling API limits. Let me know if you'd like more details. Thanks again! |
Describe the feature
Hello,
I would like to know why there are no helper functions in boto3. I understand that this library aims to provide a 1-to-1 mapping of the AWS API, but I believe it would be beneficial to include some helper functions to facilitate more efficient API calls.
For instance, the
elasticsearch-py
SDK includes helper functions likestreaming_bulk
, which optimize requests by maximizing the number of records sent or ensuring the maximum size is reached. Currently, I use custom classes to manage this for different services, including CloudWatch Logs, Kinesis, and SQS.Adding such helper functions to boto3 would greatly enhance its usability and efficiency.
Thanks in advance!
Use Case
Sent several logs to different services (CWLogs, Kinesis, SQS...) optimizing the requests
Proposed Solution
No response
Other Information
No response
Acknowledgements
SDK version used
1.35.85
Environment details (OS name and version, etc.)
MacOS 15.3.1
The text was updated successfully, but these errors were encountered: