avid.common.config_manager
Central TOML-based configuration manager for AVID.
This module provides functions to manage configuration at two levels:
User requested_scope: stored in the OS-specific user config/data dirs (via
platformdirs).Venv requested_scope: stored under the current virtual environment root (
<venv>/etc/avidfor configs,<venv>/var/avidfor tools).
When loading settings, venv values always override user values (merged view). When writing, callers can explicitly choose user or venv. If no requested_scope is given, the default is venv if inside a virtual environment, else user.
Tool configurations are stored in dedicated TOML files, one per tool,
located under the respective tools root (.../tools/tool-configs/<tool-id>/avid_tool_config.toml).
Functions
|
Returns a set with all toml keys found in a dict |
|
Ensure that the given directory exists. |
|
Retrieve a setting value. |
|
Retrieve a setting value. |
Return the base user configuration directory for AVID. Example (Linux): |
|
Return the path to the user-level config TOML file. |
|
Return the base user data directory for AVID. This is e.g. the root where the tools path is located by default Example (Linux): |
|
|
Return path to a tool's config dir. |
|
Return path to a tool's TOML config file. |
Return the default root directory for installed tools. Example (Linux): |
|
Return the root directory for installed tools. |
|
|
|
Return the configuration directory for the current venv. Layout: |
|
Return the path to the venv-level config TOML file, if in venv. |
|
Return the data directory for the current venv. Layout: |
|
Return the current virtual environment root, if any. |
|
|
Return path to a tool's TOML config dir for the current venv. |
|
Return path to a tool's TOML config file for the current venv. |
Return the default root directory for installed tools for the current venv. Example (Linux): |
|
Return the root directory for installed tools for the current venv. |
|
|
Return whether execution is inside a virtual environment. |
Load merged configuration: defaults < user < venv. |
|
Load the user-level configuration file. |
|
|
Load the user-level tool configuration file, if available. |
Load the venv-level configuration file, if available. |
|
|
Load the venv-level tool configuration file, if available. |
|
Write user-level config. |
|
Write user-level config. |
|
Write venv-level config (error if not in venv). |
|
Write venv-level config (error if not in venv). |
|
Set a configuration value. |
|
Set a configuration value. |
|
Remove a setting. |
|
Remove a setting. |
Classes