diff options
Diffstat (limited to 'openbb_platform/core/openbb_core/env.py')
-rw-r--r-- | openbb_platform/core/openbb_core/env.py | 19 |
1 files changed, 11 insertions, 8 deletions
diff --git a/openbb_platform/core/openbb_core/env.py b/openbb_platform/core/openbb_core/env.py index e4e4c1df461..9249658ffbc 100644 --- a/openbb_platform/core/openbb_core/env.py +++ b/openbb_platform/core/openbb_core/env.py @@ -1,3 +1,5 @@ +"""Environment variables.""" + import os from pathlib import Path from typing import Dict, Optional @@ -14,47 +16,48 @@ class Env(metaclass=SingletonMeta): _environ: Dict[str, str] def __init__(self) -> None: + """Initialize the environment.""" dotenv.load_dotenv(Path(OPENBB_DIRECTORY, ".env")) self._environ = os.environ.copy() @property def API_AUTH(self) -> bool: - """API authentication: enables API endpoint authentication""" + """API authentication: enables API endpoint authentication.""" return self.str2bool(self._environ.get("OPENBB_API_AUTH", False)) @property def API_USERNAME(self) -> Optional[str]: - """API username: sets API username""" + """API username: sets API username.""" return self._environ.get("OPENBB_API_USERNAME", None) @property def API_PASSWORD(self) -> Optional[str]: - """API password: sets API password""" + """API password: sets API password.""" return self._environ.get("OPENBB_API_PASSWORD", None) @property def API_AUTH_EXTENSION(self) -> Optional[str]: - """Auth extension: specifies which authentication extension to use""" + """Auth extension: specifies which authentication extension to use.""" return self._environ.get("OPENBB_API_AUTH_EXTENSION", None) @property def AUTO_BUILD(self) -> bool: - """Automatic build: enables automatic package build on import""" + """Automatic build: enables automatic package build on import.""" return self.str2bool(self._environ.get("OPENBB_AUTO_BUILD", True)) @property def DEBUG_MODE(self) -> bool: - """Debug mode: enables debug mode""" + """Debug mode: enables debug mode.""" return self.str2bool(self._environ.get("OPENBB_DEBUG_MODE", False)) @property def DEV_MODE(self) -> bool: - """Dev mode: enables development mode""" + """Dev mode: enables development mode.""" return self.str2bool(self._environ.get("OPENBB_DEV_MODE", False)) @property def HUB_BACKEND(self) -> str: - """Hub backend: sets the backend for the OpenBB Hub""" + """Hub backend: sets the backend for the OpenBB Hub.""" return self._environ.get("OPENBB_HUB_BACKEND", "https://payments.openbb.co") @staticmethod |