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_TOKENGPP_STAGING_TOKENGPP_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:
objectDefault values for the GPP client configuration.
- config_filename
The name of the configuration file.
- Type:
- app_name
The name of the application for config directory.
- Type:
- default_env
The default GPP environment.
- Type:
- url
The default URLs for each GPP environment.
- Type:
- env_var_env
The environment variable name for the GPP environment.
- Type:
- env_var_token
The environment variable name for a generic GPP token.
- Type:
- env_var_env_tokens
The environment variable names for tokens for each GPP environment.
- Type:
- disable_env_vars
The default setting for disabling environment variable usage.
- Type:
- 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]