File size: 1,194 Bytes
558d330
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
#!/usr/bin/env python3
"""
main.py — Financial Analyzer entry point.

Run: python main.py
"""
import sys, io, os
from pathlib import Path

# Force UTF-8 on Windows so log messages with unicode chars (→ ✓ ✗) don't crash
if sys.platform == "win32":
    os.environ["PYTHONIOENCODING"] = "utf-8"
    try:
        sys.stdout = io.TextIOWrapper(sys.stdout.buffer, encoding="utf-8", errors="replace")
        sys.stderr = io.TextIOWrapper(sys.stderr.buffer, encoding="utf-8", errors="replace")
    except AttributeError:
        pass

# Make sure local packages resolve correctly
sys.path.insert(0, str(Path(__file__).parent))

from storage.cache import init_db

def main():
    # Ensure DB exists
    init_db()

    try:
        from gui.app_window import AppWindow
    except ImportError as e:
        print(f"ERROR: Could not import GUI: {e}")
        print("Make sure you have installed dependencies:")
        print("  pip install customtkinter Pillow requests beautifulsoup4 lxml")
        print("  pip install python-dotenv google-generativeai anthropic openpyxl python-docx pandas")
        sys.exit(1)

    app = AppWindow()
    app.mainloop()


if __name__ == "__main__":
    main()