s3.make_s3_upath()

Build an S3 UPath with shared authentication and retries.

Usage

Source

s3.make_s3_upath(
    path,
    *,
    anon=False,
    profile=None,
    key=None,
    secret=None,
    token=None,
    region=None,
    endpoint_url=None,
    request_checksum_calculation="when_required",
    response_checksum_validation="when_required",
    client_kwargs=None
)

Parameters

path: str

S3 URI or prefix. The s3 protocol is forced.

anon: bool = False

Use unsigned requests.

profile: str = None

Named AWS profile. Mutually exclusive with anonymous or explicit keys.

key: str = None

Access key ID.

secret: str = None

Secret access key.

token: str = None

Session token.

region: str = None

AWS region.

endpoint_url: str = None

S3-compatible endpoint.

request_checksum_calculation: str = "when_required"

boto3 checksum policies.

response_checksum_validation: str = "when_required"

boto3 checksum policies.

client_kwargs: dict = None
Additional botocore client arguments. Credential entries cannot be combined with anon or profile.

Returns

UPath
Configured S3 path.

Raises

ValueError
If authentication options conflict or profile is empty.