Home > Software engineering >  Can I query an S3 Inventory for all files matching a prefix?
Can I query an S3 Inventory for all files matching a prefix?

Time:12-30

I may not have asked the right question. I'm trying to use boto3 to copy all files matching a given prefix from one bucket to another. The number of files could be quite large, so I thought using the inventory feature to create a batch job manifest would be the way to go but I'm finding the documentation... lacking. I can't see any way to get a list of file names from an inventory based on a prefix--it seems to be all or nothing. Am I misunderstanding batch jobs and inventories?

CodePudding user response:

Amazon S3 Inventory provides a CSV file.

You can parse the CSV file within your Python code to apply any type of string filtering you wish.

  • Related