Add python-dotenv support for automatic .env loading

- Added python-dotenv to requirements.txt
- Config now automatically loads .env file if present
- Allows local development without manually exporting env vars
- Gracefully falls back if python-dotenv not installed

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
knight 2025-11-05 11:03:42 -05:00
parent 7988e2751a
commit d616b87701
2 changed files with 10 additions and 0 deletions

View File

@ -16,6 +16,15 @@ from dataclasses import dataclass
from pathlib import Path
from typing import Optional
# Load .env file if it exists
try:
from dotenv import load_dotenv
_env_path = Path(__file__).parent / ".env"
if _env_path.exists():
load_dotenv(_env_path)
except ImportError:
pass # python-dotenv not installed
@dataclass(frozen=True)
class ElasticSettings:

View File

@ -2,3 +2,4 @@ Flask>=2.3
elasticsearch>=7.0.0,<9.0.0
youtube-transcript-api>=0.6
google-api-python-client>=2.0.0
python-dotenv>=0.19.0