uniqc.config module¶
Project-wide configuration and platform credentials helpers.
This module is the canonical source of truth for CONFIG_FILE and all
configuration management functions (load_config, save_config,
get_active_profile, …). uniqc.backend_adapter.config re-exports from here
so that patching uniqc.config.CONFIG_FILE propagates to every import path.
All credentials and cache settings are persisted in ~/.uniqc/config.yaml.
Example configuration structure:
always_ai_hints: false
active_profile: default
default:
originq:
token: xxx
quark:
QUARK_API_KEY: xxx
ibm:
token: xxx
proxy:
http: http://proxy:8080
https: https://proxy:8080
- uniqc.config.get_config_version(config)[source]¶
Return the schema version of a parsed config dict (0 = unversioned legacy).
- uniqc.config.has_platform_credentials(platform)[source]¶
Check whether credentials exist for a platform without raising.
Returns True if the platform section exists in the active profile and contains a non-empty token/key field. Returns False otherwise (including when the config file does not exist or the platform is not configured at all).
- uniqc.config.migrate_config(config)[source]¶
Migrate a parsed config dict to
CURRENT_CONFIG_VERSION.Raises
ConfigErrorif the file was written by a newer uniqc.