Google Cloud Storage¶
obstore.store.GCSStore ¶
Configure a connection to Google Cloud Storage.
If no credentials are explicitly provided, they will be sourced from the environment as documented here.
__init__ ¶
__init__(
bucket: str,
*,
config: GCSConfig | None = None,
client_options: ClientConfig | None = None,
retry_config: RetryConfig | None = None,
**kwargs: Unpack[GCSConfig],
) -> None
Construct a new GCSStore.
Parameters:
-
bucket
(str
) –The GCS bucket to use.
Other Parameters:
-
config
(GCSConfig | None
) –GCS Configuration. Values in this config will override values inferred from the environment. Defaults to None.
-
client_options
(ClientConfig | None
) –HTTP Client options. Defaults to None.
-
retry_config
(RetryConfig | None
) –Retry configuration. Defaults to None.
Returns:
-
None
–GCSStore
from_env
classmethod
¶
from_env(
bucket: str,
*,
config: GCSConfig | None = None,
client_options: ClientConfig | None = None,
retry_config: RetryConfig | None = None,
**kwargs: Unpack[GCSConfig],
) -> GCSStore
Construct a new GCSStore with values pre-populated from environment variables.
Variables extracted from environment:
GOOGLE_SERVICE_ACCOUNT
: location of service account fileGOOGLE_SERVICE_ACCOUNT_PATH
: (alias) location of service account fileSERVICE_ACCOUNT
: (alias) location of service account fileGOOGLE_SERVICE_ACCOUNT_KEY
: JSON serialized service account keyGOOGLE_BUCKET
: bucket nameGOOGLE_BUCKET_NAME
: (alias) bucket name
Parameters:
-
bucket
(str
) –The GCS bucket to use.
Other Parameters:
-
config
(GCSConfig | None
) –GCS Configuration. Values in this config will override values inferred from the environment. Defaults to None.
-
client_options
(ClientConfig | None
) –HTTP Client options. Defaults to None.
-
retry_config
(RetryConfig | None
) –Retry configuration. Defaults to None.
Returns:
-
GCSStore
–GCSStore
from_url
classmethod
¶
from_url(
url: str,
*,
config: GCSConfig | None = None,
client_options: ClientConfig | None = None,
retry_config: RetryConfig | None = None,
**kwargs: Unpack[GCSConfig],
) -> GCSStore
Construct a new GCSStore with values populated from a well-known storage URL.
The supported url schemes are:
gs://<bucket>/<path>
Note
Note that from_url
will not use any additional parts of the path as a
bucket prefix. It will only extract the bucket name. If you wish to use a
path prefix, consider wrapping this with PrefixStore
.
Parameters:
-
url
(str
) –well-known storage URL.
Other Parameters:
-
config
(GCSConfig | None
) –GCS Configuration. Values in this config will override values inferred from the url. Defaults to None.
-
client_options
(ClientConfig | None
) –HTTP Client options. Defaults to None.
-
retry_config
(RetryConfig | None
) –Retry configuration. Defaults to None.
Returns:
-
GCSStore
–GCSStore
obstore.store.GCSConfig ¶
Bases: TypedDict
Configuration parameters for GCSStore.
There are duplicates of many parameters, and parameters can be either upper or lower case. Not all parameters are required.
GOOGLE_APPLICATION_CREDENTIALS
instance-attribute
¶
GOOGLE_APPLICATION_CREDENTIALS: str
Application credentials path.
See cloud.google.com/docs/authentication/provide-credentials-adc.
GOOGLE_SERVICE_ACCOUNT
instance-attribute
¶
GOOGLE_SERVICE_ACCOUNT: str
Path to the service account file.
GOOGLE_SERVICE_ACCOUNT_KEY
instance-attribute
¶
GOOGLE_SERVICE_ACCOUNT_KEY: str
The serialized service account key
GOOGLE_SERVICE_ACCOUNT_PATH
instance-attribute
¶
GOOGLE_SERVICE_ACCOUNT_PATH: str
Path to the service account file.
SERVICE_ACCOUNT_KEY
instance-attribute
¶
SERVICE_ACCOUNT_KEY: str
The serialized service account key
SERVICE_ACCOUNT_PATH
instance-attribute
¶
SERVICE_ACCOUNT_PATH: str
Path to the service account file.
google_application_credentials
instance-attribute
¶
google_application_credentials: str
Application credentials path.
See cloud.google.com/docs/authentication/provide-credentials-adc.
google_service_account
instance-attribute
¶
google_service_account: str
Path to the service account file.
google_service_account_key
instance-attribute
¶
google_service_account_key: str
The serialized service account key
google_service_account_path
instance-attribute
¶
google_service_account_path: str
Path to the service account file.