Using boto3, how can I retrieve all files in my S3 bucket without retrieving the folders?
Consider the following file structure:
file_1.txt folder_1/
One way to filter out folders is by checking the end character of the Object if you are certain that no files end in a forward slash:
for object_summary in objects.all(): if object_summary.key[-1] == "/": continue