# BACH - Optional Feature Requirements
# ============================================================
# Install only the features you plan to use.
# Usage: pip install -r requirements-optional.txt
#   OR:  pip install PyMuPDF Pillow python-docx  (selective)
#
# First install core: pip install -r requirements.txt
# ============================================================


# ============================================================
# [DOCUMENT PROCESSING] Full document suite (PDF, DOCX, XLSX)
# Needed for: hub/_services/document/, report generator,
#             steuer agent, inbox watcher, OCR
# ============================================================

# PyMuPDF (AGPL-3.0 OR Commercial License) -- OPTIONAL
# Required ONLY for: OCR-rendering (tools/ocr/engine.py),
#                    PDF schwaerzen (_vendor/pdf_schwaerzer_pro.py),
#                    redaction detection (_vendor/redaction_detector.py),
#                    steuer expert (dist_type=0, not in release)
# SQ072/ENT-32: Replaced by pypdf+pdfplumber for core PDF reading.
# Install if you need PDF rendering or redaction features:
#   pip install PyMuPDF
PyMuPDF>=1.26.4           # PDF render/redact/OCR-render (AGPL -- optional!)

# extract_msg (GPL) -- OPTIONAL
# Required ONLY for: .msg Outlook file parsing (report_generator/generator.py)
# SQ072/ENT-32: Moved from core requirements due to GPL license incompatibility with MIT.
# Install if you need to process Outlook .msg files:
#   pip install extract_msg
extract_msg>=0.55.0       # Parse .msg Outlook files (GPL -- optional!)

pdf2image>=1.17.0         # Convert PDF pages to images (requires poppler)
reportlab>=4.4.5          # PDF generation from scratch
fpdf2>=2.8.3              # Lightweight PDF creation (steuer tools)
weasyprint>=68.1          # HTML/CSS -> PDF rendering (docs/convert_to_pdf)
Pillow>=10.4.0            # Image processing (PIL, bridge tray, OCR)
pytesseract>=0.3.13       # OCR (requires tesseract binary installed)
python-docx>=1.2.0        # Read/write .docx Word files
python-pptx>=1.0.2        # Read/write .pptx PowerPoint files
openpyxl>=3.1.5           # Read/write .xlsx Excel files


# ============================================================
# [CHAT SERVICE / BUDDHA] Telegram bot, web search, system tray
# Needed for: hub/_services/chat/ (telegram_chat, chat_runtime, chat_tray)
# ============================================================
python-telegram-bot>=22.4  # Telegram Bot API (telegram_chat.py)
duckduckgo-search>=8.0.0   # DuckDuckGo web search (chat_runtime.py web_search tool)


# ============================================================
# [AI / LLM PARTNERS] External AI service clients
# Needed for: hub/partners/, connectors/, multi-LLM workflows
# ============================================================
anthropic>=0.79.0         # Claude API (Anthropic) - primary LLM partner
ollama>=0.6.1             # Ollama local LLM client
# google-generativeai     # Gemini API (planned - not yet integrated)
# openai                  # OpenAI API (future)
# mcp                     # MCP SDK (tools/mcp_server.py - planned)


# ============================================================
# [DATA ANALYSIS / MARKET] Quantitative analysis stack
# Needed for: hub/_services/market/, data_analysis handler
# ============================================================
numpy>=2.3.1              # Numerical computing
pandas>=2.3.1             # Data analysis & DataFrames
scipy>=1.16.0             # Scientific/statistical computing
matplotlib>=3.10.6        # Plotting & visualization
yfinance>=1.0             # Yahoo Finance market data
# scikit-learn            # ML models (not installed, market analysis ML)
# statsmodels             # Statistical models (not installed)
# tensorflow              # Deep learning (not installed, neural_net.py)


# ============================================================
# [VECTOR DATABASE / RAG] Semantic search & retrieval
# Needed for: tools/rag/ingest.py, tools/rag/search.py
# ============================================================
chromadb>=1.4.1           # Embedded vector database (RAG features)


# ============================================================
# [GUI / WEB SERVER] BACH web dashboard and GUI
# Needed for: gui/ folder, REST API, headless mode
# ============================================================
PyQt6>=6.10.0             # Qt GUI framework (PDF redactor, prompt_manager)
FastAPI>=0.128.0          # Web API framework (gui/api/)
uvicorn>=0.40.0           # ASGI server (FastAPI runtime)
starlette>=0.50.0         # ASGI framework (FastAPI dependency)
pystray>=0.19.5           # System tray icon (bridge_tray)
tkinterdnd2>=0.4.3        # Drag & drop for Tkinter (universal converter)


# ============================================================
# [WEB SCRAPING & AUTOMATION]
# Needed for: hub/web_scrape.py, steuer tools, testing/playwright
# ============================================================
selenium>=4.38.0          # Browser automation (web scraping, receipt fetcher)
# playwright              # Modern browser automation (not installed, tests only)
# html2text               # HTML -> Markdown (not installed, web_parse uses it)


# ============================================================
# [GOOGLE SERVICES] Gmail, Google Drive, Sheets
# Needed for: hub/_services/mail/, tools/send_report.py
# ============================================================
google-api-python-client>=2.187.0   # Google APIs (Gmail, Drive)
google-auth-oauthlib>=1.2.3         # OAuth2 for Google APIs


# ============================================================
# [VOICE / AUDIO] Speech-to-text and text-to-speech
# Needed for: hub/_services/voice/voice_stt.py
# ============================================================
pyttsx3>=2.99             # Text-to-speech (installed, TTS output)
openai-whisper>=20250625  # Speech-to-text via Whisper (STT)
# pyaudio                 # Audio I/O (not installed, required for vosk/wake word)
# vosk                    # Offline STT (not installed)
# openwakeword            # Wake word detection (not installed)


# ============================================================
# [WINDOWS-SPECIFIC] Only install on Windows
# ============================================================
pywin32>=311              # Windows COM interface (pdf_schwaerzer_pro)
# winsound                # Built-in Windows audio (stdlib, no install needed)


# ============================================================
# [SCHEDULING] Cron-like task scheduling
# Needed for: gui/daemon_service.py
# ============================================================
# croniter               # Cron expression parser (not installed)


# ============================================================
# [DEVELOPMENT & TESTING]
# Install for development work only, not needed in production
# ============================================================
pytest>=9.0.2             # Test runner (system/tests/, BACH_Dev/tests/)
