Defaults

The gpp_client.config.defaults module defines all built-in default values for the GPP Client configuration system.

These defaults include:

  • The default configuration file name

  • The application directory used for storage

  • The default GPP environment

  • The mapping of environments to GraphQL URLs

  • The names of supported environment variables for tokens

Configuration File Naming

The default configuration file is always named:

config.toml

This file is stored in a directory determined by typer.get_app_dir(), based on:

GPPDefaults.app_name"gpp-client"

Environment Defaults

The default environment is:

PRODUCTION

See Environment for all supported environments.

Environment Variable Names

Each environment has a dedicated variable name for its token:

  • GPP_DEVELOPMENT_TOKEN

  • GPP_STAGING_TOKEN

  • GPP_PRODUCTION_TOKEN

These names live in:

GPPDefaults.env_var_env_tokens

Note

Whether these environment variables are used depends on the user’s config file. See Config.

API Reference

class gpp_client.config.defaults._GPPDefaults(config_filename: str = 'config.toml', app_name: str = 'gpp-client', default_env: ~gpp_client.config.environment.GPPEnvironment = GPPEnvironment.PRODUCTION, url: dict[~gpp_client.config.environment.GPPEnvironment, str] = <factory>, env_var_env: str = 'GPP_ENV', env_var_token: str = 'GPP_TOKEN', env_var_env_tokens: dict[~gpp_client.config.environment.GPPEnvironment, str] = <factory>, disable_env_vars: bool = False)[source]

Bases: object

Default values for the GPP client configuration.

config_filename

The name of the configuration file.

Type:

str

app_name

The name of the application for config directory.

Type:

str

default_env

The default GPP environment.

Type:

GPPEnvironment

url

The default URLs for each GPP environment.

Type:

dict[GPPEnvironment, str]

env_var_env

The environment variable name for the GPP environment.

Type:

str

env_var_token

The environment variable name for a generic GPP token.

Type:

str

env_var_env_tokens

The environment variable names for tokens for each GPP environment.

Type:

dict[GPPEnvironment, str]

disable_env_vars

The default setting for disabling environment variable usage.

Type:

bool

app_name: str = 'gpp-client'
config_filename: str = 'config.toml'
default_env: GPPEnvironment = 'PRODUCTION'
disable_env_vars: bool = False
env_var_env: str = 'GPP_ENV'
env_var_env_tokens: dict[GPPEnvironment, str]
env_var_token: str = 'GPP_TOKEN'
url: dict[GPPEnvironment, str]