From 5fecd9de96b5c5434a199c2fdf2c9d888b32040f Mon Sep 17 00:00:00 2001 From: Danglewood <85772166+deeleeramone@users.noreply.github.com> Date: Sun, 26 May 2024 07:07:51 -0700 Subject: [PATCH] [BugFix] Add `json_schema_extra` With Choices To Provider 'period' Field (#6451) * add json_schema_extra choices to provider 'period' field * black * unused imports * mypy * pytest --------- Co-authored-by: Igor Radovanovic <74266147+IgorWounds@users.noreply.github.com> --- .../standard_models/balance_sheet_growth.py | 130 +-- .../standard_models/cash_flow_growth.py | 117 +-- .../income_statement_growth.py | 102 +-- .../equity/integration/test_equity_api.py | 4 +- .../equity/integration/test_equity_python.py | 4 +- openbb_platform/openbb/assets/reference.json | 769 ++++++++++-------- .../openbb/package/equity_fundamental.py | 542 ++++++------ .../fmp/openbb_fmp/models/balance_sheet.py | 4 +- .../openbb_fmp/models/balance_sheet_growth.py | 222 ++++- .../fmp/openbb_fmp/models/cash_flow.py | 5 +- .../fmp/openbb_fmp/models/cash_flow_growth.py | 185 ++++- .../fmp/openbb_fmp/models/income_statement.py | 9 +- .../models/income_statement_growth.py | 173 +++- ...test_fmp_balance_sheet_growth_fetcher.yaml | 2 +- ...mp_cash_flow_statement_growth_fetcher.yaml | 2 +- .../providers/fmp/tests/test_fmp_fetchers.py | 6 +- .../openbb_intrinio/models/balance_sheet.py | 5 +- .../openbb_intrinio/models/cash_flow.py | 11 +- .../models/income_statement.py | 30 +- .../openbb_polygon/models/balance_sheet.py | 109 +-- .../openbb_polygon/models/cash_flow.py | 59 +- .../openbb_polygon/models/income_statement.py | 34 +- .../openbb_yfinance/models/balance_sheet.py | 5 +- .../openbb_yfinance/models/cash_flow.py | 5 +- .../models/income_statement.py | 5 +- 25 files changed, 1510 insertions(+), 1029 deletions(-) diff --git a/openbb_platform/core/openbb_core/provider/standard_models/balance_sheet_growth.py b/openbb_platform/core/openbb_core/provider/standard_models/balance_sheet_growth.py index e2aff45cb5d..429a623407c 100644 --- a/openbb_platform/core/openbb_core/provider/standard_models/balance_sheet_growth.py +++ b/openbb_platform/core/openbb_core/provider/standard_models/balance_sheet_growth.py @@ -1,23 +1,26 @@ """Balance Sheet Statement Growth Standard Model.""" from datetime import date as dateType -from typing import List, Optional, Set, Union +from typing import Optional 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, -) +from openbb_core.provider.utils.descriptions import 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", "")) + period: str = Field( + default="annual", + description=QUERY_DESCRIPTIONS.get("period", ""), + ) + limit: Optional[int] = Field( + default=10, description=QUERY_DESCRIPTIONS.get("limit", "") + ) @field_validator("symbol", mode="before", check_fields=False) @classmethod @@ -25,113 +28,20 @@ class BalanceSheetGrowthQueryParams(QueryParams): """Convert field to uppercase.""" return v.upper() + @field_validator("period", mode="before", check_fields=False) + @classmethod + def to_lower(cls, v: Optional[str]) -> Optional[str]: + """Convert field to lowercase.""" + return v.lower() if v else v + class BalanceSheetGrowthData(Data): """Balance Sheet Statement Growth Data.""" - symbol: Optional[str] = Field( - default=None, description=DATA_DESCRIPTIONS.get("symbol", "") + period_ending: dateType = Field(description="The end date of the reporting period.") + fiscal_period: Optional[str] = Field( + description="The fiscal period of the report.", default=None ) - 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." + fiscal_year: Optional[int] = Field( + description="The fiscal year of the fiscal period.", default=None ) - 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 to_upper(cls, v: Union[str, List[str], Set[str]]): - """Convert field to uppercase.""" - if isinstance(v, str): - return v.upper() - return ",".join([symbol.upper() for symbol in list(v)]) if v else None diff --git a/openbb_platform/core/openbb_core/provider/standard_models/cash_flow_growth.py b/openbb_platform/core/openbb_core/provider/standard_models/cash_flow_growth.py index 77dd5d5ef86..43d52fd3fbb 100644 --- a/openbb_platform/core/openbb_core/provider/standard_models/cash_flow_growth.py +++ b/openbb_platform/core/openbb_core/provider/standard_models/cash_flow_growth.py @@ -1,23 +1,26 @@ """Cash Flow Statement Growth Standard Model.""" from datetime import date as dateType -from typing import List, Optional, Set, Union +from typing import Optional 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, -) +from openbb_core.provider.utils.descriptions import QUERY_DESCRIPTIONS class CashFlowStatementGrowthQueryParams(QueryParams): """Cash Flow Statement Growth Query.""" symbol: str = Field(description=QUERY_DESCRIPTIONS.get("symbol", "")) - limit: int = Field(default=10, description=QUERY_DESCRIPTIONS.get("limit", "")) + period: str = Field( + default="annual", + description=QUERY_DESCRIPTIONS.get("period", ""), + ) + limit: Optional[int] = Field( + default=10, description=QUERY_DESCRIPTIONS.get("limit", "") + ) @field_validator("symbol", mode="before", check_fields=False) @classmethod @@ -25,100 +28,20 @@ class CashFlowStatementGrowthQueryParams(QueryParams): """Convert field to uppercase.""" return v.upper() + @field_validator("period", mode="before", check_fields=False) + @classmethod + def to_lower(cls, v: Optional[str]) -> Optional[str]: + """Convert field to lowercase.""" + return v.lower() if v else v + class CashFlowStatementGrowthData(Data): """Cash Flow Statement Growth Data.""" - symbol: Optional[str] = Field( - default=None, description=DATA_DESCRIPTIONS.get("symbol", "") + period_ending: dateType = Field(description="The end date of the reporting period.") + fiscal_period: Optional[str] = Field( + description="The fiscal period of the report.", default=None ) - date: dateType = Field(description=DATA_DESCRIPTIONS.get("date", "")) - period: str = Field(description="Period the statement is returned for.") - growth_net_income: float = Field(description="Growth rate of net income.") - growth_depreciation_and_amortization: float = Field( - description="Growth rate of depreciation and amortization." + fiscal_year: Optional[int] = Field( + description="The fiscal year of the fiscal period.", default=None ) - growth_deferred_income_tax: float = Field( - description="Growth rate of deferred income tax." - ) - growth_stock_based_compensation: float = Field( - description="Growth rate of stock-based compensation." - ) - growth_change_in_working_capital: float = Field( - description="Growth rate of change in working capital." - ) - growth_accounts_receivables: float = Field( - description="Growth rate of accounts receivables." - ) - growth_inventory: float = Field(description="Growth rate of inventory.") - growth_accounts_payables: float = Field( - description="Growth rate of accounts payables." - ) - growth_other_working_capital: float = Field( - description="Growth rate of other working capital." - ) - growth_other_non_cash_items: float = Field( - description="Growth rate of other non-cash items." - ) - growth_net_cash_provided_by_operating_activities: float = Field( - description="Growth rate of net cash provided by operating activities." - ) - growth_investments_in_property_plant_and_equipment: float = Field( - description="Growth rate of investments in property, plant, and equipment." - ) - growth_acquisitions_net: float = Field( - description="Growth rate of net acquisitions." - ) - growth_purchases_of_investments: float = Field( - description="Growth rate of purchases of investments." - ) - growth_sales_maturities_of_investments: float = Field( - description="Growth rate of sales maturities of investments." - ) - growth_other_investing_activities: float = Field( - description="Growth rate of other investing activities." - ) - growth_net_cash_used_for_investing_activities: float = Field( - description="Growth rate of net cash used for investing activities." - ) - growth_debt_repayment: float = Field(description="Growth rate of debt repayment.") - growth_common_stock_issued: float = Field( - description="Growth rate of common stock issued." - ) - growth_common_stock_repurchased: float = Field( - description="Growth rate of common stock repurchased." - ) - growth_dividends_paid: float = Field(description="Growth rate of dividends paid.") - growth_other_financing_activities: float = Field( - description="Growth rate of other financing activities." - ) - growth_net_cash_used_provided_by_financing_activities: float = Field( - description="Growth rate of net cash used/provided by financing activities." - ) - growth_effect_of_forex_changes_on_cash: float = Field( - description="Growth rate of the effect of foreign exchange changes on cash." - ) - growth_net_change_in_cash: float = Field( - description="Growth rate of net change in cash." - ) - growth_cash_at_end_of_period: float = Field( - description="Growth rate of cash at the end of the period." - ) - growth_cash_at_beginning_of_period: float = Field( - description="Growth rate of cash at the beginning of the period." - ) - growth_operating_cash_flow: float = Field( - description="Growth rate of operating cash flow." - ) - growth_capital_expenditure: float = Field( - description="Growth rate of capital expenditure." - ) - growth_free_cash_flow: float = Field(description="Growth rate of free cash flow.") - - @field_validator("symbol", mode="before", check_fields=False) - @classmethod - def to_upper(cls, v: Union[str, List[str], Set[str]]): - """Convert field to uppercase.""" - if isinstance(v, str): - return v.upper() - return ",".join([symbol.upper() for symbol in list(v)]) if v else None diff --git a/openbb_platform/core/openbb_core/provider/standard_models/income_statement_growth.py b/openbb_platform/core/openbb_core/provider/standard_models/income_statement_growth.py index 31fa068f7bc..6bb031db0a9 100644 --- a/openbb_platform/core/openbb_core/provider/standard_models/income_statement_growth.py +++ b/openbb_platform/core/openbb_core/provider/standard_models/income_statement_growth.py @@ -1,25 +1,25 @@ """Income Statement Growth Standard Model.""" from datetime import date as dateType -from typing import List, Literal, Optional, Set, Union +from typing import Optional 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, -) +from openbb_core.provider.utils.descriptions import QUERY_DESCRIPTIONS class IncomeStatementGrowthQueryParams(QueryParams): """Income Statement Growth Query.""" symbol: str = Field(description=QUERY_DESCRIPTIONS.get("symbol", "")) - limit: int = Field(default=10, description=QUERY_DESCRIPTIONS.get("limit", "")) - period: Literal["annual", "quarter"] = Field( - default="annual", description=QUERY_DESCRIPTIONS.get("period", "") + period: str = Field( + default="annual", + description=QUERY_DESCRIPTIONS.get("period", ""), + ) + limit: Optional[int] = Field( + default=10, description=QUERY_DESCRIPTIONS.get("limit", "") ) @field_validator("symbol", mode="before", check_fields=False) @@ -38,86 +38,10 @@ class IncomeStatementGrowthQueryParams(QueryParams): class IncomeStatementGrowthData(Data): """Income Statement Growth Data.""" - symbol: Optional[str] = Field( - default=None, description=DATA_DESCRIPTIONS.get("symbol", "") + period_ending: dateType = Field(description="The end date of the reporting period.") + fiscal_period: Optional[str] = Field( + description="The fiscal period of the report.", default=None ) - date: dateType = Field(description=DATA_DESCRIPTIONS.get("date", "")) - period: str = Field(description="Period the statement is returned for.") - growth_revenue: float = Field(description="Growth rate of total revenue.") - growth_cost_of_revenue: float = Field( - description="Growth rate of cost of goods sold." + fiscal_year: Optional[int] = Field( + description="The fiscal year of the fiscal period.", default=None ) - growth_gross_profit: float = Field(description="Growth rate of gross profit.") - growth_gross_profit_ratio: float = Field( - description="Growth rate of gross profit as a percentage of revenue." - ) - growth_research_and_development_expenses: float = Field( - description="Growth rate of expenses on research and development." - ) - growth_general_and_administrative_expenses: float = Field( - description="Growth rate of general and administrative expenses." - ) - growth_selling_and_marketing_expenses: float = Field( - description="Growth rate of expenses on selling and marketing activities." - ) - growth_other_expenses: float = Field( - description="Growth rate of other operating expenses." - ) - growth_operating_expenses: float = Field( - description="Growth rate of total operating expenses." - ) - growth_cost_and_expenses: float = Field( - description="Growth rate of total costs and expenses." - ) - growth_interest_expense: float = Field( - description="Growth rate of interest expenses." - ) - growth_depreciation_and_amortization: float = Field( - description="Growth rate of depreciation and amortization expenses." - ) - growth_ebitda: float = Field( - description="Growth rate of Earnings Before Interest, Taxes, Depreciation, and Amortization." - ) - growth_ebitda_ratio: float = Field( - description="Growth rate of EBITDA as a percentage of revenue." - ) - growth_operating_income: float = Field( - description="Growth rate of operating income." - ) - growth_operating_income_ratio: float = Field( - description="Growth rate of operating income as a percentage of revenue." - ) - growth_total_other_income_expenses_net: float = Field( - description="Growth rate of net total other income and expenses." - ) - growth_income_before_tax: float = Field( - description="Growth rate of income before taxes." - ) - growth_income_before_tax_ratio: float = Field( - description="Growth rate of income before taxes as a percentage of revenue." - ) - growth_income_tax_expense: float = Field( - description="Growth rate of income tax expenses." - ) - growth_net_income: float = Field(description="Growth rate of net income.") - growth_net_income_ratio: float = Field( - description="Growth rate of net income as a percentage of revenue." - ) - growth_eps: float = Field(description="Growth rate of Earnings Per Share (EPS).") - growth_eps_diluted: float = Field( - description="Growth rate of diluted Earnings Per Share (EPS)." - ) - growth_weighted_average_shs_out: float = Field( - description="Growth rate of weighted average shares outstanding." - ) - growth_weighted_average_shs_out_dil: float = Field( - description="Growth rate of diluted weighted average shares outstanding." - ) - - @field_validator("symbol", mode="before", check_fields=False) - @classmethod - def to_upper(cls, v: Union[str, List[str], Set[str]]): - """Convert field to uppercase.""" - if isinstance(v, str): - return v.upper() - return ",".join([symbol.upper() for symbol in list(v)]) if v else None diff --git a/openbb_platform/extensions/equity/integration/test_equity_api.py b/openbb_platform/extensions/equity/integration/test_equity_api.py index ffe57cda534..544bb8052b1 100644 --- a/openbb_platform/extensions/equity/integration/test_equity_api.py +++ b/openbb_platform/extensions/equity/integration/test_equity_api.py @@ -87,7 +87,7 @@ def test_equity_fundamental_balance(params, headers): @parametrize( "params", - [({"symbol": "AAPL", "limit": 10, "provider": "fmp"})], + [({"symbol": "AAPL", "limit": 10, "provider": "fmp", "period": "annual"})], ) @pytest.mark.integration def test_equity_fundamental_balance_growth(params, headers): @@ -231,7 +231,7 @@ def test_equity_fundamental_cash(params, headers): @parametrize( "params", - [({"symbol": "AAPL", "limit": 10, "provider": "fmp"})], + [({"symbol": "AAPL", "limit": 10, "provider": "fmp", "period": "annual"})], ) @pytest.mark.integration def test_equity_fundamental_cash_growth(params, headers): diff --git a/openbb_platform/extensions/equity/integration/test_equity_python.py b/openbb_platform/extensions/equity/integration/test_equity_python.py index 0e167cae8df..cb836f59019 100644 --- a/openbb_platform/extensions/equity/integration/test_equity_python.py +++ b/openbb_platform/extensions/equity/integration/test_equity_python.py @@ -83,7 +83,7 @@ def test_equity_fundamental_balance(params, obb): @parametrize( "params", [ - ({"symbol": "AAPL", "limit": 10, "provider": "fmp"}), + ({"symbol": "AAPL", "limit": 10, "provider": "fmp", "period": "annual"}), ], ) @pytest.mark.integration @@ -214,7 +214,7 @@ def test_equity_fundamental_cash(params, obb): @parametrize( "params", [ - ({"symbol": "AAPL", "limit": 10, "provider": "fmp"}), + ({"symbol": "AAPL", "limit": 10, "provider": "fmp", "period": "annual"}), ], ) @pytest.mark.integration diff --git a/openbb_platform/openbb/assets/reference.json b/openbb_platform/openbb/assets/reference.json index 61835911e88..0c01282e9c1 100644 --- a/openbb_platform/openbb/assets/reference.json +++ b/openbb_platform/openbb/assets/reference.json @@ -10500,7 +10500,10 @@ "description": "None", "default": "annual", "optional": true, - "choices": null + "choices": [ + "annual", + "quarter" + ] } ], "intrinio": [ @@ -10510,7 +10513,10 @@ "description": "None", "default": "annual", "optional": true, - "choices": null + "choices": [ + "annual", + "quarter" + ] }, { "name": "fiscal_year", @@ -10528,7 +10534,11 @@ "description": "None", "default": "annual", "optional": true, - "choices": null + "choices": [ + "annual", + "quarter", + "ttm" + ] }, { "name": "filing_date", @@ -10642,7 +10652,10 @@ "description": "None", "default": "annual", "optional": true, - "choices": null + "choices": [ + "annual", + "quarter" + ] } ] }, @@ -11829,7 +11842,7 @@ "polygon": [ { "name": "accounts_receivable", - "type": "int", + "type": "float", "description": "Accounts receivable", "default": null, "optional": true, @@ -11837,7 +11850,7 @@ }, { "name": "marketable_securities", - "type": "int", + "type": "float", "description": "Marketable securities", "default": null, "optional": true, @@ -11845,7 +11858,7 @@ }, { "name": "prepaid_expenses", - "type": "int", + "type": "float", "description": "Prepaid expenses", "default": null, "optional": true, @@ -11853,7 +11866,7 @@ }, { "name": "other_current_assets", - "type": "int", + "type": "float", "description": "Other current assets", "default": null, "optional": true, @@ -11861,7 +11874,7 @@ }, { "name": "total_current_assets", - "type": "int", + "type": "float", "description": "Total current assets", "default": null, "optional": true, @@ -11869,7 +11882,7 @@ }, { "name": "property_plant_equipment_net", - "type": "int", + "type": "float", "description": "Property plant and equipment net", "default": null, "optional": true, @@ -11877,7 +11890,7 @@ }, { "name": "inventory", - "type": "int", + "type": "float", "description": "Inventory", "default": null, "optional": true, @@ -11885,7 +11898,7 @@ }, { "name": "other_non_current_assets", - "type": "int", + "type": "float", "description": "Other non-current assets", "default": null, "optional": true, @@ -11893,7 +11906,7 @@ }, { "name": "total_non_current_assets", - "type": "int", + "type": "float", "description": "Total non-current assets", "default": null, "optional": true, @@ -11901,7 +11914,7 @@ }, { "name": "intangible_assets", - "type": "int", + "type": "float", "description": "Intangible assets", "default": null, "optional": true, @@ -11909,7 +11922,7 @@ }, { "name": "total_assets", - "type": "int", + "type": "float", "description": "Total assets", "default": null, "optional": true, @@ -11917,7 +11930,7 @@ }, { "name": "accounts_payable", - "type": "int", + "type": "float", "description": "Accounts payable", "default": null, "optional": true, @@ -11925,7 +11938,7 @@ }, { "name": "employee_wages", - "type": "int", + "type": "float", "description": "Employee wages", "default": null, "optional": true, @@ -11933,7 +11946,7 @@ }, { "name": "other_current_liabilities", - "type": "int", + "type": "float", "description": "Other current liabilities", "default": null, "optional": true, @@ -11941,7 +11954,7 @@ }, { "name": "total_current_liabilities", - "type": "int", + "type": "float", "description": "Total current liabilities", "default": null, "optional": true, @@ -11949,7 +11962,7 @@ }, { "name": "other_non_current_liabilities", - "type": "int", + "type": "float", "description": "Other non-current liabilities", "default": null, "optional": true, @@ -11957,7 +11970,7 @@ }, { "name": "total_non_current_liabilities", - "type": "int", + "type": "float", "description": "Total non-current liabilities", "default": null, "optional": true, @@ -11965,7 +11978,7 @@ }, { "name": "long_term_debt", - "type": "int", + "type": "float", "description": "Long term debt", "default": null, "optional": true, @@ -11973,7 +11986,7 @@ }, { "name": "total_liabilities", - "type": "int", + "type": "float", "description": "Total liabilities", "default": null, "optional": true, @@ -11981,7 +11994,7 @@ }, { "name": "minority_interest", - "type": "int", + "type": "float", "description": "Minority interest", "default": null, "optional": true, @@ -11989,7 +12002,7 @@ }, { "name": "temporary_equity_attributable_to_parent", - "type": "int", + "type": "float", "description": "Temporary equity attributable to parent", "default": null, "optional": true, @@ -11997,7 +12010,7 @@ }, { "name": "equity_attributable_to_parent", - "type": "int", + "type": "float", "description": "Equity attributable to parent", "default": null, "optional": true, @@ -12005,7 +12018,7 @@ }, { "name": "temporary_equity", - "type": "int", + "type": "float", "description": "Temporary equity", "default": null, "optional": true, @@ -12013,7 +12026,7 @@ }, { "name": "preferred_stock", - "type": "int", + "type": "float", "description": "Preferred stock", "default": null, "optional": true, @@ -12021,7 +12034,7 @@ }, { "name": "redeemable_non_controlling_interest", - "type": "int", + "type": "float", "description": "Redeemable non-controlling interest", "default": null, "optional": true, @@ -12029,32 +12042,32 @@ }, { "name": "redeemable_non_controlling_interest_other", - "type": "int", + "type": "float", "description": "Redeemable non-controlling interest other", "default": null, "optional": true, "choices": null }, { - "name": "total_stock_holders_equity", - "type": "int", + "name": "total_shareholders_equity", + "type": "float", "description": "Total stock holders equity", "default": null, "optional": true, "choices": null }, { - "name": "total_liabilities_and_stock_holders_equity", - "type": "int", - "description": "Total liabilities and stockholders equity", + "name": "total_equity", + "type": "float", + "description": "Total equity", "default": null, "optional": true, "choices": null }, { - "name": "total_equity", - "type": "int", - "description": "Total equity", + "name": "total_liabilities_and_shareholders_equity", + "type": "float", + "description": "Total liabilities and stockholders equity", "default": null, "optional": true, "choices": null @@ -12081,6 +12094,14 @@ "optional": false, "choices": null }, + { + "name": "period", + "type": "str", + "description": "Time period of the data to return.", + "default": "annual", + "optional": true, + "choices": null + }, { "name": "limit", "type": "int", @@ -12097,7 +12118,19 @@ "optional": true } ], - "fmp": [] + "fmp": [ + { + "name": "period", + "type": "Literal['annual', 'quarter']", + "description": "None", + "default": "annual", + "optional": true, + "choices": [ + "annual", + "quarter" + ] + } + ] }, "returns": { "OBBject": [ @@ -12131,25 +12164,35 @@ "data": { "standard": [ { - "name": "symbol", - "type": "str", - "description": "Symbol representing the entity requested in the data.", - "default": null, - "optional": true, - "choices": null - }, - { - "name": "date", + "name": "period_ending", "type": "date", - "description": "The date of the data.", + "description": "The end date of the reporting period.", "default": "", "optional": false, "choices": null }, { - "name": "period", + "name": "fiscal_period", "type": "str", - "description": "Reporting period.", + "description": "The fiscal period of the report.", + "default": null, + "optional": true, + "choices": null + }, + { + "name": "fiscal_year", + "type": "int", + "description": "The fiscal year of the fiscal period.", + "default": null, + "optional": true, + "choices": null + } + ], + "fmp": [ + { + "name": "symbol", + "type": "str", + "description": "Symbol representing the entity requested in the data.", "default": "", "optional": false, "choices": null @@ -12158,56 +12201,56 @@ "name": "growth_cash_and_cash_equivalents", "type": "float", "description": "Growth rate of cash and cash equivalents.", - "default": "", - "optional": false, + "default": null, + "optional": true, "choices": null }, { "name": "growth_short_term_investments", "type": "float", "description": "Growth rate of short-term investments.", - "default": "", - "optional": false, + "default": null, + "optional": true, "choices": null }, { "name": "growth_cash_and_short_term_investments", "type": "float", "description": "Growth rate of cash and short-term investments.", - "default": "", - "optional": false, + "default": null, + "optional": true, "choices": null }, { "name": "growth_net_receivables", "type": "float", "description": "Growth rate of net receivables.", - "default": "", - "optional": false, + "default": null, + "optional": true, "choices": null }, { "name": "growth_inventory", "type": "float", "description": "Growth rate of inventory.", - "default": "", - "optional": false, + "default": null, + "optional": true, "choices": null }, { "name": "growth_other_current_assets", "type": "float", "description": "Growth rate of other current assets.", - "default": "", - "optional": false, + "default": null, + "optional": true, "choices": null }, { "name": "growth_total_current_assets", "type": "float", "description": "Growth rate of total current assets.", - "default": "", - "optional": false, + "default": null, + "optional": true, "choices": null }, { @@ -12246,136 +12289,136 @@ "name": "growth_long_term_investments", "type": "float", "description": "Growth rate of long-term investments.", - "default": "", - "optional": false, + "default": null, + "optional": true, "choices": null }, { "name": "growth_tax_assets", "type": "float", "description": "Growth rate of tax assets.", - "default": "", - "optional": false, + "default": null, + "optional": true, "choices": null }, { "name": "growth_other_non_current_assets", "type": "float", "description": "Growth rate of other non-current assets.", - "default": "", - "optional": false, + "default": null, + "optional": true, "choices": null }, { "name": "growth_total_non_current_assets", "type": "float", "description": "Growth rate of total non-current assets.", - "default": "", - "optional": false, + "default": null, + "optional": true, "choices": null }, { "name": "growth_other_assets", "type": "float", "description": "Growth rate of other assets.", - "default": "", - "optional": false, + "default": null, + "optional": true, "choices": null }, { "name": "growth_total_assets", "type": "float", "description": "Growth rate of total assets.", - "default": "", - "optional": false, + "default": null, + "optional": true, "choices": null }, { "name": "growth_account_payables", "type": "float", "description": "Growth rate of accounts payable.", - "default": "", - "optional": false, + "default": null, + "optional": true, "choices": null }, { "name": "growth_short_term_debt", "type": "float", "description": "Growth rate of short-term debt.", - "default": "", - "optional": false, + "default": null, + "optional": true, "choices": null }, { "name": "growth_tax_payables", "type": "float", "description": "Growth rate of tax payables.", - "default": "", - "optional": false, + "default": null, + "optional": true, "choices": null }, { "name": "growth_deferred_revenue", "type": "float", "description": "Growth rate of deferred revenue.", - "default": "", - "optional": false, + "default": null, + "optional": true, "choices": null }, { "name": "growth_other_current_liabilities", "type": "float", "description": "Growth rate of other current liabilities.", - "default": "", - "optional": false, + "default": null, + "optional": true, "choices": null }, { "name": "growth_total_current_liabilities", "type": "float", "description": "Growth rate of total current liabilities.", - "default": "", - "optional": false, + "default": null, + "optional": true, "choices": null }, { "name": "growth_long_term_debt", "type": "float", "description": "Growth rate of long-term debt.", - "default": "", - "optional": false, + "default": null, + "optional": true, "choices": null }, { "name": "growth_deferred_revenue_non_current", "type": "float", "description": "Growth rate of non-current deferred revenue.", - "default": "", - "optional": false, + "default": null, + "optional": true, "choices": null }, { "name": "growth_deferrred_tax_liabilities_non_current", "type": "float", "description": "Growth rate of non-current deferred tax liabilities.", - "default": "", - "optional": false, + "default": null, + "optional": true, "choices": null }, { "name": "growth_other_non_current_liabilities", "type": "float", "description": "Growth rate of other non-current liabilities.", - "default": "", - "optional": false, + "default": null, + "optional": true, "choices": null }, { "name": "growth_total_non_current_liabilities", "type": "float", "description": "Growth rate of total non-current liabilities.", - "default": "", - "optional": false, + "default": null, + "optional": true, "choices": null }, { @@ -12411,7 +12454,7 @@ "choices": null }, { - "name": "growth_accumulated_other_comprehensive_income_loss", + "name": "growth_accumulated_other_comprehensive_income", "type": "float", "description": "Growth rate of accumulated other comprehensive income/loss.", "default": "", @@ -12419,55 +12462,54 @@ "choices": null }, { - "name": "growth_othertotal_stockholders_equity", + "name": "growth_other_total_shareholders_equity", "type": "float", "description": "Growth rate of other total stockholders' equity.", - "default": "", - "optional": false, + "default": null, + "optional": true, "choices": null }, { - "name": "growth_total_stockholders_equity", + "name": "growth_total_shareholders_equity", "type": "float", "description": "Growth rate of total stockholders' equity.", - "default": "", - "optional": false, + "default": null, + "optional": true, "choices": null }, { - "name": "growth_total_liabilities_and_stockholders_equity", + "name": "growth_total_liabilities_and_shareholders_equity", "type": "float", "description": "Growth rate of total liabilities and stockholders' equity.", - "default": "", - "optional": false, + "default": null, + "optional": true, "choices": null }, { "name": "growth_total_investments", "type": "float", "description": "Growth rate of total investments.", - "default": "", - "optional": false, + "default": null, + "optional": true, "choices": null }, { "name": "growth_total_debt", "type": "float", "description": "Growth rate of total debt.", - "default": "", - "optional": false, + "default": null, + "optional": true, "choices": null }, { "name": "growth_net_debt", "type": "float", "description": "Growth rate of net debt.", - "default": "", - "optional": false, + "default": null, + "optional": true, "choices": null } - ], - "fmp": [] + ] }, "model": "BalanceSheetGrowth" }, @@ -12519,7 +12561,10 @@ "description": "None", "default": "annual", "optional": true, - "choices": null + "choices": [ + "annual", + "quarter" + ] } ], "intrinio": [ @@ -12529,7 +12574,12 @@ "description": "None", "default": "annual", "optional": true, - "choices": null + "choices": [ + "annual", + "quarter", + "ttm", + "ytd" + ] }, { "name": "fiscal_year", @@ -12543,11 +12593,15 @@ "polygon": [ { "name": "period", - "type": "Literal['annual', 'quarter']", + "type": "Literal['annual', 'quarter', 'ttm']", "description": "None", "default": "annual", "optional": true, - "choices": null + "choices": [ + "annual", + "quarter", + "ttm" + ] }, { "name": "filing_date", @@ -13376,7 +13430,7 @@ "polygon": [ { "name": "net_cash_flow_from_operating_activities_continuing", - "type": "int", + "type": "float", "description": "Net cash flow from operating activities continuing.", "default": null, "optional": true, @@ -13384,7 +13438,7 @@ }, { "name": "net_cash_flow_from_operating_activities_discontinued", - "type": "int", + "type": "float", "description": "Net cash flow from operating activities discontinued.", "default": null, "optional": true, @@ -13392,7 +13446,7 @@ }, { "name": "net_cash_flow_from_operating_activities", - "type": "int", + "type": "float", "description": "Net cash flow from operating activities.", "default": null, "optional": true, @@ -13400,7 +13454,7 @@ }, { "name": "net_cash_flow_from_investing_activities_continuing", - "type": "int", + "type": "float", "description": "Net cash flow from investing activities continuing.", "default": null, "optional": true, @@ -13408,7 +13462,7 @@ }, { "name": "net_cash_flow_from_investing_activities_discontinued", - "type": "int", + "type": "float", "description": "Net cash flow from investing activities discontinued.", "default": null, "optional": true, @@ -13416,7 +13470,7 @@ }, { "name": "net_cash_flow_from_investing_activities", - "type": "int", + "type": "float", "description": "Net cash flow from investing activities.", "default": null, "optional": true, @@ -13424,7 +13478,7 @@ }, { "name": "net_cash_flow_from_financing_activities_continuing", - "type": "int", + "type": "float", "description": "Net cash flow from financing activities continuing.", "default": null, "optional": true, @@ -13432,7 +13486,7 @@ }, { "name": "net_cash_flow_from_financing_activities_discontinued", - "type": "int", + "type": "float", "description": "Net cash flow from financing activities discontinued.", "default": null, "optional": true, @@ -13440,7 +13494,7 @@ }, { "name": "net_cash_flow_from_financing_activities", - "type": "int", + "type": "float", "description": "Net cash flow from financing activities.", "default": null, "optional": true, @@ -13448,7 +13502,7 @@ }, { "name": "net_cash_flow_continuing", - "type": "int", + "type": "float", "description": "Net cash flow continuing.", "default": null, "optional": true, @@ -13456,7 +13510,7 @@ }, { "name": "net_cash_flow_discontinued", - "type": "int", + "type": "float", "description": "Net cash flow discontinued.", "default": null, "optional": true, @@ -13464,7 +13518,7 @@ }, { "name": "exchange_gains_losses", - "type": "int", + "type": "float", "description": "Exchange gains losses.", "default": null, "optional": true, @@ -13472,7 +13526,7 @@ }, { "name": "net_cash_flow", - "type": "int", + "type": "float", "description": "Net cash flow.", "default": null, "optional": true, @@ -13636,6 +13690,14 @@ "optional": false, "choices": null }, + { + "name": "period", + "type": "str", + "description": "Time period of the data to return.", + "default": "annual", + "optional": true, + "choices": null + }, { "name": "limit", "type": "int", @@ -13652,7 +13714,19 @@ "optional": true } ], - "fmp": [] + "fmp": [ + { + "name": "period", + "type": "Literal['annual', 'quarter']", + "description": "None", + "default": "annual", + "optional": true, + "choices": [ + "annual", + "quarter" + ] + } + ] }, "returns": { "OBBject": [ @@ -13686,25 +13760,35 @@ "data": { "standard": [ { - "name": "symbol", - "type": "str", - "description": "Symbol representing the entity requested in the data.", - "default": null, - "optional": true, - "choices": null - }, - { - "name": "date", + "name": "period_ending", "type": "date", - "description": "The date of the data.", + "description": "The end date of the reporting period.", "default": "", "optional": false, "choices": null }, { - "name": "period", + "name": "fiscal_period", "type": "str", - "description": "Period the statement is returned for.", + "description": "The fiscal period of the report.", + "default": null, + "optional": true, + "choices": null + }, + { + "name": "fiscal_year", + "type": "int", + "description": "The fiscal year of the fiscal period.", + "default": null, + "optional": true, + "choices": null + } + ], + "fmp": [ + { + "name": "symbol", + "type": "str", + "description": "Symbol representing the entity requested in the data.", "default": "", "optional": false, "choices": null @@ -13713,244 +13797,243 @@ "name": "growth_net_income", "type": "float", "description": "Growth rate of net income.", - "default": "", - "optional": false, + "default": null, + "optional": true, "choices": null }, { "name": "growth_depreciation_and_amortization", "type": "float", "description": "Growth rate of depreciation and amortization.", - "default": "", - "optional": false, + "default": null, + "optional": true, "choices": null }, { "name": "growth_deferred_income_tax", "type": "float", "description": "Growth rate of deferred income tax.", - "default": "", - "optional": false, + "default": null, + "optional": true, "choices": null }, { "name": "growth_stock_based_compensation", "type": "float", "description": "Growth rate of stock-based compensation.", - "default": "", - "optional": false, + "default": null, + "optional": true, "choices": null }, { "name": "growth_change_in_working_capital", "type": "float", "description": "Growth rate of change in working capital.", - "default": "", - "optional": false, + "default": null, + "optional": true, "choices": null }, { - "name": "growth_accounts_receivables", + "name": "growth_account_receivables", "type": "float", "description": "Growth rate of accounts receivables.", - "default": "", - "optional": false, + "default": null, + "optional": true, "choices": null }, { "name": "growth_inventory", "type": "float", "description": "Growth rate of inventory.", - "default": "", - "optional": false, + "default": null, + "optional": true, "choices": null }, { - "name": "growth_accounts_payables", + "name": "growth_account_payable", "type": "float", - "description": "Growth rate of accounts payables.", - "default": "", - "optional": false, + "description": "Growth rate of account payable.", + "default": null, + "optional": true, "choices": null }, { "name": "growth_other_working_capital", "type": "float", "description": "Growth rate of other working capital.", - "default": "", - "optional": false, + "default": null, + "optional": true, "choices": null }, { "name": "growth_other_non_cash_items", "type": "float", "description": "Growth rate of other non-cash items.", - "default": "", - "optional": false, + "default": null, + "optional": true, "choices": null }, { - "name": "growth_net_cash_provided_by_operating_activities", + "name": "growth_net_cash_from_operating_activities", "type": "float", "description": "Growth rate of net cash provided by operating activities.", - "default": "", - "optional": false, + "default": null, + "optional": true, "choices": null }, { - "name": "growth_investments_in_property_plant_and_equipment", + "name": "growth_purchase_of_property_plant_and_equipment", "type": "float", "description": "Growth rate of investments in property, plant, and equipment.", - "default": "", - "optional": false, + "default": null, + "optional": true, "choices": null }, { - "name": "growth_acquisitions_net", + "name": "growth_acquisitions", "type": "float", "description": "Growth rate of net acquisitions.", - "default": "", - "optional": false, + "default": null, + "optional": true, "choices": null }, { - "name": "growth_purchases_of_investments", + "name": "growth_purchase_of_investment_securities", "type": "float", "description": "Growth rate of purchases of investments.", - "default": "", - "optional": false, + "default": null, + "optional": true, "choices": null }, { - "name": "growth_sales_maturities_of_investments", + "name": "growth_sale_and_maturity_of_investments", "type": "float", "description": "Growth rate of sales maturities of investments.", - "default": "", - "optional": false, + "default": null, + "optional": true, "choices": null }, { "name": "growth_other_investing_activities", "type": "float", "description": "Growth rate of other investing activities.", - "default": "", - "optional": false, + "default": null, + "optional": true, "choices": null }, { - "name": "growth_net_cash_used_for_investing_activities", + "name": "growth_net_cash_from_investing_activities", "type": "float", "description": "Growth rate of net cash used for investing activities.", - "default": "", - "optional": false, + "default": null, + "optional": true, "choices": null }, { - "name": "growth_debt_repayment", + "name": "growth_repayment_of_debt", "type": "float", "description": "Growth rate of debt repayment.", - "default": "", - "optional": false, + "default": null, + "optional": true, "choices": null }, { "name": "growth_common_stock_issued", "type": "float", "description": "Growth rate of common stock issued.", - "default": "", - "optional": false, + "default": null, + "optional": true, "choices": null }, { "name": "growth_common_stock_repurchased", "type": "float", "description": "Growth rate of common stock repurchased.", - "default": "", - "optional": false, + "default": null, + "optional": true, "choices": null }, { "name": "growth_dividends_paid", "type": "float", "description": "Growth rate of dividends paid.", - "default": "", - "optional": false, + "default": null, + "optional": true, "choices": null }, { "name": "growth_other_financing_activities", "type": "float", "description": "Growth rate of other financing activities.", - "default": "", - "optional": false, + "default": null, + "optional": true, "choices": null }, { - "name": "growth_net_cash_used_provided_by_financing_activities", + "name": "growth_net_cash_from_financing_activities", "type": "float", "description": "Growth rate of net cash used/provided by financing activities.", - "default": "", - "optional": false, + "default": null, + "optional": true, "choices": null }, { - "name": "growth_effect_of_forex_changes_on_cash", + "name": "growth_effect_of_exchange_rate_changes_on_cash", "type": "float", "description": "Growth rate of the effect of foreign exchange changes on cash.", - "default": "", - "optional": false, + "default": null, + "optional": true, "choices": null }, { - "name": "growth_net_change_in_cash", + "name": "growth_net_change_in_cash_and_equivalents", "type": "float", "description": "Growth rate of net change in cash.", - "default": "", - "optional": false, - "choices": null - }, - { - "name": "growth_cash_at_end_of_period", - "type": "float", - "description": "Growth rate of cash at the end of the period.", - "default": "", - "optional": false, + "default": null, + "optional": true, "choices": null }, { "name": "growth_cash_at_beginning_of_period", "type": "float", "description": "Growth rate of cash at the beginning of the period.", - "default": "", - "optional": false, + "default": null, + "optional": true, + "choices": null + }, + { + "name": "growth_cash_at_end_of_period", + "type": "float", + "description": "Growth rate of cash at the end of the period.", + "default": null, + "optional": true, "choices": null }, { "name": "growth_operating_cash_flow", "type": "float", "description": "Growth rate of operating cash flow.", - "default": "", - "optional": false, + "default": null, + "optional": true, "choices": null }, { "name": "growth_capital_expenditure", "type": "float", "description": "Growth rate of capital expenditure.", - "default": "", - "optional": false, + "default": null, + "optional": true, "choices": null }, { "name": "growth_free_cash_flow", "type": "float", "description": "Growth rate of free cash flow.", - "default": "", - "optional": false, + "default": null, + "optional": true, "choices": null } - ], - "fmp": [] + ] }, "model": "CashFlowStatementGrowth" }, @@ -14869,7 +14952,10 @@ "description": "None", "default": "annual", "optional": true, - "choices": null + "choices": [ + "annual", + "quarter" + ] } ], "intrinio": [ @@ -14879,7 +14965,12 @@ "description": "None", "default": "annual", "optional": true, - "choices": null + "choices": [ + "annual", + "quarter", + "ttm", + "ytd" + ] }, { "name": "fiscal_year", @@ -14897,7 +14988,11 @@ "description": "None", "default": "annual", "optional": true, - "choices": null + "choices": [ + "annual", + "quarter", + "ttm" + ] }, { "name": "filing_date", @@ -15011,7 +15106,10 @@ "description": "None", "default": "annual", "optional": true, - "choices": null + "choices": [ + "annual", + "quarter" + ] } ] }, @@ -16339,18 +16437,18 @@ "choices": null }, { - "name": "limit", - "type": "int", - "description": "The number of data entries to return.", - "default": 10, + "name": "period", + "type": "str", + "description": "Time period of the data to return.", + "default": "annual", "optional": true, "choices": null }, { - "name": "period", - "type": "Literal['annual', 'quarter']", - "description": "Time period of the data to return.", - "default": "annual", + "name": "limit", + "type": "int", + "description": "The number of data entries to return.", + "default": 10, "optional": true, "choices": null }, @@ -16362,7 +16460,19 @@ "optional": true } ], - "fmp": [] + "fmp": [ + { + "name": "period", + "type": "Literal['annual', 'quarter']", + "description": "None", + "default": "annual", + "optional": true, + "choices": [ + "annual", + "quarter" + ] + } + ] }, "returns": { "OBBject": [ @@ -16396,25 +16506,35 @@ "data": { "standard": [ { - "name": "symbol", - "type": "str", - "description": "Symbol representing the entity requested in the data.", - "default": null, - "optional": true, - "choices": null - }, - { - "name": "date", + "name": "period_ending", "type": "date", - "description": "The date of the data.", + "description": "The end date of the reporting period.", "default": "", "optional": false, "choices": null }, { - "name": "period", + "name": "fiscal_period", "type": "str", - "description": "Period the statement is returned for.", + "description": "The fiscal period of the report.", + "default": null, + "optional": true, + "choices": null + }, + { + "name": "fiscal_year", + "type": "int", + "description": "The fiscal year of the fiscal period.", + "default": null, + "optional": true, + "choices": null + } + ], + "fmp": [ + { + "name": "symbol", + "type": "str", + "description": "Symbol representing the entity requested in the data.", "default": "", "optional": false, "choices": null @@ -16423,212 +16543,211 @@ "name": "growth_revenue", "type": "float", "description": "Growth rate of total revenue.", - "default": "", - "optional": false, + "default": null, + "optional": true, "choices": null }, { "name": "growth_cost_of_revenue", "type": "float", "description": "Growth rate of cost of goods sold.", - "default": "", - "optional": false, + "default": null, + "optional": true, "choices": null }, { "name": "growth_gross_profit", "type": "float", "description": "Growth rate of gross profit.", - "default": "", - "optional": false, + "default": null, + "optional": true, "choices": null }, { - "name": "growth_gross_profit_ratio", + "name": "growth_gross_profit_margin", "type": "float", "description": "Growth rate of gross profit as a percentage of revenue.", - "default": "", - "optional": false, + "default": null, + "optional": true, "choices": null }, { - "name": "growth_research_and_development_expenses", - "type": "float", - "description": "Growth rate of expenses on research and development.", - "default": "", - "optional": false, - "choices": null - }, - { - "name": "growth_general_and_administrative_expenses", + "name": "growth_general_and_admin_expense", "type": "float", "description": "Growth rate of general and administrative expenses.", - "default": "", - "optional": false, + "default": null, + "optional": true, "choices": null }, { - "name": "growth_selling_and_marketing_expenses", + "name": "growth_research_and_development_expense", + "type": "float", + "description": "Growth rate of expenses on research and development.", + "default": null, + "optional": true, + "choices": null + }, + { + "name": "growth_selling_and_marketing_expense", "type": "float", "description": "Growth rate of expenses on selling and marketing activities.", - "default": "", - "optional": false, + "default": null, + "optional": true, "choices": null }, { "name": "growth_other_expenses", "type": "float", "description": "Growth rate of other operating expenses.", - "default": "", - "optional": false, + "default": null, + "optional": true, "choices": null }, { "name": "growth_operating_expenses", "type": "float", "description": "Growth rate of total operating expenses.", - "default": "", - "optional": false, + "default": null, + "optional": true, "choices": null }, { "name": "growth_cost_and_expenses", "type": "float", "description": "Growth rate of total costs and expenses.", - "default": "", - "optional": false, + "default": null, + "optional": true, "choices": null }, { "name": "growth_interest_expense", "type": "float", "description": "Growth rate of interest expenses.", - "default": "", - "optional": false, + "default": null, + "optional": true, "choices": null }, { "name": "growth_depreciation_and_amortization", "type": "float", "description": "Growth rate of depreciation and amortization expenses.", - "default": "", - "optional": false, + "default": null, + "optional": true, "choices": null }, { "name": "growth_ebitda", "type": "float", "description": "Growth rate of Earnings Before Interest, Taxes, Depreciation, and Amortization.", - "default": "", - "optional": false, + "default": null, + "optional": true, "choices": null }, { - "name": "growth_ebitda_ratio", + "name": "growth_ebitda_margin", "type": "float", "description": "Growth rate of EBITDA as a percentage of revenue.", - "default": "", - "optional": false, + "default": null, + "optional": true, "choices": null }, { "name": "growth_operating_income", "type": "float", "description": "Growth rate of operating income.", - "default": "", - "optional": false, + "default": null, + "optional": true, "choices": null }, { - "name": "growth_operating_income_ratio", + "name": "growth_operating_income_margin", "type": "float", "description": "Growth rate of operating income as a percentage of revenue.", - "default": "", - "optional": false, + "default": null, + "optional": true, "choices": null }, { "name": "growth_total_other_income_expenses_net", "type": "float", "description": "Growth rate of net total other income and expenses.", - "default": "", - "optional": false, + "default": null, + "optional": true, "choices": null }, { "name": "growth_income_before_tax", "type": "float", "description": "Growth rate of income before taxes.", - "default": "", - "optional": false, + "default": null, + "optional": true, "choices": null }, { - "name": "growth_income_before_tax_ratio", + "name": "growth_income_before_tax_margin", "type": "float", "description": "Growth rate of income before taxes as a percentage of revenue.", - "default": "", - "optional": false, + "default": null, + "optional": true, "choices": null }, { "name": "growth_income_tax_expense", "type": "float", "description": "Growth rate of income tax expenses.", - "default": "", - "optional": false, + "default": null, + "optional": true, "choices": null }, { - "name": "growth_net_income", + "name": "growth_consolidated_net_income", "type": "float", "description": "Growth rate of net income.", - "default": "", - "optional": false, + "default": null, + "optional": true, "choices": null }, { - "name": "growth_net_income_ratio", + "name": "growth_net_income_margin", "type": "float", "description": "Growth rate of net income as a percentage of revenue.", - "default": "", - "optional": false, + "default": null, + "optional": true, "choices": null }, { - "name": "growth_eps", + "name": "growth_basic_earings_per_share", "type": "float", "description": "Growth rate of Earnings Per Share (EPS).", - "default": "", - "optional": false, + "default": null, + "optional": true, "choices": null }, { - "name": "growth_eps_diluted", + "name": "growth_diluted_earnings_per_share", "type": "float", "description": "Growth rate of diluted Earnings Per Share (EPS).", - "default": "", - "optional": false, + "default": null, + "optional": true, "choices": null }, { - "name": "growth_weighted_average_shs_out", + "name": "growth_weighted_average_basic_shares_outstanding", "type": "float", "description": "Growth rate of weighted average shares outstanding.", - "default": "", - "optional": false, + "default": null, + "optional": true, "choices": null }, { - "name": "growth_weighted_average_shs_out_dil", + "name": "growth_weighted_average_diluted_shares_outstanding", "type": "float", "description": "Growth rate of diluted weighted average shares outstanding.", - "default": "", - "optional": false, + "default": null, + "optional": true, "choices": null } - ], - "fmp": [] + ] }, "model": "IncomeStatementGrowth" }, diff --git a/openbb_platform/openbb/package/equity_fundamental.py b/openbb_platform/openbb/package/equity_fundamental.py index 90077853ac8..3835a53a946 100644 --- a/openbb_platform/openbb/package/equity_fundamental.py +++ b/openbb_platform/openbb/package/equity_fundamental.py @@ -145,17 +145,17 @@ class ROUTER_equity_fundamental(Container): Cash and short term investments. (provider: fmp) net_receivables : Optional[float] Net receivables. (provider: fmp) - inventory : Optional[Union[float, int]] + inventory : Optional[float] Inventory. (provider: fmp, polygon) - other_current_assets : Optional[Union[float, int]] + other_current_assets : Optional[float] Other current assets. (provider: fmp, intrinio, polygon) - total_current_assets : Optional[Union[float, int]] + total_current_assets : Optional[float] Total current assets. (provider: fmp, intrinio, polygon) plant_property_equipment_net : Optional[float] Plant property equipment net. (provider: fmp, intrinio) goodwill : Optional[float] Goodwill. (provider: fmp, intrinio) - intangible_assets : Optional[Union[float, int]] + intangible_assets : Optional[float] Intangible assets. (provider: fmp, intrinio, polygon) goodwill_and_intangible_assets : Optional[float] Goodwill and intangible assets. (provider: fmp) @@ -163,15 +163,15 @@ class ROUTER_equity_fundamental(Container): Long term investments. (provider: fmp, intrinio) tax_assets : Optional[float] Tax assets. (provider: fmp) - other_non_current_assets : Optional[Union[float, int]] + other_non_current_assets : Optional[float] Other non current assets. (provider: fmp, polygon) non_current_assets : Optional[float] Total non current assets. (provider: fmp) other_assets : Optional[float] Other assets. (provider: fmp, intrinio) - total_assets : Optional[Union[float, int]] + total_assets : Optional[float] Total assets. (provider: fmp, intrinio, polygon) - accounts_payable : Optional[Union[float, int]] + accounts_payable : Optional[float] Accounts payable. (provider: fmp, intrinio, polygon) short_term_debt : Optional[float] Short term debt. (provider: fmp, intrinio) @@ -179,27 +179,27 @@ class ROUTER_equity_fundamental(Container): Tax payables. (provider: fmp) current_deferred_revenue : Optional[float] Current deferred revenue. (provider: fmp, intrinio) - other_current_liabilities : Optional[Union[float, int]] + other_current_liabilities : Optional[float] Other current liabilities. (provider: fmp, intrinio, polygon) - total_current_liabilities : Optional[Union[float, int]] + total_current_liabilities : Optional[float] Total current liabilities. (provider: fmp, intrinio, polygon) - long_term_debt : Optional[Union[float, int]] + long_term_debt : Optional[float] Long term debt. (provider: fmp, intrinio, polygon) deferred_revenue_non_current : Optional[float] Non current deferred revenue. (provider: fmp) deferred_tax_liabilities_non_current : Optional[float] Deferred tax liabilities non current. (provider: fmp) - other_non_current_liabilities : Optional[Union[float, int]] + other_non_current_liabilities : Optional[float] Other non current liabilities. (provider: fmp, polygon) - total_non_current_liabilities : Optional[Union[float, int]] + total_non_current_liabilities : Optional[float] Total non current liabilities. (provider: fmp, intrinio, polygon) other_liabilities : Optional[float] Other liabilities. (provider: fmp) capital_lease_obligations : Optional[float] Capital lease obligations. (provider: fmp, intrinio) - total_liabilities : Optional[Union[float, int]] + total_liabilities : Optional[float] Total liabilities. (provider: fmp, intrinio, polygon) - preferred_stock : Optional[Union[float, int]] + preferred_stock : Optional[float] Preferred stock. (provider: fmp, intrinio, polygon) common_stock : Optional[float] Common stock. (provider: fmp, intrinio) @@ -216,8 +216,8 @@ class ROUTER_equity_fundamental(Container): total_equity_non_controlling_interests : Optional[float] Total equity non controlling interests. (provider: fmp, intrinio) total_liabilities_and_shareholders_equity : Optional[float] - Total liabilities and shareholders equity. (provider: fmp) - minority_interest : Optional[Union[float, int]] + Total liabilities and shareholders equity. (provider: fmp, polygon) + minority_interest : Optional[float] Minority interest. (provider: fmp, polygon) total_liabilities_and_total_equity : Optional[float] Total liabilities and total equity. (provider: fmp) @@ -237,7 +237,7 @@ class ROUTER_equity_fundamental(Container): Restricted cash. (provider: intrinio) federal_funds_sold : Optional[float] Federal funds sold. (provider: intrinio) - accounts_receivable : Optional[Union[float, int]] + accounts_receivable : Optional[float] Accounts receivable. (provider: intrinio, polygon) note_and_lease_receivable : Optional[float] Note and lease receivable. (Vendor non-trade receivables) (provider: intrinio) @@ -265,7 +265,7 @@ class ROUTER_equity_fundamental(Container): Other current non-operating assets. (provider: intrinio) loans_held_for_sale : Optional[float] Loans held for sale. (provider: intrinio) - prepaid_expenses : Optional[Union[float, int]] + prepaid_expenses : Optional[float] Prepaid expenses. (provider: intrinio, polygon) plant_property_equipment_gross : Optional[float] Plant property equipment gross. (provider: intrinio) @@ -293,7 +293,7 @@ class ROUTER_equity_fundamental(Container): Other noncurrent non-operating assets. (provider: intrinio) interest_bearing_deposits : Optional[float] Interest bearing deposits. (provider: intrinio) - total_non_current_assets : Optional[Union[float, int]] + total_non_current_assets : Optional[float] Total noncurrent assets. (provider: intrinio, polygon) non_interest_bearing_deposits : Optional[float] Non interest bearing deposits. (provider: intrinio) @@ -345,7 +345,7 @@ class ROUTER_equity_fundamental(Container): Asset retirement reserve litigation obligation. (provider: intrinio) commitments_contingencies : Optional[float] Commitments contingencies. (provider: intrinio) - redeemable_non_controlling_interest : Optional[Union[float, int]] + redeemable_non_controlling_interest : Optional[float] Redeemable non-controlling interest. (provider: intrinio, polygon) treasury_stock : Optional[float] Treasury stock. (provider: intrinio) @@ -359,25 +359,23 @@ class ROUTER_equity_fundamental(Container): Non-controlling interest. (provider: intrinio) total_liabilities_shareholders_equity : Optional[float] Total liabilities and shareholders equity. (provider: intrinio) - marketable_securities : Optional[int] + marketable_securities : Optional[float] Marketable securities (provider: polygon) - property_plant_equipment_net : Optional[int] + property_plant_equipment_net : Optional[float] Property plant and equipment net (provider: polygon) - employee_wages : Optional[int] + employee_wages : Optional[float] Employee wages (provider: polygon) - temporary_equity_attributable_to_parent : Optional[int] + temporary_equity_attributable_to_parent : Optional[float] Temporary equity attributable to parent (provider: polygon) - equity_attributable_to_parent : Optional[int] + equity_attributable_to_parent : Optional[float] Equity attributable to parent (provider: polygon) - temporary_equity : Optional[int] + temporary_equity : Optional[float] Temporary equity (provider: polygon) - redeemable_non_controlling_interest_other : Optional[int] + redeemable_non_controlling_interest_other : Optional[float] Redeemable non-controlling interest other (provider: polygon) - total_stock_holders_equity : Optional[int] + total_shareholders_equity : Optional[float] Total stock holders equity (provider: polygon) - total_liabilities_and_stock_holders_equity : Optional[int] - Total liabilities and stockholders equity (provider: polygon) - total_equity : Optional[int] + total_equity : Optional[float] Total equity (provider: polygon) Examples @@ -411,8 +409,12 @@ class ROUTER_equity_fundamental(Container): def balance_growth( self, symbol: Annotated[str, OpenBBField(description="Symbol to get data for.")], + period: Annotated[ + str, OpenBBField(description="Time period of the data to return.") + ] = "annual", limit: Annotated[ - int, OpenBBField(description="The number of data entries to return.") + Optional[int], + OpenBBField(description="The number of data entries to return."), ] = 10, provider: Annotated[ Optional[Literal["fmp"]], @@ -428,7 +430,9 @@ class ROUTER_equity_fundamental(Container): ---------- symbol : str Symbol to get data for. - limit : int + period : str + Time period of the data to return. + limit : Optional[int] The number of data entries to return. provider : Optional[Literal['fmp']] The provider to use for the query, by default None. @@ -451,90 +455,92 @@ class ROUTER_equity_fundamental(Container): BalanceSheetGrowth ------------------ + period_ending : date + The end date of the reporting period. + fiscal_period : Optional[str] + The fiscal period of the report. + fiscal_year : Optional[int] + The fiscal year of the fiscal period. symbol : Optional[str] - Symbol representing the entity requested in the data. - date : date - The date of the data. - period : str - Reporting period. - growth_cash_and_cash_equivalents : float - Growth rate of cash and cash equivalents. - growth_short_term_investments : float - Growth rate of short-term investments. - growth_cash_and_short_term_investments : float - Growth rate of cash and short-term investments. - growth_net_receivables : float - Growth rate of net receivables. - growth_inventory : float - Growth rate of inventory. - growth_other_current_assets : float - Growth rate of other current assets. - growth_total_current_assets : float - Growth rate of total current assets. - growth_property_plant_equipment_net : float - Growth rate of net property, plant, and equipment. - growth_goodwill : float - Growth rate of goodwill. - growth_intangible_assets : float - Growth rate of intangible assets. - growth_goodwill_and_intangible_assets : float - Growth rate of goodwill and intangible assets. - growth_long_term_investments : float - Growth rate of long-term investments. - growth_tax_assets : float - Growth rate of tax assets. - growth_other_non_current_assets : float - Growth rate of other non-current assets. - growth_total_non_current_assets : float - Growth rate of total non-current assets. - growth_other_assets : float - Growth rate of other assets. - growth_total_assets : float - Growth rate of total assets. - growth_account_payables : float - Growth rate of accounts payable. - growth_short_term_debt : float - Growth rate of short-term debt. - growth_tax_payables : float - Growth rate of tax payables. - growth_deferred_revenue : float - Growth rate of deferred revenue. - growth_other_current_liabilities : float - Growth rate of other current liabilities. - growth_total_current_liabilities : float - Growth rate of total current liabilities. - growth_long_term_debt : float - Growth rate of long-term debt. - growth_deferred_revenue_non_current : float - Growth rate of non-current deferred revenue. - growth_deferrred_tax_liabilities_non_current : float - Growth rate of non-current deferred tax liabilities. - growth_other_non_current_liabilities : float - Growth rate of other non-current liabilities. - growth_total_non_current_liabilities : float - Growth rate of total non-current liabilities. - growth_other_liabilities : float - Growth rate of other liabilities. - growth_total_liabilities : float - Growth rate of total liabilities. - growth_common_stock : float - Growth rate of common stock. - growth_retained_earnings : float - Growth rate of retained earnings. - growth_accumulated_other_comprehensive_income_loss : float - Growth rate of accumulated other comprehensive income/loss. - growth_othertotal_stockholders_equity : float - Growth rate of other total stockholders' equity. - growth_total_stockholders_equity : float - Growth rate of total stockholders' equity. - growth_total_liabilities_and_stockholders_equity : float - Growth rate of total liabilities and stockholders' equity. - growth_total_investments : float - Growth rate of total investments. - growth_total_debt : float - Growth rate of total debt. - growth_net_debt : float - Growth rate of net debt. + Symbol representing the entity requested in the data. (provider: fmp) + growth_cash_and_cash_equivalents : Optional[float] + Growth rate of cash and cash equivalents. (provider: fmp) + growth_short_term_investments : Optional[float] + Growth rate of short-term investments. (provider: fmp) + growth_cash_and_short_term_investments : Optional[float] + Growth rate of cash and short-term investments. (provider: fmp) + growth_net_receivables : Optional[float] + Growth rate of net receivables. (provider: fmp) + growth_inventory : Optional[float] + Growth rate of inventory. (provider: fmp) + growth_other_current_assets : Optional[float] + Growth rate of other current assets. (provider: fmp) + growth_total_current_assets : Optional[float] + Growth rate of total current assets. (provider: fmp) + growth_property_plant_equipment_net : Optional[float] + Growth rate of net property, plant, and equipment. (provider: fmp) + growth_goodwill : Optional[float] + Growth rate of goodwill. (provider: fmp) + growth_intangible_assets : Optional[float] + Growth rate of intangible assets. (provider: fmp) + growth_goodwill_and_intangible_assets : Optional[float] + Growth rate of goodwill and intangible assets. (provider: fmp) + growth_long_term_investments : Optional[float] + Growth rate of long-term investments. (provider: fmp) + growth_tax_assets : Optional[float] + Growth rate of tax assets. (provider: fmp) + growth_other_non_current_assets : Optional[float] + Growth rate of other non-current assets. (provider: fmp) + growth_total_non_current_assets : Optional[float] + Growth rate of total non-current assets. (provider: fmp) + growth_other_assets : Optional[float] + Growth rate of other assets. (provider: fmp) + growth_total_assets : Optional[float] + Growth rate of total assets. (provider: fmp) + growth_account_payables : Optional[float] + Growth rate of accounts payable. (provider: fmp) + growth_short_term_debt : Optional[float] + Growth rate of short-term debt. (provider: fmp) + growth_tax_payables : Optional[float] + Growth rate of tax payables. (provider: fmp) + growth_deferred_revenue : Optional[float] + Growth rate of deferred revenue. (provider: fmp) + growth_other_current_liabilities : Optional[float] + Growth rate of other current liabilities. (provider: fmp) + growth_total_current_liabilities : Optional[float] + Growth rate of total current liabilities. (provider: fmp) + growth_long_term_debt : Optional[float] + Growth rate of long-term debt. (provider: fmp) + growth_deferred_revenue_non_current : Optional[float] + Growth rate of non-current deferred revenue. (provider: fmp) + growth_deferrred_tax_liabilities_non_current : Optional[float] + Growth rate of non-current deferred tax liabilities. (provider: fmp) + growth_other_non_current_liabilities : Optional[float] + Growth rate of other non-current liabilities. (provider: fmp) + growth_total_non_current_liabilities : Optional[float] + Growth rate of total non-current liabilities. (provider: fmp) + growth_other_liabilities : Optional[float] + Growth rate of other liabilities. (provider: fmp) + growth_total_liabilities : Optional[float] + Growth rate of total liabilities. (provider: fmp) + growth_common_stock : Optional[float] + Growth rate of common stock. (provider: fmp) + growth_retained_earnings : Optional[float] + Growth rate of retained earnings. (provider: fmp) + growth_accumulated_other_comprehensive_income : Optional[float] + Growth rate of accumulated other comprehensive income/loss. (provider: fmp) + growth_other_total_shareholders_equity : Optional[float] + Growth rate of other total stockholders' equity. (provider: fmp) + growth_total_shareholders_equity : Optional[float] + Growth rate of total stockholders' equity. (provider: fmp) + growth_total_liabilities_and_shareholders_equity : Optional[float] + Growth rate of total liabilities and stockholders' equity. (provider: fmp) + growth_total_investments : Optional[float] + Growth rate of total investments. (provider: fmp) + growth_total_debt : Optional[float] + Growth rate of total debt. (provider: fmp) + growth_net_debt : Optional[float] + Growth rate of net debt. (provider: fmp) Examples -------- @@ -555,6 +561,7 @@ class ROUTER_equity_fundamental(Container): }, standard_params={ "symbol": symbol, + "period": period, "limit": limit, }, extra_params=kwargs, @@ -776,31 +783,31 @@ class ROUTER_equity_fundamental(Container): Cash Income Taxes Paid (provider: intrinio) cash_interest_paid : Optional[float] Cash Interest Paid (provider: intrinio) - net_cash_flow_from_operating_activities_continuing : Optional[int] + net_cash_flow_from_operating_activities_continuing : Optional[float] Net cash flow from operating activities continuing. (provider: polygon) - net_cash_flow_from_operating_activities_discontinued : Optional[int] + net_cash_flow_from_operating_activities_discontinued : Optional[float] Net cash flow from operating activities discontinued. (provider: polygon) - net_cash_flow_from_operating_activities : Optional[int] + net_cash_flow_from_operating_activities : Optional[float] Net cash flow from operating activities. (provider: polygon) - net_cash_flow_from_investing_activities_continuing : Optional[int] + net_cash_flow_from_investing_activities_continuing : Optional[float] Net cash flow from investing activities continuing. (provider: polygon) - net_cash_flow_from_investing_activities_discontinued : Optional[int] + net_cash_flow_from_investing_activities_discontinued : Optional[float] Net cash flow from investing activities discontinued. (provider: polygon) - net_cash_flow_from_investing_activities : Optional[int] + net_cash_flow_from_investing_activities : Optional[float] Net cash flow from investing activities. (provider: polygon) - net_cash_flow_from_financing_activities_continuing : Optional[int] + net_cash_flow_from_financing_activities_continuing : Optional[float] Net cash flow from financing activities continuing. (provider: polygon) - net_cash_flow_from_financing_activities_discontinued : Optional[int] + net_cash_flow_from_financing_activities_discontinued : Optional[float] Net cash flow from financing activities discontinued. (provider: polygon) - net_cash_flow_from_financing_activities : Optional[int] + net_cash_flow_from_financing_activities : Optional[float] Net cash flow from financing activities. (provider: polygon) - net_cash_flow_continuing : Optional[int] + net_cash_flow_continuing : Optional[float] Net cash flow continuing. (provider: polygon) - net_cash_flow_discontinued : Optional[int] + net_cash_flow_discontinued : Optional[float] Net cash flow discontinued. (provider: polygon) - exchange_gains_losses : Optional[int] + exchange_gains_losses : Optional[float] Exchange gains losses. (provider: polygon) - net_cash_flow : Optional[int] + net_cash_flow : Optional[float] Net cash flow. (provider: polygon) Examples @@ -834,8 +841,12 @@ class ROUTER_equity_fundamental(Container): def cash_growth( self, symbol: Annotated[str, OpenBBField(description="Symbol to get data for.")], + period: Annotated[ + str, OpenBBField(description="Time period of the data to return.") + ] = "annual", limit: Annotated[ - int, OpenBBField(description="The number of data entries to return.") + Optional[int], + OpenBBField(description="The number of data entries to return."), ] = 10, provider: Annotated[ Optional[Literal["fmp"]], @@ -851,7 +862,9 @@ class ROUTER_equity_fundamental(Container): ---------- symbol : str Symbol to get data for. - limit : int + period : str + Time period of the data to return. + limit : Optional[int] The number of data entries to return. provider : Optional[Literal['fmp']] The provider to use for the query, by default None. @@ -874,72 +887,74 @@ class ROUTER_equity_fundamental(Container): CashFlowStatementGrowth ----------------------- + period_ending : date + The end date of the reporting period. + fiscal_period : Optional[str] + The fiscal period of the report. + fiscal_year : Optional[int] + The fiscal year of the fiscal period. symbol : Optional[str] - Symbol representing the entity requested in the data. - date : date - The date of the data. - period : str - Period the statement is returned for. - growth_net_income : float - Growth rate of net income. - growth_depreciation_and_amortization : float - Growth rate of depreciation and amortization. - growth_deferred_income_tax : float - Growth rate of deferred income tax. - growth_stock_based_compensation : float - Growth rate of stock-based compensation. - growth_change_in_working_capital : float - Growth rate of change in working capital. - growth_accounts_receivables : float - Growth rate of accounts receivables. - growth_inventory : float - Growth rate of inventory. - growth_accounts_payables : float - Growth rate of accounts payables. - growth_other_working_capital : float - Growth rate of other working capital. - growth_other_non_cash_items : float - Growth rate of other non-cash items. - growth_net_cash_provided_by_operating_activities : float - Growth rate of net cash provided by operating activities. - growth_investments_in_property_plant_and_equipment : float - Growth rate of investments in property, plant, and equipment. - growth_acquisitions_net : float - Growth rate of net acquisitions. - growth_purchases_of_investments : float - Growth rate of purchases of investments. - growth_sales_maturities_of_investments : float - Growth rate of sales maturities of investments. - growth_other_investing_activities : float - Growth rate of other investing activities. - growth_net_cash_used_for_investing_activities : float - Growth rate of net cash used for investing activities. - growth_debt_repayment : float - Growth rate of debt repayment. - growth_common_stock_issued : float - Growth rate of common stock issued. - growth_common_stock_repurchased : float - Growth rate of common stock repurchased. - growth_dividends_paid : float - Growth rate of dividends paid. - growth_other_financing_activities : float - Growth rate of other financing activities. - growth_net_cash_used_provided_by_financing_activities : float - Growth rate of net cash used/provided by financing activities. - growth_effect_of_forex_changes_on_cash : float - Growth rate of the effect of foreign exchange changes on cash. - growth_net_change_in_cash : float - Growth rate of net change in cash. - growth_cash_at_end_of_period : float - Growth rate of cash at the end of the period. - growth_cash_at_beginning_of_period : float - Growth rate of cash at the beginning of the period. - growth_operating_cash_flow : float - Growth rate of operating cash flow. - growth_capital_expenditure : float - Growth rate of capital expenditure. - growth_free_cash_flow : float - Growth rate of free cash flow. + Symbol representing the entity requested in the data. (provider: fmp) + growth_net_income : Optional[float] + Growth rate of net income. (provider: fmp) + growth_depreciation_and_amortization : Optional[float] + Growth rate of depreciation and amortization. (provider: fmp) + growth_deferred_income_tax : Optional[float] + Growth rate of deferred income tax. (provider: fmp) + growth_stock_based_compensation : Optional[float] + Growth rate of stock-based compensation. (provider: fmp) + growth_change_in_working_capital : Optional[float] + Growth rate of change in working capital. (provider: fmp) + growth_account_receivables : Optional[float] + Growth rate of accounts receivables. (provider: fmp) + growth_inventory : Optional[float] + Growth rate of inventory. (provider: fmp) + growth_account_payable : Optional[float] + Growth rate of account payable. (provider: fmp) + growth_other_working_capital : Optional[float] + Growth rate of other working capital. (provider: fmp) + growth_other_non_cash_items : Optional[float] + Growth rate of other non-cash items. (provider: fmp) + growth_net_cash_from_operating_activities : Optional[float] + Growth rate of net cash provided by operating activities. (provider: fmp) + growth_purchase_of_property_plant_and_equipment : Optional[float] + Growth rate of investments in property, plant, and equipment. (provider: fmp) + growth_acquisitions : Optional[float] + Growth rate of net acquisitions. (provider: fmp) + growth_purchase_of_investment_securities : Optional[float] + Growth rate of purchases of investments. (provider: fmp) + growth_sale_and_maturity_of_investments : Optional[float] + Growth rate of sales maturities of investments. (provider: fmp) + growth_other_investing_activities : Optional[float] + Growth rate of other investing activities. (provider: fmp) + growth_net_cash_from_investing_activities : Optional[float] + Growth rate of net cash used for investing activities. (provider: fmp) + growth_repayment_of_debt : Optional[float] + Growth rate of debt repayment. (provider: fmp) + growth_common_stock_issued : Optional[float] + Growth rate of common stock issued. (provider: fmp) + growth_common_stock_repurchased : Optional[float] + Growth rate of common stock repurchased. (provider: fmp) + growth_dividends_paid : Optional[float] + Growth rate of dividends paid. (provider: fmp) + growth_other_financing_activities : Optional[float] + Growth rate of other financing activities. (provider: fmp) + growth_net_cash_from_financing_activities : Optional[float] + Growth rate of net cash used/provided by financing activities. (provider: fmp) + growth_effect_of_exchange_rate_changes_on_cash : Optional[float] + Growth rate of the effect of foreign exchange changes on cash. (provider: fmp) + growth_net_change_in_cash_and_equivalents : Optional[float] + Growth rate of net change in cash. (provider: fmp) + growth_cash_at_beginning_of_period : Optional[float] + Growth rate of cash at the beginning of the period. (provider: fmp) + growth_cash_at_end_of_period : Optional[float] + Growth rate of cash at the end of the period. (provider: fmp) + growth_operating_cash_flow : Optional[float] + Growth rate of operating cash flow. (provider: fmp) + growth_capital_expenditure : Optional[float] + Growth rate of capital expenditure. (provider: fmp) + growth_free_cash_flow : Optional[float] + Growth rate of free cash flow. (provider: fmp) Examples -------- @@ -960,6 +975,7 @@ class ROUTER_equity_fundamental(Container): }, standard_params={ "symbol": symbol, + "period": period, "limit": limit, }, extra_params=kwargs, @@ -1952,13 +1968,13 @@ class ROUTER_equity_fundamental(Container): def income_growth( self, symbol: Annotated[str, OpenBBField(description="Symbol to get data for.")], - limit: Annotated[ - int, OpenBBField(description="The number of data entries to return.") - ] = 10, period: Annotated[ - Literal["annual", "quarter"], - OpenBBField(description="Time period of the data to return."), + str, OpenBBField(description="Time period of the data to return.") ] = "annual", + limit: Annotated[ + Optional[int], + OpenBBField(description="The number of data entries to return."), + ] = 10, provider: Annotated[ Optional[Literal["fmp"]], OpenBBField( @@ -1973,10 +1989,10 @@ class ROUTER_equity_fundamental(Container): ---------- symbol : str Symbol to get data for. - limit : int - The number of data entries to return. - period : Literal['annual', 'quarter'] + period : str Time period of the data to return. + limit : Optional[int] + The number of data entries to return. provider : Optional[Literal['fmp']] The provider to use for the query, by default None. If None, the provider specified in defaults is selected or 'fmp' if there is @@ -1998,64 +2014,66 @@ class ROUTER_equity_fundamental(Container): IncomeStatementGrowth --------------------- + period_ending : date + The end date of the reporting period. + fiscal_period : Optional[str] + The fiscal period of the report. + fiscal_year : Optional[int] + The fiscal year of the fiscal period. symbol : Optional[str] - Symbol representing the entity requested in the data. - date : date - The date of the data. - period : str - Period the statement is returned for. - growth_revenue : float - Growth rate of total revenue. - growth_cost_of_revenue : float - Growth rate of cost of goods sold. - growth_gross_profit : float - Growth rate of gross profit. - growth_gross_profit_ratio : float - Growth rate of gross profit as a percentage of revenue. - growth_research_and_development_expenses : float - Growth rate of expenses on research and development. - growth_general_and_administrative_expenses : float - Growth rate of general and administrative expenses. - growth_selling_and_marketing_expenses : float - Growth rate of expenses on selling and marketing activities. - growth_other_expenses : float - Growth rate of other operating expenses. - growth_operating_expenses : float - Growth rate of total operating expenses. - growth_cost_and_expenses : float - Growth rate of total costs and expenses. - growth_interest_expense : float - Growth rate of interest expenses. - growth_depreciation_and_amortization : float - Growth rate of depreciation and amortization expenses. - growth_ebitda : float - Growth rate of Earnings Before Interest, Taxes, Depreciation, and Amortization. - growth_ebitda_ratio : float - Growth rate of EBITDA as a percentage of revenue. - growth_operating_income : float - Growth rate of operating income. - growth_operating_income_ratio : float - Growth rate of operating income as a percentage of revenue. - growth_total_other_income_expenses_net : float - Growth rate of net total other income and expenses. - growth_income_before_tax : float - Growth rate of income before taxes. - growth_income_before_tax_ratio : float - Growth rate of income before taxes as a percentage of revenue. - growth_income_tax_expense : float - Growth rate of income tax expenses. - growth_net_income : float - Growth rate of net income. - growth_net_income_ratio : float - Growth rate of net income as a percentage of revenue. - growth_eps : float - Growth rate of Earnings Per Share (EPS). - growth_eps_diluted : float - Growth rate of diluted Earnings Per Share (EPS). - growth_weighted_average_shs_out : float - Growth rate of weighted average shares outstanding. - growth_weighted_average_shs_out_dil : float - Growth rate of diluted weighted average shares outstanding. + Symbol representing the entity requested in the data. (provider: fmp) + growth_revenue : Optional[float] + Growth rate of total revenue. (provider: fmp) + growth_cost_of_revenue : Optional[float] + Growth rate of cost of goods sold. (provider: fmp) + growth_gross_profit : Optional[float] + Growth rate of gross profit. (provider: fmp) + growth_gross_profit_margin : Optional[float] + Growth rate of gross profit as a percentage of revenue. (provider: fmp) + growth_general_and_admin_expense : Optional[float] + Growth rate of general and administrative expenses. (provider: fmp) + growth_research_and_development_expense : Optional[float] + Growth rate of expenses on research and development. (provider: fmp) + growth_selling_and_marketing_expense : Optional[float] + Growth rate of expenses on selling and marketing activities. (provider: fmp) + growth_other_expenses : Optional[float] + Growth rate of other operating expenses. (provider: fmp) + growth_operating_expenses : Optional[float] + Growth rate of total operating expenses. (provider: fmp) + growth_cost_and_expenses : Optional[float] + Growth rate of total costs and expenses. (provider: fmp) + growth_interest_expense : Optional[float] + Growth rate of interest expenses. (provider: fmp) + growth_depreciation_and_amortization : Optional[float] + Growth rate of depreciation and amortization expenses. (provider: fmp) + growth_ebitda : Optional[float] + Growth rate of Earnings Before Interest, Taxes, Depreciation, and Amortization. (provider: fmp) + growth_ebitda_margin : Optional[float] + Growth rate of EBITDA as a percentage of revenue. (provider: fmp) + growth_operating_income : Optional[float] + Growth rate of operating income. (provider: fmp) + growth_operating_income_margin : Optional[float] + Growth rate of operating income as a percentage of revenue. (provider: fmp) + growth_total_other_income_expenses_net : Optional[float] + Growth rate of net total other income and expenses. (provider: fmp) + growth_income_before_tax : Optional[float] + Growth rate of income before taxes. (provider: fmp) + growth_income_before_tax_margin : Optional[float] + Growth rate of income before taxes as a percentage of revenue. (provider: fmp) + growth_income_tax_expense : Optional[float] + Growth rate of income tax expenses. (provider: fmp) + growth_consolidated_net_income : Optional[float] + Growth rate of net income. (provider: fmp) + growth_net_income_margin : Optional[float] + Growth rate of net income as a percentage of revenue. (provider: fmp) + growth_basic_earings_per_share : Optional[float] + Growth rate of Earnings Per Share (EPS). (provider: fmp) + growth_diluted_earnings_per_share : Optional[float] + Growth rate of diluted Earnings Per Share (EPS). (provider: fmp) + growth_weighted_average_basic_shares_outstanding : Optional[float] + Growth rate of weighted average shares outstanding. (provider: fmp) + growth_weighted_average_diluted_shares_outstanding : Optional[float] + Growth rate of diluted weighted average shares outstanding. (provider: fmp) Examples -------- @@ -2076,8 +2094,8 @@ class ROUTER_equity_fundamental(Container): }, standard_params={ "symbol": symbol, - "limit": limit, "period": period, + "limit": limit, }, extra_params=kwargs, ) diff --git a/openbb_platform/providers/fmp/openbb_fmp/models/balance_sheet.py b/openbb_platform/providers/fmp/openbb_fmp/models/balance_sheet.py index b1c2f2a92ee..71bf7055158 100644 --- a/openbb_platform/providers/fmp/openbb_fmp/models/balance_sheet.py +++ b/openbb_platform/providers/fmp/openbb_fmp/models/balance_sheet.py @@ -22,7 +22,9 @@ class FMPBalanceSheetQueryParams(BalanceSheetQueryParams): Source: https://financialmodelingprep.com/developer/docs/#Balance-Sheet """ - period: Optional[Literal["annual", "quarter"]] = Field(default="annual") + period: Literal["annual", "quarter"] = Field( + default="annual", json_schema_extra={"choices": ["annual", "quarter"]} + ) class FMPBalanceSheetData(BalanceSheetData): diff --git a/openbb_platform/providers/fmp/openbb_fmp/models/balance_sheet_growth.py b/openbb_platform/providers/fmp/openbb_fmp/models/balance_sheet_growth.py index 3d7dab85418..dd58e2a1981 100644 --- a/openbb_platform/providers/fmp/openbb_fmp/models/balance_sheet_growth.py +++ b/openbb_platform/providers/fmp/openbb_fmp/models/balance_sheet_growth.py @@ -1,15 +1,15 @@ """FMP Balance Sheet Growth Model.""" -from datetime import datetime -from typing import Any, Dict, List, Optional +from typing import Any, Dict, List, Literal, Optional from openbb_core.provider.abstract.fetcher import Fetcher from openbb_core.provider.standard_models.balance_sheet_growth import ( BalanceSheetGrowthData, BalanceSheetGrowthQueryParams, ) +from openbb_core.provider.utils.descriptions import DATA_DESCRIPTIONS from openbb_fmp.utils.helpers import create_url, get_data_many -from pydantic import field_validator +from pydantic import Field, model_validator class FMPBalanceSheetGrowthQueryParams(BalanceSheetGrowthQueryParams): @@ -18,15 +18,221 @@ class FMPBalanceSheetGrowthQueryParams(BalanceSheetGrowthQueryParams): Source: https://site.financialmodelingprep.com/developer/docs/#Financial-Statements-Growth """ + period: Literal["annual", "quarter"] = Field( + default="annual", json_schema_extra={"choices": ["annual", "quarter"]} + ) + class FMPBalanceSheetGrowthData(BalanceSheetGrowthData): """FMP Balance Sheet Growth Data.""" - @field_validator("date", mode="before", check_fields=False) + __alias_dict__ = { + "period_ending": "date", + "fiscal_year": "calendarYear", + "fiscal_period": "period", + "growth_other_total_shareholders_equity": "growthOtherTotalStockholdersEquity", + "growth_total_shareholders_equity": "growthTotalStockholdersEquity", + "growth_total_liabilities_and_shareholders_equity": "growthTotalLiabilitiesAndStockholdersEquity", + "growth_accumulated_other_comprehensive_income": "growthAccumulatedOtherComprehensiveIncomeLoss", + } + + symbol: str = Field(description=DATA_DESCRIPTIONS.get("symbol", "")) + growth_cash_and_cash_equivalents: Optional[float] = Field( + default=None, + description="Growth rate of cash and cash equivalents.", + json_schema_extra={"x-unit_measurement": "percent", "x-frontend_multiply": 100}, + ) + growth_short_term_investments: Optional[float] = Field( + default=None, + description="Growth rate of short-term investments.", + json_schema_extra={"x-unit_measurement": "percent", "x-frontend_multiply": 100}, + ) + growth_cash_and_short_term_investments: Optional[float] = Field( + default=None, + description="Growth rate of cash and short-term investments.", + json_schema_extra={"x-unit_measurement": "percent", "x-frontend_multiply": 100}, + ) + growth_net_receivables: Optional[float] = Field( + default=None, + description="Growth rate of net receivables.", + json_schema_extra={"x-unit_measurement": "percent", "x-frontend_multiply": 100}, + ) + growth_inventory: Optional[float] = Field( + default=None, + description="Growth rate of inventory.", + json_schema_extra={"x-unit_measurement": "percent", "x-frontend_multiply": 100}, + ) + growth_other_current_assets: Optional[float] = Field( + default=None, + description="Growth rate of other current assets.", + json_schema_extra={"x-unit_measurement": "percent", "x-frontend_multiply": 100}, + ) + growth_total_current_assets: Optional[float] = Field( + default=None, + description="Growth rate of total current assets.", + json_schema_extra={"x-unit_measurement": "percent", "x-frontend_multiply": 100}, + ) + growth_property_plant_equipment_net: Optional[float] = Field( + description="Growth rate of net property, plant, and equipment.", + json_schema_extra={"x-unit_measurement": "percent", "x-frontend_multiply": 100}, + ) + growth_goodwill: Optional[float] = Field( + description="Growth rate of goodwill.", + json_schema_extra={"x-unit_measurement": "percent", "x-frontend_multiply": 100}, + ) + growth_intangible_assets: Optional[float] = Field( + description="Growth rate of intangible assets.", + json_schema_extra={"x-unit_measurement": "percent", "x-frontend_multiply": 100}, + ) + growth_goodwill_and_intangible_assets: Optional[float] = Field( + description="Growth rate of goodwill and intangible assets.", + json_schema_extra={"x-unit_measurement": "percent", "x-frontend_multiply": 100}, + ) + growth_long_term_investments: Optional[float] = Field( + default=None, + description="Growth rate of long-term investments.", + json_schema_extra={"x-unit_measurement": "percent", "x-frontend_multiply": 100}, + ) + growth_tax_assets: Optional[float] = Field( + default=None, + description="Growth rate of tax assets.", + json_schema_extra={"x-unit_measurement": "percent", "x-frontend_multiply": 100}, + ) + growth_other_non_current_assets: Optional[float] = Field( + default=None, + description="Growth rate of other non-current assets.", + json_schema_extra={"x-unit_measurement": "percent", "x-frontend_multiply": 100}, + ) + growth_total_non_current_assets: Optional[float] = Field( + default=None, + description="Growth rate of total non-current assets.", + json_schema_extra={"x-unit_measurement": "percent", "x-frontend_multiply": 100}, + ) + growth_other_assets: Optional[float] = Field( + default=None, + description="Growth rate of other assets.", + json_schema_extra={"x-unit_measurement": "percent", "x-frontend_multiply": 100}, + ) + growth_total_assets: Optional[float] = Field( + default=None, + description="Growth rate of total assets.", + json_schema_extra={"x-unit_measurement": "percent", "x-frontend_multiply": 100}, + ) + growth_account_payables: Optional[float] = Field( + default=None, + description="Growth rate of accounts payable.", + json_schema_extra={"x-unit_measurement": "percent", "x-frontend_multiply": 100}, + ) + growth_short_term_debt: Optional[float] = Field( + default=None, + description="Growth rate of short-term debt.", + json_schema_extra={"x-unit_measurement": "percent", "x-frontend_multiply": 100}, + ) + growth_tax_payables: Optional[float] = Field( + default=None, + description="Growth rate of tax payables.", + json_schema_extra={"x-unit_measurement": "percent", "x-frontend_multiply": 100}, + ) + growth_deferred_revenue: Optional[float] = Field( + default=None, + description="Growth rate of deferred revenue.", + json_schema_extra={"x-unit_measurement": "percent", "x-frontend_multiply": 100}, + ) + growth_other_current_liabilities: Optional[float] = Field( + default=None, + description="Growth rate of other current liabilities.", + json_schema_extra={"x-unit_measurement": "percent", "x-frontend_multiply": 100}, + ) + growth_total_current_liabilities: Optional[float] = Field( + default=None, + description="Growth rate of total current liabilities.", + json_schema_extra={"x-unit_measurement": "percent", "x-frontend_multiply": 100}, + ) + growth_long_term_debt: Optional[float] = Field( + default=None, + description="Growth rate of long-term debt.", + json_schema_extra={"x-unit_measurement": "percent", "x-frontend_multiply": 100}, + ) + growth_deferred_revenue_non_current: Optional[float] = Field( + default=None, + description="Growth rate of non-current deferred revenue.", + json_schema_extra={"x-unit_measurement": "percent", "x-frontend_multiply": 100}, + ) + growth_deferrred_tax_liabilities_non_current: Optional[float] = Field( + default=None, + description="Growth rate of non-current deferred tax liabilities.", + json_schema_extra={"x-unit_measurement": "percent", "x-frontend_multiply": 100}, + ) + growth_other_non_current_liabilities: Optional[float] = Field( + default=None, + description="Growth rate of other non-current liabilities.", + json_schema_extra={"x-unit_measurement": "percent", "x-frontend_multiply": 100}, + ) + growth_total_non_current_liabilities: Optional[float] = Field( + default=None, + description="Growth rate of total non-current liabilities.", + json_schema_extra={"x-unit_measurement": "percent", "x-frontend_multiply": 100}, + ) + growth_other_liabilities: Optional[float] = Field( + description="Growth rate of other liabilities.", + json_schema_extra={"x-unit_measurement": "percent", "x-frontend_multiply": 100}, + ) + growth_total_liabilities: Optional[float] = Field( + description="Growth rate of total liabilities.", + json_schema_extra={"x-unit_measurement": "percent", "x-frontend_multiply": 100}, + ) + growth_common_stock: Optional[float] = Field( + description="Growth rate of common stock.", + json_schema_extra={"x-unit_measurement": "percent", "x-frontend_multiply": 100}, + ) + growth_retained_earnings: Optional[float] = Field( + description="Growth rate of retained earnings.", + json_schema_extra={"x-unit_measurement": "percent", "x-frontend_multiply": 100}, + ) + growth_accumulated_other_comprehensive_income: Optional[float] = Field( + description="Growth rate of accumulated other comprehensive income/loss.", + json_schema_extra={"x-unit_measurement": "percent", "x-frontend_multiply": 100}, + ) + growth_other_total_shareholders_equity: Optional[float] = Field( + default=None, + description="Growth rate of other total stockholders' equity.", + json_schema_extra={"x-unit_measurement": "percent", "x-frontend_multiply": 100}, + ) + growth_total_shareholders_equity: Optional[float] = Field( + default=None, + description="Growth rate of total stockholders' equity.", + json_schema_extra={"x-unit_measurement": "percent", "x-frontend_multiply": 100}, + ) + growth_total_liabilities_and_shareholders_equity: Optional[float] = Field( + default=None, + description="Growth rate of total liabilities and stockholders' equity.", + json_schema_extra={"x-unit_measurement": "percent", "x-frontend_multiply": 100}, + ) + growth_total_investments: Optional[float] = Field( + default=None, + description="Growth rate of total investments.", + json_schema_extra={"x-unit_measurement": "percent", "x-frontend_multiply": 100}, + ) + growth_total_debt: Optional[float] = Field( + default=None, + description="Growth rate of total debt.", + json_schema_extra={"x-unit_measurement": "percent", "x-frontend_multiply": 100}, + ) + growth_net_debt: Optional[float] = Field( + default=None, + description="Growth rate of net debt.", + json_schema_extra={"x-unit_measurement": "percent", "x-frontend_multiply": 100}, + ) + + @model_validator(mode="before") @classmethod - def date_validate(cls, v): # pylint: disable=E0213 - """Return the date as a datetime object.""" - return datetime.strptime(v, "%Y-%m-%d") + def replace_zero(cls, values): + """Check for zero values and replace with None.""" + return ( + {k: None if v == 0 else v for k, v in values.items()} + if isinstance(values, dict) + else values + ) class FMPBalanceSheetGrowthFetcher( @@ -35,7 +241,7 @@ class FMPBalanceSheetGrowthFetcher( List[FMPBalanceSheetGrowthData], ] ): - """Transform the query, extract and transform the data from the FMP endpoints.""" + """FMP Balance Sheet Growth Fetcher.""" @staticmethod def transform_query(params: Dict[str, Any]) -> FMPBalanceSheetGrowthQueryParams: diff --git a/openbb_platform/providers/fmp/openbb_fmp/models/cash_flow.py b/openbb_platform/providers/fmp/openbb_fmp/models/cash_flow.py index f04d9a19b5c..9e4cc2e8f09 100644 --- a/openbb_platform/providers/fmp/openbb_fmp/models/cash_flow.py +++ b/openbb_platform/providers/fmp/openbb_fmp/models/cash_flow.py @@ -23,7 +23,10 @@ class FMPCashFlowStatementQueryParams(CashFlowStatementQueryParams): Source: https://financialmodelingprep.com/developer/docs/#Cash-Flow-Statement """ - period: Optional[Literal["annual", "quarter"]] = Field(default="annual") + period: Literal["annual", "quarter"] = Field( + default="annual", + json_schema_extra={"choices": ["annual", "quarter"]}, + ) class FMPCashFlowStatementData(CashFlowStatementData): diff --git a/openbb_platform/providers/fmp/openbb_fmp/models/cash_flow_growth.py b/openbb_platform/providers/fmp/openbb_fmp/models/cash_flow_growth.py index 62a3371bb29..847bcebaae0 100644 --- a/openbb_platform/providers/fmp/openbb_fmp/models/cash_flow_growth.py +++ b/openbb_platform/providers/fmp/openbb_fmp/models/cash_flow_growth.py @@ -1,15 +1,15 @@ """FMP Cash Flow Statement Growth Model.""" -from datetime import datetime -from typing import Any, Dict, List, Optional +from typing import Any, Dict, List, Literal, Optional from openbb_core.provider.abstract.fetcher import Fetcher from openbb_core.provider.standard_models.cash_flow_growth import ( CashFlowStatementGrowthData, CashFlowStatementGrowthQueryParams, ) +from openbb_core.provider.utils.descriptions import DATA_DESCRIPTIONS from openbb_fmp.utils.helpers import create_url, get_data_many -from pydantic import field_validator +from pydantic import Field class FMPCashFlowStatementGrowthQueryParams(CashFlowStatementGrowthQueryParams): @@ -18,22 +18,183 @@ class FMPCashFlowStatementGrowthQueryParams(CashFlowStatementGrowthQueryParams): Source: https://site.financialmodelingprep.com/developer/docs/financial-statements-growth-api/ """ + period: Literal["annual", "quarter"] = Field( + default="annual", json_schema_extra={"choices": ["annual", "quarter"]} + ) + class FMPCashFlowStatementGrowthData(CashFlowStatementGrowthData): """FMP Cash Flow Statement Growth Data.""" __alias_dict__ = { - "growth_net_cash_provided_by_operating_activities": "growthNetCashProvidedByOperatingActivites", + "period_ending": "date", + "fiscal_year": "calendarYear", + "fiscal_period": "period", + "growth_acquisitions": "growthAcquisitionsNet", + "growth_sale_and_maturity_of_investments": "growthSalesMaturitiesOfInvestments", + "growth_net_cash_from_operating_activities": "growthNetCashProvidedByOperatingActivites", "growth_other_investing_activities": "growthOtherInvestingActivites", - "growth_net_cash_used_for_investing_activities": "growthNetCashUsedForInvestingActivites", + "growth_net_cash_from_investing_activities": "growthNetCashUsedForInvestingActivites", "growth_other_financing_activities": "growthOtherFinancingActivites", + "growth_purchase_of_investment_securities": "growthPurchasesOfInvestments", + "growth_account_receivables": "growthAccountsReceivables", + "growth_account_payable": "growthAccountsPayables", + "growth_purchase_of_property_plant_and_equipment": "growthInvestmentsInPropertyPlantAndEquipment", + "growth_repayment_of_debt": "growthDebtRepayment", + "growth_net_change_in_cash_and_equivalents": "growthNetChangeInCash", + "growth_effect_of_exchange_rate_changes_on_cash": "growthEffectOfForexChangesOnCash", } - - @field_validator("date", mode="before", check_fields=False) - @classmethod - def date_validate(cls, v): # pylint: disable=E0213 - """Return the date as a datetime object.""" - return datetime.strptime(v, "%Y-%m-%d") + symbol: str = Field(description=DATA_DESCRIPTIONS.get("symbol", "")) + growth_net_income: Optional[float] = Field( + default=None, + description="Growth rate of net income.", + json_schema_extra={"x-unit_measurement": "percent", "x-frontend_multiply": 100}, + ) + growth_depreciation_and_amortization: Optional[float] = Field( + default=None, + description="Growth rate of depreciation and amortization.", + json_schema_extra={"x-unit_measurement": "percent", "x-frontend_multiply": 100}, + ) + growth_deferred_income_tax: Optional[float] = Field( + default=None, + description="Growth rate of deferred income tax.", + json_schema_extra={"x-unit_measurement": "percent", "x-frontend_multiply": 100}, + ) + growth_stock_based_compensation: Optional[float] = Field( + default=None, + description="Growth rate of stock-based compensation.", + json_schema_extra={"x-unit_measurement": "percent", "x-frontend_multiply": 100}, + ) + growth_change_in_working_capital: Optional[float] = Field( + default=None, + description="Growth rate of change in working capital.", + json_schema_extra={"x-unit_measurement": "percent", "x-frontend_multiply": 100}, + ) + growth_account_receivables: Optional[float] = Field( + default=None, + description="Growth rate of accounts receivables.", + json_schema_extra={"x-unit_measurement": "percent", "x-frontend_multiply": 100}, + ) + growth_inventory: Optional[float] = Field( + default=None, + description="Growth rate of inventory.", + json_schema_extra={"x-unit_measurement": "percent", "x-frontend_multiply": 100}, + ) + growth_account_payable: Optional[float] = Field( + default=None, + description="Growth rate of account payable.", + json_schema_extra={"x-unit_measurement": "percent", "x-frontend_multiply": 100}, + ) + growth_other_working_capital: Optional[float] = Field( + default=None, + description="Growth rate of other working capital.", + json_schema_extra={"x-unit_measurement": "percent", "x-frontend_multiply": 100}, + ) + growth_other_non_cash_items: Optional[float] = Field( + default=None, + description="Growth rate of other non-cash items.", + json_schema_extra={"x-unit_measurement": "percent", "x-frontend_multiply": 100}, + ) + growth_net_cash_from_operating_activities: Optional[float] = Field( + default=None, + description="Growth rate of net cash provided by operating activities.", + json_schema_extra={"x-unit_measurement": "percent", "x-frontend_multiply": 100}, + ) + growth_purchase_of_property_plant_and_equipment: Optional[float] = Field( + default=None, + description="Growth rate of investments in property, plant, and equipment.", + json_schema_extra={"x-unit_measurement": "percent", "x-frontend_multiply": 100}, + ) + growth_acquisitions: Optional[float] = Field( + default=None, + description="Growth rate of net acquisitions.", + json_schema_extra={"x-unit_measurement": "percent", "x-frontend_multiply": 100}, + ) + growth_purchase_of_investment_securities: Optional[float] = Field( + default=None, + description="Growth rate of purchases of investments.", + json_schema_extra={"x-unit_measurement": "percent", "x-frontend_multiply": 100}, + ) + growth_sale_and_maturity_of_investments: Optional[float] = Field( + default=None, + description="Growth rate of sales maturities of investments.", + json_schema_extra={"x-unit_measurement": "percent", "x-frontend_multiply": 100}, + ) + growth_other_investing_activities: Optional[float] = Field( + default=None, + description="Growth rate of other investing activities.", + json_schema_extra={"x-unit_measurement": "percent", "x-frontend_multiply": 100}, + ) + growth_net_cash_from_investing_activities: Optional[float] = Field( + default=None, + description="Growth rate of net cash used for investing activities.", + json_schema_extra={"x-unit_measurement": "percent", "x-frontend_multiply": 100}, + ) + growth_repayment_of_debt: Optional[float] = Field( + default=None, + description="Growth rate of debt repayment.", + json_schema_extra={"x-unit_measurement": "percent", "x-frontend_multiply": 100}, + ) + growth_common_stock_issued: Optional[float] = Field( + default=None, + description="Growth rate of common stock issued.", + json_schema_extra={"x-unit_measurement": "percent", "x-frontend_multiply": 100}, + ) + growth_common_stock_repurchased: Optional[float] = Field( + default=None, + description="Growth rate of common stock repurchased.", + json_schema_extra={"x-unit_measurement": "percent", "x-frontend_multiply": 100}, + ) + growth_dividends_paid: Optional[float] = Field( + default=None, + description="Growth rate of dividends paid.", + json_schema_extra={"x-unit_measurement": "percent", "x-frontend_multiply": 100}, + ) + growth_other_financing_activities: Optional[float] = Field( + default=None, + description="Growth rate of other financing activities.", + json_schema_extra={"x-unit_measurement": "percent", "x-frontend_multiply": 100}, + ) + growth_net_cash_from_financing_activities: Optional[float] = Field( + default=None, + description="Growth rate of net cash used/provided by financing activities.", + json_schema_extra={"x-unit_measurement": "percent", "x-frontend_multiply": 100}, + ) + growth_effect_of_exchange_rate_changes_on_cash: Optional[float] = Field( + default=None, + description="Growth rate of the effect of foreign exchange changes on cash.", + json_schema_extra={"x-unit_measurement": "percent", "x-frontend_multiply": 100}, + ) + growth_net_change_in_cash_and_equivalents: Optional[float] = Field( + default=None, + description="Growth rate of net change in cash.", + json_schema_extra={"x-unit_measurement": "percent", "x-frontend_multiply": 100}, + ) + growth_cash_at_beginning_of_period: Optional[float] = Field( + default=None, + description="Growth rate of cash at the beginning of the period.", + json_schema_extra={"x-unit_measurement": "percent", "x-frontend_multiply": 100}, + ) + growth_cash_at_end_of_period: Optional[float] = Field( + default=None, + description="Growth rate of cash at the end of the period.", + json_schema_extra={"x-unit_measurement": "percent", "x-frontend_multiply": 100}, + ) + growth_operating_cash_flow: Optional[float] = Field( + default=None, + description="Growth rate of operating cash flow.", + json_schema_extra={"x-unit_measurement": "percent", "x-frontend_multiply": 100}, + ) + growth_capital_expenditure: Optional[float] = Field( + default=None, + description="Growth rate of capital expenditure.", + json_schema_extra={"x-unit_measurement": "percent", "x-frontend_multiply": 100}, + ) + growth_free_cash_flow: Optional[float] = Field( + default=None, + description="Growth rate of free cash flow.", + json_schema_extra={"x-unit_measurement": "percent", "x-frontend_multiply": 100}, + ) class FMPCashFlowStatementGrowthFetcher( @@ -42,7 +203,7 @@ class FMPCashFlowStatementGrowthFetcher( List[FMPCashFlowStatementGrowthData], ] ): - """Transform the query, extract and transform the data from the FMP endpoints.""" + """FMP Cash Flow Statement Growth Fetcher.""" @staticmethod def transform_query( diff --git a/openbb_platform/providers/fmp/openbb_fmp/models/income_statement.py b/openbb_platform/providers/fmp/openbb_fmp/models/income_statement.py index 1f31beef144..5dcb3860221 100644 --- a/openbb_platform/providers/fmp/openbb_fmp/models/income_statement.py +++ b/openbb_platform/providers/fmp/openbb_fmp/models/income_statement.py @@ -22,7 +22,9 @@ class FMPIncomeStatementQueryParams(IncomeStatementQueryParams): Source: https://financialmodelingprep.com/developer/docs/#Income-Statement """ - period: Optional[Literal["annual", "quarter"]] = Field(default="annual") + period: Literal["annual", "quarter"] = Field( + default="annual", json_schema_extra={"choices": ["annual", "quarter"]} + ) class FMPIncomeStatementData(IncomeStatementData): @@ -94,6 +96,7 @@ class FMPIncomeStatementData(IncomeStatementData): gross_profit_margin: Optional[float] = Field( default=None, description="Gross profit margin.", + json_schema_extra={"x-unit_measurement": "percent", "x-frontend_multiply": 100}, ) general_and_admin_expense: Optional[float] = Field( default=None, @@ -142,6 +145,7 @@ class FMPIncomeStatementData(IncomeStatementData): ebitda_margin: Optional[float] = Field( default=None, description="EBITDA margin.", + json_schema_extra={"x-unit_measurement": "percent", "x-frontend_multiply": 100}, ) total_operating_income: Optional[float] = Field( default=None, @@ -150,6 +154,7 @@ class FMPIncomeStatementData(IncomeStatementData): operating_income_margin: Optional[float] = Field( default=None, description="Operating income margin.", + json_schema_extra={"x-unit_measurement": "percent", "x-frontend_multiply": 100}, ) total_other_income_expenses: Optional[float] = Field( default=None, @@ -162,6 +167,7 @@ class FMPIncomeStatementData(IncomeStatementData): pre_tax_income_margin: Optional[float] = Field( default=None, description="Pre-tax income margin.", + json_schema_extra={"x-unit_measurement": "percent", "x-frontend_multiply": 100}, ) income_tax_expense: Optional[float] = Field( default=None, @@ -174,6 +180,7 @@ class FMPIncomeStatementData(IncomeStatementData): net_income_margin: Optional[float] = Field( default=None, description="Net income margin.", + json_schema_extra={"x-unit_measurement": "percent", "x-frontend_multiply": 100}, ) basic_earnings_per_share: Optional[float] = Field( default=None, diff --git a/openbb_platform/providers/fmp/openbb_fmp/models/income_statement_growth.py b/openbb_platform/providers/fmp/openbb_fmp/models/income_statement_growth.py index 5dca2c6a974..cd54bb7abeb 100644 --- a/openbb_platform/providers/fmp/openbb_fmp/models/income_statement_growth.py +++ b/openbb_platform/providers/fmp/openbb_fmp/models/income_statement_growth.py @@ -1,15 +1,15 @@ """FMP Income Statement Growth Model.""" -from datetime import datetime -from typing import Any, Dict, List, Optional +from typing import Any, Dict, List, Literal, Optional from openbb_core.provider.abstract.fetcher import Fetcher from openbb_core.provider.standard_models.income_statement_growth import ( IncomeStatementGrowthData, IncomeStatementGrowthQueryParams, ) +from openbb_core.provider.utils.descriptions import DATA_DESCRIPTIONS from openbb_fmp.utils.helpers import create_url, get_data_many -from pydantic import field_validator +from pydantic import Field, model_validator class FMPIncomeStatementGrowthQueryParams(IncomeStatementGrowthQueryParams): @@ -18,22 +18,175 @@ class FMPIncomeStatementGrowthQueryParams(IncomeStatementGrowthQueryParams): Source: https://site.financialmodelingprep.com/developer/docs/financial-statements-growth-api/ """ + period: Literal["annual", "quarter"] = Field( + default="annual", json_schema_extra={"choices": ["annual", "quarter"]} + ) + class FMPIncomeStatementGrowthData(IncomeStatementGrowthData): """FMP Income Statement Growth Data.""" __alias_dict__ = { + "period_ending": "date", + "fiscal_year": "calendarYear", + "fiscal_period": "period", "growth_ebitda": "growthEBITDA", "growth_ebitda_ratio": "growthEBITDARatio", - "growth_eps": "growthEPS", - "growth_eps_diluted": "growthEPSDiluted", + "growth_basic_earings_per_share": "growthEPS", + "growth_net_income_margin": "growthNetIncomeRatio", + "growth_consolidated_net_income": "growthNetIncome", + "growth_gross_profit_margin": "growthGrossProfitRatio", + "growth_income_before_tax_margin": "growthIncomeBeforeTaxRatio", + "growth_operating_income_margin": "growthOperatingIncomeRatio", + "growth_diluted_earnings_per_share": "growthEPSDiluted", + "growth_weighted_average_basic_shares_outstanding": "growthWeightedAverageShsOut", + "growth_weighted_average_diluted_shares_outstanding": "growthWeightedAverageShsOutDil", + "growth_research_and_development_expense": "growthResearchAndDevelopmentExpenses", + "growth_general_and_admin_expense": "growthGeneralAndAdministrativeExpenses", + "growth_selling_and_marketing_expense": "growthSellingAndMarketingExpenses", } - @field_validator("date", mode="before", check_fields=False) + symbol: str = Field(description=DATA_DESCRIPTIONS.get("symbol", "")) + growth_revenue: Optional[float] = Field( + default=None, + description="Growth rate of total revenue.", + json_schema_extra={"x-unit_measurement": "percent", "x-frontend_multiply": 100}, + ) + growth_cost_of_revenue: Optional[float] = Field( + default=None, + description="Growth rate of cost of goods sold.", + json_schema_extra={"x-unit_measurement": "percent", "x-frontend_multiply": 100}, + ) + growth_gross_profit: Optional[float] = Field( + default=None, + description="Growth rate of gross profit.", + json_schema_extra={"x-unit_measurement": "percent", "x-frontend_multiply": 100}, + ) + growth_gross_profit_margin: Optional[float] = Field( + default=None, + description="Growth rate of gross profit as a percentage of revenue.", + json_schema_extra={"x-unit_measurement": "percent", "x-frontend_multiply": 100}, + ) + growth_general_and_admin_expense: Optional[float] = Field( + default=None, + description="Growth rate of general and administrative expenses.", + json_schema_extra={"x-unit_measurement": "percent", "x-frontend_multiply": 100}, + ) + growth_research_and_development_expense: Optional[float] = Field( + default=None, + description="Growth rate of expenses on research and development.", + json_schema_extra={"x-unit_measurement": "percent", "x-frontend_multiply": 100}, + ) + growth_selling_and_marketing_expense: Optional[float] = Field( + default=None, + description="Growth rate of expenses on selling and marketing activities.", + json_schema_extra={"x-unit_measurement": "percent", "x-frontend_multiply": 100}, + ) + growth_other_expenses: Optional[float] = Field( + default=None, + description="Growth rate of other operating expenses.", + json_schema_extra={"x-unit_measurement": "percent", "x-frontend_multiply": 100}, + ) + growth_operating_expenses: Optional[float] = Field( + default=None, + description="Growth rate of total operating expenses.", + json_schema_extra={"x-unit_measurement": "percent", "x-frontend_multiply": 100}, + ) + growth_cost_and_expenses: Optional[float] = Field( + default=None, + description="Growth rate of total costs and expenses.", + json_schema_extra={"x-unit_measurement": "percent", "x-frontend_multiply": 100}, + ) + growth_interest_expense: Optional[float] = Field( + default=None, + description="Growth rate of interest expenses.", + json_schema_extra={"x-unit_measurement": "percent", "x-frontend_multiply": 100}, + ) + growth_depreciation_and_amortization: Optional[float] = Field( + default=None, + description="Growth rate of depreciation and amortization expenses.", + json_schema_extra={"x-unit_measurement": "percent", "x-frontend_multiply": 100}, + ) + growth_ebitda: Optional[float] = Field( + default=None, + description="Growth rate of Earnings Before Interest, Taxes, Depreciation, and Amortization.", + json_schema_extra={"x-unit_measurement": "percent", "x-frontend_multiply": 100}, + ) + growth_ebitda_margin: Optional[float] = Field( + default=None, + description="Growth rate of EBITDA as a percentage of revenue.", + json_schema_extra={"x-unit_measurement": "percent", "x-frontend_multiply": 100}, + ) + growth_operating_income: Optional[float] = Field( + default=None, + description="Growth rate of operating income.", + json_schema_extra={"x-unit_measurement": "percent", "x-frontend_multiply": 100}, + ) + growth_operating_income_margin: Optional[float] = Field( + default=None, + description="Growth rate of operating income as a percentage of revenue.", + json_schema_extra={"x-unit_measurement": "percent", "x-frontend_multiply": 100}, + ) + growth_total_other_income_expenses_net: Optional[float] = Field( + default=None, + description="Growth rate of net total other income and expenses.", + json_schema_extra={"x-unit_measurement": "percent", "x-frontend_multiply": 100}, + ) + growth_income_before_tax: Optional[float] = Field( + default=None, + description="Growth rate of income before taxes.", + json_schema_extra={"x-unit_measurement": "percent", "x-frontend_multiply": 100}, + ) + growth_income_before_tax_margin: Optional[float] = Field( + default=None, + description="Growth rate of income before taxes as a percentage of revenue.", + json_schema_extra={"x-unit_measurement": "percent", "x-frontend_multiply": 100}, + ) + growth_income_tax_expense: Optional[float] = Field( + default=None, + description="Growth rate of income tax expenses.", + json_schema_extra={"x-unit_measurement": "percent", "x-frontend_multiply": 100}, + ) + growth_consolidated_net_income: Optional[float] = Field( + default=None, + description="Growth rate of net income.", + json_schema_extra={"x-unit_measurement": "percent", "x-frontend_multiply": 100}, + ) + growth_net_income_margin: Optional[float] = Field( + default=None, + description="Growth rate of net income as a percentage of revenue.", + json_schema_extra={"x-unit_measurement": "percent", "x-frontend_multiply": 100}, + ) + growth_basic_earings_per_share: Optional[float] = Field( + default=None, + description="Growth rate of Earnings Per Share (EPS).", + json_schema_extra={"x-unit_measurement": "percent", "x-frontend_multiply": 100}, + ) + growth_diluted_earnings_per_share: Optional[float] = Field( + default=None, + description="Growth rate of diluted Earnings Per Share (EPS).", + json_schema_extra={"x-unit_measurement": "percent", "x-frontend_multiply": 100}, + ) + growth_weighted_average_basic_shares_outstanding: Optional[float] = Field( + default=None, + description="Growth rate of weighted average shares outstanding.", + json_schema_extra={"x-unit_measurement": "percent", "x-frontend_multiply": 100}, + ) + growth_weighted_average_diluted_shares_outstanding: Optional[float] = Field( + default=None, + description="Growth rate of diluted weighted average shares outstanding.", + json_schema_extra={"x-unit_measurement": "percent", "x-frontend_multiply": 100}, + ) + + @model_validator(mode="before") @classmethod - def date_validate(cls, v): # pylint: disable=E0213 - """Return the date as a datetime object.""" - return datetime.strptime(v, "%Y-%m-%d") + def replace_zero(cls, values): + """Check for zero values and replace with None.""" + return ( + {k: None if v == 0 else v for k, v in values.items()} + if isinstance(values, dict) + else values + ) class FMPIncomeStatementGrowthFetcher( @@ -42,7 +195,7 @@ class FMPIncomeStatementGrowthFetcher( List[FMPIncomeStatementGrowthData], ] ): - """Transform the query, extract and transform the data from the FMP endpoints.""" + """FMP Income Statement Growth Fetcher.""" @staticmethod def transform_query(params: Dict[str, Any]) -> FMPIncomeStatementGrowthQueryParams: diff --git a/openbb_platform/providers/fmp/tests/record/http/test_fmp_fetchers/test_fmp_balance_sheet_growth_fetcher.yaml b/openbb_platform/providers/fmp/tests/record/http/test_fmp_fetchers/test_fmp_balance_sheet_growth_fetcher.yaml index f062cc32ebb..68033fc0fb5 100644 --- a/openbb_platform/providers/fmp/tests/record/http/test_fmp_fetchers/test_fmp_balance_sheet_growth_fetcher.yaml +++ b/openbb_platform/providers/fmp/tests/record/http/test_fmp_fetchers/test_fmp_balance_sheet_growth_fetcher.yaml @@ -9,7 +9,7 @@ interactions: Connection: - keep-alive method: GET - uri: https://financialmodelingprep.com/api/v3/balance-sheet-statement-growth/AAPL?apikey=MOCK_API_KEY&limit=10 + uri: https://financialmodelingprep.com/api/v3/balance-sheet-statement-growth/AAPL?apikey=MOCK_API_KEY&limit=10&period=annual response: body: string: !!binary | diff --git a/openbb_platform/providers/fmp/tests/record/http/test_fmp_fetchers/test_fmp_cash_flow_statement_growth_fetcher.yaml b/openbb_platform/providers/fmp/tests/record/http/test_fmp_fetchers/test_fmp_cash_flow_statement_growth_fetcher.yaml index c75859dc90b..3579bff2b8e 100644 --- a/openbb_platform/providers/fmp/tests/record/http/test_fmp_fetchers/test_fmp_cash_flow_statement_growth_fetcher.yaml +++ b/openbb_platform/providers/fmp/tests/record/http/test_fmp_fetchers/test_fmp_cash_flow_statement_growth_fetcher.yaml @@ -9,7 +9,7 @@ interactions: Connection: - keep-alive method: GET - uri: https://financialmodelingprep.com/api/v3/cash-flow-statement-growth/AAPL?apikey=MOCK_API_KEY&limit=10 + uri: https://financialmodelingprep.com/api/v3/cash-flow-statement-growth/AAPL?apikey=MOCK_API_KEY&limit=10&period=annual response: body: string: !!binary | diff --git a/openbb_platform/providers/fmp/tests/test_fmp_fetchers.py b/openbb_platform/providers/fmp/tests/test_fmp_fetchers.py index 17992bd6946..42bfe949ccc 100644 --- a/openbb_platform/providers/fmp/tests/test_fmp_fetchers.py +++ b/openbb_platform/providers/fmp/tests/test_fmp_fetchers.py @@ -253,7 +253,7 @@ def test_fmp_world_news_fetcher(credentials=test_credentials): @pytest.mark.record_http def test_fmp_income_statement_growth_fetcher(credentials=test_credentials): """Test FMP income statement growth fetcher.""" - params = {"symbol": "AAPL"} + params = {"symbol": "AAPL", "limit": 10, "period": "annual"} fetcher = FMPIncomeStatementGrowthFetcher() result = fetcher.test(params, credentials) @@ -263,7 +263,7 @@ def test_fmp_income_statement_growth_fetcher(credentials=test_credentials): @pytest.mark.record_http def test_fmp_balance_sheet_growth_fetcher(credentials=test_credentials): """Test FMP balance sheet growth fetcher.""" - params = {"symbol": "AAPL"} + params = {"symbol": "AAPL", "limit": 10, "period": "annual"} fetcher = FMPBalanceSheetGrowthFetcher() result = fetcher.test(params, credentials) @@ -273,7 +273,7 @@ def test_fmp_balance_sheet_growth_fetcher(credentials=test_credentials): @pytest.mark.record_http def test_fmp_cash_flow_statement_growth_fetcher(credentials=test_credentials): """Test FMP cash flow statement growth fetcher.""" - params = {"symbol": "AAPL"} + params = {"symbol": "AAPL", "limit": 10, "period": "annual"} fetcher = FMPCashFlowStatementGrowthFetcher() result = fetcher.test(params, credentials) diff --git a/openbb_platform/providers/intrinio/openbb_intrinio/models/balance_sheet.py b/openbb_platform/providers/intrinio/openbb_intrinio/models/balance_sheet.py index 5b1bc8bd7fa..cb64b2df43b 100644 --- a/openbb_platform/providers/intrinio/openbb_intrinio/models/balance_sheet.py +++ b/openbb_platform/providers/intrinio/openbb_intrinio/models/balance_sheet.py @@ -22,7 +22,10 @@ class IntrinioBalanceSheetQueryParams(BalanceSheetQueryParams): Source: https://docs.intrinio.com/documentation/web_api/get_fundamental_standardized_financials_v2 """ - period: Literal["annual", "quarter"] = Field(default="annual") + period: Literal["annual", "quarter"] = Field( + default="annual", + json_schema_extra={"choices": ["annual", "quarter"]}, + ) fiscal_year: Optional[int] = Field( default=None, description="The specific fiscal year. Reports do not go beyond 2008.", diff --git a/openbb_platform/providers/intrinio/openbb_intrinio/models/cash_flow.py b/openbb_platform/providers/intrinio/openbb_intrinio/models/cash_flow.py index c8fffcc5237..3441983152d 100644 --- a/openbb_platform/providers/intrinio/openbb_intrinio/models/cash_flow.py +++ b/openbb_platform/providers/intrinio/openbb_intrinio/models/cash_flow.py @@ -2,8 +2,8 @@ # pylint: disable=unused-argument -import warnings from typing import Any, Dict, List, Literal, Optional +from warnings import warn from openbb_core.provider.abstract.fetcher import Fetcher from openbb_core.provider.standard_models.cash_flow import ( @@ -14,8 +14,6 @@ from openbb_core.provider.utils.helpers import ClientResponse, amake_requests from openbb_intrinio.utils.helpers import get_data_one from pydantic import Field, field_validator, model_validator -_warn = warnings.warn - class IntrinioCashFlowStatementQueryParams(CashFlowStatementQueryParams): """Intrinio Cash Flow Statement Query. @@ -24,7 +22,10 @@ class IntrinioCashFlowStatementQueryParams(CashFlowStatementQueryParams): Source: https://docs.intrinio.com/documentation/web_api/get_fundamental_standardized_financials_v2 """ - period: Literal["annual", "quarter", "ttm", "ytd"] = Field(default="annual") + period: Literal["annual", "quarter", "ttm", "ytd"] = Field( + default="annual", + json_schema_extra={"choices": ["annual", "quarter", "ttm", "ytd"]}, + ) fiscal_year: Optional[int] = Field( default=None, description="The specific fiscal year. Reports do not go beyond 2008.", @@ -265,7 +266,7 @@ class IntrinioCashFlowStatementFetcher( ) if query.fiscal_year is not None: if query.fiscal_year < 2008: - _warn("Financials data is only available from 2008 and later.") + warn("Financials data is only available from 2008 and later.") query.fiscal_year = 2008 fundamentals_url = fundamentals_url + f"&fiscal_year={query.fiscal_year}" fundamentals_url = fundamentals_url + f"&api_key={api_key}" diff --git a/openbb_platform/providers/intrinio/openbb_intrinio/models/income_statement.py b/openbb_platform/providers/intrinio/openbb_intrinio/models/income_statement.py index 64b95e5976a..04e9d7fa8fd 100644 --- a/openbb_platform/providers/intrinio/openbb_intrinio/models/income_statement.py +++ b/openbb_platform/providers/intrinio/openbb_intrinio/models/income_statement.py @@ -2,8 +2,8 @@ # pylint: disable=unused-argument -import warnings from typing import Any, Dict, List, Literal, Optional +from warnings import warn from openbb_core.provider.abstract.fetcher import Fetcher from openbb_core.provider.standard_models.income_statement import ( @@ -18,8 +18,6 @@ from openbb_core.provider.utils.helpers import ( from openbb_intrinio.utils.helpers import get_data_one from pydantic import Field, field_validator -_warn = warnings.warn - class IntrinioIncomeStatementQueryParams(IncomeStatementQueryParams): """Intrinio Income Statement Query. @@ -28,7 +26,10 @@ class IntrinioIncomeStatementQueryParams(IncomeStatementQueryParams): Source: https://docs.intrinio.com/documentation/web_api/get_fundamental_standardized_financials_v2 """ - period: Literal["annual", "quarter", "ttm", "ytd"] = Field(default="annual") + period: Literal["annual", "quarter", "ttm", "ytd"] = Field( + default="annual", + json_schema_extra={"choices": ["annual", "quarter", "ttm", "ytd"]}, + ) fiscal_year: Optional[int] = Field( default=None, description="The specific fiscal year. Reports do not go beyond 2008.", @@ -144,7 +145,9 @@ class IntrinioIncomeStatementData(IncomeStatementData): default=None, description="Total gross profit" ) gross_profit_margin: Optional[float] = Field( - default=None, description="Gross margin ratio." + default=None, + description="Gross margin ratio.", + json_schema_extra={"x-unit_measurement": "percent", "x-frontend_multiply": 100}, ) provision_for_credit_losses: Optional[float] = Field( default=None, @@ -290,6 +293,7 @@ class IntrinioIncomeStatementData(IncomeStatementData): ebitda_margin: Optional[float] = Field( default=None, description="Margin on Earnings Before Interest, Taxes, Depreciation and Amortization.", + json_schema_extra={"x-unit_measurement": "percent", "x-frontend_multiply": 100}, ) total_pre_tax_income: Optional[float] = Field( default=None, description="Total pre-tax income" @@ -298,7 +302,9 @@ class IntrinioIncomeStatementData(IncomeStatementData): default=None, description="Earnings Before Interest and Taxes." ) pre_tax_income_margin: Optional[float] = Field( - default=None, description="Pre-Tax Income Margin." + default=None, + description="Pre-Tax Income Margin.", + json_schema_extra={"x-unit_measurement": "percent", "x-frontend_multiply": 100}, ) income_tax_expense: Optional[float] = Field( default=None, description="Income tax expense" @@ -416,7 +422,7 @@ class IntrinioIncomeStatementFetcher( ) if query.fiscal_year is not None: if query.fiscal_year < 2008: - _warn("Financials data is only available from 2008 and later.") + warn("Financials data is only available from 2008 and later.") query.fiscal_year = 2008 fundamentals_url = fundamentals_url + f"&fiscal_year={query.fiscal_year}" fundamentals_url = fundamentals_url + f"&api_key={api_key}" @@ -441,15 +447,15 @@ class IntrinioIncomeStatementFetcher( calculations_data = [ item - for item in calculations_data.get("standardized_financials", []) + for item in calculations_data.get("standardized_financials", []) # type: ignore if item["data_tag"]["tag"] in data_tags ] return { - "period_ending": statement_data["fundamental"]["end_date"], - "fiscal_period": statement_data["fundamental"]["fiscal_period"], - "fiscal_year": statement_data["fundamental"]["fiscal_year"], - "financials": statement_data["standardized_financials"] + "period_ending": statement_data["fundamental"]["end_date"], # type: ignore + "fiscal_period": statement_data["fundamental"]["fiscal_period"], # type: ignore + "fiscal_year": statement_data["fundamental"]["fiscal_year"], # type: ignore + "financials": statement_data["standardized_financials"] # type: ignore + calculations_data, } diff --git a/openbb_platform/providers/polygon/openbb_polygon/models/balance_sheet.py b/openbb_platform/providers/polygon/openbb_polygon/models/balance_sheet.py index ecd6691f37a..4250c7ba53c 100644 --- a/openbb_platform/providers/polygon/openbb_polygon/models/balance_sheet.py +++ b/openbb_platform/providers/polygon/openbb_polygon/models/balance_sheet.py @@ -1,6 +1,8 @@ """Polygon Balance Sheet Statement Model.""" -from datetime import date +# pylint: disable=unused-argument + +from datetime import date as dateType from typing import Any, Dict, List, Literal, Optional from openbb_core.provider.abstract.fetcher import Fetcher @@ -10,7 +12,7 @@ from openbb_core.provider.standard_models.balance_sheet import ( ) from openbb_core.provider.utils.helpers import get_querystring from openbb_polygon.utils.helpers import get_data_many -from pydantic import Field +from pydantic import Field, model_validator class PolygonBalanceSheetQueryParams(BalanceSheetQueryParams): @@ -21,41 +23,44 @@ class PolygonBalanceSheetQueryParams(BalanceSheetQueryParams): __alias_dict__ = {"symbol": "ticker", "period": "timeframe"} - period: Literal["annual", "quarter", "ttm"] = Field(default="annual") - filing_date: Optional[date] = Field( + period: Literal["annual", "quarter", "ttm"] = Field( + default="annual", + json_schema_extra={"choices": ["annual", "quarter", "ttm"]}, + ) + filing_date: Optional[dateType] = Field( default=None, description="Filing date of the financial statement." ) - filing_date_lt: Optional[date] = Field( + filing_date_lt: Optional[dateType] = Field( default=None, description="Filing date less than the given date." ) - filing_date_lte: Optional[date] = Field( + filing_date_lte: Optional[dateType] = Field( default=None, description="Filing date less than or equal to the given date.", ) - filing_date_gt: Optional[date] = Field( + filing_date_gt: Optional[dateType] = Field( default=None, description="Filing date greater than the given date.", ) - filing_date_gte: Optional[date] = Field( + filing_date_gte: Optional[dateType] = Field( default=None, description="Filing date greater than or equal to the given date.", ) - period_of_report_date: Optional[date] = Field( + period_of_report_date: Optional[dateType] = Field( default=None, description="Period of report date of the financial statement." ) - period_of_report_date_lt: Optional[date] = Field( + period_of_report_date_lt: Optional[dateType] = Field( default=None, description="Period of report date less than the given date.", ) - period_of_report_date_lte: Optional[date] = Field( + period_of_report_date_lte: Optional[dateType] = Field( default=None, description="Period of report date less than or equal to the given date.", ) - period_of_report_date_gt: Optional[date] = Field( + period_of_report_date_gt: Optional[dateType] = Field( default=None, description="Period of report date greater than the given date.", ) - period_of_report_date_gte: Optional[date] = Field( + period_of_report_date_gte: Optional[dateType] = Field( default=None, description="Period of report date greater than or equal to the given date.", ) @@ -76,7 +81,7 @@ class PolygonBalanceSheetData(BalanceSheetData): __alias_dict__ = { "date": "start_date", - "total_liabilities_and_stock_holders_equity": "liabilities_and_equity", + "total_liabilities_and_shareholders_equity": "liabilities_and_equity", "minority_interest": "equity_attributable_to_noncontrolling_interest", "total_current_assets": "current_assets", "marketable_securities": "fixed_assets", @@ -88,88 +93,100 @@ class PolygonBalanceSheetData(BalanceSheetData): "other_non_current_liabilities": "other_noncurrent_liabilities", "total_non_current_liabilities": "noncurrent_liabilities", "total_liabilities": "liabilities", - "total_stock_holders_equity": "equity_attributable_to_parent", + "total_shareholders_equity": "equity_attributable_to_parent", "total_equity": "equity", "employee_wages": "wages", "redeemable_non_controlling_interest": "redeemable_noncontrolling_interest", "redeemable_non_controlling_interest_other": "redeemable_noncontrolling_interest_other", } - accounts_receivable: Optional[int] = Field( + accounts_receivable: Optional[float] = Field( description="Accounts receivable", default=None ) - marketable_securities: Optional[int] = Field( + marketable_securities: Optional[float] = Field( description="Marketable securities", default=None ) - prepaid_expenses: Optional[int] = Field( + prepaid_expenses: Optional[float] = Field( description="Prepaid expenses", default=None ) - other_current_assets: Optional[int] = Field( + other_current_assets: Optional[float] = Field( description="Other current assets", default=None ) - total_current_assets: Optional[int] = Field( + total_current_assets: Optional[float] = Field( description="Total current assets", default=None ) - property_plant_equipment_net: Optional[int] = Field( + property_plant_equipment_net: Optional[float] = Field( description="Property plant and equipment net", default=None ) - inventory: Optional[int] = Field(description="Inventory", default=None) - other_non_current_assets: Optional[int] = Field( + inventory: Optional[float] = Field(description="Inventory", default=None) + other_non_current_assets: Optional[float] = Field( description="Other non-current assets", default=None ) - total_non_current_assets: Optional[int] = Field( + total_non_current_assets: Optional[float] = Field( description="Total non-current assets", default=None ) - intangible_assets: Optional[int] = Field( + intangible_assets: Optional[float] = Field( description="Intangible assets", default=None ) - total_assets: Optional[int] = Field(description="Total assets", default=None) - accounts_payable: Optional[int] = Field( + total_assets: Optional[float] = Field(description="Total assets", default=None) + accounts_payable: Optional[float] = Field( description="Accounts payable", default=None ) - employee_wages: Optional[int] = Field(description="Employee wages", default=None) - other_current_liabilities: Optional[int] = Field( + employee_wages: Optional[float] = Field(description="Employee wages", default=None) + other_current_liabilities: Optional[float] = Field( description="Other current liabilities", default=None ) - total_current_liabilities: Optional[int] = Field( + total_current_liabilities: Optional[float] = Field( description="Total current liabilities", default=None ) - other_non_current_liabilities: Optional[int] = Field( + other_non_current_liabilities: Optional[float] = Field( description="Other non-current liabilities", default=None ) - total_non_current_liabilities: Optional[int] = Field( + total_non_current_liabilities: Optional[float] = Field( description="Total non-current liabilities", default=None ) - long_term_debt: Optional[int] = Field(description="Long term debt", default=None) - total_liabilities: Optional[int] = Field( + long_term_debt: Optional[float] = Field(description="Long term debt", default=None) + total_liabilities: Optional[float] = Field( description="Total liabilities", default=None ) - minority_interest: Optional[int] = Field( + minority_interest: Optional[float] = Field( description="Minority interest", default=None ) - temporary_equity_attributable_to_parent: Optional[int] = Field( + temporary_equity_attributable_to_parent: Optional[float] = Field( description="Temporary equity attributable to parent", default=None ) - equity_attributable_to_parent: Optional[int] = Field( + equity_attributable_to_parent: Optional[float] = Field( description="Equity attributable to parent", default=None ) - temporary_equity: Optional[int] = Field( + temporary_equity: Optional[float] = Field( description="Temporary equity", default=None ) - preferred_stock: Optional[int] = Field(description="Preferred stock", default=None) - redeemable_non_controlling_interest: Optional[int] = Field( + preferred_stock: Optional[float] = Field( + description="Preferred stock", default=None + ) + redeemable_non_controlling_interest: Optional[float] = Field( description="Redeemable non-controlling interest", default=None ) - redeemable_non_controlling_interest_other: Optional[int] = Field( + redeemable_non_controlling_interest_other: Optional[float] = Field( description="Redeemable non-controlling interest other", default=None ) - total_stock_holders_equity: Optional[int] = Field( + total_shareholders_equity: Optional[float] = Field( description="Total stock holders equity", default=None ) - total_liabilities_and_stock_holders_equity: Optional[int] = Field( + total_equity: Optional[float] = Field(description="Total equity", default=None) + total_liabilities_and_shareholders_equity: Optional[float] = Field( description="Total liabilities and stockholders equity", default=None ) - total_equity: Optional[int] = Field(description="Total equity", default=None) + + @model_validator(mode="before") + @classmethod + def replace_zero(cls, values): + """Check for zero values and replace with None.""" + return ( + {k: None if v == 0 else v for k, v in values.items()} + if isinstance(values, dict) + else values + ) class PolygonBalanceSheetFetcher( @@ -207,7 +224,7 @@ class PolygonBalanceSheetFetcher( request_url = f"{base_url}?{query_string}&apiKey={api_key}" - return await get_data_many(request_url, "results", **kwargs) + return await get_data_many(request_url, "results", **kwargs) # type: ignore @staticmethod def transform_data( @@ -216,7 +233,7 @@ class PolygonBalanceSheetFetcher( **kwargs: Any, ) -> List[PolygonBalanceSheetData]: """Return the transformed data.""" - transformed_data = [] + transformed_data: List[PolygonBalanceSheetData] = [] for item in data: if "balance_sheet" in item["financials"]: diff --git a/openbb_platform/providers/polygon/openbb_polygon/models/cash_flow.py b/openbb_platform/providers/polygon/openbb_polygon/models/cash_flow.py index 51d7f432a6f..320ca6bf1e2 100644 --- a/openbb_platform/providers/polygon/openbb_polygon/models/cash_flow.py +++ b/openbb_platform/providers/polygon/openbb_polygon/models/cash_flow.py @@ -1,5 +1,7 @@ """Polygon Cash Flow Statement Model.""" +# pylint: disable=unused-argument + from datetime import date as dateType from typing import Any, Dict, List, Literal, Optional @@ -10,7 +12,7 @@ from openbb_core.provider.standard_models.cash_flow import ( ) from openbb_core.provider.utils.helpers import get_querystring from openbb_polygon.utils.helpers import get_data_many -from pydantic import Field +from pydantic import Field, model_validator class PolygonCashFlowStatementQueryParams(CashFlowStatementQueryParams): @@ -21,7 +23,10 @@ class PolygonCashFlowStatementQueryParams(CashFlowStatementQueryParams): __alias_dict__ = {"symbol": "ticker", "period": "timeframe"} - period: Literal["annual", "quarter"] = Field(default="annual") + period: Literal["annual", "quarter", "ttm"] = Field( + default="annual", + json_schema_extra={"choices": ["annual", "quarter", "ttm"]}, + ) filing_date: Optional[dateType] = Field( default=None, description="Filing date of the financial statement." @@ -75,46 +80,56 @@ class PolygonCashFlowStatementQueryParams(CashFlowStatementQueryParams): class PolygonCashFlowStatementData(CashFlowStatementData): """Polygon Cash Flow Statement Data.""" - net_cash_flow_from_operating_activities_continuing: Optional[int] = Field( + net_cash_flow_from_operating_activities_continuing: Optional[float] = Field( description="Net cash flow from operating activities continuing.", default=None ) - net_cash_flow_from_operating_activities_discontinued: Optional[int] = Field( + net_cash_flow_from_operating_activities_discontinued: Optional[float] = Field( description="Net cash flow from operating activities discontinued.", default=None, ) - net_cash_flow_from_operating_activities: Optional[int] = Field( + net_cash_flow_from_operating_activities: Optional[float] = Field( description="Net cash flow from operating activities.", default=None ) - net_cash_flow_from_investing_activities_continuing: Optional[int] = Field( + net_cash_flow_from_investing_activities_continuing: Optional[float] = Field( description="Net cash flow from investing activities continuing.", default=None ) - net_cash_flow_from_investing_activities_discontinued: Optional[int] = Field( + net_cash_flow_from_investing_activities_discontinued: Optional[float] = Field( description="Net cash flow from investing activities discontinued.", default=None, ) - net_cash_flow_from_investing_activities: Optional[int] = Field( + net_cash_flow_from_investing_activities: Optional[float] = Field( description="Net cash flow from investing activities.", default=None ) - net_cash_flow_from_financing_activities_continuing: Optional[int] = Field( + net_cash_flow_from_financing_activities_continuing: Optional[float] = Field( description="Net cash flow from financing activities continuing.", default=None ) - net_cash_flow_from_financing_activities_discontinued: Optional[int] = Field( + net_cash_flow_from_financing_activities_discontinued: Optional[float] = Field( description="Net cash flow from financing activities discontinued.", default=None, ) - net_cash_flow_from_financing_activities: Optional[int] = Field( + net_cash_flow_from_financing_activities: Optional[float] = Field( description="Net cash flow from financing activities.", default=None ) - net_cash_flow_continuing: Optional[int] = Field( + net_cash_flow_continuing: Optional[float] = Field( description="Net cash flow continuing.", default=None ) - net_cash_flow_discontinued: Optional[int] = Field( + net_cash_flow_discontinued: Optional[float] = Field( description="Net cash flow discontinued.", default=None ) - exchange_gains_losses: Optional[int] = Field( + exchange_gains_losses: Optional[float] = Field( description="Exchange gains losses.", default=None ) - net_cash_flow: Optional[int] = Field(description="Net cash flow.", default=None) + net_cash_flow: Optional[float] = Field(description="Net cash flow.", default=None) + + @model_validator(mode="before") + @classmethod + def replace_zero(cls, values): + """Check for zero values and replace with None.""" + return ( + {k: None if v == 0 else v for k, v in values.items()} + if isinstance(values, dict) + else values + ) class PolygonCashFlowStatementFetcher( @@ -123,7 +138,7 @@ class PolygonCashFlowStatementFetcher( List[PolygonCashFlowStatementData], ] ): - """Transform the query, extract and transform the data from the Polygon endpoints.""" + """Polygon Cash Flow Statement Fetcher.""" @staticmethod def transform_query(params: Dict[str, Any]) -> PolygonCashFlowStatementQueryParams: @@ -135,7 +150,7 @@ class PolygonCashFlowStatementFetcher( query: PolygonCashFlowStatementQueryParams, credentials: Optional[Dict[str, str]], **kwargs: Any, - ) -> dict: + ) -> Dict: """Return the raw data from the Intrinio endpoint.""" api_key = credentials.get("polygon_api_key") if credentials else "" @@ -156,16 +171,16 @@ class PolygonCashFlowStatementFetcher( request_url = f"{base_url}?{query_string}&apiKey={api_key}" - return await get_data_many(request_url, "results", **kwargs) + return await get_data_many(request_url, "results", **kwargs) # type: ignore @staticmethod def transform_data( - query: PolygonCashFlowStatementQueryParams, # pylint: disable=unused-argument - data: dict, - **kwargs: Any, # pylint: disable=unused-argument + query: PolygonCashFlowStatementQueryParams, + data: Dict, + **kwargs: Any, ) -> List[PolygonCashFlowStatementData]: """Return the transformed data.""" - transformed_data = [] + transformed_data: List[PolygonCashFlowStatementData] = [] for item in data: sub_data = { diff --git a/openbb_platform/providers/polygon/openbb_polygon/models/income_statement.py b/openbb_platform/providers/polygon/openbb_polygon/models/income_statement.py index 6fee1010fea..10883be72bd 100644 --- a/openbb_platform/providers/polygon/openbb_polygon/models/income_statement.py +++ b/openbb_platform/providers/polygon/openbb_polygon/models/income_statement.py @@ -1,7 +1,8 @@ """Polygon Income Statement Model.""" # pylint: disable=unused-argument -from datetime import date + +from datetime import date as dateType from typing import Any, Dict, List, Literal, Optional from openbb_core.provider.abstract.fetcher import Fetcher @@ -22,41 +23,44 @@ class PolygonIncomeStatementQueryParams(IncomeStatementQueryParams): __alias_dict__ = {"symbol": "ticker", "period": "timeframe"} - period: Literal["annual", "quarter", "ttm"] = Field(default="annual") - filing_date: Optional[date] = Field( + period: Literal["annual", "quarter", "ttm"] = Field( + default="annual", + json_schema_extra={"choices": ["annual", "quarter", "ttm"]}, + ) + filing_date: Optional[dateType] = Field( default=None, description="Filing date of the financial statement." ) - filing_date_lt: Optional[date] = Field( + filing_date_lt: Optional[dateType] = Field( default=None, description="Filing date less than the given date." ) - filing_date_lte: Optional[date] = Field( + filing_date_lte: Optional[dateType] = Field( default=None, description="Filing date less than or equal to the given date.", ) - filing_date_gt: Optional[date] = Field( + filing_date_gt: Optional[dateType] = Field( default=None, description="Filing date greater than the given date.", ) - filing_date_gte: Optional[date] = Field( + filing_date_gte: Optional[dateType] = Field( default=None, description="Filing date greater than or equal to the given date.", ) - period_of_report_date: Optional[date] = Field( + period_of_report_date: Optional[dateType] = Field( default=None, description="Period of report date of the financial statement." ) - period_of_report_date_lt: Optional[date] = Field( + period_of_report_date_lt: Optional[dateType] = Field( default=None, description="Period of report date less than the given date.", ) - period_of_report_date_lte: Optional[date] = Field( + period_of_report_date_lte: Optional[dateType] = Field( default=None, description="Period of report date less than or equal to the given date.", ) - period_of_report_date_gt: Optional[date] = Field( + period_of_report_date_gt: Optional[dateType] = Field( default=None, description="Period of report date greater than the given date.", ) - period_of_report_date_gte: Optional[date] = Field( + period_of_report_date_gte: Optional[dateType] = Field( default=None, description="Period of report date greater than or equal to the given date.", ) @@ -261,7 +265,7 @@ class PolygonIncomeStatementFetcher( List[PolygonIncomeStatementData], ] ): - """Transform the query, extract and transform the data from the Polygon endpoints.""" + """Polygon Income Statement Fetcher.""" @staticmethod def transform_query(params: Dict[str, Any]) -> PolygonIncomeStatementQueryParams: @@ -290,7 +294,7 @@ class PolygonIncomeStatementFetcher( request_url = f"{base_url}?{query_string}&apiKey={api_key}" - return await get_data_many(request_url, "results", **kwargs) + return await get_data_many(request_url, "results", **kwargs) # type: ignore @staticmethod def transform_data( @@ -299,7 +303,7 @@ class PolygonIncomeStatementFetcher( **kwargs: Any, ) -> List[PolygonIncomeStatementData]: """Return the transformed data.""" - transformed_data = [] + transformed_data: List[PolygonIncomeStatementData] = [] for item in data: sub_data = { diff --git a/openbb_platform/providers/yfinance/openbb_yfinance/models/balance_sheet.py b/openbb_platform/providers/yfinance/openbb_yfinance/models/balance_sheet.py index 24d3f536a6f..1788adf6475 100644 --- a/openbb_platform/providers/yfinance/openbb_yfinance/models/balance_sheet.py +++ b/openbb_platform/providers/yfinance/openbb_yfinance/models/balance_sheet.py @@ -21,7 +21,10 @@ class YFinanceBalanceSheetQueryParams(BalanceSheetQueryParams): Source: https://finance.yahoo.com/ """ - period: Optional[Literal["annual", "quarter"]] = Field(default="annual") + period: Literal["annual", "quarter"] = Field( + default="annual", + json_schema_extra={"choices": ["annual", "quarter"]}, + ) class YFinanceBalanceSheetData(BalanceSheetData): diff --git a/openbb_platform/providers/yfinance/openbb_yfinance/models/cash_flow.py b/openbb_platform/providers/yfinance/openbb_yfinance/models/cash_flow.py index cef64f77c5c..f025bbe36b3 100644 --- a/openbb_platform/providers/yfinance/openbb_yfinance/models/cash_flow.py +++ b/openbb_platform/providers/yfinance/openbb_yfinance/models/cash_flow.py @@ -21,7 +21,10 @@ class YFinanceCashFlowStatementQueryParams(CashFlowStatementQueryParams): Source: https://finance.yahoo.com/ """ - period: Optional[Literal["annual", "quarter"]] = Field(default="annual") + period: Literal["annual", "quarter"] = Field( + default="annual", + json_schema_extra={"chocies": ["annual", "quarter"]}, + ) class YFinanceCashFlowStatementData(CashFlowStatementData): diff --git a/openbb_platform/providers/yfinance/openbb_yfinance/models/income_statement.py b/openbb_platform/providers/yfinance/openbb_yfinance/models/income_statement.py index 6f8cc0a1fda..6b79891cd0f 100644 --- a/openbb_platform/providers/yfinance/openbb_yfinance/models/income_statement.py +++ b/openbb_platform/providers/yfinance/openbb_yfinance/models/income_statement.py @@ -21,7 +21,10 @@ class YFinanceIncomeStatementQueryParams(IncomeStatementQueryParams): Source: https://finance.yahoo.com/ """ - period: Optional[Literal["annual", "quarter"]] = Field(default="annual") + period: Literal["annual", "quarter"] = Field( + default="annual", + json_schema_extra={"choices": ["annual", "quarter"]}, + ) class YFinanceIncomeStatementData(IncomeStatementData):