up extractor env getting

This commit is contained in:
Tykayn 2025-09-18 22:30:25 +02:00 committed by tykayn
parent 4951eeb1c8
commit 153e9bd8f9
11 changed files with 196 additions and 4 deletions

View file

@ -12,6 +12,9 @@ def load_env_from_file():
"""
Load environment variables from .env file.
This ensures that database connection parameters are properly set.
Returns:
bool: True if the .env file exists and was loaded, False otherwise.
"""
if os.path.exists('.env'):
logger.info("Loading environment variables from .env file...")
@ -21,6 +24,10 @@ def load_env_from_file():
if line and not line.startswith('#'):
key, value = line.split('=', 1)
os.environ[key] = value
return True
else:
logger.warning(".env file not found")
return False
def db_connect():
"""