danoan.word_guru.cli.config module

word-guru CLI configuration

danoan.word_guru.cli.config.get_absolute_configuration_path(path: Path)[source]

Get absolute path of a configuration parameter.

Paths in the configuration file are given relative to the location of the configuration file. This function resolves to its absolute path.

Parameters:

path (Path)

danoan.word_guru.cli.config.get_configuration() WordGuruConfiguration[source]

Return configuration object.

Return type:

WordGuruConfiguration

danoan.word_guru.cli.config.get_configuration_filepath() Path[source]

Return path to word-guru configuration file.

Return type:

Path

danoan.word_guru.cli.config.get_configuration_folder() Path[source]

Return directory where configuration file is stored.

First checks if a configuration file exists in the file hierarchy. If that is the case, return the directory where the configuration file is located.

If the procedure above does not find a configuration file, return the value stored in the environment variable WORD_GURU_ENV_VARIABLE.

If the environment variable is not defined, raise an error.

Raises:

EnvironmentVariableNotDefinedError – If the WORD_GURU_ENV_VARIABLE is not defined and a configuration file is not found in the file hierarchy

Return type:

Path

danoan.word_guru.cli.config.get_environment_variable_value() Path[source]
Return type:

Path