libera_utils.aws.s3_utilities#

Module for S3 cli utilities

Functions

find_bucket_in_account_by_partial_name(...)

Finds a Bucket by substring match to the bucket name

s3_copy_cli_handler(parsed_args)

CLI handler function for s3-utils cp CLI subcommand.

s3_list_archive_files(data_product_id, *[, ...])

List all files in an archive S3 bucket for a given processing step.

s3_list_cli_handler(parsed_args)

CLI handler function for s3-utils list CLI subcommand.

s3_put_cli_handler(parsed_args)

CLI handler function for s3-utils put CLI subcommand.

s3_put_in_archive_for_processing_step(...[, ...])

Upload a file to the archive S3 bucket associated with a given processing step.

libera_utils.aws.s3_utilities.find_bucket_in_account_by_partial_name(boto_session, partial_name: str)#

Finds a Bucket by substring match to the bucket name

libera_utils.aws.s3_utilities.s3_copy_cli_handler(parsed_args: Namespace) None#

CLI handler function for s3-utils cp CLI subcommand.

libera_utils.aws.s3_utilities.s3_list_archive_files(data_product_id: str | DataProductIdentifier, *, profile_name: str = None) list#

List all files in an archive S3 bucket for a given processing step.

libera_utils.aws.s3_utilities.s3_list_cli_handler(parsed_args: Namespace) None#

CLI handler function for s3-utils list CLI subcommand.

libera_utils.aws.s3_utilities.s3_put_cli_handler(parsed_args: Namespace) None#

CLI handler function for s3-utils put CLI subcommand.

libera_utils.aws.s3_utilities.s3_put_in_archive_for_processing_step(path_to_file: Path | S3Path, *, profile_name: str = None)#

Upload a file to the archive S3 bucket associated with a given processing step.

Parameters:
  • path_to_file (Path) – Local path to the file to upload

  • profile_name (str, optional) – Boto3 profile name to use for authentication, by default None