|
| 1 | +from typing import Optional |
| 2 | +from pydantic import BaseModel, Field |
| 3 | + |
| 4 | + |
| 5 | +class CompanyProfile(BaseModel): |
| 6 | + symbol: str |
| 7 | + beta: float |
| 8 | + range: str |
| 9 | + company_name: str = Field(..., alias="companyName") |
| 10 | + sector: Optional[str] = None |
| 11 | + industry: Optional[str] = None |
| 12 | + description: Optional[str] = None |
| 13 | + image: Optional[str] = None |
| 14 | + |
| 15 | + |
| 16 | +class Quote(BaseModel): |
| 17 | + symbol: str |
| 18 | + price: float |
| 19 | + change_percent: Optional[float] = Field(..., alias="changesPercentage") |
| 20 | + year_high: float = Field(..., alias="yearHigh") |
| 21 | + year_low: float = Field(..., alias="yearLow") |
| 22 | + market_cap: float = Field(..., alias="marketCap") |
| 23 | + vol_avg: int = Field(..., alias="avgVolume") |
| 24 | + eps: float |
| 25 | + pe: float |
| 26 | + earning_date: str = Field(..., alias="earningsAnnouncement") |
| 27 | + shares_outstanding: int = Field(..., alias="sharesOutstanding") |
| 28 | + |
| 29 | + |
| 30 | + |
| 31 | +class Ratings(BaseModel): |
| 32 | + symbol: str |
| 33 | + date: str |
| 34 | + rating: str |
| 35 | + score: int = Field(..., alias="ratingScore") |
| 36 | + recommendation: str = Field(..., alias="ratingRecommendation") |
| 37 | + dcf_score: int = Field(..., alias="ratingDetailsDCFScore") |
| 38 | + dcf_rec: str = Field(..., alias="ratingDetailsDCFRecommendation") |
| 39 | + roe_score: int = Field(..., alias="ratingDetailsROEScore") |
| 40 | + roe_rec: str = Field(..., alias="ratingDetailsROERecommendation") |
| 41 | + roa_score: int = Field(..., alias="ratingDetailsROAScore") |
| 42 | + roa_rec: str = Field(..., alias="ratingDetailsROARecommendation") |
| 43 | + de_score: int = Field(..., alias="ratingDetailsDEScore") |
| 44 | + de_rec: str = Field(..., alias="ratingDetailsDERecommendation") |
| 45 | + pe_score: int = Field(..., alias="ratingDetailsPEScore") |
| 46 | + pe_rec: str = Field(..., alias="ratingDetailsPERecommendation") |
| 47 | + pb_score: int = Field(..., alias="ratingDetailsPBScore") |
| 48 | + pb_rec: str = Field(..., alias="ratingDetailsPBRecommendation") |
| 49 | + |
| 50 | + |
| 51 | +class KeyMetricsTTM(BaseModel): |
| 52 | + rev_per_share_ttm: float = Field(..., alias="revenuePerShareTTM") |
| 53 | + net_income_per_share_ttm: float = Field(..., alias="netIncomePerShareTTM") |
| 54 | + fcf_per_share_ttm: float = Field(..., alias="freeCashFlowPerShareTTM") |
| 55 | + pe_ratio_ttm: float = Field(..., alias="peRatioTTM") |
| 56 | + ev_over_ebitda_ttm: float = Field(..., alias="enterpriseValueOverEBITDATTM") |
| 57 | + ev_to_fcf_ttm: float = Field(..., alias="evToFreeCashFlowTTM") |
| 58 | + fcf_yield_ttm: float = Field(..., alias="freeCashFlowYieldTTM") |
| 59 | + pts_ratio_ttm: float = Field(..., alias="priceToSalesRatioTTM") |
| 60 | + ptb_ratio_ttm: float = Field(..., alias="ptbRatioTTM") |
| 61 | + pfcf_ratio_ttm: float = Field(..., alias="pfcfRatioTTM") |
| 62 | + dvd_yield_pct_ttm: float = Field(..., alias="dividendYieldPercentageTTM") |
| 63 | + dvd_per_share_ttm: float = Field(..., alias="dividendPerShareTTM") |
| 64 | + payout_ratio_ttm: float = Field(..., alias="payoutRatioTTM") |
| 65 | + |
| 66 | + |
| 67 | +class KeyMetrics(BaseModel): |
| 68 | + symbol: str |
| 69 | + date: str |
| 70 | + rev_per_share: float = Field(..., alias="revenuePerShare") |
| 71 | + fcf_per_share: float = Field(..., alias="freeCashFlowPerShare") |
| 72 | + pe_ratio: float = Field(..., alias="peRatio") |
| 73 | + ev_over_ebitda: float = Field(..., alias="enterpriseValueOverEBITDA") |
| 74 | + ev_to_fcf: float = Field(..., alias="evToFreeCashFlow") |
| 75 | + fcf_yield: float = Field(..., alias="freeCashFlowYield") |
| 76 | + |
| 77 | + |
| 78 | +class Growth(BaseModel): |
| 79 | + symbol: str |
| 80 | + date: str |
| 81 | + rev_growth: float = Field(..., alias="revenueGrowth") |
| 82 | + eps_growth: float = Field(..., alias="epsdilutedGrowth") |
| 83 | + dps_growth: float = Field(..., alias="dividendsperShareGrowth") |
| 84 | + fcf_growth: float = Field(..., alias="freeCashFlowGrowth") |
| 85 | + debt_growth: float = Field(..., alias="debtGrowth") |
| 86 | + fiveY_rev_growth_per_share: float = Field(..., alias="fiveYRevenueGrowthPerShare") |
| 87 | + fiveY_ni_growth_per_share: float = Field(..., alias="fiveYNetIncomeGrowthPerShare") |
| 88 | + fiveY_dps_growth_per_share: float = Field(..., alias="fiveYDividendperShareGrowthPerShare") |
| 89 | + fiveY_opcf_growth_per_share: float = Field(..., alias="fiveYOperatingCFGrowthPerShare") |
| 90 | + |
| 91 | + |
| 92 | + |
| 93 | +class CombinedModel(BaseModel): |
| 94 | + profile: list[CompanyProfile] |
| 95 | + quote: list[Quote] |
| 96 | + ratings: list[Ratings] |
| 97 | + key_metrics_ttm: list[KeyMetricsTTM] |
| 98 | + key_metrics: list[KeyMetrics] |
| 99 | + growth: list[Growth] |
| 100 | + |
0 commit comments