goalie.is_existing_aws_s3_uri

goalie.is_existing_aws_s3_uri(x: object) bool

Check whether an AWS S3 URI exists (object is accessible).

Requires boto3 (optional) or falls back to the AWS CLI (aws s3api head-object).

Parameters:

x (object) – S3 URI to check (e.g. s3://bucket/key).

Returns:

True if the object exists and is accessible.

Return type:

bool

Raises:

RuntimeError – If neither boto3 nor the aws CLI is available, so the existence of the object cannot be determined.

Examples

>>> is_existing_aws_s3_uri("not-an-s3-uri")
False