from pydantic import BaseSettings, ValidationError
from pydantic_settings import SettingsConfigDict
class Config(BaseSettings):
value: bool
model_config = SettingsConfigDict(
case_sensitive=False,
env_nested_delimiter="__",
env_file=(".env",)
)
if __name__ == "__main__":
try:
config = Config()
print(f"Значение: {config.value}")
except ValidationError as e:
print(f"Ошибка в настройках: {e}")