# ===================================
# Daily Stock Analysis - dependencies
# ===================================

# Core dependencies
python-dotenv>=1.0.0        # Environment variable configuration
tenacity>=8.2.0             # Retry support with exponential backoff
sqlalchemy>=2.0.0           # ORM database access
schedule>=1.2.0             # Scheduled task runner
exchange-calendars>=4.13.0   # Trading calendars; 4.5.x is incompatible with pandas 3 Timedelta "T"

# Data source dependencies, ordered by fallback priority
efinance>=0.5.5             # Priority 0: East Money data source https://github.com/Micro-sheep/efinance
akshare>=1.12.0             # Priority 1: East Money crawler data source
tushare>=1.4.0              # Priority 2: Tushare Pro API
pytdx>=1.72                 # Priority 2: Tongdaxin quote servers
baostock>=0.8.0             # Priority 3: Baostock data
yfinance>=0.2.0             # Priority 4: Yahoo Finance (Fallback)
# Longbridge 4.x Linux wheels currently require manylinux_2_39; Docker uses bookworm/glibc 2.36.
# Priority 5: Docker/Linux fallback SDK.
longbridge==0.2.74; platform_system == "Linux" and python_version < "3.12"
# Priority 5: Longbridge OpenAPI SDK with OAuth support.
longbridge>=4.0.5,<5; platform_system != "Linux" or python_version >= "3.12"
tickflow>=0.1.24           # TickFlow official SDK; 0.1.24 verified for klines/get batch quotes/universes
# Built-in optional AlphaSift screening engine
git+https://github.com/ZhuLinsen/alphasift.git@0a7b9cd59e81718f851890535241bc105d4ddc64#egg=alphasift

# Feishu
lark-oapi>=1.0.0             # Feishu API

# Data processing
pandas>=2.0.0               # Data analysis
pypinyin>=0.50.0            # Name-to-code resolver (pinyin matching)
openpyxl>=3.1.0             # Excel (.xlsx) parsing for import
numpy>=1.24.0               # Numeric computing
json-repair>=0.55.1         # JSON repair

# AI analysis
# Keep the historical minimum version while excluding quarantined builds and avoiding future major breaks.
litellm>=1.80.10,!=1.82.7,!=1.82.8,<2.0.0   # Unified LLM client (Gemini/Anthropic/OpenAI/DeepSeek etc.)
tiktoken>=0.8.0,<0.12.0    # BPE tokenizer for LLM token counting (pin <0.12 to avoid plugin registration issues, #537)
openai>=1.0.0               # OpenAI SDK (transitive dependency of litellm, kept explicit)
PyYAML>=6.0                 # YAML parser for LITELLM_CONFIG support

# Search engines for stock news
tavily-python>=0.3.0        # Tavily Search API
google-search-results>=2.4.0  # SerpAPI

# Network requests
requests>=2.31.0            # HTTP requests
markdown2>=2.4.0            # Markdown to HTML
imgkit>=1.2.0              # Markdown to image; requires wkhtmltopdf
fake-useragent>=1.4.0       # Random User-Agent support
httpx[socks]                # HTTP client with SOCKS proxy support; optional OpenAI dependency
dingtalk-stream >= 0.24.3    # DingTalk Stream SDK
# Database
# SQLite is built into Python and does not need an extra package

# Discord bot
discord.py>=2.0.0              # Discord bot development library
PyNaCl>=1.5.0                  # Discord Interaction/Webhook Ed25519 signature verification

# Web Content Extraction
newspaper3k>=0.2.8          # Article extraction
lxml_html_clean             # Fix for lxml.html.clean ImportError in newer lxml versions

# Report template engine (Report Engine P0)
jinja2>=3.1.0               # Jinja2 template engine for report rendering

# FastAPI Web framework
fastapi>=0.109.0            # Modern Python Web framework
uvicorn[standard]>=0.27.0   # ASGI server
python-multipart>=0.0.6     # FastAPI File/Form upload support
