Boto3: [Feature Request] Ability to download a specific version of an S3 object

Created on 9 Jun 2017  路  5Comments  路  Source: boto/boto3

I want to be able to download a specific version of a file in S3.

Based on the current documentation, it seems this is not possible. Perhaps it is possible with some optional arguments which might not be mentioned in the documentation.

The documentation says:

s3.meta.client.download_file('mybucket', 'hello.txt', '/tmp/hello.txt')

Similar behavior as S3Transfer's download_file() method, except that parameters are capitalized. Detailed examples can be found at S3Transfer's Usage.

But the docs for "S3Transfer" are not linked to anywhere. The github README for S3Transfer just says to use boto3.

My current workaround is to:

  • manually download the version I want with a browser on my local machine
  • manually upload that under a new key
  • use boto3 or terminal client to download the file from that new key, on my headless server
documentation enhancement

Most helpful comment

We should probably update that documentation. You can provide a specific version using ExtraArgs:

import boto3

s3 = boto3.client('s3')
s3.download_file('mybucket, 'hello.txt', '/tmp/hello.txt', ExtraArgs={'VersionId': 'foo'})

All 5 comments

We should probably update that documentation. You can provide a specific version using ExtraArgs:

import boto3

s3 = boto3.client('s3')
s3.download_file('mybucket, 'hello.txt', '/tmp/hello.txt', ExtraArgs={'VersionId': 'foo'})

Yeah, I think that doc update is still required. I was about to mess around with get_object because the ability to specify a version when using download_file is not documented.

Yep, same here.

So where do we add the documentation for this?
Is this the right file?

Was this page helpful?
0 / 5 - 0 ratings