thumbtackthief
thumbtackthief

Reputation: 6211

Can I query an S3 Inventory for all files matching a prefix?

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?

Upvotes: 0

Views: 529

Answers (1)

John Rotenstein
John Rotenstein

Reputation: 269191

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.

Upvotes: 1

Related Questions