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
21 lines
512 B
Python
21 lines
512 B
Python
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()
|