公用事业

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.

欢迎加入QQ群-->: 979659372 Python中文网_新手群

推荐PyPI第三方库


热门话题
java Apache Flink外部Jar   创建和强制转换对象数组时发生java错误   Java,添加数组   具有相同包结构和类的java JAR   java Jenkins未能构建Maven项目   java为什么一个forloop比另一个更快,尽管它们做的“一样”?   servlets在将“/”站点迁移到Java EE包时处理contextpath引用   无法解析java MavReplugin:2.21或其某个依赖项   泛型如何编写比较器来泛化Java中的两种类型的对象?   java Android Emulator未在netbeans上加载   多线程Java使用线程对数组中的数字求和:在同步块中使用新变量作为锁:差异   java如何在JSP/servlet中设置<input>标记的值?