s3.s3_env()
Enter a rasterio (bundled GDAL) environment for S3-compatible storage.
Usage
s3.s3_env(path)Extracts credentials and endpoint configuration from the fsspec storage options attached to path and applies them to rasterio for the duration of the with block. Requests are sent unsigned only when the path carries anon=True; otherwise GDAL signs them, using key/secret when present, selecting the path’s named profile when configured, and falling back to boto’s default credential resolver otherwise.
The session itself comes from aws_session(), so entering this block repeatedly for the same configuration doesn’t re-resolve credentials.
Parameters
path: UPath-
A UPath with
protocol="s3"whosestorage_optionscarry an optional namedprofile, fsspec/s3fs credentials (key,secret,token), an optionalanonflag, an optionalclient_kwargs["region_name"], and an optional customendpoint_url(as produced by make_s3_upath()).