- class vortex.store.GCSStore(bucket: str | None = None, *, prefix: str | None = None, config: GCSConfig | None = None, client_options: ClientConfig | None = None, retry_config: RetryConfig | None = None, credential_provider: GCSCredentialProvider | None = None, **kwargs: Unpack[GCSConfig])#
Interface to Google Cloud Storage.
All constructors will check for environment variables. Refer to
GCSConfigfor valid environment variables.If no credentials are explicitly provided, they will be sourced from the environment as documented here.
- property client_options: ClientConfig | None#
Get the store’s client configuration.
- property credential_provider: GCSCredentialProvider | None#
Get the store’s credential provider.
- classmethod from_url(url: str, *, prefix: str | None = None, config: GCSConfig | None = None, client_options: ClientConfig | None = None, retry_config: RetryConfig | None = None, credential_provider: GCSCredentialProvider | None = None, **kwargs: Unpack[GCSConfig]) → Self#
Construct a new GCSStore with values populated from a well-known storage URL.
Any path on the URL will be assigned as the
prefixfor the store. So if you passgs://<bucket>/path/to/directory, the store will be created with a prefix ofpath/to/directory, and all further operations will use paths relative to that prefix.The supported url schemes are:
gs://<bucket>/<path>
- Parameters:
url – well-known storage URL.
- Keyword Arguments:
prefix – A prefix within the bucket to use for all operations.
config – GCS Configuration. Values in this config will override values inferred from the url. Defaults to None.
client_options – HTTP Client options. Defaults to None.
retry_config – Retry configuration. Defaults to None.
credential_provider – A callback to provide custom Google credentials.
kwargs – GCS configuration values. Supports the same values as
config, but as named keyword args.
- Returns:
GCSStore
- property retry_config: RetryConfig | None#
Get the store’s retry configuration.
- class vortex.store.GCSConfig#
Configuration parameters for GCSStore.
- application_credentials: str#
Application credentials path.
See <https://cloud.google.com/docs/authentication/provide-credentials-adc>.
Environment variable:
GOOGLE_APPLICATION_CREDENTIALS.
- service_account: str#
Path to the service account file.
This or
service_account_keymust be set.Example value
"/tmp/gcs.json". Example contents ofgcs.json:{ "gcs_base_url": "https://localhost:4443", "disable_oauth": true, "client_email": "", "private_key": "" }
Environment variables:
GOOGLE_SERVICE_ACCOUNTGOOGLE_SERVICE_ACCOUNT_PATH
- class vortex.store.GCSCredential#
A Google Cloud Storage Credential.
- class vortex.store.GCSCredentialProvider(*args, **kwargs)#
A type hint for a synchronous or asynchronous callback to provide custom Google Cloud Storage credentials.
This should be passed into the
credential_providerparameter ofGCSStore.