diff --git a/src/proxy_pool/config.py b/src/proxy_pool/config.py new file mode 100644 index 0000000..fa56074 --- /dev/null +++ b/src/proxy_pool/config.py @@ -0,0 +1,29 @@ +from functools import lru_cache + +from pydantic_settings import BaseSettings, SettingsConfigDict + + +class Settings(BaseSettings): + model_config = SettingsConfigDict( + env_file=".env", + env_file_encoding="utf-8", + case_sensitive=False, + ) + + # Infrastructure + database_url: str + redis_url: str + secret_key: str + + # Application + app_name: str = "proxy-pool" + log_level: str = "INFO" + + # Database pool + db_pool_size: int = 10 + db_max_overflow: int = 10 + + +@lru_cache +def get_settings() -> Settings: + return Settings()