AWS Tools

Tools to interact with the Amazon Web Services (AWS) API.

source

AwsClient

 AwsClient (aws_access_key_id:str, aws_secret_access_key:str,
            region_name:str)

A client for interacting with AWS services, specifically for operations related to Amazon S3.

Upload


source

AwsClient.upload_to_s3

 AwsClient.upload_to_s3 (file_path:str, bucket_name:str, object_name:str)

*Uploads a file to an Amazon S3 bucket.

Args: file_path (str): Local path to the file. bucket_name (str): Name of the S3 bucket. object_name (str): Object name in the S3 bucket (i.e., S3 key).*

Zip


source

AwsClient.extract_zip_with_correct_encoding

 AwsClient.extract_zip_with_correct_encoding (zip_file_path:str,
                                              extract_to_path:str,
                                              encoding:str='cp437')

*Extracts a ZIP file with specific encoding for the file names.

Args: zip_file_path (str): Path to the ZIP file. extract_to_path (str): Path to extract the ZIP contents to. encoding (str, optional): Encoding to use for file names. Defaults to ‘cp437’.*


source

AwsClient.upload_to_s3_zip

 AwsClient.upload_to_s3_zip (zip_file_path:str, dst_path:str,
                             bucket_name:str)

*Extracts a ZIP file and uploads its contents to an Amazon S3 bucket.

Args: zip_file_path (str): Path to the ZIP file. dst_path (str): Destination path in the S3 bucket. bucket_name (str): Name of the S3 bucket.*