feat: OpenBB Investment Analysis API

REST API wrapping OpenBB SDK for stock data, sentiment analysis,
technical indicators, macro data, and rule-based portfolio analysis.

- Stock data via yfinance (quote, profile, metrics, financials, historical, news)
- News sentiment via Alpha Vantage (per-article, per-ticker scores)
- Analyst data via Finnhub (recommendations, insider trades, upgrades)
- Macro data via FRED (Fed rate, CPI, GDP, unemployment, treasury yields)
- Technical indicators via openbb-technical (RSI, MACD, SMA, EMA, Bollinger)
- Rule-based portfolio analysis engine (BUY_MORE/HOLD/SELL)
- Stock discovery (gainers, losers, active, undervalued, growth)
- 102 tests, all passing
This commit is contained in:
Yaojia Wang
2026-03-09 00:20:10 +01:00
commit ad45cb429c
30 changed files with 3107 additions and 0 deletions

20
config.py Normal file
View File

@@ -0,0 +1,20 @@
from pydantic import Field
from pydantic_settings import BaseSettings
class Settings(BaseSettings):
host: str = "0.0.0.0"
port: int = 8000
cors_origins: list[str] = Field(default_factory=lambda: ["http://localhost:3000"])
log_level: str = "info"
debug: bool = False
# Optional API keys (free tiers)
finnhub_api_key: str = ""
fred_api_key: str = ""
alphavantage_api_key: str = ""
model_config = {"env_prefix": "INVEST_API_", "env_file": ".env"}
settings = Settings()