Commit Graph

6 Commits

Author SHA1 Message Date
John Weston f7f0aa0678 Address Gemini round 6: fix indicator fallback, consistent _safe_get usage
HIGH: Unknown indicator now returns clear error with supported list instead of
  silently falling back to technicals() which has a different response structure
MEDIUM: Use _safe_get consistently in get_sentiment_score (was data.get)
2026-03-23 19:05:23 -04:00
John Weston 7850413348 Address Gemini round 5: date validation, cashflow consistency, clean CSV values
MEDIUM: Validate start_date < end_date (return error instead of large API call)
MEDIUM: get_cashflow returns tabular format when available, matching other vendors
MEDIUM: Remove formatting chars from CSV data (no $ or % in values)
2026-03-23 18:46:16 -04:00
John Weston 435854e5a6 Address Gemini round 4: register get_technicals, fix curr_date, clean up naming
HIGH: Add get_technicals to TOOLS_CATEGORIES (was unregistered)
HIGH: Use curr_date param in get_indicators for historical range calculation
HIGH: Remove misleading get_insider_transactions alias — keep separate:
  - get_insider_transactions: yfinance/AV (actual insider trades, Form 4)
  - get_sec_filings: Polaris (earnings filings, 8-K/10-Q/10-K)
MEDIUM: Simplify _extract_briefs helper
2026-03-23 18:16:21 -04:00
John Weston 7e3516e400 Address all Gemini round 3 feedback
HIGH: Remove cachetools fallback — require it directly (it's in requirements.txt)
HIGH: Fix get_global_news — return empty result instead of unfiltered fallback
HIGH: Fail fast if POLARIS_API_KEY not set (no silent 'demo' fallback)

MEDIUM: Merge get_competitors into get_sector_analysis (remove duplication)
MEDIUM: Extract _extract_briefs() and _format_brief_detail() shared helpers
MEDIUM: Add trailing newline to get_news for consistency
MEDIUM: All .get() calls use _safe_get with proper defaults
2026-03-23 18:00:50 -04:00
John Weston b622630e53 Address Gemini review: date filtering, caching, dedup, naming + add technicals & competitors
Fixes all 9 Gemini issues:
- HIGH: get_news/get_global_news now pass start_date/end_date to API
- HIGH: get_sec_filings (renamed from get_insider_transactions) has caching
- MEDIUM: Replaced _get2 duplicate with shared _safe_get at module level
- MEDIUM: _safe_get returns default instead of None (no more 'None' in strings)
- MEDIUM: balance_sheet/cashflow/income_statement now cache formatted results
- MEDIUM: String concatenation replaced with list join pattern throughout
- MEDIUM: _days_to_range helper eliminates range calculation duplication
- MEDIUM: Fallback for unknown indicator types formats dict keys as CSV

New Polaris-exclusive methods:
- get_technicals: 20 indicators + buy/sell signal in one call
- get_competitors: same-sector peers with live price, RSI, sentiment
2026-03-23 17:49:46 -04:00
John Weston 4abad33e0f Add Polaris as news/sentiment/price data vendor
Adds Polaris Knowledge API as a third data vendor alongside yfinance and
Alpha Vantage. Polaris provides sentiment-scored intelligence, composite
trading signals, and news impact analysis that raw data feeds don't offer.

Implements all existing vendor methods plus 3 Polaris-exclusive methods
(sentiment_score, sector_analysis, news_impact).

Uses cachetools.TTLCache for thread-safe caching, shared financials fetch
to avoid redundant API calls, and polaris-news SDK for all API access.

Tested with real API calls — all functions return valid data.
Addresses #305, #11, #86.
2026-03-23 09:12:06 -04:00