summaryrefslogtreecommitdiffstats
path: root/openbb_platform/core/openbb_core/provider/standard_models/balance_sheet_growth.py
blob: 746eaacf0e3c51a1cf1750e7bc4f48c659985b1d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
"""Balance Sheet Statement Growth Standard Model."""

from datetime import date as dateType
from typing import List, Optional, Set, Union

from pydantic import Field, field_validator

from openbb_core.provider.abstract.data import Data
from openbb_core.provider.abstract.query_params import QueryParams
from openbb_core.provider.utils.descriptions import (
    DATA_DESCRIPTIONS,
    QUERY_DESCRIPTIONS,
)


class BalanceSheetGrowthQueryParams(QueryParams):
    """Balance Sheet Statement Growth Query."""

    symbol: str = Field(description=QUERY_DESCRIPTIONS.get("symbol", ""))
    limit: int = Field(default=10, description=QUERY_DESCRIPTIONS.get("limit", ""))

    @field_validator("symbol", mode="before", check_fields=False)
    @classmethod
    def upper_symbol(cls, v: str):
        """Convert symbol to uppercase."""
        return v.upper()


class BalanceSheetGrowthData(Data):
    """Balance Sheet Statement Growth Data."""

    symbol: Optional[str] = Field(
        default=None, description=DATA_DESCRIPTIONS.get("symbol", "")
    )
    date: dateType = Field(description=DATA_DESCRIPTIONS.get("date", ""))
    period: str = Field(description="Reporting period.")
    growth_cash_and_cash_equivalents: float = Field(
        description="Growth rate of cash and cash equivalents."
    )
    growth_short_term_investments: float = Field(
        description="Growth rate of short-term investments."
    )
    growth_cash_and_short_term_investments: float = Field(
        description="Growth rate of cash and short-term investments."
    )
    growth_net_receivables: float = Field(description="Growth rate of net receivables.")
    growth_inventory: float = Field(description="Growth rate of inventory.")
    growth_other_current_assets: float = Field(
        description="Growth rate of other current assets."
    )
    growth_total_current_assets: float = Field(
        description="Growth rate of total current assets."
    )
    growth_property_plant_equipment_net: float = Field(
        description="Growth rate of net property, plant, and equipment."
    )
    growth_goodwill: float = Field(description="Growth rate of goodwill.")
    growth_intangible_assets: float = Field(
        description="Growth rate of intangible assets."
    )
    growth_goodwill_and_intangible_assets: float = Field(
        description="Growth rate of goodwill and intangible assets."
    )
    growth_long_term_investments: float = Field(
        description="Growth rate of long-term investments."
    )
    growth_tax_assets: float = Field(description="Growth rate of tax assets.")
    growth_other_non_current_assets: float = Field(
        description="Growth rate of other non-current assets."
    )
    growth_total_non_current_assets: float = Field(
        description="Growth rate of total non-current assets."
    )
    growth_other_assets: float = Field(description="Growth rate of other assets.")
    growth_total_assets: float = Field(description="Growth rate of total assets.")
    growth_account_payables: float = Field(
        description="Growth rate of accounts payable."
    )
    growth_short_term_debt: float = Field(description="Growth rate of short-term debt.")
    growth_tax_payables: float = Field(description="Growth rate of tax payables.")
    growth_deferred_revenue: float = Field(
        description="Growth rate of deferred revenue."
    )
    growth_other_current_liabilities: float = Field(
        description="Growth rate of other current liabilities."
    )
    growth_total_current_liabilities: float = Field(
        description="Growth rate of total current liabilities."
    )
    growth_long_term_debt: float = Field(description="Growth rate of long-term debt.")
    growth_deferred_revenue_non_current: float = Field(
        description="Growth rate of non-current deferred revenue."
    )
    growth_deferrred_tax_liabilities_non_current: float = Field(
        description="Growth rate of non-current deferred tax liabilities."
    )
    growth_other_non_current_liabilities: float = Field(
        description="Growth rate of other non-current liabilities."
    )
    growth_total_non_current_liabilities: float = Field(
        description="Growth rate of total non-current liabilities."
    )
    growth_other_liabilities: float = Field(
        description="Growth rate of other liabilities."
    )
    growth_total_liabilities: float = Field(
        description="Growth rate of total liabilities."
    )
    growth_common_stock: float = Field(description="Growth rate of common stock.")
    growth_retained_earnings: float = Field(
        description="Growth rate of retained earnings."
    )
    growth_accumulated_other_comprehensive_income_loss: float = Field(
        description="Growth rate of accumulated other comprehensive income/loss."
    )
    growth_othertotal_stockholders_equity: float = Field(
        description="Growth rate of other total stockholders' equity."
    )
    growth_total_stockholders_equity: float = Field(
        description="Growth rate of total stockholders' equity."
    )
    growth_total_liabilities_and_stockholders_equity: float = Field(
        description="Growth rate of total liabilities and stockholders' equity."
    )
    growth_total_investments: float = Field(
        description="Growth rate of total investments."
    )
    growth_total_debt: float = Field(description="Growth rate of total debt.")
    growth_net_debt: float = Field(description="Growth rate of net debt.")

    @field_validator("symbol", mode="before", check_fields=False)
    @classmethod
    def upper_symbol(cls, v: Union[str, List[str], Set[str]]):
        """Convert symbol to uppercase."""
        if isinstance(v, str):
            return v.upper()
        return ",".join([symbol.upper() for symbol in list(v)]) if v else None