-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathinit_project.py
More file actions
53 lines (40 loc) · 1.62 KB
/
init_project.py
File metadata and controls
53 lines (40 loc) · 1.62 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
#!/usr/bin/env python3
"""Initialize MoviePicker 2.0 project structure and database."""
import sys
from pathlib import Path
# Add src to Python path
sys.path.insert(0, str(Path(__file__).parent / "src"))
from src.utils.config import ensure_directories, settings
from src.utils.logger import setup_logger
from src.core.migrations import run_migrations
def main():
"""Initialize the MoviePicker 2.0 project."""
print("🎬 Initializing MoviePicker 2.0...")
# Set up logging
logger = setup_logger("moviepicker", log_file="init.log")
try:
# Ensure directories exist
print("📁 Creating directories...")
ensure_directories()
# Check for TMDb API key
if (
not settings.tmdb_api_key
or settings.tmdb_api_key == "your_tmdb_api_key_here"
):
print("⚠️ Warning: TMDb API key not configured.")
print(" Please set TMDB_API_KEY in your .env file")
print(" Get a free API key at: https://www.themoviedb.org/settings/api")
# Initialize database
print("🗄️ Initializing database...")
run_migrations()
print("✅ MoviePicker 2.0 initialization completed successfully!")
print("\n🎯 Next steps:")
print(" 1. Set up your TMDb API key in .env file")
print(" 2. Run: python src/ui/cli_interface.py")
print(" 3. For development: pip install -r requirements-dev.txt")
except Exception as e:
logger.error(f"Initialization failed: {e}")
print(f"❌ Initialization failed: {e}")
sys.exit(1)
if __name__ == "__main__":
main()