chaturbate_poller.config.manager

Configuration manager module.

Classes

ConfigManager

Configuration manager for environment variables and .env files.

Module Contents

class chaturbate_poller.config.manager.ConfigManager(env_file: str = '.env')[source]

Configuration manager for environment variables and .env files.

Initialize the configuration manager.

Parameters:

env_file – The path to the environment file.

get(key: str, default: str | None = None) str | None[source]

Retrieve a configuration value by key, or default value if the key is not found.

Parameters:
  • key – The configuration key to retrieve.

  • default – The default value to return if the key is not found.

Returns:

The configuration value or default value.

get_bool(key: str, *, default: bool = False) bool[source]

Retrieve a boolean configuration value by key.

Parameters:
  • key – The configuration key to retrieve.

  • default – The default value to return if the key is not found.

Returns:

The boolean configuration value or default value.

static str_to_bool(value: str) bool[source]

Convert a string to a boolean value.

Parameters:

value – The string value to convert.

Returns:

The converted boolean value.

ENV_VARIABLES: ClassVar[dict[str, str | bool]]
config: dict[str, str | bool | None]