公用事业
ddls3utils的Python项目详细描述
s3实用程序
此模块定义了管理S3存储桶的常用实用程序
init(自我, 地区名称, 访问密钥id, aws_secret_access_密钥, 下载文件扩展名筛选器=[], 上载文件扩展名筛选器=[])
@description
Initializes the S3Client object and creates a S3 client object.
@arguments
region_name : <str> Supplies the region name of the S3 instance.
aws_access_key_id : <str> Supplies the AWS access key id.
aws_secret_access_key : <str> Supplies the AWS secret access key.
download_file_extension_filter : <list> [optional, default=[]] Supplies the file extensions
to download. If set to [], all files will be downloaded.
upload_file_extension_filter : <list> [optional, default=[]] Supplies the file extensions
to upload. If set to [], all files will be uploaded.
s3_list_文件夹(self, 水桶, s3_folder=无)
@description
Lists all files and sub-folders of the given folder.
@arguments
bucket : <str> Supplies the bucket name.
s3_folder : <str> [optional, default=None] Supplies the folder name to list under.
If set to None, the top-level content under the given bucket will be listed.
@returns
<list>, <list>: Returns a list contains the name of the files under the given
folder, and a list contains the name of the sub-folders under the given folder.
S3 U上传文件(自我, 水桶, 本地文件位置, s3_folder=无)
@description
Upload a file to the given folder under the given S3 bucket.
@arguments
bucket : <str> Supplies the bucket name.
local_file_location : <str> Supplies the location of the file to upload.
s3_folder : <str> [optional, default=None] Supplies the folder name to upload to.
If set to None, the file will be uploaded under the bucket.
@returns
None.
s3_upload_文件夹(自我, 水桶, s3_base_文件夹, 本地文件夹位置)
@description
Upload a folder to the given folder under the given S3 bucket.
@arguments
bucket : <str> Supplies the bucket name.
s3_base_folder : <str> Supplies the base folder on S3 to upload to.
local_folder_location : <str> Supplies the location of the folder to upload.
@returns
None.
s3_下载文件(self, 水桶, s3_文件名, 下载到文件夹位置)
@description
Download the file from S3 to the given location.
@arguments
bucket : <str> Supplies the bucket name.
s3_file_name : <str> Supplies the name of the file on S3 to download.
download_to_folder_location : <str> Supplies the folder to download to.
@returns
None.
S3_下载文件夹(自我, 水桶, S3U文件夹, 下载到文件夹位置)
@description
Download the files in the given folder from S3 to the given location.
@arguments
bucket : <str> Supplies the bucket name.
s3_folder : <str> Supplies the name of the folder on S3 to download.
download_to_folder_location : <str> Supplies the folder to download to.
@returns
None.
s3_按键删除(self, 水桶, s3_folder=无, 键=无)
@description
Delete all files from the given bucket starting at the given folder that
match the given key.
@arguments
bucket : <str> Supplies the bucket name.
s3_folder : <str> [optional, default=None] Supplies the name of the folder
on S3 to start deleting. If set to None, deletion will start at the bucket.
key : <str> [optional, default=None] Supplies the key to delete. If set to
None, all files will be deleted.
@returns
None.