I successfully have my: Access Key ID
and Secret Access Key
.
I have an S3 URL, of this path length/ structure:
s3://parent_filepath/foo/bar/folder_of_interest/
Update: I thought I was able to download everything via. Console, but it turns out you cannot download sub-folders and their contents recursively. So this task would need to be done in my Python application.
How can I download folder_of_interest
via. Python
, using the below answer to existing post?:
Specifically, what values from my S3 URL do I place into keys: name
and location
as well as code underneath the dictionary?
Code:
pip install d6tpipe
import d6tpipe
api = d6tpipe.api.APILocal() # keep permissions locally for security
settings = \
{
'name': 'folder_of_interest',
'protocol': 's3',
'location': '',
'readCredentials' : {
'aws_access_key_id': '###',
'aws_secret_access_key': '###'
}
}
d6tpipe.api.create_pipe_with_remote(api, settings)
pipe = d6tpipe.Pipe(api, 'folder_of_interest')
pipe.scan_remote() # show all files
pipe.pull_preview() # preview
#pipe.pull(['']) # download single file
pipe.pull() # download all files
pipe.files() # show files
#file=open(pipe.dirpath/'') # access file
Traceback:
Welcome to d6tpipe!
auto created profile "default", see docs how to customize profile
---------------------------------------------------------------------------
AttributeError Traceback (most recent call last)
<ipython-input-5-cbb589dcee20> in <module>()
14 }
15
---> 16 d6tpipe.api.create_pipe_with_remote(api, settings)
17
18 pipe = d6tpipe.Pipe(api, 'folder_of_interest')
AttributeError: module 'd6tpipe.api' has no attribute 'create_pipe_with_remote'