Client Config

class gretel_client.config.ClientConfig(endpoint: Optional[str] = None, api_key: Optional[str] = None, default_project_name: Optional[str] = None, default_runner: str = 'cloud')

Holds Gretel client configuration details. This can be instantiated from a file or environment.

api_key: Optional[str] = None

Gretel API key.

default_project_name: Optional[str] = None

Default Gretel project name.

default_runner: str = 'cloud'

Default runner

endpoint: str = None

Gretel API endpoint.

property masked

Returns a masked representation of the config object.

update_default_project(project_id: str)

Updates the default project.


project_name – The name or id of the project to set.

gretel_client.config.DEFAULT_GRETEL_ENDPOINT = ''

Default gretel endpoint

gretel_client.config.GRETEL = 'gretel'

Gretel application name

gretel_client.config.GRETEL_API_KEY = 'GRETEL_API_KEY'

Env variable to configure Gretel api key.


Env variable name to override default configuration file location

gretel_client.config.GRETEL_ENDPOINT = 'GRETEL_ENDPOINT'

Env variable name to configure default Gretel endpoint. Defaults to DEFAULT_GRETEL_ENDPOINT.

gretel_client.config.GRETEL_PROJECT = 'GRETEL_PROJECT'

Env variable name to select default project

exception gretel_client.config.GretelClientConfigurationError
class gretel_client.config.RunnerMode

An enumeration.

gretel_client.config.configure_session(config: Union[str, gretel_client.config.ClientConfig])

Updates client config for the session


config – The config to update. If the config is a string, this function will attempt to parse it as a Gretel URI.


Return the session’s client config

gretel_client.config.write_config(config: gretel_client.config.ClientConfig, config_path: Union[str, pathlib.Path, None] = None) → pathlib.Path

Writes a Gretel client config to disk.

  • config – The client config to write

  • config_path – Path to write the config to. If not path is provided, the default $HOME/.gretel/config.json path is used.