How do I paginate my results from DynamoDB using the Boto python library? From the Boto API documentation, I can’t figure out if it even has support for pagination, although the DynamoDB API does have pagination support.
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Boto does have support for “pagination” like behavior using a combination of “ExclusiveStartKey” and “Limit”. For example, to paginate
Scan.Here is an example that should parse a whole table by chunks of 10
EDIT:
As pointed out by @garnaat, it is possible that I misunderstood your actual goal. The above suggestion allows you to provide pagination like SO does for questions for example. No more than 15 per pages.
If you just need a way to load the whole result set produced by a given
Scan, Boto is a great library and already abstracts this for you with no need for black magic like in my answer. In this case, you should follow what he (@garnaat) advises. Btw, he is the author of Boto and, as such, a great reference for Boto related questions 🙂