Skip to content

Documentation for acme_s3

acme_s3.s3.S3Client

__init__(bucket, max_workers=10, retry_max_attempts=3, boto3_client=None)

Initialize S3 client with parallel processing capabilities, retries and progress tracking

Parameters:

Name Type Description Default
bucket str

S3 bucket name

required
max_workers int

Maximum number of parallel workers for file operations

10
retry_max_attempts int

Maximum number of retry attempts for recoverable errors

3
boto3_client client

boto3 client to use for s3 operations

None

delete_file(s3_key, **kwargs)

Delete single file from S3 with retry logic and progress tracking

delete_files(s3_keys, show_progress=True, **kwargs)

Delete multiple files in parallel with progress bar

Parameters:

Name Type Description Default
s3_keys List[str]

List of S3 keys to delete

required
show_progress bool

Whether to show progress bar

True

delete_prefix(s3_prefix)

Delete all files under a given prefix in S3 bucket with progress tracking

download_file(s3_key, local_path, show_progress=True, **kwargs)

Download single file from S3 with retry logic and progress tracking

download_files(file_mappings, show_progress=True, show_individual_progress=False, **kwargs)

Download multiple files in parallel with progress bar

Parameters:

Name Type Description Default
file_mappings Dict[str, str]

Dictionary mapping S3 keys to local file paths

required
show_progress bool

Whether to show progress bar

True

list_objects(s3_prefix)

List all objects under a given prefix in S3 bucket

path_exists(s3_key)

Check if a path exists in S3

Parameters:

Name Type Description Default
s3_key str

S3 key to check

required

Returns:

Name Type Description
bool bool

True if path exists, False otherwise

upload_file(local_path, s3_key, show_progress=True, **kwargs)

Upload single file to S3 with retry logic and progress tracking

upload_files(file_mappings, show_progress=True, show_individual_progress=False, **kwargs)

Upload multiple files in parallel with progress bar

Parameters:

Name Type Description Default
file_mappings Dict[str, str]

Dictionary mapping local file paths to S3 keys

required
show_progress bool

Whether to show progress bar

True
show_individual_progress bool

Whether to show individual progress bar for each file

False