@@ -11,12 +11,84 @@ from ._retry import RetryConfig
1111# Note: we removed `bucket` because it overlaps with an existing named arg in the
1212# constructors
1313class S3Config (TypedDict , total = False ):
14- """Configuration parameters for S3Store.
14+ """Configuration parameters returned from [ S3Store.config][obstore.store.S3Store.config] .
1515
16- There are duplicates of many parameters, and parameters can be either upper or lower
17- case. Not all parameters are required .
16+ Note that this is a strict subset of the keys allowed for _input_ into the store,
17+ see [S3ConfigInput][obstore.store.S3ConfigInput] .
1818 """
1919
20+ aws_access_key_id : str
21+ """AWS Access Key"""
22+ aws_bucket : str
23+ """Bucket name"""
24+ aws_checksum_algorithm : str
25+ """
26+ Sets the [checksum algorithm] which has to be used for object integrity check during upload.
27+
28+ [checksum algorithm]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/checking-object-integrity.html
29+ """
30+ aws_conditional_put : str
31+ """
32+ See [`S3ConfigInput.aws_conditional_put`][obstore.store.S3ConfigInput.aws_conditional_put].
33+ """
34+ aws_container_credentials_relative_uri : str
35+ """
36+ See [`S3ConfigInput.aws_container_credentials_relative_uri`][obstore.store.S3ConfigInput.aws_container_credentials_relative_uri].
37+ """
38+ aws_copy_if_not_exists : str
39+ """
40+ See [`S3ConfigInput.aws_copy_if_not_exists`][obstore.store.S3ConfigInput.aws_copy_if_not_exists].
41+ """
42+ aws_default_region : str
43+ """Default region"""
44+ aws_disable_tagging : bool
45+ """Disable tagging objects. This can be desirable if not supported by the backing store."""
46+ aws_endpoint : str
47+ """Sets custom endpoint for communicating with AWS S3."""
48+ aws_imdsv1_fallback : str
49+ """Fall back to ImdsV1"""
50+ aws_metadata_endpoint : str
51+ """Set the instance metadata endpoint"""
52+ aws_region : str
53+ """Region"""
54+ aws_request_payer : bool
55+ """If `True`, enable operations on requester-pays buckets."""
56+ aws_s3_express : bool
57+ """Enable Support for S3 Express One Zone"""
58+ aws_secret_access_key : str
59+ """Secret Access Key"""
60+ aws_server_side_encryption : str
61+ """
62+ See [`S3ConfigInput.aws_server_side_encryption`][obstore.store.S3ConfigInput.aws_server_side_encryption].
63+ """
64+ aws_session_token : str
65+ """Token to use for requests (passed to underlying provider)"""
66+ aws_skip_signature : bool
67+ """If `True`, S3Store will not fetch credentials and will not sign requests."""
68+ aws_sse_bucket_key_enabled : bool
69+ """
70+ If set to `True`, will use the bucket's default KMS key for server-side encryption.
71+ If set to `False`, will disable the use of the bucket's default KMS key for server-side encryption.
72+ """
73+ aws_sse_customer_key_base64 : str
74+ """
75+ The base64 encoded, 256-bit customer encryption key to use for server-side
76+ encryption. If set, the server side encryption config value must be `"sse-c"`.
77+ """
78+ aws_sse_kms_key_id : str
79+ """
80+ The KMS key ID to use for server-side encryption.
81+
82+ If set, the server side encryption config value must be `"aws:kms"` or `"aws:kms:dsse"`.
83+ """
84+ aws_token : str
85+ """Token to use for requests (passed to underlying provider)"""
86+ aws_unsigned_payload : bool
87+ """Avoid computing payload checksum when calculating signature."""
88+ aws_virtual_hosted_style_request : bool
89+ """If virtual hosted style request has to be used."""
90+
91+ class S3ConfigInput (TypedDict , total = False ):
2092 access_key_id : str
2193 """AWS Access Key"""
2294 aws_access_key_id : str
@@ -152,6 +224,7 @@ class S3Config(TypedDict, total=False):
152224 """Avoid computing payload checksum when calculating signature."""
153225 aws_virtual_hosted_style_request : bool
154226 """If virtual hosted style request has to be used."""
227+
155228 bucket_name : str
156229 """Bucket name"""
157230 checksum_algorithm : str
@@ -491,8 +564,8 @@ class S3Store:
491564
492565 All constructors will check for environment variables. All environment variables
493566 starting with `AWS_` will be evaluated. Names must match keys from
494- [`S3Config `][obstore.store.S3Config ]. Only upper-case environment variables are
495- accepted.
567+ [`S3ConfigInput `][obstore.store.S3ConfigInput ]. Only upper-case environment
568+ variables are accepted.
496569
497570 Some examples of variables extracted from environment:
498571
@@ -522,10 +595,10 @@ class S3Store:
522595 bucket : str | None = None ,
523596 * ,
524597 prefix : str | None = None ,
525- config : S3Config | None = None ,
598+ config : S3Config | S3ConfigInput | None = None ,
526599 client_options : ClientConfig | None = None ,
527600 retry_config : RetryConfig | None = None ,
528- ** kwargs : Unpack [S3Config ],
601+ ** kwargs : Unpack [S3ConfigInput ],
529602 ) -> None :
530603 """Create a new S3Store.
531604
@@ -549,10 +622,10 @@ class S3Store:
549622 bucket : str | None = None ,
550623 * ,
551624 prefix : str | None = None ,
552- config : S3Config | None = None ,
625+ config : S3Config | S3ConfigInput | None = None ,
553626 client_options : ClientConfig | None = None ,
554627 retry_config : RetryConfig | None = None ,
555- ** kwargs : Unpack [S3Config ],
628+ ** kwargs : Unpack [S3ConfigInput ],
556629 ) -> S3Store :
557630 """Construct a new S3Store with credentials inferred from a boto3 Session.
558631
@@ -590,10 +663,10 @@ class S3Store:
590663 cls ,
591664 url : str ,
592665 * ,
593- config : S3Config | None = None ,
666+ config : S3Config | S3ConfigInput | None = None ,
594667 client_options : ClientConfig | None = None ,
595668 retry_config : RetryConfig | None = None ,
596- ** kwargs : Unpack [S3Config ],
669+ ** kwargs : Unpack [S3ConfigInput ],
597670 ) -> S3Store :
598671 """Parse available connection info from a well-known storage URL.
599672
@@ -620,3 +693,15 @@ class S3Store:
620693
621694 def __getnewargs_ex__ (self ): ...
622695 def __repr__ (self ) -> str : ...
696+ @property
697+ def prefix (self ) -> str | None :
698+ """Get the prefix applied to all operations in this store, if any."""
699+ @property
700+ def config (self ) -> S3Config :
701+ """Get the underlying S3 config parameters."""
702+ @property
703+ def client_options (self ) -> ClientConfig | None :
704+ """Get the store's client configuration."""
705+ @property
706+ def retry_config (self ) -> RetryConfig | None :
707+ """Get the store's retry configuration."""
0 commit comments