Stores all files in the directory under the prefix key.
Arguments
key(str): prefix to store files under in bucket
directory(str): path to directory to grab files from
Returns
None
Raises
if writing to bucket fails
Bucket.keys(self)
Lists all keys in the bucket.
Returns
List of strings
Bucket.delete(self, key)
Deletes a key from the bucket.
Arguments
key(str): key to delete
Returns
None
Raises
if delete fails
Bucket.delete_dir(self, path)
Delete a directory and all of its contents from the bucket.
Arguments
path (str): path to the directory to delete
Bucket.ls(self, path=None, recursive=False)
List data from the specified path.
Arguments
path (str): bucket path to list
recursive (bool): show subdirectories and their contents as well
Returns
list: Return value structure has not yet been permanently decided Currently, it's a tuple of list objects, containing the following: (directory info, file/object info, delete markers).
Bucket.fetch(self, key, path)
Fetches file (or files) at key to path.
If key ends in '/', then all files with the prefix key will match and will be stored in a directory at path.
Otherwise, only one file will be fetched and it will be stored at path.
Arguments
key(str): key in bucket to fetch
path(str): path in local filesystem to store file or files fetched
Returns
None
Raises
if path doesn't exist
if download fails
Bucket.select(self, key, query, raw=False)
Selects data from an S3 object.
Arguments
key(str): key to query in bucket
query(str): query to execute (SQL by default)
query_type(str): other query type accepted by S3 service