日々精進

新しく学んだことを書き留めていきます

2017-04-21から1日間の記事一覧

boto3のlist_objects_v2は最大1000オブジェクトまでしか取得出来ない

AI

1001以上取得したい場合はループを回す必要がある。例は以下。 def list_all_contents(self, prefix: str = ''): next_token = '' base_kwargs = { 'Bucket': self.bucket_name, 'Prefix': prefix, } all_contents: List[dict] = [] while next_token is not…