algokit_utils.config
Classes
UpdatableConfig | Class to manage and update configuration settings for the AlgoKit project. |
---|
API
class algokit_utils.config.UpdatableConfig
UpdatableConfig
Class to manage and update configuration settings for the AlgoKit project.
Attributes: debug (bool): Indicates whether debug mode is enabled. project_root (Path | None): The path to the project root directory. trace_all (bool): Indicates whether to trace all operations. trace_buffer_size_mb (int): The size of the trace buffer in megabytes. max_search_depth (int): The maximum depth to search for a specific file.
Initialization
configure
configure(*, debug: bool, project_root: pathlib.Path | None = None, trace_all: bool = False, trace_buffer_size_mb: float = 256, max_search_depth: int = 10) → None
Configures various settings for the application.
Please note, when project_root
is not specified, by default config will attempt to find the algokit.toml
by
scanning the parent directories according to the max_search_depth
parameter.
Alternatively value can also be set via the ALGOKIT_PROJECT_ROOT
environment variable.
If you are executing the config from an algokit compliant project, you can simply call
config.configure(debug=True)
.
Args: debug (bool): Indicates whether debug mode is enabled. project_root (Path | None, optional): The path to the project root directory. Defaults to None. trace_all (bool, optional): Indicates whether to trace all operations. Defaults to False. Which implies that only the operations that are failed will be traced by default. trace_buffer_size_mb (float, optional): The size of the trace buffer in megabytes. Defaults to 512mb. max_search_depth (int, optional): The maximum depth to search for a specific file. Defaults to 10.
Returns: None
property debug
debug : bool
Returns the debug status.
property project_root
project_root : pathlib.Path | None
Returns the project root path.
property trace_all
trace_all : bool
Indicates whether to store simulation traces for all operations.
property trace_buffer_size_mb
trace_buffer_size_mb : int | float
Returns the size of the trace buffer in megabytes.
with_debug
with_debug(func: collections.abc.Callable[[], str | None]) → None
Executes a function with debug mode temporarily enabled.