Skip to content

settings

The application settings.

kelp.core.settings.Settings

Bases: BaseSettings

Represents Application Settings with nested configuration sections

Source code in kelp/core/settings.py
 8
 9
10
11
12
13
14
15
16
17
18
class Settings(BaseSettings):
    """Represents Application Settings with nested configuration sections"""

    environment: str = "local"

    model_config = SettingsConfigDict(
        env_file=consts.directories.ROOT_DIR / ".env",
        env_file_encoding="utf-8",
        env_nested_delimiter="__",
        extra="ignore",
    )

Importing settings

To use current settings without the need to parse them each time you can use:

import logging

from kelp.core.settings import current_settings


# log current environment
logging.info(current_settings.env)  # INFO:dev