up extractor env getting
This commit is contained in:
parent
4951eeb1c8
commit
153e9bd8f9
11 changed files with 196 additions and 4 deletions
|
@ -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():
|
||||
"""
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue