From bec1a53202a8fd5cc5ea98f7565bb2a0bd93677e Mon Sep 17 00:00:00 2001 From: Igor Radovanovic <74266147+IgorWounds@users.noreply.github.com> Date: Fri, 11 Aug 2023 12:38:25 +0200 Subject: [PATCH 1/3] Convert all return fields to snake_case --- .../openbb_core/app/static/package/crypto.py | 8 ++-- .../openbb_core/app/static/package/economy.py | 8 ++-- .../openbb_core/app/static/package/forex.py | 10 ++--- .../openbb_core/app/static/package/news.py | 12 ++--- .../openbb_core/app/static/package/stocks.py | 18 ++++---- .../app/static/package/stocks_fa.py | 44 +++++++++---------- .../openbb_core/app/static/package_builder.py | 7 ++- .../provider/openbb_provider/abstract/data.py | 11 +++++ 8 files changed, 67 insertions(+), 51 deletions(-) diff --git a/openbb_sdk/sdk/core/openbb_core/app/static/package/crypto.py b/openbb_sdk/sdk/core/openbb_core/app/static/package/crypto.py index 78b79d715db..8a8f7206fec 100644 --- a/openbb_sdk/sdk/core/openbb_core/app/static/package/crypto.py +++ b/openbb_sdk/sdk/core/openbb_core/app/static/package/crypto.py @@ -118,17 +118,17 @@ class CLASS_crypto(Container): CryptoEOD --------- - adjClose : float + adj_close : float Adjusted Close Price of the symbol. - unadjustedVolume : float + unadjusted_volume : float Unadjusted volume of the symbol. change : float Change in the price of the symbol from the previous day. - changePercent : float + change_percent : float Change \% in the price of the symbol. label : str Human readable format of the date. - changeOverTime : float + change_over_time : float Change \% in the price of the symbol over a period of time.""" inputs = filter_inputs( provider_choices={ diff --git a/openbb_sdk/sdk/core/openbb_core/app/static/package/economy.py b/openbb_sdk/sdk/core/openbb_core/app/static/package/economy.py index f948bd96570..5f9467a7dff 100644 --- a/openbb_sdk/sdk/core/openbb_core/app/static/package/economy.py +++ b/openbb_sdk/sdk/core/openbb_core/app/static/package/economy.py @@ -429,19 +429,19 @@ class CLASS_economy(Container): --------------- date : datetime The date of the data. - adjClose : float + adj_close : float Adjusted Close Price of the symbol. - unadjustedVolume : float + unadjusted_volume : float Unadjusted volume of the symbol. change : float Change in the price of the symbol from the previous day. - changePercent : float + change_percent : float Change \% in the price of the symbol. vwap : float Volume Weighted Average Price of the symbol. label : str Human readable format of the date. - changeOverTime : float + change_over_time : float Change \% in the price of the symbol over a period of time.""" inputs = filter_inputs( provider_choices={ diff --git a/openbb_sdk/sdk/core/openbb_core/app/static/package/forex.py b/openbb_sdk/sdk/core/openbb_core/app/static/package/forex.py index 21d30707bfb..c41e1ecc261 100644 --- a/openbb_sdk/sdk/core/openbb_core/app/static/package/forex.py +++ b/openbb_sdk/sdk/core/openbb_core/app/static/package/forex.py @@ -107,7 +107,7 @@ class CLASS_forex(Container): The symbol of the currency pair. currency : str The base currency of the currency pair. - stockExchange : Optional[str] + stock_exchange : Optional[str] The stock exchange of the currency pair. exchange_short_name : Optional[str] The short name of the stock exchange of the currency pair.""" @@ -231,17 +231,17 @@ class CLASS_forex(Container): ForexEOD -------- - adjClose : float + adj_close : float Adjusted Close Price of the symbol. - unadjustedVolume : float + unadjusted_volume : float Unadjusted volume of the symbol. change : float Change in the price of the symbol from the previous day. - changePercent : float + change_percent : float Change \% in the price of the symbol. label : str Human readable format of the date. - changeOverTime : float + change_over_time : float Change \% in the price of the symbol over a period of time.""" inputs = filter_inputs( provider_choices={ diff --git a/openbb_sdk/sdk/core/openbb_core/app/static/package/news.py b/openbb_sdk/sdk/core/openbb_core/app/static/package/news.py index 703fd2fd0ac..924ac8db425 100644 --- a/openbb_sdk/sdk/core/openbb_core/app/static/package/news.py +++ b/openbb_sdk/sdk/core/openbb_core/app/static/package/news.py @@ -73,19 +73,19 @@ class CLASS_news(Container): Parameters ---------- - pageSize : int + page_size : int The number of results to return per page. - displayOutput : Literal['headline', 'summary', 'full', 'all'] + display_output : Literal['headline', 'summary', 'full', 'all'] The type of data to return. date : Optional[datetime] The date of the news to retrieve. - dateFrom : Optional[datetime] + date_from : Optional[datetime] The start date of the news to retrieve. - dateTo : Optional[datetime] + date_to : Optional[datetime] The end date of the news to retrieve. - updatedSince : Optional[int] + updated_since : Optional[int] The number of seconds since the news was updated. - publishedSince : Optional[int] + published_since : Optional[int] The number of seconds since the news was published. sort : Optional[Literal['published_at', 'updated_at', 'title', 'author', 'channel', 'ticker', 'topic', 'content_type']] The order in which to sort the news. Options are: published_at, updated_at, title, author, channel, ticker, topic, content_type. diff --git a/openbb_sdk/sdk/core/openbb_core/app/static/package/stocks.py b/openbb_sdk/sdk/core/openbb_core/app/static/package/stocks.py index 8fd80da14ba..3cb451a182b 100644 --- a/openbb_sdk/sdk/core/openbb_core/app/static/package/stocks.py +++ b/openbb_sdk/sdk/core/openbb_core/app/static/package/stocks.py @@ -185,17 +185,17 @@ class CLASS_stocks(Container): StockEOD -------- - adjClose : float + adj_close : float Adjusted Close Price of the symbol. - unadjustedVolume : float + unadjusted_volume : float Unadjusted volume of the symbol. change : float Change in the price of the symbol from the previous day. - changePercent : float + change_percent : float Change \% in the price of the symbol. label : str Human readable format of the date. - changeOverTime : float + change_over_time : float Change \% in the price of the symbol over a period of time.""" inputs = filter_inputs( provider_choices={ @@ -288,17 +288,17 @@ class CLASS_stocks(Container): Parameters ---------- - displayOutput : Literal['headline', 'summary', 'full', 'all'] + display_output : Literal['headline', 'summary', 'full', 'all'] The type of data to return. date : Optional[datetime] The date of the news to retrieve. - dateFrom : Optional[datetime] + date_from : Optional[datetime] The start date of the news to retrieve. - dateTo : Optional[datetime] + date_to : Optional[datetime] The end date of the news to retrieve. - updatedSince : Optional[int] + updated_since : Optional[int] The number of seconds since the news was updated. - publishedSince : Optional[int] + published_since : Optional[int] The number of seconds since the news was published. sort : Optional[Literal['published_at', 'updated_at', 'title', 'author', 'channel', 'ticker', 'topic', 'content_type']] The order in which to sort the news. Options are: published_at, updated_at, title, author, channel, ticker, topic, content_type. diff --git a/openbb_sdk/sdk/core/openbb_core/app/static/package/stocks_fa.py b/openbb_sdk/sdk/core/openbb_core/app/static/package/stocks_fa.py index aa9abebcde3..48b2e8d46d7 100644 --- a/openbb_sdk/sdk/core/openbb_core/app/static/package/stocks_fa.py +++ b/openbb_sdk/sdk/core/openbb_core/app/static/package/stocks_fa.py @@ -229,29 +229,29 @@ class CLASS_stocks_fa(Container): BalanceSheet ------------ - calendarYear : Optional[int] + calendar_year : Optional[int] None link : Optional[str] None - finalLink : Optional[str] + final_link : Optional[str] None - cashAndShortTermInvestments : Optional[int] + cash_and_short_term_investments : Optional[int] None - goodwillAndIntangibleAssets : Optional[int] + goodwill_and_intangible_assets : Optional[int] None - deferredRevenueNonCurrent : Optional[int] + deferred_revenue_non_current : Optional[int] None - totalInvestments : Optional[int] + total_investments : Optional[int] None - capitalLeaseObligations : Optional[int] + capital_lease_obligations : Optional[int] None - deferredTaxLiabilitiesNonCurrent : Optional[int] + deferred_tax_liabilities_non_current : Optional[int] None - totalNonCurrentLiabilities : Optional[int] + total_non_current_liabilities : Optional[int] None - totalDebt : Optional[int] + total_debt : Optional[int] None - netDebt : Optional[int] + net_debt : Optional[int] None""" inputs = filter_inputs( provider_choices={ @@ -710,11 +710,11 @@ class CLASS_stocks_fa(Container): CashFlowStatement ----------------- - calendarYear : Optional[int] + calendar_year : Optional[int] None link : Optional[str] None - finalLink : Optional[str] + final_link : Optional[str] None""" inputs = filter_inputs( provider_choices={ @@ -1821,21 +1821,21 @@ class CLASS_stocks_fa(Container): IncomeStatement --------------- - calendarYear : Optional[int] + calendar_year : Optional[int] None - grossProfitRatio : Optional[float] + gross_profit_ratio : Optional[float] None ebitdaratio : Optional[float] None - operatingIncomeRatio : Optional[float] + operating_income_ratio : Optional[float] None - incomeBeforeTaxRatio : Optional[float] + income_before_tax_ratio : Optional[float] None - netIncomeRatio : Optional[float] + net_income_ratio : Optional[float] None link : Optional[str] None - finalLink : Optional[str] + final_link : Optional[str] None""" inputs = filter_inputs( provider_choices={ @@ -2064,11 +2064,11 @@ class CLASS_stocks_fa(Container): The provider to use for the query. symbol : ConstrainedStrValue Symbol to get data for. - transactionType : Optional[List[Literal['A-Award', 'C-Conversion', 'D-Return', 'E-ExpireShort', 'F-InKind', 'G-Gift', 'H-ExpireLong', 'I-Discretionary', 'J-Other', 'L-Small', 'M-Exempt', 'O-OutOfTheMoney', 'P-Purchase', 'S-Sale', 'U-Tender', 'W-Will', 'X-InTheMoney', 'Z-Trust']]] + transaction_type : Optional[List[Literal['A-Award', 'C-Conversion', 'D-Return', 'E-ExpireShort', 'F-InKind', 'G-Gift', 'H-ExpireLong', 'I-Discretionary', 'J-Other', 'L-Small', 'M-Exempt', 'O-OutOfTheMoney', 'P-Purchase', 'S-Sale', 'U-Tender', 'W-Will', 'X-InTheMoney', 'Z-Trust']]] The type of the transaction. - reportingCik : Optional[int] + reporting_cik : Optional[int] The CIK of the reporting owner. - companyCik : Optional[int] + company_cik : Optional[int] The CIK of the company owner. page : Optional[int] The page number of the data to fetch. diff --git a/openbb_sdk/sdk/core/openbb_core/app/static/package_builder.py b/openbb_sdk/sdk/core/openbb_core/app/static/package_builder.py index bd32af3258a..b5b31d4f376 100644 --- a/openbb_sdk/sdk/core/openbb_core/app/static/package_builder.py +++ b/openbb_sdk/sdk/core/openbb_core/app/static/package_builder.py @@ -1,4 +1,5 @@ import builtins +import re import shutil import subprocess from collections import OrderedDict @@ -308,6 +309,10 @@ class DocstringGenerator: field_mapping = mapping[model_name][provider.lower()][section_name]["fields"] fields = field_mapping.keys() + def _to_snake_case(string: str) -> str: + s1 = re.sub("(.)([A-Z][a-z]+)", r"\1_\2", string) + return re.sub("([a-z0-9])([A-Z])", r"\1_\2", s1).lower() + if len(fields) == 0: section_docstring += "All fields are standardized.\n" else: @@ -322,7 +327,7 @@ class DocstringGenerator: field_description = field_mapping[field].field_info.description - section_docstring += f"{field} : {field_type}\n" + section_docstring += f"{_to_snake_case(field)} : {field_type}\n" section_docstring += f"{padding}{field_description}\n" if provider == "openbb" and section_name == "QueryParams": diff --git a/openbb_sdk/sdk/provider/openbb_provider/abstract/data.py b/openbb_sdk/sdk/provider/openbb_provider/abstract/data.py index 17f67b05c60..8e2f6601bac 100644 --- a/openbb_sdk/sdk/provider/openbb_provider/abstract/data.py +++ b/openbb_sdk/sdk/provider/openbb_provider/abstract/data.py @@ -1,9 +1,20 @@ +import re + from pydantic import BaseModel, Extra +def to_snake_case(string: str) -> str: + s1 = re.sub("(.)([A-Z][a-z]+)", r"\1_\2", string) + return re.sub("([a-z0-9])([A-Z])", r"\1_\2", s1).lower() + + class Data(BaseModel): """The OpenBB Standardized Data Model.""" + def dict(self, *args, **kwargs): + original_dict = super().dict(*args, **kwargs) + return {to_snake_case(k): v for k, v in original_dict.items()} + def __repr__(self): return f"{self.__class__.__name__}({', '.join([f'{k}={v}' for k, v in self.dict().items()])})" From bd1bca653e43a4627b8c6210a808609a06af96a7 Mon Sep 17 00:00:00 2001 From: Igor Radovanovic <74266147+IgorWounds@users.noreply.github.com> Date: Fri, 11 Aug 2023 16:59:07 +0200 Subject: [PATCH 2/3] Revert "Convert all return fields to snake_case" This reverts commit bec1a53202a8fd5cc5ea98f7565bb2a0bd93677e. --- .../openbb_core/app/static/package/crypto.py | 8 ++-- .../openbb_core/app/static/package/economy.py | 8 ++-- .../openbb_core/app/static/package/forex.py | 10 ++--- .../openbb_core/app/static/package/news.py | 12 ++--- .../openbb_core/app/static/package/stocks.py | 18 ++++---- .../app/static/package/stocks_fa.py | 44 +++++++++---------- .../openbb_core/app/static/package_builder.py | 7 +-- .../provider/openbb_provider/abstract/data.py | 11 ----- 8 files changed, 51 insertions(+), 67 deletions(-) diff --git a/openbb_sdk/sdk/core/openbb_core/app/static/package/crypto.py b/openbb_sdk/sdk/core/openbb_core/app/static/package/crypto.py index 8a8f7206fec..78b79d715db 100644 --- a/openbb_sdk/sdk/core/openbb_core/app/static/package/crypto.py +++ b/openbb_sdk/sdk/core/openbb_core/app/static/package/crypto.py @@ -118,17 +118,17 @@ class CLASS_crypto(Container): CryptoEOD --------- - adj_close : float + adjClose : float Adjusted Close Price of the symbol. - unadjusted_volume : float + unadjustedVolume : float Unadjusted volume of the symbol. change : float Change in the price of the symbol from the previous day. - change_percent : float + changePercent : float Change \% in the price of the symbol. label : str Human readable format of the date. - change_over_time : float + changeOverTime : float Change \% in the price of the symbol over a period of time.""" inputs = filter_inputs( provider_choices={ diff --git a/openbb_sdk/sdk/core/openbb_core/app/static/package/economy.py b/openbb_sdk/sdk/core/openbb_core/app/static/package/economy.py index 5f9467a7dff..f948bd96570 100644 --- a/openbb_sdk/sdk/core/openbb_core/app/static/package/economy.py +++ b/openbb_sdk/sdk/core/openbb_core/app/static/package/economy.py @@ -429,19 +429,19 @@ class CLASS_economy(Container): --------------- date : datetime The date of the data. - adj_close : float + adjClose : float Adjusted Close Price of the symbol. - unadjusted_volume : float + unadjustedVolume : float Unadjusted volume of the symbol. change : float Change in the price of the symbol from the previous day. - change_percent : float + changePercent : float Change \% in the price of the symbol. vwap : float Volume Weighted Average Price of the symbol. label : str Human readable format of the date. - change_over_time : float + changeOverTime : float Change \% in the price of the symbol over a period of time.""" inputs = filter_inputs( provider_choices={ diff --git a/openbb_sdk/sdk/core/openbb_core/app/static/package/forex.py b/openbb_sdk/sdk/core/openbb_core/app/static/package/forex.py index c41e1ecc261..21d30707bfb 100644 --- a/openbb_sdk/sdk/core/openbb_core/app/static/package/forex.py +++ b/openbb_sdk/sdk/core/openbb_core/app/static/package/forex.py @@ -107,7 +107,7 @@ class CLASS_forex(Container): The symbol of the currency pair. currency : str The base currency of the currency pair. - stock_exchange : Optional[str] + stockExchange : Optional[str] The stock exchange of the currency pair. exchange_short_name : Optional[str] The short name of the stock exchange of the currency pair.""" @@ -231,17 +231,17 @@ class CLASS_forex(Container): ForexEOD -------- - adj_close : float + adjClose : float Adjusted Close Price of the symbol. - unadjusted_volume : float + unadjustedVolume : float Unadjusted volume of the symbol. change : float Change in the price of the symbol from the previous day. - change_percent : float + changePercent : float Change \% in the price of the symbol. label : str Human readable format of the date. - change_over_time : float + changeOverTime : float Change \% in the price of the symbol over a period of time.""" inputs = filter_inputs( provider_choices={ diff --git a/openbb_sdk/sdk/core/openbb_core/app/static/package/news.py b/openbb_sdk/sdk/core/openbb_core/app/static/package/news.py index 924ac8db425..703fd2fd0ac 100644 --- a/openbb_sdk/sdk/core/openbb_core/app/static/package/news.py +++ b/openbb_sdk/sdk/core/openbb_core/app/static/package/news.py @@ -73,19 +73,19 @@ class CLASS_news(Container): Parameters ---------- - page_size : int + pageSize : int The number of results to return per page. - display_output : Literal['headline', 'summary', 'full', 'all'] + displayOutput : Literal['headline', 'summary', 'full', 'all'] The type of data to return. date : Optional[datetime] The date of the news to retrieve. - date_from : Optional[datetime] + dateFrom : Optional[datetime] The start date of the news to retrieve. - date_to : Optional[datetime] + dateTo : Optional[datetime] The end date of the news to retrieve. - updated_since : Optional[int] + updatedSince : Optional[int] The number of seconds since the news was updated. - published_since : Optional[int] + publishedSince : Optional[int] The number of seconds since the news was published. sort : Optional[Literal['published_at', 'updated_at', 'title', 'author', 'channel', 'ticker', 'topic', 'content_type']] The order in which to sort the news. Options are: published_at, updated_at, title, author, channel, ticker, topic, content_type. diff --git a/openbb_sdk/sdk/core/openbb_core/app/static/package/stocks.py b/openbb_sdk/sdk/core/openbb_core/app/static/package/stocks.py index 3cb451a182b..8fd80da14ba 100644 --- a/openbb_sdk/sdk/core/openbb_core/app/static/package/stocks.py +++ b/openbb_sdk/sdk/core/openbb_core/app/static/package/stocks.py @@ -185,17 +185,17 @@ class CLASS_stocks(Container): StockEOD -------- - adj_close : float + adjClose : float Adjusted Close Price of the symbol. - unadjusted_volume : float + unadjustedVolume : float Unadjusted volume of the symbol. change : float Change in the price of the symbol from the previous day. - change_percent : float + changePercent : float Change \% in the price of the symbol. label : str Human readable format of the date. - change_over_time : float + changeOverTime : float Change \% in the price of the symbol over a period of time.""" inputs = filter_inputs( provider_choices={ @@ -288,17 +288,17 @@ class CLASS_stocks(Container): Parameters ---------- - display_output : Literal['headline', 'summary', 'full', 'all'] + displayOutput : Literal['headline', 'summary', 'full', 'all'] The type of data to return. date : Optional[datetime] The date of the news to retrieve. - date_from : Optional[datetime] + dateFrom : Optional[datetime] The start date of the news to retrieve. - date_to : Optional[datetime] + dateTo : Optional[datetime] The end date of the news to retrieve. - updated_since : Optional[int] + updatedSince : Optional[int] The number of seconds since the news was updated. - published_since : Optional[int] + publishedSince : Optional[int] The number of seconds since the news was published. sort : Optional[Literal['published_at', 'updated_at', 'title', 'author', 'channel', 'ticker', 'topic', 'content_type']] The order in which to sort the news. Options are: published_at, updated_at, title, author, channel, ticker, topic, content_type. diff --git a/openbb_sdk/sdk/core/openbb_core/app/static/package/stocks_fa.py b/openbb_sdk/sdk/core/openbb_core/app/static/package/stocks_fa.py index 48b2e8d46d7..aa9abebcde3 100644 --- a/openbb_sdk/sdk/core/openbb_core/app/static/package/stocks_fa.py +++ b/openbb_sdk/sdk/core/openbb_core/app/static/package/stocks_fa.py @@ -229,29 +229,29 @@ class CLASS_stocks_fa(Container): BalanceSheet ------------ - calendar_year : Optional[int] + calendarYear : Optional[int] None link : Optional[str] None - final_link : Optional[str] + finalLink : Optional[str] None - cash_and_short_term_investments : Optional[int] + cashAndShortTermInvestments : Optional[int] None - goodwill_and_intangible_assets : Optional[int] + goodwillAndIntangibleAssets : Optional[int] None - deferred_revenue_non_current : Optional[int] + deferredRevenueNonCurrent : Optional[int] None - total_investments : Optional[int] + totalInvestments : Optional[int] None - capital_lease_obligations : Optional[int] + capitalLeaseObligations : Optional[int] None - deferred_tax_liabilities_non_current : Optional[int] + deferredTaxLiabilitiesNonCurrent : Optional[int] None - total_non_current_liabilities : Optional[int] + totalNonCurrentLiabilities : Optional[int] None - total_debt : Optional[int] + totalDebt : Optional[int] None - net_debt : Optional[int] + netDebt : Optional[int] None""" inputs = filter_inputs( provider_choices={ @@ -710,11 +710,11 @@ class CLASS_stocks_fa(Container): CashFlowStatement ----------------- - calendar_year : Optional[int] + calendarYear : Optional[int] None link : Optional[str] None - final_link : Optional[str] + finalLink : Optional[str] None""" inputs = filter_inputs( provider_choices={ @@ -1821,21 +1821,21 @@ class CLASS_stocks_fa(Container): IncomeStatement --------------- - calendar_year : Optional[int] + calendarYear : Optional[int] None - gross_profit_ratio : Optional[float] + grossProfitRatio : Optional[float] None ebitdaratio : Optional[float] None - operating_income_ratio : Optional[float] + operatingIncomeRatio : Optional[float] None - income_before_tax_ratio : Optional[float] + incomeBeforeTaxRatio : Optional[float] None - net_income_ratio : Optional[float] + netIncomeRatio : Optional[float] None link : Optional[str] None - final_link : Optional[str] + finalLink : Optional[str] None""" inputs = filter_inputs( provider_choices={ @@ -2064,11 +2064,11 @@ class CLASS_stocks_fa(Container): The provider to use for the query. symbol : ConstrainedStrValue Symbol to get data for. - transaction_type : Optional[List[Literal['A-Award', 'C-Conversion', 'D-Return', 'E-ExpireShort', 'F-InKind', 'G-Gift', 'H-ExpireLong', 'I-Discretionary', 'J-Other', 'L-Small', 'M-Exempt', 'O-OutOfTheMoney', 'P-Purchase', 'S-Sale', 'U-Tender', 'W-Will', 'X-InTheMoney', 'Z-Trust']]] + transactionType : Optional[List[Literal['A-Award', 'C-Conversion', 'D-Return', 'E-ExpireShort', 'F-InKind', 'G-Gift', 'H-ExpireLong', 'I-Discretionary', 'J-Other', 'L-Small', 'M-Exempt', 'O-OutOfTheMoney', 'P-Purchase', 'S-Sale', 'U-Tender', 'W-Will', 'X-InTheMoney', 'Z-Trust']]] The type of the transaction. - reporting_cik : Optional[int] + reportingCik : Optional[int] The CIK of the reporting owner. - company_cik : Optional[int] + companyCik : Optional[int] The CIK of the company owner. page : Optional[int] The page number of the data to fetch. diff --git a/openbb_sdk/sdk/core/openbb_core/app/static/package_builder.py b/openbb_sdk/sdk/core/openbb_core/app/static/package_builder.py index b5b31d4f376..bd32af3258a 100644 --- a/openbb_sdk/sdk/core/openbb_core/app/static/package_builder.py +++ b/openbb_sdk/sdk/core/openbb_core/app/static/package_builder.py @@ -1,5 +1,4 @@ import builtins -import re import shutil import subprocess from collections import OrderedDict @@ -309,10 +308,6 @@ class DocstringGenerator: field_mapping = mapping[model_name][provider.lower()][section_name]["fields"] fields = field_mapping.keys() - def _to_snake_case(string: str) -> str: - s1 = re.sub("(.)([A-Z][a-z]+)", r"\1_\2", string) - return re.sub("([a-z0-9])([A-Z])", r"\1_\2", s1).lower() - if len(fields) == 0: section_docstring += "All fields are standardized.\n" else: @@ -327,7 +322,7 @@ class DocstringGenerator: field_description = field_mapping[field].field_info.description - section_docstring += f"{_to_snake_case(field)} : {field_type}\n" + section_docstring += f"{field} : {field_type}\n" section_docstring += f"{padding}{field_description}\n" if provider == "openbb" and section_name == "QueryParams": diff --git a/openbb_sdk/sdk/provider/openbb_provider/abstract/data.py b/openbb_sdk/sdk/provider/openbb_provider/abstract/data.py index 8e2f6601bac..17f67b05c60 100644 --- a/openbb_sdk/sdk/provider/openbb_provider/abstract/data.py +++ b/openbb_sdk/sdk/provider/openbb_provider/abstract/data.py @@ -1,20 +1,9 @@ -import re - from pydantic import BaseModel, Extra -def to_snake_case(string: str) -> str: - s1 = re.sub("(.)([A-Z][a-z]+)", r"\1_\2", string) - return re.sub("([a-z0-9])([A-Z])", r"\1_\2", s1).lower() - - class Data(BaseModel): """The OpenBB Standardized Data Model.""" - def dict(self, *args, **kwargs): - original_dict = super().dict(*args, **kwargs) - return {to_snake_case(k): v for k, v in original_dict.items()} - def __repr__(self): return f"{self.__class__.__name__}({', '.join([f'{k}={v}' for k, v in self.dict().items()])})" From f850994de4efeaf8f304439ac3052ce5d352b9b0 Mon Sep 17 00:00:00 2001 From: Pratyush Shukla Date: Fri, 11 Aug 2023 20:30:46 +0530 Subject: [PATCH 3/3] `CommandOutput` to `Obbject` --- openbb_sdk/extensions/charting/README.md | 2 +- .../openbb_charting/charting_router.py | 12 +- .../crypto/openbb_crypto/crypto_router.py | 6 +- .../economy/openbb_economy/economy_router.py | 138 ++++++------- .../openbb_fixedincome/fixedincome_router.py | 10 +- .../forex/openbb_forex/forex_router.py | 10 +- .../news/openbb_news/news_router.py | 10 +- .../extensions/qa/openbb_qa/qa_router.py | 122 ++++++----- .../stocks/openbb_stocks/ca/ca_router.py | 46 ++--- .../stocks/openbb_stocks/dd/dd_router.py | 6 +- .../stocks/openbb_stocks/disc/disc_router.py | 74 +++---- .../stocks/openbb_stocks/dps/dps_router.py | 50 ++--- .../stocks/openbb_stocks/fa/fa_router.py | 194 +++++++++--------- .../stocks/openbb_stocks/gov/gov_router.py | 46 ++--- .../stocks/openbb_stocks/ins/ins_router.py | 66 +++--- .../openbb_stocks/options/options_router.py | 62 +++--- .../stocks/openbb_stocks/stocks_router.py | 26 +-- .../extensions/ta/openbb_ta/ta_router.py | 178 ++++++++-------- openbb_sdk/sdk/core/README.md | 10 +- .../core/openbb_core/api/router/commands.py | 18 +- .../core/openbb_core/app/charting_manager.py | 6 +- .../core/openbb_core/app/command_runner.py | 42 ++-- .../openbb_core/app/logs/logging_manager.py | 16 +- .../openbb_core/app/model/journal_entry.py | 4 +- .../openbb_core/app/model/journal_query.py | 2 +- .../model/{command_output.py => obbject.py} | 2 +- openbb_sdk/sdk/core/openbb_core/app/router.py | 24 +-- .../core/openbb_core/app/static/filters.py | 14 +- .../openbb_core/app/static/package/crypto.py | 6 +- .../openbb_core/app/static/package/economy.py | 80 ++++---- .../app/static/package/fixedincome.py | 8 +- .../openbb_core/app/static/package/forex.py | 10 +- .../openbb_core/app/static/package/news.py | 8 +- .../core/openbb_core/app/static/package/qa.py | 68 +++--- .../openbb_core/app/static/package/stocks.py | 20 +- .../app/static/package/stocks_ca.py | 26 +-- .../app/static/package/stocks_dd.py | 6 +- .../app/static/package/stocks_disc.py | 38 ++-- .../app/static/package/stocks_dps.py | 26 +-- .../app/static/package/stocks_fa.py | 150 +++++++------- .../app/static/package/stocks_gov.py | 24 +-- .../app/static/package/stocks_ins.py | 34 +-- .../app/static/package/stocks_options.py | 32 +-- .../core/openbb_core/app/static/package/ta.py | 114 +++++----- .../openbb_core/app/static/package_builder.py | 20 +- .../tests/app/logs/test_logging_manager.py | 20 +- ...test_command_output.py => test_obbject.py} | 24 +-- .../sdk/core/tests/app/static/test_filters.py | 6 +- openbb_sdk/sdk/core/tests/app/test_router.py | 24 +-- openbb_sdk/sdk/core/tests/test_router.py | 24 +-- 50 files changed, 974 insertions(+), 990 deletions(-) rename openbb_sdk/sdk/core/openbb_core/app/model/{command_output.py => obbject.py} (98%) rename openbb_sdk/sdk/core/tests/app/model/{test_command_output.py => test_obbject.py} (89%) diff --git a/openbb_sdk/extensions/charting/README.md b/openbb_sdk/extensions/charting/README.md index f6c91179728..2a03a0906d9 100644 --- a/openbb_sdk/extensions/charting/README.md +++ b/openbb_sdk/extensions/charting/README.md @@ -43,7 +43,7 @@ from openbb import obb stock_data = obb.stocks.load(symbol="TSLA", chart=True) ``` -This results in a `CommandOutput` object containing a `chart` attribute, which contains Plotly JSON data. +This results in a `Obbject` object containing a `chart` attribute, which contains Plotly JSON data. In order to display the chart, you need to call the `show()` method: diff --git a/openbb_sdk/extensions/charting/openbb_charting/charting_router.py b/openbb_sdk/extensions/charting/openbb_charting/charting_router.py index 10d1b9fcf1a..cf296370ec3 100644 --- a/openbb_sdk/extensions/charting/openbb_charting/charting_router.py +++ b/openbb_sdk/extensions/charting/openbb_charting/charting_router.py @@ -1819,9 +1819,7 @@ def stocks_load(**kwargs) -> Tuple[OpenBBFigure, Dict[str, Any]]: k["rma"] = dict(length=ma) return k - data = basemodel_to_df( - kwargs["command_output_item"], index=kwargs.get("index", "date") - ) + data = basemodel_to_df(kwargs["obbject_item"], index=kwargs.get("index", "date")) standard_params = kwargs["standard_params"].__dict__ ma = standard_params.get("ma", None) prepost = standard_params.get("prepost", False) @@ -1840,9 +1838,7 @@ def stocks_load(**kwargs) -> Tuple[OpenBBFigure, Dict[str, Any]]: def stocks_news(**kwargs) -> Tuple[OpenBBFigure, Dict[str, Any]]: - data = basemodel_to_df( - kwargs["command_output_item"], index=kwargs.get("index", "date") - ) + data = basemodel_to_df(kwargs["obbject_item"], index=kwargs.get("index", "date")) standard_params = kwargs["standard_params"].__dict__ columnwidth = standard_params.get("columnwidth", None) @@ -2108,9 +2104,7 @@ def stocks_ins_filt(**kwargs) -> Tuple[OpenBBFigure, Dict[str, Any]]: def stocks_multiples(**kwargs) -> Tuple[OpenBBFigure, Dict[str, Any]]: - data = basemodel_to_df( - kwargs["command_output_item"], index=kwargs.get("index", "date") - ) + data = basemodel_to_df(kwargs["obbject_item"], index=kwargs.get("index", "date")) standard_params = kwargs["standard_params"].__dict__ columnwidth = standard_params.get("columnwidth", None) diff --git a/openbb_sdk/extensions/crypto/openbb_crypto/crypto_router.py b/openbb_sdk/extensions/crypto/openbb_crypto/crypto_router.py index fa5a74886bd..eac56a98873 100644 --- a/openbb_sdk/extensions/crypto/openbb_crypto/crypto_router.py +++ b/openbb_sdk/extensions/crypto/openbb_crypto/crypto_router.py @@ -1,5 +1,5 @@ from openbb_core.app.model.command_context import CommandContext -from openbb_core.app.model.command_output import CommandOutput +from openbb_core.app.model.obbject import Obbject from openbb_core.app.provider_interface import ( ExtraParams, ProviderChoices, @@ -19,6 +19,6 @@ def load( provider_choices: ProviderChoices, standard_params: StandardParams, extra_params: ExtraParams, -) -> CommandOutput[BaseModel]: +) -> Obbject[BaseModel]: """Crypto Intraday Price.""" - return CommandOutput(results=Query(**locals()).execute()) + return Obbject(results=Query(**locals()).execute()) diff --git a/openbb_sdk/extensions/economy/openbb_economy/economy_router.py b/openbb_sdk/extensions/economy/openbb_economy/economy_router.py index e4dc585a654..5be7f73bffb 100644 --- a/openbb_sdk/extensions/economy/openbb_economy/economy_router.py +++ b/openbb_sdk/extensions/economy/openbb_economy/economy_router.py @@ -1,5 +1,5 @@ from openbb_core.app.model.command_context import CommandContext -from openbb_core.app.model.command_output import CommandOutput +from openbb_core.app.model.obbject import Obbject from openbb_core.app.model.results.empty import Empty from openbb_core.app.provider_interface import ( ExtraParams, @@ -21,9 +21,9 @@ router = Router(prefix="") @router.command def corecpi( cc: CommandContext, provider_choices: ProviderChoices -) -> CommandOutput[Empty]: # type: ignore +) -> Obbject[Empty]: # type: ignore """CORECPI.""" - return CommandOutput(results=Empty()) + return Obbject(results=Empty()) @router.command(model="MajorIndicesConstituents") @@ -32,9 +32,9 @@ def const( provider_choices: ProviderChoices, standard_params: StandardParams, extra_params: ExtraParams, -) -> CommandOutput[BaseModel]: +) -> Obbject[BaseModel]: """Get the constituents of an index.""" - return CommandOutput(results=Query(**locals()).execute()) + return Obbject(results=Query(**locals()).execute()) @router.command(model="CPI") @@ -43,17 +43,17 @@ def cpi( provider_choices: ProviderChoices, standard_params: StandardParams, extra_params: ExtraParams, -) -> CommandOutput[BaseModel]: +) -> Obbject[BaseModel]: """CPI.""" - return CommandOutput(results=Query(**locals()).execute()) + return Obbject(results=Query(**locals()).execute()) @router.command def cpi_options( cc: CommandContext, provider_choices: ProviderChoices -) -> CommandOutput[Empty]: +) -> Obbject[Empty]: """Get the options for v3 cpi(options=True)""" - return CommandOutput(results=Empty()) + return Obbject(results=Empty()) @router.command(model="MajorIndicesEOD") @@ -62,9 +62,9 @@ def index( provider_choices: ProviderChoices, standard_params: StandardParams, extra_params: ExtraParams, -) -> CommandOutput[BaseModel]: +) -> Obbject[BaseModel]: """Get OHLCV data for an index.""" - return CommandOutput(results=Query(**locals()).execute()) + return Obbject(results=Query(**locals()).execute()) @router.command(model="AvailableIndices") @@ -73,9 +73,9 @@ def available_indices( provider_choices: ProviderChoices, standard_params: StandardParams, extra_params: ExtraParams, -) -> CommandOutput[BaseModel]: +) -> Obbject[BaseModel]: """AVAILABLE_INDICES.""" - return CommandOutput(results=Query(**locals()).execute()) + return Obbject(results=Query(**locals()).execute()) @router.command(model="RiskPremium") @@ -84,249 +84,249 @@ def risk( provider_choices: ProviderChoices, standard_params: StandardParams, extra_params: ExtraParams, -) -> CommandOutput[BaseModel]: +) -> Obbject[BaseModel]: """Market Risk Premium.""" - return CommandOutput(results=Query(**locals()).execute()) + return Obbject(results=Query(**locals()).execute()) @router.command def macro( cc: CommandContext, provider_choices: ProviderChoices, -) -> CommandOutput[Empty]: # type: ignore +) -> Obbject[Empty]: # type: ignore """Query EconDB for macro data.""" - return CommandOutput(results=Empty()) + return Obbject(results=Empty()) @router.command def macro_countries( cc: CommandContext, provider_choices: ProviderChoices, -) -> CommandOutput[Empty]: +) -> Obbject[Empty]: """MACRO_COUNTRIES.""" - return CommandOutput(results=Empty()) + return Obbject(results=Empty()) @router.command def macro_parameters( cc: CommandContext, provider_choices: ProviderChoices, -) -> CommandOutput[Empty]: +) -> Obbject[Empty]: """MACRO_PARAMETERS.""" - return CommandOutput(results=Empty()) + return Obbject(results=Empty()) @router.command def balance( cc: CommandContext, provider_choices: ProviderChoices, -) -> CommandOutput[Empty]: +) -> Obbject[Empty]: """BALANCE.""" - return CommandOutput(results=Empty()) + return Obbject(results=Empty()) @router.command def bigmac( cc: CommandContext, provider_choices: ProviderChoices, -) -> CommandOutput[Empty]: +) -> Obbject[Empty]: """BIGMAC.""" - return CommandOutput(results=Empty()) + return Obbject(results=Empty()) @router.command def country_codes( cc: CommandContext, provider_choices: ProviderChoices, -) -> CommandOutput[Empty]: +) -> Obbject[Empty]: """COUNTRY_CODES.""" - return CommandOutput(results=Empty()) + return Obbject(results=Empty()) @router.command def currencies( cc: CommandContext, provider_choices: ProviderChoices, -) -> CommandOutput[Empty]: +) -> Obbject[Empty]: """CURRENCIES.""" - return CommandOutput(results=Empty()) + return Obbject(results=Empty()) @router.command def debt( cc: CommandContext, provider_choices: ProviderChoices, -) -> CommandOutput[Empty]: +) -> Obbject[Empty]: """DEBT.""" - return CommandOutput(results=Empty()) + return Obbject(results=Empty()) @router.command def events( cc: CommandContext, provider_choices: ProviderChoices, -) -> CommandOutput[Empty]: +) -> Obbject[Empty]: """EVENTS.""" - return CommandOutput(results=Empty()) + return Obbject(results=Empty()) @router.command def fgdp( cc: CommandContext, provider_choices: ProviderChoices, -) -> CommandOutput[Empty]: +) -> Obbject[Empty]: """FGDP.""" - return CommandOutput(results=Empty()) + return Obbject(results=Empty()) @router.command def fred( cc: CommandContext, provider_choices: ProviderChoices, -) -> CommandOutput[Empty]: +) -> Obbject[Empty]: """FRED.""" - return CommandOutput(results=Empty()) + return Obbject(results=Empty()) @router.command def fred_search( cc: CommandContext, provider_choices: ProviderChoices, -) -> CommandOutput[Empty]: +) -> Obbject[Empty]: """FRED Search (was fred_notes).""" - return CommandOutput(results=Empty()) + return Obbject(results=Empty()) @router.command def futures( cc: CommandContext, provider_choices: ProviderChoices, -) -> CommandOutput[Empty]: +) -> Obbject[Empty]: """FUTURES. 2 sources""" - return CommandOutput(results=Empty()) + return Obbject(results=Empty()) @router.command def gdp( cc: CommandContext, provider_choices: ProviderChoices, -) -> CommandOutput[Empty]: +) -> Obbject[Empty]: """GDP.""" - return CommandOutput(results=Empty()) + return Obbject(results=Empty()) @router.command def glbonds( cc: CommandContext, provider_choices: ProviderChoices, -) -> CommandOutput[Empty]: +) -> Obbject[Empty]: """GLBONDS.""" - return CommandOutput(results=Empty()) + return Obbject(results=Empty()) @router.command def indices( cc: CommandContext, provider_choices: ProviderChoices, -) -> CommandOutput[Empty]: +) -> Obbject[Empty]: """INDICES.""" - return CommandOutput(results=Empty()) + return Obbject(results=Empty()) @router.command def overview( cc: CommandContext, provider_choices: ProviderChoices, -) -> CommandOutput[Empty]: +) -> Obbject[Empty]: """OVERVIEW.""" - return CommandOutput(results=Empty()) + return Obbject(results=Empty()) @router.command def perfmap( cc: CommandContext, provider_choices: ProviderChoices, -) -> CommandOutput[Empty]: +) -> Obbject[Empty]: """PERFMAP.""" - return CommandOutput(results=Empty()) + return Obbject(results=Empty()) @router.command def performance( cc: CommandContext, provider_choices: ProviderChoices, -) -> CommandOutput[Empty]: +) -> Obbject[Empty]: """PERFORMANCE.""" - return CommandOutput(results=Empty()) + return Obbject(results=Empty()) @router.command def revenue( cc: CommandContext, provider_choices: ProviderChoices, -) -> CommandOutput[Empty]: +) -> Obbject[Empty]: """REVENUE.""" - return CommandOutput(results=Empty()) + return Obbject(results=Empty()) @router.command def rgdp( cc: CommandContext, provider_choices: ProviderChoices, -) -> CommandOutput[Empty]: +) -> Obbject[Empty]: """RGDP.""" - return CommandOutput(results=Empty()) + return Obbject(results=Empty()) @router.command def rtps( cc: CommandContext, provider_choices: ProviderChoices, -) -> CommandOutput[Empty]: +) -> Obbject[Empty]: """RTPS.""" - return CommandOutput(results=Empty()) + return Obbject(results=Empty()) @router.command def search_index( cc: CommandContext, provider_choices: ProviderChoices, -) -> CommandOutput[Empty]: +) -> Obbject[Empty]: """SEARCH_INDEX.""" - return CommandOutput(results=Empty()) + return Obbject(results=Empty()) @router.command def spending( cc: CommandContext, provider_choices: ProviderChoices, -) -> CommandOutput[Empty]: +) -> Obbject[Empty]: """SPENDING.""" - return CommandOutput(results=Empty()) + return Obbject(results=Empty()) @router.command def trust( cc: CommandContext, provider_choices: ProviderChoices, -) -> CommandOutput[Empty]: +) -> Obbject[Empty]: """TRUST.""" - return CommandOutput(results=Empty()) + return Obbject(results=Empty()) @router.command def usbonds( cc: CommandContext, provider_choices: ProviderChoices, -) -> CommandOutput[Empty]: +) -> Obbject[Empty]: """USBONDS.""" - return CommandOutput(results=Empty()) + return Obbject(results=Empty()) @router.command def valuation( cc: CommandContext, provider_choices: ProviderChoices, -) -> CommandOutput[Empty]: +) -> Obbject[Empty]: """VALUATION.""" - return CommandOutput(results=Empty()) + return Obbject(results=Empty()) diff --git a/openbb_sdk/extensions/fixedincome/openbb_fixedincome/fixedincome_router.py b/openbb_sdk/extensions/fixedincome/openbb_fixedincome/fixedincome_router.py index 5d3a3a5acb2..1d3af373a0b 100644 --- a/openbb_sdk/extensions/fixedincome/openbb_fixedincome/fixedincome_router.py +++ b/openbb_sdk/extensions/fixedincome/openbb_fixedincome/fixedincome_router.py @@ -1,7 +1,7 @@ # pylint: disable=W0613:unused-argument from openbb_core.app.model.command_context import CommandContext -from openbb_core.app.model.command_output import CommandOutput +from openbb_core.app.model.obbject import Obbject from openbb_core.app.model.results.empty import Empty from openbb_core.app.provider_interface import ( ExtraParams, @@ -21,12 +21,12 @@ def treasury( provider_choices: ProviderChoices, standard_params: StandardParams, extra_params: ExtraParams, -) -> CommandOutput[BaseModel]: +) -> Obbject[BaseModel]: """Get treasury rates.""" - return CommandOutput(results=Query(**locals()).execute()) + return Obbject(results=Query(**locals()).execute()) @router.command -def ycrv() -> CommandOutput[Empty]: # type: ignore +def ycrv() -> Obbject[Empty]: # type: ignore """Yield curve.""" - return CommandOutput(results=Empty()) + return Obbject(results=Empty()) diff --git a/openbb_sdk/extensions/forex/openbb_forex/forex_router.py b/openbb_sdk/extensions/forex/openbb_forex/forex_router.py index 308a90fd131..352ff04654f 100644 --- a/openbb_sdk/extensions/forex/openbb_forex/forex_router.py +++ b/openbb_sdk/extensions/forex/openbb_forex/forex_router.py @@ -1,5 +1,5 @@ from openbb_core.app.model.command_context import CommandContext -from openbb_core.app.model.command_output import CommandOutput +from openbb_core.app.model.obbject import Obbject from openbb_core.app.provider_interface import ( ExtraParams, ProviderChoices, @@ -19,9 +19,9 @@ def pairs( provider_choices: ProviderChoices, standard_params: StandardParams, extra_params: ExtraParams, -) -> CommandOutput[BaseModel]: +) -> Obbject[BaseModel]: """Forex Available Pairs.""" - return CommandOutput(results=Query(**locals()).execute()) + return Obbject(results=Query(**locals()).execute()) # pylint: disable=unused-argument @@ -31,6 +31,6 @@ def load( provider_choices: ProviderChoices, standard_params: StandardParams, extra_params: ExtraParams, -) -> CommandOutput[BaseModel]: +) -> Obbject[BaseModel]: """Forex Intraday Price.""" - return CommandOutput(results=Query(**locals()).execute()) + return Obbject(results=Query(**locals()).execute()) diff --git a/openbb_sdk/extensions/news/openbb_news/news_router.py b/openbb_sdk/extensions/news/openbb_news/news_router.py index a0299203182..9cd0798c0cf 100644 --- a/openbb_sdk/extensions/news/openbb_news/news_router.py +++ b/openbb_sdk/extensions/news/openbb_news/news_router.py @@ -2,7 +2,7 @@ """News Router.""" from openbb_core.app.model.command_context import CommandContext -from openbb_core.app.model.command_output import CommandOutput +from openbb_core.app.model.obbject import Obbject from openbb_core.app.model.results.empty import Empty from openbb_core.app.provider_interface import ( ExtraParams, @@ -22,12 +22,12 @@ def globalnews( provider_choices: ProviderChoices, standard_params: StandardParams, extra_params: ExtraParams, -) -> CommandOutput[BaseModel]: +) -> Obbject[BaseModel]: """Global News.""" - return CommandOutput(results=Query(**locals()).execute()) + return Obbject(results=Query(**locals()).execute()) @router.command -def sectornews() -> CommandOutput[Empty]: # type: ignore +def sectornews() -> Obbject[Empty]: # type: ignore """Sector news.""" - return CommandOutput(results=Empty()) + return Obbject(results=Empty()) diff --git a/openbb_sdk/extensions/qa/openbb_qa/qa_router.py b/openbb_sdk/extensions/qa/openbb_qa/qa_router.py index 881e24b3667..c7522cfade2 100644 --- a/openbb_sdk/extensions/qa/openbb_qa/qa_router.py +++ b/openbb_sdk/extensions/qa/openbb_qa/qa_router.py @@ -4,7 +4,7 @@ import numpy as np import pandas as pd import pandas_ta as ta import statsmodels.api as sm -from openbb_core.app.model.command_output import CommandOutput +from openbb_core.app.model.obbject import Obbject from openbb_core.app.model.results.empty import Empty from openbb_core.app.router import Router from openbb_core.app.utils import ( @@ -34,7 +34,7 @@ router = Router(prefix="") @router.command(methods=["POST"]) -def normality(data: List[Data], target: str) -> CommandOutput[NormalityModel]: +def normality(data: List[Data], target: str) -> Obbject[NormalityModel]: """ Normality Statistics. @@ -53,7 +53,7 @@ def normality(data: List[Data], target: str) -> CommandOutput[NormalityModel]: Returns ------- - CommandOutput[NormalityModel] + Obbject[NormalityModel] Normality tests summary. See qa_models.NormalityModel for details. """ @@ -74,11 +74,11 @@ def normality(data: List[Data], target: str) -> CommandOutput[NormalityModel]: kolmogorov_smirnov=TestModel(statistic=ks_statistic, p_value=ks_pvalue), ) - return CommandOutput(results=norm_summary) + return Obbject(results=norm_summary) @router.command(methods=["POST"]) -def capm(data: List[Data], target: str) -> CommandOutput[CAPMModel]: +def capm(data: List[Data], target: str) -> Obbject[CAPMModel]: """Capital Asset Pricing Model.""" df = basemodel_to_df(data) @@ -106,13 +106,13 @@ def capm(data: List[Data], target: str) -> CommandOutput[CAPMModel]: idiosyncratic_risk=1 - model.rsquared, ) - return CommandOutput(results=results) + return Obbject(results=results) @router.command(methods=["POST"]) -def qqplot() -> CommandOutput[Empty]: +def qqplot() -> Obbject[Empty]: """QQ Plot.""" - return CommandOutput(results=Empty()) + return Obbject(results=Empty()) @router.command(methods=["POST"]) @@ -121,7 +121,7 @@ def om( target: str, threshold_start: float = 0.0, threshold_end: float = 1.5, -) -> CommandOutput[List[OmegaModel]]: +) -> Obbject[List[OmegaModel]]: """Omega Ratio. Parameters @@ -137,7 +137,7 @@ def om( Returns ------- - CommandOutput[List[OmegaModel]] + Obbject[List[OmegaModel]] Omega ratios. """ @@ -156,13 +156,11 @@ def om( for i in threshold: results.append(OmegaModel(threshold=i, omega=get_omega_ratio(series_target, i))) - return CommandOutput(results=results) + return Obbject(results=results) @router.command(methods=["POST"]) -def kurtosis( - data: List[Data], target: str, window: PositiveInt -) -> CommandOutput[List[Data]]: +def kurtosis(data: List[Data], target: str, window: PositiveInt) -> Obbject[List[Data]]: """Kurtosis. Parameters @@ -176,7 +174,7 @@ def kurtosis( Returns ------- - CommandOutput[List[Data]] + Obbject[List[Data]] Kurtosis. """ df = basemodel_to_df(data) @@ -184,43 +182,43 @@ def kurtosis( results = ta.kurtosis(close=series_target, length=window).dropna() results = df_to_basemodel(results) - return CommandOutput(results=results) + return Obbject(results=results) @router.command(methods=["POST"]) -def pick() -> CommandOutput[Empty]: +def pick() -> Obbject[Empty]: """Pick.""" - return CommandOutput(results=Empty()) + return Obbject(results=Empty()) @router.command(methods=["POST"]) -def spread() -> CommandOutput[Empty]: +def spread() -> Obbject[Empty]: """Spread.""" - return CommandOutput(results=Empty()) + return Obbject(results=Empty()) @router.command(methods=["POST"]) -def rolling() -> CommandOutput[Empty]: +def rolling() -> Obbject[Empty]: """Rolling.""" - return CommandOutput(results=Empty()) + return Obbject(results=Empty()) @router.command(methods=["POST"]) -def var() -> CommandOutput[Empty]: +def var() -> Obbject[Empty]: """Value at Risk.""" - return CommandOutput(results=Empty()) + return Obbject(results=Empty()) @router.command(methods=["POST"]) -def line() -> CommandOutput[Empty]: +def line() -> Obbject[Empty]: """Line.""" - return CommandOutput(results=Empty()) + return Obbject(results=Empty()) @router.command(methods=["POST"]) -def hist() -> CommandOutput[Empty]: +def hist() -> Obbject[Empty]: """Histogram.""" - return CommandOutput(results=Empty()) + return Obbject(results=Empty()) @router.command(methods=["POST"]) @@ -229,7 +227,7 @@ def unitroot( target: str, fuller_reg: Literal["c", "ct", "ctt", "nc", "c"] = "c", kpss_reg: Literal["c", "ct"] = "c", -) -> CommandOutput[UnitRootModel]: +) -> Obbject[UnitRootModel]: """Unit Root Test. Augmented Dickey-Fuller test for unit root. @@ -248,7 +246,7 @@ def unitroot( Returns ------- - CommandOutput[UnitRootModel] + Obbject[UnitRootModel] Unit root tests summary. """ @@ -272,19 +270,19 @@ def unitroot( nlags=kpss[2], ), ) - return CommandOutput(results=unitroot_summary) + return Obbject(results=unitroot_summary) @router.command(methods=["POST"]) -def beta() -> CommandOutput[Empty]: +def beta() -> Obbject[Empty]: """Beta.""" - return CommandOutput(results=Empty()) + return Obbject(results=Empty()) @router.command(methods=["POST"]) def sh( data: List[Data], target: str, rfr: float = 0.0, window: PositiveInt = 252 -) -> CommandOutput[List[Data]]: +) -> Obbject[List[Data]]: """Sharpe Ratio. Parameters @@ -300,7 +298,7 @@ def sh( Returns ------- - CommandOutput[List[Data]] + Obbject[List[Data]] Sharpe ratio. """ @@ -313,7 +311,7 @@ def sh( results = df_to_basemodel(results) - return CommandOutput(results=results) + return Obbject(results=results) @router.command(methods=["POST"]) @@ -323,7 +321,7 @@ def so( target_return: float = 0.0, window: PositiveInt = 252, adjusted: bool = False, -) -> CommandOutput[List[Data]]: +) -> Obbject[List[Data]]: """Sortino Ratio. For method & terminology see: http://www.redrockcapital.com/Sortino__A__Sharper__Ratio_Red_Rock_Capital.pdf @@ -343,7 +341,7 @@ def so( Returns ------- - CommandOutput[List[Data]] + Obbject[List[Data]] Sortino ratio. """ @@ -361,37 +359,35 @@ def so( results = df_to_basemodel(results) - return CommandOutput(results=results) + return Obbject(results=results) @router.command(methods=["POST"]) -def cusum() -> CommandOutput[Empty]: +def cusum() -> Obbject[Empty]: """Cumulative Sum.""" - return CommandOutput(results=Empty()) + return Obbject(results=Empty()) @router.command(methods=["POST"]) -def raw() -> CommandOutput[Empty]: +def raw() -> Obbject[Empty]: """Raw.""" - return CommandOutput(results=Empty()) + return Obbject(results=Empty()) @router.command(methods=["POST"]) -def cdf() -> CommandOutput[Empty]: +def cdf() -> Obbject[Empty]: """Cumulative Distribution Function.""" - return CommandOutput(results=Empty()) + return Obbject(results=Empty()) @router.command(methods=["POST"]) -def decompose() -> CommandOutput[Empty]: +def decompose() -> Obbject[Empty]: """Decompose.""" - return CommandOutput(results=Empty()) + return Obbject(results=Empty()) @router.command(methods=["POST"]) -def skew( - data: List[Data], target: str, window: PositiveInt -) -> CommandOutput[List[Data]]: +def skew(data: List[Data], target: str, window: PositiveInt) -> Obbject[List[Data]]: """Skewness. Parameters @@ -405,7 +401,7 @@ def skew( Returns ------- - CommandOutput[List[Data]] + Obbject[List[Data]] Skewness. """ df = basemodel_to_df(data) @@ -413,7 +409,7 @@ def skew( results = ta.skew(close=series_target, length=window).dropna() results = df_to_basemodel(results) - return CommandOutput(results=results) + return Obbject(results=results) @router.command(methods=["POST"]) @@ -422,7 +418,7 @@ def quantile( target: str, window: PositiveInt, quantile_pct: NonNegativeFloat = 0.5, -) -> CommandOutput[List[Data]]: +) -> Obbject[List[Data]]: """Quantile.""" df = basemodel_to_df(data) @@ -434,29 +430,29 @@ def quantile( results = df_to_basemodel(results) - return CommandOutput(results=results) + return Obbject(results=results) @router.command(methods=["POST"]) -def bw() -> CommandOutput[Empty]: +def bw() -> Obbject[Empty]: """Bandwidth.""" - return CommandOutput(results=Empty()) + return Obbject(results=Empty()) @router.command(methods=["POST"]) -def es() -> CommandOutput[Empty]: +def es() -> Obbject[Empty]: """Expected Shortfall.""" - return CommandOutput(results=Empty()) + return Obbject(results=Empty()) @router.command(methods=["POST"]) -def acf() -> CommandOutput[Empty]: +def acf() -> Obbject[Empty]: """Autocorrelation Function.""" - return CommandOutput(results=Empty()) + return Obbject(results=Empty()) @router.command(methods=["POST"]) -def summary(data: List[Data], target: str) -> CommandOutput[SummaryModel]: +def summary(data: List[Data], target: str) -> Obbject[SummaryModel]: """Summary. Parameters @@ -468,7 +464,7 @@ def summary(data: List[Data], target: str) -> CommandOutput[SummaryModel]: Returns ------- - CommandOutput[SummaryModel] + Obbject[SummaryModel] Summary table. """ @@ -489,4 +485,4 @@ def summary(data: List[Data], target: str) -> CommandOutput[SummaryModel]: max=df_stats.loc["max"], ) - return CommandOutput(results=results) + return Obbject(results=results) diff --git a/openbb_sdk/extensions/stocks/openbb_stocks/ca/ca_router.py b/openbb_sdk/extensions/stocks/openbb_stocks/ca/ca_router.py index 51f2ed451c4..7e69e283f07 100644 --- a/openbb_sdk/extensions/stocks/openbb_stocks/ca/ca_router.py +++ b/openbb_sdk/extensions/stocks/openbb_stocks/ca/ca_router.py @@ -2,7 +2,7 @@ """Comparison Analysis Router.""" from openbb_core.app.model.command_context import CommandContext -from openbb_core.app.model.command_output import CommandOutput +from openbb_core.app.model.obbject import Obbject from openbb_core.app.model.results.empty import Empty from openbb_core.app.provider_interface import ( ExtraParams, @@ -22,66 +22,66 @@ def peers( provider_choices: ProviderChoices, standard_params: StandardParams, extra_params: ExtraParams, -) -> CommandOutput[BaseModel]: +) -> Obbject[BaseModel]: """Company peers.""" - return CommandOutput(results=Query(**locals()).execute()) + return Obbject(results=Query(**locals()).execute()) @router.command -def balance() -> CommandOutput[Empty]: # type: ignore +def balance() -> Obbject[Empty]: # type: ignore """Company balance sheet.""" - return CommandOutput(results=Empty()) + return Obbject(results=Empty()) @router.command -def cashflow() -> CommandOutput[Empty]: # type: ignore +def cashflow() -> Obbject[Empty]: # type: ignore """Company cashflow.""" - return CommandOutput(results=Empty()) + return Obbject(results=Empty()) @router.command -def hcorr() -> CommandOutput[Empty]: # type: ignore +def hcorr() -> Obbject[Empty]: # type: ignore """Company historical correlation.""" - return CommandOutput(results=Empty()) + return Obbject(results=Empty()) @router.command -def hist() -> CommandOutput[Empty]: # type: ignore +def hist() -> Obbject[Empty]: # type: ignore """Company historical prices.""" - return CommandOutput(results=Empty()) + return Obbject(results=Empty()) @router.command -def income() -> CommandOutput[Empty]: # type: ignore +def income() -> Obbject[Empty]: # type: ignore """Company income statement.""" - return CommandOutput(results=Empty()) + return Obbject(results=Empty()) @router.command -def scorr() -> CommandOutput[Empty]: # type: ignore +def scorr() -> Obbject[Empty]: # type: ignore """Company sector correlation.""" - return CommandOutput(results=Empty()) + return Obbject(results=Empty()) @router.command -def screener() -> CommandOutput[Empty]: # type: ignore +def screener() -> Obbject[Empty]: # type: ignore """Company screener.""" - return CommandOutput(results=Empty()) + return Obbject(results=Empty()) @router.command -def sentiment() -> CommandOutput[Empty]: # type: ignore +def sentiment() -> Obbject[Empty]: # type: ignore """Company sentiment.""" - return CommandOutput(results=Empty()) + return Obbject(results=Empty()) @router.command -def similar() -> CommandOutput[Empty]: # type: ignore +def similar() -> Obbject[Empty]: # type: ignore """Company similar.""" - return CommandOutput(results=Empty()) + return Obbject(results=Empty()) @router.command -def volume() -> CommandOutput[Empty]: # type: ignore +def volume() -> Obbject[Empty]: # type: ignore """Company volume.""" - return CommandOutput(results=Empty()) + return Obbject(results=Empty()) diff --git a/openbb_sdk/extensions/stocks/openbb_stocks/dd/dd_router.py b/openbb_sdk/extensions/stocks/openbb_stocks/dd/dd_router.py index 5f0b9db0509..b4344d961b9 100644 --- a/openbb_sdk/extensions/stocks/openbb_stocks/dd/dd_router.py +++ b/openbb_sdk/extensions/stocks/openbb_stocks/dd/dd_router.py @@ -2,7 +2,7 @@ """Due Diligence Router.""" from openbb_core.app.model.command_context import CommandContext -from openbb_core.app.model.command_output import CommandOutput +from openbb_core.app.model.obbject import Obbject from openbb_core.app.provider_interface import ( ExtraParams, ProviderChoices, @@ -21,6 +21,6 @@ def sec( provider_choices: ProviderChoices, standard_params: StandardParams, extra_params: ExtraParams, -) -> CommandOutput[BaseModel]: +) -> Obbject[BaseModel]: """SEC Filings.""" - return CommandOutput(results=Query(**locals()).execute()) + return Obbject(results=Query(**locals()).execute()) diff --git a/openbb_sdk/extensions/stocks/openbb_stocks/disc/disc_router.py b/openbb_sdk/extensions/stocks/openbb_stocks/disc/disc_router.py index 301d2b466fd..e5a040040be 100644 --- a/openbb_sdk/extensions/stocks/openbb_stocks/disc/disc_router.py +++ b/openbb_sdk/extensions/stocks/openbb_stocks/disc/disc_router.py @@ -1,4 +1,4 @@ -from openbb_core.app.model.command_output import CommandOutput +from openbb_core.app.model.obbject import Obbject from openbb_core.app.model.results.empty import Empty from openbb_core.app.router import Router @@ -6,106 +6,106 @@ router = Router(prefix="/disc") @router.command -def active() -> CommandOutput[Empty]: # type: ignore +def active() -> Obbject[Empty]: # type: ignore """Most active stocks by intraday trade volumes.""" - return CommandOutput(results=Empty()) + return Obbject(results=Empty()) @router.command -def arkord() -> CommandOutput[Empty]: # type: ignore +def arkord() -> Obbject[Empty]: # type: ignore """Order by ARK INvestment Management LLC.""" - return CommandOutput(results=Empty()) + return Obbject(results=Empty()) @router.command -def asc() -> CommandOutput[Empty]: # type: ignore +def asc() -> Obbject[Empty]: # type: ignore """Small cap stocks with revenue and earnings growth more than 25%.""" - return CommandOutput(results=Empty()) + return Obbject(results=Empty()) @router.command -def dividends() -> CommandOutput[Empty]: # type: ignore - return CommandOutput(results=Empty()) +def dividends() -> Obbject[Empty]: # type: ignore + return Obbject(results=Empty()) @router.command -def filings() -> CommandOutput[Empty]: # type: ignore +def filings() -> Obbject[Empty]: # type: ignore """The most-recent form submissions to the SEC.""" - return CommandOutput(results=Empty()) + return Obbject(results=Empty()) @router.command -def fipo() -> CommandOutput[Empty]: # type: ignore +def fipo() -> Obbject[Empty]: # type: ignore """Future IPOs dates.""" - return CommandOutput(results=Empty()) + return Obbject(results=Empty()) @router.command -def gainers() -> CommandOutput[Empty]: # type: ignore +def gainers() -> Obbject[Empty]: # type: ignore """Show latest top gainers.""" - return CommandOutput(results=Empty()) + return Obbject(results=Empty()) @router.command -def gtech() -> CommandOutput[Empty]: # type: ignore +def gtech() -> Obbject[Empty]: # type: ignore """Tech stocks with revenue and earnings growth more than 25%.""" - return CommandOutput(results=Empty()) + return Obbject(results=Empty()) @router.command -def hotpenny() -> CommandOutput[Empty]: # type: ignore +def hotpenny() -> Obbject[Empty]: # type: ignore """Today's hot penny stocks.""" - return CommandOutput(results=Empty()) + return Obbject(results=Empty()) @router.command -def ipo() -> CommandOutput[Empty]: # type: ignore - return CommandOutput(results=Empty()) +def ipo() -> Obbject[Empty]: # type: ignore + return Obbject(results=Empty()) @router.command -def losers() -> CommandOutput[Empty]: # type: ignore +def losers() -> Obbject[Empty]: # type: ignore """Show latest top losers.""" - return CommandOutput(results=Empty()) + return Obbject(results=Empty()) @router.command -def lowfloat() -> CommandOutput[Empty]: # type: ignore +def lowfloat() -> Obbject[Empty]: # type: ignore """Low float stocks under 10M shares float.""" - return CommandOutput(results=Empty()) + return Obbject(results=Empty()) @router.command -def pipo() -> CommandOutput[Empty]: # type: ignore +def pipo() -> Obbject[Empty]: # type: ignore """Past IPOs dates.""" - return CommandOutput(results=Empty()) + return Obbject(results=Empty()) @router.command -def rtat() -> CommandOutput[Empty]: # type: ignore +def rtat() -> Obbject[Empty]: # type: ignore """Top 10 retail traded stocks per day.""" - return CommandOutput(results=Empty()) + return Obbject(results=Empty()) @router.command -def trending() -> CommandOutput[Empty]: # type: ignore +def trending() -> Obbject[Empty]: # type: ignore """Trending news.""" - return CommandOutput(results=Empty()) + return Obbject(results=Empty()) @router.command -def ugs() -> CommandOutput[Empty]: # type: ignore +def ugs() -> Obbject[Empty]: # type: ignore """Undervalued stocks with revenue and earnings growth above 25%.""" - return CommandOutput(results=Empty()) + return Obbject(results=Empty()) @router.command -def ulc() -> CommandOutput[Empty]: # type: ignore +def ulc() -> Obbject[Empty]: # type: ignore """Potentially undervalued large cap stocks.""" - return CommandOutput(results=Empty()) + return Obbject(results=Empty()) @router.command -def upcoming() -> CommandOutput[Empty]: # type: ignore +def upcoming() -> Obbject[Empty]: # type: ignore """Upcoming earnings release dates.""" - return CommandOutput(results=Empty()) + return Obbject(results=Empty()) diff --git a/openbb_sdk/extensions/stocks/openbb_stocks/dps/dps_router.py b/openbb_sdk/extensions/stocks/openbb_stocks/dps/dps_router.py index 500adb33000..dc517ac826f 100644 --- a/openbb_sdk/extensions/stocks/openbb_stocks/dps/dps_router.py +++ b/openbb_sdk/extensions/stocks/openbb_stocks/dps/dps_router.py @@ -1,4 +1,4 @@ -from openbb_core.app.model.command_output import CommandOutput +from openbb_core.app.model.obbject import Obbject from openbb_core.app.model.results.empty import Empty from openbb_core.app.router import Router @@ -6,70 +6,70 @@ router = Router(prefix="/dps") @router.command -def psi() -> CommandOutput[Empty]: # type: ignore +def psi() -> Obbject[Empty]: # type: ignore """Price vs short interest volume""" - return CommandOutput(results=Empty()) + return Obbject(results=Empty()) @router.command -def ctb() -> CommandOutput[Empty]: # type: ignore +def ctb() -> Obbject[Empty]: # type: ignore """Cost to borrow of stocks.""" - return CommandOutput(results=Empty()) + return Obbject(results=Empty()) @router.command -def dpotc() -> CommandOutput[Empty]: # type: ignore +def dpotc() -> Obbject[Empty]: # type: ignore """Dark pools (ATS) vs OTC data.""" - return CommandOutput(results=Empty()) + return Obbject(results=Empty()) @router.command -def ftd() -> CommandOutput[Empty]: # type: ignore +def ftd() -> Obbject[Empty]: # type: ignore """Fails-to-deliver data.""" - return CommandOutput(results=Empty()) + return Obbject(results=Empty()) @router.command -def hsi() -> CommandOutput[Empty]: # type: ignore +def hsi() -> Obbject[Empty]: # type: ignore """Show top high short interest stocks of over 20% ratio.""" - return CommandOutput(results=Empty()) + return Obbject(results=Empty()) @router.command -def pos() -> CommandOutput[Empty]: # type: ignore +def pos() -> Obbject[Empty]: # type: ignore """Dark pool short position.""" - return CommandOutput(results=Empty()) + return Obbject(results=Empty()) @router.command -def prom() -> CommandOutput[Empty]: # type: ignore +def prom() -> Obbject[Empty]: # type: ignore """Promising tickers based on dark pool shares regression.""" - return CommandOutput(results=Empty()) + return Obbject(results=Empty()) @router.command -def psi_q() -> CommandOutput[Empty]: # type: ignore - return CommandOutput(results=Empty()) +def psi_q() -> Obbject[Empty]: # type: ignore + return Obbject(results=Empty()) @router.command -def psi_sg() -> CommandOutput[Empty]: # type: ignore - return CommandOutput(results=Empty()) +def psi_sg() -> Obbject[Empty]: # type: ignore + return Obbject(results=Empty()) @router.command -def shorted() -> CommandOutput[Empty]: # type: ignore +def shorted() -> Obbject[Empty]: # type: ignore """Most shorted stocks.""" - return CommandOutput(results=Empty()) + return Obbject(results=Empty()) @router.command -def sidtc() -> CommandOutput[Empty]: # type: ignore +def sidtc() -> Obbject[Empty]: # type: ignore """Short interest and days to cover.""" - return CommandOutput(results=Empty()) + return Obbject(results=Empty()) @router.command -def spos() -> CommandOutput[Empty]: # type: ignore +def spos() -> Obbject[Empty]: # type: ignore """Net short vs position.""" - return CommandOutput(results=Empty()) + return Obbject(results=Empty()) diff --git a/openbb_sdk/extensions/stocks/openbb_stocks/fa/fa_router.py b/openbb_sdk/extensions/stocks/openbb_stocks/fa/fa_router.py index 19e3cc5f272..233202d3b21 100644 --- a/openbb_sdk/extensions/stocks/openbb_stocks/fa/fa_router.py +++ b/openbb_sdk/extensions/stocks/openbb_stocks/fa/fa_router.py @@ -2,7 +2,7 @@ """Fundamental Analysis Router.""" from openbb_core.app.model.command_context import CommandContext -from openbb_core.app.model.command_output import CommandOutput +from openbb_core.app.model.obbject import Obbject from openbb_core.app.model.results.empty import Empty from openbb_core.app.provider_interface import ( ExtraParams, @@ -17,9 +17,9 @@ router = Router(prefix="/fa") @router.command -def analysis() -> CommandOutput[Empty]: # type: ignore +def analysis() -> Obbject[Empty]: # type: ignore """Analyse SEC filings with the help of machine learning.""" - return CommandOutput(results=Empty()) + return Obbject(results=Empty()) @router.command(model="BalanceSheet") @@ -28,9 +28,9 @@ def balance( provider_choices: ProviderChoices, standard_params: StandardParams, extra_params: ExtraParams, -) -> CommandOutput[BaseModel]: +) -> Obbject[BaseModel]: """Balance Sheet.""" - return CommandOutput(results=Query(**locals()).execute()) + return Obbject(results=Query(**locals()).execute()) @router.command(model="BalanceSheetGrowth") @@ -39,9 +39,9 @@ def balance_growth( provider_choices: ProviderChoices, standard_params: StandardParams, extra_params: ExtraParams, -) -> CommandOutput[BaseModel]: +) -> Obbject[BaseModel]: """Balance Sheet Statement Growth.""" - return CommandOutput(results=Query(**locals()).execute()) + return Obbject(results=Query(**locals()).execute()) @router.command(model="DividendCalendar") @@ -50,9 +50,9 @@ def cal( provider_choices: ProviderChoices, standard_params: StandardParams, extra_params: ExtraParams, -) -> CommandOutput[BaseModel]: +) -> Obbject[BaseModel]: """Show Dividend Calendar for a given start and end dates.""" - return CommandOutput(results=Query(**locals()).execute()) + return Obbject(results=Query(**locals()).execute()) @router.command(model="CashFlowStatement") @@ -61,9 +61,9 @@ def cash( provider_choices: ProviderChoices, standard_params: StandardParams, extra_params: ExtraParams, -) -> CommandOutput[BaseModel]: +) -> Obbject[BaseModel]: """Cash Flow Statement.""" - return CommandOutput(results=Query(**locals()).execute()) + return Obbject(results=Query(**locals()).execute()) @router.command(model="CashFlowStatementGrowth") @@ -72,9 +72,9 @@ def cash_growth( provider_choices: ProviderChoices, standard_params: StandardParams, extra_params: ExtraParams, -) -> CommandOutput[BaseModel]: +) -> Obbject[BaseModel]: """Cash Flow Statement Growth.""" - return CommandOutput(results=Query(**locals()).execute()) + return Obbject(results=Query(**locals()).execute()) @router.command(model="ExecutiveCompensation") @@ -83,9 +83,9 @@ def comp( provider_choices: ProviderChoices, standard_params: StandardParams, extra_params: ExtraParams, -) -> CommandOutput[BaseModel]: +) -> Obbject[BaseModel]: """Executive Compensation.""" - return CommandOutput(results=Query(**locals()).execute()) + return Obbject(results=Query(**locals()).execute()) @router.command(model="StockSplitCalendar") @@ -94,21 +94,21 @@ def comsplit( provider_choices: ProviderChoices, standard_params: StandardParams, extra_params: ExtraParams, -) -> CommandOutput[BaseModel]: +) -> Obbject[BaseModel]: """Stock Split Calendar.""" - return CommandOutput(results=Query(**locals()).execute()) + return Obbject(results=Query(**locals()).execute()) @router.command -def customer() -> CommandOutput[Empty]: # type: ignore +def customer() -> Obbject[Empty]: # type: ignore """List of customers of the company.""" - return CommandOutput(results=Empty()) + return Obbject(results=Empty()) @router.command -def dcfc() -> CommandOutput[Empty]: # type: ignore +def dcfc() -> Obbject[Empty]: # type: ignore """Determine the (historical) discounted cash flow.""" - return CommandOutput(results=Empty()) + return Obbject(results=Empty()) @router.command(model="HistoricalDividends") @@ -117,15 +117,15 @@ def divs( provider_choices: ProviderChoices, standard_params: StandardParams, extra_params: ExtraParams, -) -> CommandOutput[BaseModel]: +) -> Obbject[BaseModel]: """Historical Dividends.""" - return CommandOutput(results=Query(**locals()).execute()) + return Obbject(results=Query(**locals()).execute()) @router.command -def dupont() -> CommandOutput[Empty]: # type: ignore +def dupont() -> Obbject[Empty]: # type: ignore """Detailed breakdown for Return on Equity (RoE).""" - return CommandOutput(results=Empty()) + return Obbject(results=Empty()) @router.command(model="EarningsCalendar") @@ -134,9 +134,9 @@ def earning( provider_choices: ProviderChoices, standard_params: StandardParams, extra_params: ExtraParams, -) -> CommandOutput[BaseModel]: +) -> Obbject[BaseModel]: """Earnings Calendar.""" - return CommandOutput(results=Query(**locals()).execute()) + return Obbject(results=Query(**locals()).execute()) @router.command(model="HistoricalEmployees") @@ -145,21 +145,21 @@ def emp( provider_choices: ProviderChoices, standard_params: StandardParams, extra_params: ExtraParams, -) -> CommandOutput[BaseModel]: +) -> Obbject[BaseModel]: """Number of Employees.""" - return CommandOutput(results=Query(**locals()).execute()) + return Obbject(results=Query(**locals()).execute()) @router.command -def enterprise() -> CommandOutput[Empty]: # type: ignore +def enterprise() -> Obbject[Empty]: # type: ignore """Enterprise value.""" - return CommandOutput(results=Empty()) + return Obbject(results=Empty()) @router.command -def epsfc() -> CommandOutput[Empty]: # type: ignore +def epsfc() -> Obbject[Empty]: # type: ignore """Earnings Estimate by Analysts - EPS.""" - return CommandOutput(results=Empty()) + return Obbject(results=Empty()) @router.command(model="AnalystEstimates") @@ -168,38 +168,38 @@ def est( provider_choices: ProviderChoices, standard_params: StandardParams, extra_params: ExtraParams, -) -> CommandOutput[BaseModel]: +) -> Obbject[BaseModel]: """Analyst Estimates.""" - return CommandOutput(results=Query(**locals()).execute()) + return Obbject(results=Query(**locals()).execute()) @router.command -def fama_coe() -> CommandOutput[Empty]: # type: ignore +def fama_coe() -> Obbject[Empty]: # type: ignore """Fama French 3 Factor Model - Coefficient of Earnings.""" - return CommandOutput(results=Empty()) + return Obbject(results=Empty()) @router.command -def fama_raw() -> CommandOutput[Empty]: # type: ignore +def fama_raw() -> Obbject[Empty]: # type: ignore """Fama French 3 Factor Model - Raw Data.""" - return CommandOutput(results=Empty()) + return Obbject(results=Empty()) @router.command -def fraud() -> CommandOutput[Empty]: # type: ignore +def fraud() -> Obbject[Empty]: # type: ignore """Key fraud ratios including M-score, Z-score and McKee.""" - return CommandOutput(results=Empty()) + return Obbject(results=Empty()) @router.command -def growth() -> CommandOutput[Empty]: # type: ignore +def growth() -> Obbject[Empty]: # type: ignore """Growth of financial statement items and ratios.""" - return CommandOutput(results=Empty()) + return Obbject(results=Empty()) @router.command -def historical_5() -> CommandOutput[Empty]: # type: ignore - return CommandOutput(results=Empty()) +def historical_5() -> Obbject[Empty]: # type: ignore + return Obbject(results=Empty()) @router.command(model="IncomeStatement") @@ -208,9 +208,9 @@ def income( provider_choices: ProviderChoices, standard_params: StandardParams, extra_params: ExtraParams, -) -> CommandOutput[BaseModel]: +) -> Obbject[BaseModel]: """Income Statement.""" - return CommandOutput(results=Query(**locals()).execute()) + return Obbject(results=Query(**locals()).execute()) @router.command(model="IncomeStatementGrowth") @@ -219,9 +219,9 @@ def income_growth( provider_choices: ProviderChoices, standard_params: StandardParams, extra_params: ExtraParams, -) -> CommandOutput[BaseModel]: +) -> Obbject[BaseModel]: """Income Statement Growth.""" - return CommandOutput(results=Query(**locals()).execute()) + return Obbject(results=Query(**locals()).execute()) @router.command(model="StockInsiderTrading") @@ -230,9 +230,9 @@ def ins( provider_choices: ProviderChoices, standard_params: StandardParams, extra_params: ExtraParams, -) -> CommandOutput[BaseModel]: +) -> Obbject[BaseModel]: """Stock Insider Trading.""" - return CommandOutput(results=Query(**locals()).execute()) + return Obbject(results=Query(**locals()).execute()) @router.command(model="InstitutionalOwnership") @@ -241,14 +241,14 @@ def ins_own( provider_choices: ProviderChoices, standard_params: StandardParams, extra_params: ExtraParams, -) -> CommandOutput[BaseModel]: +) -> Obbject[BaseModel]: """Institutional Ownership.""" - return CommandOutput(results=Query(**locals()).execute()) + return Obbject(results=Query(**locals()).execute()) @router.command -def key() -> CommandOutput[Empty]: # type: ignore - return CommandOutput(results=Empty()) +def key() -> Obbject[Empty]: # type: ignore + return Obbject(results=Empty()) @router.command(model="KeyMetrics") @@ -257,9 +257,9 @@ def metrics( provider_choices: ProviderChoices, standard_params: StandardParams, extra_params: ExtraParams, -) -> CommandOutput[BaseModel]: +) -> Obbject[BaseModel]: """Key Metrics.""" - return CommandOutput(results=Query(**locals()).execute()) + return Obbject(results=Query(**locals()).execute()) @router.command(model="KeyExecutives") @@ -268,20 +268,20 @@ def mgmt( provider_choices: ProviderChoices, standard_params: StandardParams, extra_params: ExtraParams, -) -> CommandOutput[BaseModel]: +) -> Obbject[BaseModel]: """Key Executives.""" - return CommandOutput(results=Query(**locals()).execute()) + return Obbject(results=Query(**locals()).execute()) @router.command -def mktcap() -> CommandOutput[Empty]: # type: ignore +def mktcap() -> Obbject[Empty]: # type: ignore """Obtain the market capitalization or enterprise value.""" - return CommandOutput(results=Empty()) + return Obbject(results=Empty()) @router.command # CHECK IF NEWS IS NEEDED HERE -def news() -> CommandOutput[Empty]: # type: ignore - return CommandOutput(results=Empty()) +def news() -> Obbject[Empty]: # type: ignore + return Obbject(results=Empty()) @router.command(model="CompanyOverview") @@ -290,9 +290,9 @@ def overview( provider_choices: ProviderChoices, standard_params: StandardParams, extra_params: ExtraParams, -) -> CommandOutput[BaseModel]: +) -> Obbject[BaseModel]: """Company Overview.""" - return CommandOutput(results=Query(**locals()).execute()) + return Obbject(results=Query(**locals()).execute()) @router.command(model="StockOwnership") @@ -301,9 +301,9 @@ def own( provider_choices: ProviderChoices, standard_params: StandardParams, extra_params: ExtraParams, -) -> CommandOutput[BaseModel]: +) -> Obbject[BaseModel]: """Stock Ownership.""" - return CommandOutput(results=Query(**locals()).execute()) + return Obbject(results=Query(**locals()).execute()) @router.command(model="PriceTargetConsensus") @@ -312,9 +312,9 @@ def pt( provider_choices: ProviderChoices, standard_params: StandardParams, extra_params: ExtraParams, -) -> CommandOutput[BaseModel]: +) -> Obbject[BaseModel]: """Price Target Consensus.""" - return CommandOutput(results=Query(**locals()).execute()) + return Obbject(results=Query(**locals()).execute()) @router.command(model="PriceTarget") @@ -323,27 +323,27 @@ def pta( provider_choices: ProviderChoices, standard_params: StandardParams, extra_params: ExtraParams, -) -> CommandOutput[BaseModel]: +) -> Obbject[BaseModel]: """Price Target.""" - return CommandOutput(results=Query(**locals()).execute()) + return Obbject(results=Query(**locals()).execute()) @router.command -def rating() -> CommandOutput[Empty]: # type: ignore +def rating() -> Obbject[Empty]: # type: ignore """Analyst prices and ratings over time of the company.""" - return CommandOutput(results=Empty()) + return Obbject(results=Empty()) @router.command -def ratios() -> CommandOutput[Empty]: # type: ignore +def ratios() -> Obbject[Empty]: # type: ignore """Extensive set of ratios over time.""" - return CommandOutput(results=Empty()) + return Obbject(results=Empty()) @router.command -def revfc() -> CommandOutput[Empty]: # type: ignore +def revfc() -> Obbject[Empty]: # type: ignore """Earning Estimate by Analysts - Revenue.""" - return CommandOutput(results=Empty()) + return Obbject(results=Empty()) @router.command(model="RevenueGeographic") @@ -352,9 +352,9 @@ def revgeo( provider_choices: ProviderChoices, standard_params: StandardParams, extra_params: ExtraParams, -) -> CommandOutput[BaseModel]: +) -> Obbject[BaseModel]: """Revenue Geographic.""" - return CommandOutput(results=Query(**locals()).execute()) + return Obbject(results=Query(**locals()).execute()) @router.command(model="RevenueBusinessLine") @@ -363,31 +363,31 @@ def revseg( provider_choices: ProviderChoices, standard_params: StandardParams, extra_params: ExtraParams, -) -> CommandOutput[BaseModel]: +) -> Obbject[BaseModel]: """Revenue Business Line.""" - return CommandOutput(results=Query(**locals()).execute()) + return Obbject(results=Query(**locals()).execute()) @router.command -def rot() -> CommandOutput[Empty]: # type: ignore +def rot() -> Obbject[Empty]: # type: ignore """Number of analyst ratings over time on a monthly basis.""" - return CommandOutput(results=Empty()) + return Obbject(results=Empty()) @router.command -def score() -> CommandOutput[Empty]: # type: ignore +def score() -> Obbject[Empty]: # type: ignore """Value investing scores for any time period.""" - return CommandOutput(results=Empty()) + return Obbject(results=Empty()) @router.command -def sec() -> CommandOutput[Empty]: # type: ignore - return CommandOutput(results=Empty()) +def sec() -> Obbject[Empty]: # type: ignore + return Obbject(results=Empty()) @router.command -def shares() -> CommandOutput[Empty]: # type: ignore - return CommandOutput(results=Empty()) +def shares() -> Obbject[Empty]: # type: ignore + return Obbject(results=Empty()) @router.command(model="ShareStatistics") @@ -396,9 +396,9 @@ def shrs( provider_choices: ProviderChoices, standard_params: StandardParams, extra_params: ExtraParams, -) -> CommandOutput[BaseModel]: +) -> Obbject[BaseModel]: """Share Statistics.""" - return CommandOutput(results=Query(**locals()).execute()) + return Obbject(results=Query(**locals()).execute()) @router.command(model="HistoricalStockSplits") @@ -407,15 +407,15 @@ def split( provider_choices: ProviderChoices, standard_params: StandardParams, extra_params: ExtraParams, -) -> CommandOutput[BaseModel]: +) -> Obbject[BaseModel]: """Historical Stock Splits.""" - return CommandOutput(results=Query(**locals()).execute()) + return Obbject(results=Query(**locals()).execute()) @router.command -def supplier() -> CommandOutput[Empty]: # type: ignore +def supplier() -> Obbject[Empty]: # type: ignore """List of suppliers of the company.""" - return CommandOutput(results=Empty()) + return Obbject(results=Empty()) @router.command(model="EarningsCallTranscript") @@ -424,6 +424,6 @@ def transcript( provider_choices: ProviderChoices, standard_params: StandardParams, extra_params: ExtraParams, -) -> CommandOutput[BaseModel]: +) -> Obbject[BaseModel]: """Earnings Call Transcript.""" - return CommandOutput(results=Query(**locals()).execute()) + return Obbject(results=Query(**locals()).execute()) diff --git a/openbb_sdk/extensions/stocks/openbb_stocks/gov/gov_router.py b/openbb_sdk/extensions/stocks/openbb_stocks/gov/gov_router.py index fa3c3151cdf..737ea0b0051 100644 --- a/openbb_sdk/extensions/stocks/openbb_stocks/gov/gov_router.py +++ b/openbb_sdk/extensions/stocks/openbb_stocks/gov/gov_router.py @@ -1,7 +1,7 @@ """Due Diligence Router.""" -from openbb_core.app.model.command_output import CommandOutput +from openbb_core.app.model.obbject import Obbject from openbb_core.app.model.results.empty import Empty from openbb_core.app.router import Router @@ -9,66 +9,66 @@ router = Router(prefix="/gov") @router.command -def contracts() -> CommandOutput[Empty]: # type: ignore +def contracts() -> Obbject[Empty]: # type: ignore """Return government contracts.""" - return CommandOutput(results=Empty()) + return Obbject(results=Empty()) @router.command -def government_trading() -> CommandOutput[Empty]: # type: ignore +def government_trading() -> Obbject[Empty]: # type: ignore """Return government trading.""" - return CommandOutput(results=Empty()) + return Obbject(results=Empty()) @router.command # Isn't this one the same as the one above? -def gtrades() -> CommandOutput[Empty]: # type: ignore +def gtrades() -> Obbject[Empty]: # type: ignore """Return government trades.""" - return CommandOutput(results=Empty()) + return Obbject(results=Empty()) @router.command -def histcont() -> CommandOutput[Empty]: # type: ignore +def histcont() -> Obbject[Empty]: # type: ignore """Historical quarterly government contracts.""" - return CommandOutput(results=Empty()) + return Obbject(results=Empty()) @router.command -def lastcontracts() -> CommandOutput[Empty]: # type: ignore +def lastcontracts() -> Obbject[Empty]: # type: ignore """Return last government contracts given out.""" - return CommandOutput(results=Empty()) + return Obbject(results=Empty()) @router.command -def lasttrades() -> CommandOutput[Empty]: # type: ignore +def lasttrades() -> Obbject[Empty]: # type: ignore """Last trades.""" - return CommandOutput(results=Empty()) + return Obbject(results=Empty()) @router.command -def lobbying() -> CommandOutput[Empty]: # type: ignore +def lobbying() -> Obbject[Empty]: # type: ignore """Corporate lobbying details.""" - return CommandOutput(results=Empty()) + return Obbject(results=Empty()) @router.command -def qtrcontracts() -> CommandOutput[Empty]: # type: ignore +def qtrcontracts() -> Obbject[Empty]: # type: ignore """Quarterly government contracts analysis.""" - return CommandOutput(results=Empty()) + return Obbject(results=Empty()) @router.command -def topbuys() -> CommandOutput[Empty]: # type: ignore +def topbuys() -> Obbject[Empty]: # type: ignore """Show most purchased stocks.""" - return CommandOutput(results=Empty()) + return Obbject(results=Empty()) @router.command -def toplobbying() -> CommandOutput[Empty]: # type: ignore +def toplobbying() -> Obbject[Empty]: # type: ignore """Top corporate lobbying tickers.""" - return CommandOutput(results=Empty()) + return Obbject(results=Empty()) @router.command -def topsells() -> CommandOutput[Empty]: # type: ignore +def topsells() -> Obbject[Empty]: # type: ignore """Show most sold stocks.""" - return CommandOutput(results=Empty()) + return Obbject(results=Empty()) diff --git a/openbb_sdk/extensions/stocks/openbb_stocks/ins/ins_router.py b/openbb_sdk/extensions/stocks/openbb_stocks/ins/ins_router.py index fe0a6ea385e..06d3b757771 100644 --- a/openbb_sdk/extensions/stocks/openbb_stocks/ins/ins_router.py +++ b/openbb_sdk/extensions/stocks/openbb_stocks/ins/ins_router.py @@ -1,7 +1,7 @@ """Due Diligence Router.""" -from openbb_core.app.model.command_output import CommandOutput +from openbb_core.app.model.obbject import Obbject from openbb_core.app.model.results.empty import Empty from openbb_core.app.router import Router @@ -9,96 +9,96 @@ router = Router(prefix="/ins") @router.command -def act() -> CommandOutput[Empty]: # type: ignore +def act() -> Obbject[Empty]: # type: ignore """Insider activity over time.""" - return CommandOutput(results=Empty()) + return Obbject(results=Empty()) @router.command -def blcp() -> CommandOutput[Empty]: # type: ignore +def blcp() -> Obbject[Empty]: # type: ignore """Big latest CEO/CFO purchaces ($25k+).""" - return CommandOutput(results=Empty()) + return Obbject(results=Empty()) @router.command -def blcs() -> CommandOutput[Empty]: # type: ignore +def blcs() -> Obbject[Empty]: # type: ignore """Big latest CEO/CFO sales ($100k+).""" - return CommandOutput(results=Empty()) + return Obbject(results=Empty()) @router.command -def blip() -> CommandOutput[Empty]: # type: ignore +def blip() -> Obbject[Empty]: # type: ignore """Big latest insider purchaces ($25+).""" - return CommandOutput(results=Empty()) + return Obbject(results=Empty()) @router.command -def blis() -> CommandOutput[Empty]: # type: ignore +def blis() -> Obbject[Empty]: # type: ignore """Big latest insider sales ($100k+).""" - return CommandOutput(results=Empty()) + return Obbject(results=Empty()) @router.command -def blop() -> CommandOutput[Empty]: # type: ignore +def blop() -> Obbject[Empty]: # type: ignore """Big latest officer purchaces ($25k+).""" - return CommandOutput(results=Empty()) + return Obbject(results=Empty()) @router.command -def blos() -> CommandOutput[Empty]: # type: ignore +def blos() -> Obbject[Empty]: # type: ignore """Big latest officer sales ($100k+).""" - return CommandOutput(results=Empty()) + return Obbject(results=Empty()) @router.command # Can't use filter because it's a python keyword -def filt() -> CommandOutput[Empty]: # type: ignore +def filt() -> Obbject[Empty]: # type: ignore """Filter insiders based on preset.""" - return CommandOutput(results=Empty()) + return Obbject(results=Empty()) @router.command -def lcb() -> CommandOutput[Empty]: # type: ignore +def lcb() -> Obbject[Empty]: # type: ignore """Latest cluster buys.""" - return CommandOutput(results=Empty()) + return Obbject(results=Empty()) @router.command -def lins() -> CommandOutput[Empty]: # type: ignore +def lins() -> Obbject[Empty]: # type: ignore """Last insider trading of the company.""" - return CommandOutput(results=Empty()) + return Obbject(results=Empty()) @router.command -def lip() -> CommandOutput[Empty]: # type: ignore +def lip() -> Obbject[Empty]: # type: ignore """Latest insider purchaces.""" - return CommandOutput(results=Empty()) + return Obbject(results=Empty()) @router.command -def lis() -> CommandOutput[Empty]: # type: ignore +def lis() -> Obbject[Empty]: # type: ignore """Latest insider sales.""" - return CommandOutput(results=Empty()) + return Obbject(results=Empty()) @router.command -def lit() -> CommandOutput[Empty]: # type: ignore +def lit() -> Obbject[Empty]: # type: ignore """Latest insider trading (all filings).""" - return CommandOutput(results=Empty()) + return Obbject(results=Empty()) @router.command -def lpsb() -> CommandOutput[Empty]: # type: ignore +def lpsb() -> Obbject[Empty]: # type: ignore """Latest penny stock buys.""" - return CommandOutput(results=Empty()) + return Obbject(results=Empty()) @router.command -def print_insider_data() -> CommandOutput[Empty]: # type: ignore +def print_insider_data() -> Obbject[Empty]: # type: ignore """Print insider data.""" - return CommandOutput(results=Empty()) + return Obbject(results=Empty()) @router.command -def stats() -> CommandOutput[Empty]: # type: ignore +def stats() -> Obbject[Empty]: # type: ignore """Insider stats of the company.""" - return CommandOutput(results=Empty()) + return Obbject(results=Empty()) diff --git a/openbb_sdk/extensions/stocks/openbb_stocks/options/options_router.py b/openbb_sdk/extensions/stocks/openbb_stocks/options/options_router.py index 83393510a36..e2416f75c90 100644 --- a/openbb_sdk/extensions/stocks/openbb_stocks/options/options_router.py +++ b/openbb_sdk/extensions/stocks/openbb_stocks/options/options_router.py @@ -1,4 +1,4 @@ -from openbb_core.app.model.command_output import CommandOutput +from openbb_core.app.model.obbject import Obbject from openbb_core.app.model.results.empty import Empty from openbb_core.app.router import Router @@ -6,88 +6,88 @@ router = Router(prefix="/options") @router.command -def chains() -> CommandOutput[Empty]: # type: ignore +def chains() -> Obbject[Empty]: # type: ignore """Return options chains with greeks.""" - return CommandOutput(results=Empty()) + return Obbject(results=Empty()) @router.command -def dte() -> CommandOutput[Empty]: # type: ignore - return CommandOutput(results=Empty()) +def dte() -> Obbject[Empty]: # type: ignore + return Obbject(results=Empty()) @router.command -def eodchain() -> CommandOutput[Empty]: # type: ignore +def eodchain() -> Obbject[Empty]: # type: ignore """Gets option chain at a specific date.""" - return CommandOutput(results=Empty()) + return Obbject(results=Empty()) @router.command -def expirations() -> CommandOutput[Empty]: # type: ignore +def expirations() -> Obbject[Empty]: # type: ignore """Return options expirations.""" - return CommandOutput(results=Empty()) + return Obbject(results=Empty()) @router.command -def grhist() -> CommandOutput[Empty]: # type: ignore +def grhist() -> Obbject[Empty]: # type: ignore """Plot option greek history.""" - return CommandOutput(results=Empty()) + return Obbject(results=Empty()) @router.command -def hist() -> CommandOutput[Empty]: # type: ignore +def hist() -> Obbject[Empty]: # type: ignore """Plot option history.""" - return CommandOutput(results=Empty()) + return Obbject(results=Empty()) @router.command -def info() -> CommandOutput[Empty]: # type: ignore +def info() -> Obbject[Empty]: # type: ignore """Display option information (volatility, IV rank, etc.).""" - return CommandOutput(results=Empty()) + return Obbject(results=Empty()) @router.command -def last_price() -> CommandOutput[Empty]: # type: ignore +def last_price() -> Obbject[Empty]: # type: ignore """Return last price of an option.""" - return CommandOutput(results=Empty()) + return Obbject(results=Empty()) @router.command -def oi() -> CommandOutput[Empty]: # type: ignore +def oi() -> Obbject[Empty]: # type: ignore """Plot option open interest.""" - return CommandOutput(results=Empty()) + return Obbject(results=Empty()) @router.command -def pcr() -> CommandOutput[Empty]: # type: ignore +def pcr() -> Obbject[Empty]: # type: ignore """Display put/call ratio for ticker.""" - return CommandOutput(results=Empty()) + return Obbject(results=Empty()) @router.command -def price() -> CommandOutput[Empty]: # type: ignore - return CommandOutput(results=Empty()) +def price() -> Obbject[Empty]: # type: ignore + return Obbject(results=Empty()) @router.command -def unu() -> CommandOutput[Empty]: # type: ignore +def unu() -> Obbject[Empty]: # type: ignore """Show unusual options activity.""" - return CommandOutput(results=Empty()) + return Obbject(results=Empty()) @router.command -def voi() -> CommandOutput[Empty]: # type: ignore +def voi() -> Obbject[Empty]: # type: ignore """Plot volume and open interest.""" - return CommandOutput(results=Empty()) + return Obbject(results=Empty()) @router.command -def vol() -> CommandOutput[Empty]: # type: ignore +def vol() -> Obbject[Empty]: # type: ignore """Plot volume.""" - return CommandOutput(results=Empty()) + return Obbject(results=Empty()) @router.command -def vsurf() -> CommandOutput[Empty]: # type: ignore +def vsurf() -> Obbject[Empty]: # type: ignore """Show 3D volatility surface.""" - return CommandOutput(results=Empty()) + return Obbject(results=Empty()) diff --git a/openbb_sdk/extensions/stocks/openbb_stocks/stocks_router.py b/openbb_sdk/extensions/stocks/openbb_stocks/stocks_router.py index 28411d5c71b..f0e147c8921 100644 --- a/openbb_sdk/extensions/stocks/openbb_stocks/stocks_router.py +++ b/openbb_sdk/extensions/stocks/openbb_stocks/stocks_router.py @@ -2,7 +2,7 @@ """Stocks Router.""" from openbb_core.app.model.command_context import CommandContext -from openbb_core.app.model.command_output import CommandOutput +from openbb_core.app.model.obbject import Obbject from openbb_core.app.model.results.empty import Empty from openbb_core.app.provider_interface import ( ExtraParams, @@ -39,9 +39,9 @@ def load( provider_choices: ProviderChoices, standard_params: StandardParams, extra_params: ExtraParams, -) -> CommandOutput[BaseModel]: +) -> Obbject[BaseModel]: """Load stock data for a specific ticker.""" - return CommandOutput(results=Query(**locals()).execute()) + return Obbject(results=Query(**locals()).execute()) @router.command(model="StockNews") @@ -50,9 +50,9 @@ def news( provider_choices: ProviderChoices, standard_params: StandardParams, extra_params: ExtraParams, -) -> CommandOutput[BaseModel]: +) -> Obbject[BaseModel]: """Get news for one or more stock tickers.""" - return CommandOutput(results=Query(**locals()).execute()) + return Obbject(results=Query(**locals()).execute()) @router.command(model="StockMultiples") @@ -61,24 +61,24 @@ def multiples( provider_choices: ProviderChoices, standard_params: StandardParams, extra_params: ExtraParams, -) -> CommandOutput[BaseModel]: +) -> Obbject[BaseModel]: """Get valuation multiples for a stock ticker.""" - return CommandOutput(results=Query(**locals()).execute()) + return Obbject(results=Query(**locals()).execute()) @router.command -def tob() -> CommandOutput[Empty]: +def tob() -> Obbject[Empty]: """View top of book for loaded ticker (US exchanges only).""" - return CommandOutput(results=Empty()) + return Obbject(results=Empty()) @router.command -def quote() -> CommandOutput[Empty]: +def quote() -> Obbject[Empty]: """View the current price for a specific stock ticker.""" - return CommandOutput(results=Empty()) + return Obbject(results=Empty()) @router.command -def search() -> CommandOutput[Empty]: +def search() -> Obbject[Empty]: """Search a specific stock ticker for analysis.""" - return CommandOutput(results=Empty()) + return Obbject(results=Empty()) diff --git a/openbb_sdk/extensions/ta/openbb_ta/ta_router.py b/openbb_sdk/extensions/ta/openbb_ta/ta_router.py index 3dbfd23886f..e5076baeb6f 100644 --- a/openbb_sdk/extensions/ta/openbb_ta/ta_router.py +++ b/openbb_sdk/extensions/ta/openbb_ta/ta_router.py @@ -1,7 +1,7 @@ from typing import List, Literal, Optional import pandas as pd -from openbb_core.app.model.command_output import CommandOutput +from openbb_core.app.model.obbject import Obbject from openbb_core.app.model.results.empty import Empty from openbb_core.app.router import Router from openbb_core.app.utils import ( @@ -31,7 +31,7 @@ def atr( mamode: Literal["rma", "ema", "sma", "wma"] = "rma", drift: NonNegativeInt = 1, offset: int = 0, -) -> CommandOutput[List[Data]]: +) -> Obbject[List[Data]]: """ Average True Range is used to measure volatility, especially volatility caused by gaps or limit moves. @@ -53,7 +53,7 @@ def atr( Returns ------- - CommandOutput[List[Data]] + Obbject[List[Data]] List of data with the indicator applied. Examples @@ -71,7 +71,7 @@ def atr( results = df_to_basemodel(df_target.join(df_atr, how="left"), index=True) - return CommandOutput(results=results) + return Obbject(results=results) @router.command(methods=["POST"]) @@ -82,7 +82,7 @@ def fib( period: PositiveInt = 120, start_date: Optional[str] = None, end_date: Optional[str] = None, -) -> CommandOutput[List[Data]]: +) -> Obbject[List[Data]]: """ Fibonacci Retracement Levels. @@ -97,7 +97,7 @@ def fib( Returns ------- - CommandOutput[List[Data]] + Obbject[List[Data]] List of data with the indicator applied. Examples @@ -132,7 +132,7 @@ def fib( results = df_to_basemodel(df_fib) - return CommandOutput(results=results) + return Obbject(results=results) @router.command(methods=["POST"]) @@ -140,7 +140,7 @@ def obv( data: List[Data], index: str = "date", offset: int = 0, -) -> CommandOutput[List[Data]]: +) -> Obbject[List[Data]]: """ The On Balance Volume (OBV) is a cumulative total of the up and down volume. When the close is higher than the previous close, the volume is added @@ -161,7 +161,7 @@ def obv( Returns ------- - CommandOutput[List[Data]] + Obbject[List[Data]] List of data with the indicator applied. Examples @@ -177,7 +177,7 @@ def obv( results = df_to_basemodel(df_target.join(df_obv, how="left"), index=True) - return CommandOutput(results=results) + return Obbject(results=results) @router.command(methods=["POST"]) @@ -186,7 +186,7 @@ def fisher( index: str = "date", length: PositiveInt = 14, signal: PositiveInt = 1, -) -> CommandOutput[List[Data]]: +) -> Obbject[List[Data]]: """ The Fisher Transform is a technical indicator created by John F. Ehlers that converts prices into a Gaussian normal distribution.1 The indicator @@ -207,7 +207,7 @@ def fisher( Returns ------- - CommandOutput[List[Data]] + Obbject[List[Data]] List of data with the indicator applied. Examples @@ -223,7 +223,7 @@ def fisher( results = df_to_basemodel(df_target.join(df_fisher, how="left"), index=True) - return CommandOutput(results=results) + return Obbject(results=results) @router.command(methods=["POST"]) @@ -233,7 +233,7 @@ def adosc( fast: PositiveInt = 3, slow: PositiveInt = 10, offset: int = 0, -) -> CommandOutput[List[Data]]: +) -> Obbject[List[Data]]: """ Accumulation/Distribution Oscillator, also known as the Chaikin Oscillator is essentially a momentum indicator, but of the Accumulation-Distribution line @@ -256,7 +256,7 @@ def adosc( Returns ------- - CommandOutput[List[Data]] + Obbject[List[Data]] Examples -------- @@ -271,16 +271,16 @@ def adosc( results = df_to_basemodel(df_target.join(df_adosc, how="left"), index=True) - return CommandOutput(results=results) + return Obbject(results=results) @router.command(methods=["POST"]) -def tv() -> CommandOutput[Empty]: +def tv() -> Obbject[Empty]: """TradingView.""" # TODO : probably out of scope for now - return CommandOutput(results=Empty()) + return Obbject(results=Empty()) @router.command(methods=["POST"]) @@ -292,7 +292,7 @@ def bbands( std: NonNegativeFloat = 2, mamode: Literal["sma", "ema", "wma", "rma"] = "sma", offset: int = 0, -) -> CommandOutput[List[Data]]: +) -> Obbject[List[Data]]: """ Bollinger Bands consist of three lines. The middle band is a simple moving average (generally 20 periods) of the typical price (TP). The upper and lower @@ -324,7 +324,7 @@ def bbands( Returns ------- - CommandOutput[List[Data]] + Obbject[List[Data]] The calculated data. Examples @@ -344,16 +344,16 @@ def bbands( results = df_to_basemodel(df_target.join(bbands_df, how="left"), index=True) - return CommandOutput(results=results) + return Obbject(results=results) @router.command(methods=["POST"]) -def multi() -> CommandOutput[Empty]: +def multi() -> Obbject[Empty]: """Plot multiple indicators on the same chart.""" # TODO : probably out of scope for now - return CommandOutput(results=Empty()) + return Obbject(results=Empty()) @router.command(methods=["POST"]) @@ -363,7 +363,7 @@ def zlma( index: str = "date", length: int = 50, offset: int = 0, -) -> CommandOutput[List[Data]]: +) -> Obbject[List[Data]]: """ The zero lag exponential moving average (ZLEMA) indicator was created by John Ehlers and Ric Way. The idea is do a @@ -388,7 +388,7 @@ def zlma( Returns ------- - CommandOutput[List[Data]] + Obbject[List[Data]] The calculated data. Examples @@ -403,7 +403,7 @@ def zlma( results = df_to_basemodel(df_target.join(zlma_df, how="left"), index=True) - return CommandOutput(results=results) + return Obbject(results=results) @router.command(methods=["POST"]) @@ -412,7 +412,7 @@ def aroon( index: str = "date", length: int = 25, scalar: int = 100, -) -> CommandOutput[List[Data]]: +) -> Obbject[List[Data]]: """ The word aroon is Sanskrit for "dawn's early light." The Aroon indicator attempts to show when a new trend is dawning. The indicator consists @@ -438,7 +438,7 @@ def aroon( Returns ------- - CommandOutput[List[Data]] + Obbject[List[Data]] The calculated data. Examples @@ -453,7 +453,7 @@ def aroon( results = df_to_basemodel(df_target.join(aroon_df, how="left"), index=True) - return CommandOutput(results=results) + return Obbject(results=results) @router.command(methods=["POST"]) @@ -463,7 +463,7 @@ def sma( index: str = "date", length: int = 50, offset: int = 0, -) -> CommandOutput[List[Data]]: +) -> Obbject[List[Data]]: """ Moving Averages are used to smooth the data in an array to help eliminate noise and identify trends. The Simple Moving Average is literally @@ -488,7 +488,7 @@ def sma( Returns ------- - CommandOutput[List[Data]] + Obbject[List[Data]] The calculated data. Examples @@ -503,7 +503,7 @@ def sma( results = df_to_basemodel(df_target.join(sma_df, how="left"), index=True) - return CommandOutput(results=results) + return Obbject(results=results) @router.command(methods=["POST"]) @@ -514,7 +514,7 @@ def demark( show_all: bool = False, asint: bool = False, offset: int = 0, -) -> CommandOutput[List[Data]]: +) -> Obbject[List[Data]]: """ Demark sequential indicator @@ -535,7 +535,7 @@ def demark( Returns ------- - CommandOutput[List[Data]] + Obbject[List[Data]] The calculated data. Examples @@ -553,7 +553,7 @@ def demark( results = df_to_basemodel(df_target.join(demark_df, how="left"), index=True) - return CommandOutput(results=results) + return Obbject(results=results) @router.command(methods=["POST"]) @@ -562,7 +562,7 @@ def vwap( index: str = "date", anchor: str = "D", offset: int = 0, -) -> CommandOutput[List[Data]]: +) -> Obbject[List[Data]]: """ The Volume Weighted Average Price that measures the average typical price by volume. It is typically used with intraday charts to identify general direction. @@ -582,7 +582,7 @@ def vwap( Returns ------- - CommandOutput[List[Data]] + Obbject[List[Data]] The calculated data. Examples @@ -598,17 +598,17 @@ def vwap( results = df_to_basemodel(df_target.join(df_vwap, how="left"), index=True) - return CommandOutput(results=results) + return Obbject(results=results) @router.command(methods=["POST"]) -def recom() -> CommandOutput[Empty]: +def recom() -> Obbject[Empty]: """Recommendation.""" # TODO : this command does only a call to a Tradingview's endpoint # thus, it should probably be implement on a provider level - return CommandOutput(results=Empty()) + return Obbject(results=Empty()) @router.command(methods=["POST"]) @@ -619,7 +619,7 @@ def macd( fast: int = 12, slow: int = 26, signal: int = 9, -) -> CommandOutput[List[Data]]: +) -> Obbject[List[Data]]: """ The Moving Average Convergence Divergence (MACD) is the difference between two Exponential Moving Averages. The Signal line is an Exponential Moving @@ -646,7 +646,7 @@ def macd( Returns ------- - CommandOutput[List[Data]] + Obbject[List[Data]] The calculated data. Examples @@ -663,7 +663,7 @@ def macd( results = df_to_basemodel(df_target.join(macd_df, how="left"), index=True) - return CommandOutput(results=results) + return Obbject(results=results) @router.command(methods=["POST"]) @@ -673,7 +673,7 @@ def hma( index: str = "date", length: int = 50, offset: int = 0, -) -> CommandOutput[List[Data]]: +) -> Obbject[List[Data]]: """ The Hull Moving Average solves the age old dilemma of making a moving average more responsive to current price activity whilst maintaining curve smoothness. @@ -695,7 +695,7 @@ def hma( Returns ------- - CommandOutput[List[Data]] + Obbject[List[Data]] The calculated data. Examples @@ -710,7 +710,7 @@ def hma( results = df_to_basemodel(df_target.join(hma_df, how="left"), index=True) - return CommandOutput(results=results) + return Obbject(results=results) @router.command(methods=["POST"]) @@ -720,7 +720,7 @@ def donchian( lower_length: PositiveInt = 20, upper_length: PositiveInt = 20, offset: int = 0, -) -> CommandOutput[List[Data]]: +) -> Obbject[List[Data]]: """ Donchian Channels are three lines generated by moving average calculations that comprise an indicator formed by upper and lower @@ -744,7 +744,7 @@ def donchian( Returns ------- - CommandOutput[List[Data]] + Obbject[List[Data]] The calculated data. Examples @@ -764,7 +764,7 @@ def donchian( results = df_to_basemodel(df_target.join(donchian_df, how="left"), index=True) - return CommandOutput(results=results) + return Obbject(results=results) @router.command(methods=["POST"]) @@ -776,7 +776,7 @@ def ichimoku( lagging: PositiveInt = 52, offset: PositiveInt = 26, lookahead: bool = False, -) -> CommandOutput[List[Data]]: +) -> Obbject[List[Data]]: """ The Ichimoku Cloud, also known as Ichimoku Kinko Hyo, is a versatile indicator that defines support and resistance, identifies trend direction, gauges momentum and provides @@ -816,7 +816,7 @@ def ichimoku( results = df_to_basemodel(df_result, index=True) - return CommandOutput(results=results) + return Obbject(results=results) @router.command(methods=["POST"]) @@ -825,7 +825,7 @@ def clenow( index: str = "date", target: str = "adj_close", period: PositiveInt = 90, -) -> CommandOutput[List[Data]]: +) -> Obbject[List[Data]]: """ Clenow Volatility Adjusted Momentum. @@ -842,7 +842,7 @@ def clenow( Returns ------- - CommandOutput[List[Data]] + Obbject[List[Data]] The calculated data. Examples @@ -868,13 +868,11 @@ def clenow( results = df_to_basemodel(df_clenow) - return CommandOutput(results=results) + return Obbject(results=results) @router.command(methods=["POST"]) -def ad( - data: List[Data], index: str = "date", offset: int = 0 -) -> CommandOutput[List[Data]]: +def ad(data: List[Data], index: str = "date", offset: int = 0) -> Obbject[List[Data]]: """ The Accumulation/Distribution Line is similar to the On Balance Volume (OBV), which sums the volume times +1/-1 based on whether the close is @@ -898,7 +896,7 @@ def ad( Returns ------- - CommandOutput[List[Data]] + Obbject[List[Data]] Examples -------- @@ -913,7 +911,7 @@ def ad( results = df_to_basemodel(df_target.join(ad_df, how="left"), index=True) - return CommandOutput(results=results) + return Obbject(results=results) @router.command(methods=["POST"]) @@ -923,7 +921,7 @@ def adx( length: int = 50, scalar: float = 100.0, drift: int = 1, -) -> CommandOutput[List[Data]]: +) -> Obbject[List[Data]]: """ The ADX is a Welles Wilder style moving average of the Directional Movement Index (DX). The values range from 0 to 100, but rarely get above 60. To interpret the ADX, consider @@ -944,7 +942,7 @@ def adx( Returns ------- - CommandOutput[List[Data]] + Obbject[List[Data]] The calculated data. Examples @@ -961,7 +959,7 @@ def adx( results = df_to_basemodel(df_target.join(adx_df, how="left"), index=True) - return CommandOutput(results=results) + return Obbject(results=results) @router.command(methods=["POST"]) @@ -971,7 +969,7 @@ def wma( index: str = "date", length: int = 50, offset: int = 0, -) -> CommandOutput[List[Data]]: +) -> Obbject[List[Data]]: """ A Weighted Moving Average puts more weight on recent data and less on past data. This is done by multiplying each bar’s price by a weighting factor. Because of its @@ -993,7 +991,7 @@ def wma( Returns ------- - CommandOutput[List[Data]] + Obbject[List[Data]] The WMA data. Examples @@ -1008,7 +1006,7 @@ def wma( results = df_to_basemodel(df_target.join(wma_df, how="left"), index=True) - return CommandOutput(results=results) + return Obbject(results=results) @router.command(methods=["POST"]) @@ -1017,7 +1015,7 @@ def cci( index: str = "date", length: PositiveInt = 14, scalar: PositiveFloat = 0.015, -) -> CommandOutput[List[Data]]: +) -> Obbject[List[Data]]: """ The CCI is designed to detect beginning and ending market trends. The range of 100 to -100 is the normal trading range. CCI values outside of this @@ -1038,7 +1036,7 @@ def cci( Returns ------- - CommandOutput[List[Data]] + Obbject[List[Data]] The CCI data. """ @@ -1048,7 +1046,7 @@ def cci( results = df_to_basemodel(df_target.join(cci_df, how="left"), index=True) - return CommandOutput(results=results) + return Obbject(results=results) @router.command(methods=["POST"]) @@ -1059,7 +1057,7 @@ def rsi( length: int = 14, scalar: float = 100.0, drift: int = 1, -) -> CommandOutput[List[Data]]: +) -> Obbject[List[Data]]: """ The Relative Strength Index (RSI) calculates a ratio of the recent upward price movements to the absolute price movement. The RSI ranges @@ -1084,7 +1082,7 @@ def rsi( Returns ------- - CommandOutput[List[Data]] + Obbject[List[Data]] The RSI data. Examples @@ -1101,17 +1099,17 @@ def rsi( results = df_to_basemodel(df_target.join(rsi_df, how="left"), index=True) - return CommandOutput(results=results) + return Obbject(results=results) @router.command(methods=["POST"]) -def summary() -> CommandOutput[Empty]: +def summary() -> Obbject[Empty]: """Summary.""" # TODO : this command does only a call to a finbrain's endpoint # thus, it should probably be implement on a provider level - return CommandOutput(results=Empty()) + return Obbject(results=Empty()) @router.command(methods=["POST"]) @@ -1121,7 +1119,7 @@ def stoch( fast_k_period: NonNegativeInt = 14, slow_d_period: NonNegativeInt = 3, slow_k_period: NonNegativeInt = 3, -) -> CommandOutput[List[Data]]: +) -> Obbject[List[Data]]: """ The Stochastic Oscillator measures where the close is in relation to the recent trading range. The values range from zero to 100. %D values over 75 @@ -1145,7 +1143,7 @@ def stoch( Returns ------- - CommandOutput[List[Data]] + Obbject[List[Data]] The Stochastic Oscillator data. Examples @@ -1167,16 +1165,16 @@ def stoch( results = df_to_basemodel(df_target.join(stoch_df, how="left"), index=True) - return CommandOutput(results=results) + return Obbject(results=results) @router.command(methods=["POST"]) -def rsp() -> CommandOutput[Empty]: +def rsp() -> Obbject[Empty]: """Relative Strength Performance.""" # TODO : https://github.com/OpenBB-finance/OpenBBTerminal/issues/5167 - return CommandOutput(results=Empty()) + return Obbject(results=Empty()) @router.command(methods=["POST"]) @@ -1187,7 +1185,7 @@ def kc( scalar: PositiveFloat = 20, mamode: Literal["ema", "sma", "wma", "hma", "zlma"] = "ema", offset: NonNegativeInt = 0, -) -> CommandOutput[List[Data]]: +) -> Obbject[List[Data]]: """ Keltner Channels are volatility-based bands that are placed on either side of an asset's price and can aid in determining @@ -1212,7 +1210,7 @@ def kc( Returns ------- - CommandOutput[List[Data]] + Obbject[List[Data]] The Keltner Channels data. Examples @@ -1235,13 +1233,13 @@ def kc( results = df_to_basemodel(df_target.join(kc_df, how="left"), index=True) - return CommandOutput(results=results) + return Obbject(results=results) @router.command(methods=["POST"]) def cg( data: List[Data], index: str = "date", length: PositiveInt = 14 -) -> CommandOutput[List[Data]]: +) -> Obbject[List[Data]]: """ The Center of Gravity indicator, in short, is used to anticipate future price movements and to trade on price reversals as soon as they happen. However, just like other oscillators, @@ -1260,7 +1258,7 @@ def cg( Returns ------- - CommandOutput[List[Data]] + Obbject[List[Data]] The COG data. Examples @@ -1276,7 +1274,7 @@ def cg( results = df_to_basemodel(df_target.join(cg_df, how="left"), index=True) - return CommandOutput(results=results) + return Obbject(results=results) @router.command(methods=["POST"]) @@ -1294,7 +1292,7 @@ def cones( "Yang-Zhang", ] = "STD", is_crypto: bool = False, -) -> CommandOutput[List[Data]]: +) -> Obbject[List[Data]]: """Calculate the realized volatility quantiles over rolling windows of time. The model for calculating volatility is selectable. @@ -1336,7 +1334,7 @@ def cones( Returns ------- - CommandOutput[List[Data]] + Obbject[List[Data]] The cones data. Examples @@ -1356,7 +1354,7 @@ def cones( results = df_to_basemodel(df_cones, index=True) - return CommandOutput(results=results) + return Obbject(results=results) @router.command(methods=["POST"]) @@ -1366,7 +1364,7 @@ def ema( index: str = "date", length: int = 50, offset: int = 0, -) -> CommandOutput[List[Data]]: +) -> Obbject[List[Data]]: """ The Exponential Moving Average is a staple of technical analysis and is used in countless technical indicators. In a Simple Moving @@ -1392,7 +1390,7 @@ def ema( Returns ------- - CommandOutput[List[Data]] + Obbject[List[Data]] The calculated data. Examples @@ -1408,4 +1406,4 @@ def ema( results = df_to_basemodel(df_target.join(ema_df, how="left"), index=True) - return CommandOutput(results=results) + return Obbject(results=results) diff --git a/openbb_sdk/sdk/core/README.md b/openbb_sdk/sdk/core/README.md index 38d91d6ccd8..2c0f30fa296 100644 --- a/openbb_sdk/sdk/core/README.md +++ b/openbb_sdk/sdk/core/README.md @@ -70,7 +70,7 @@ router = Router(prefix="/router_name") @router.command def some_command( some_param: some_param_type, -) -> CommandOutput[Item]: +) -> Obbject[Item]: pass ``` @@ -85,9 +85,9 @@ def load( provider_choices: ProviderChoices, # available providers standard_params: StandardParams, # symbol, start_date, etc. extra_params: ExtraParams, # provider specific parameters -) -> CommandOutput[BaseModel]: +) -> Obbject[BaseModel]: """Load stock data for a specific ticker.""" - return CommandOutput(results=Query(**locals()).execute()) + return Obbject(results=Query(**locals()).execute()) ``` ### Entrypoint @@ -165,7 +165,7 @@ output = obb.stocks.load( ### 4.1.1. Command output -Each command will always return a `CommandOutput`. There you will find: +Each command will always return a `Obbject`. There you will find: - `results`: the data returned by the command `None` - `provider`: the provider name (only available provider names allowed) used to get the data or `None` @@ -341,7 +341,7 @@ timestamp: ... # Execution starting timestamp. alias_list: ... # List of alias to find a JournalEntry easier than with it's `tag`. >>> response.output -CommandOutput +Obbject id: ... # UUID Tag results: ... # Serializable results. diff --git a/openbb_sdk/sdk/core/openbb_core/api/router/commands.py b/openbb_sdk/sdk/core/openbb_core/api/router/commands.py index 49ee6a65c5a..b89713a2877 100644 --- a/openbb_sdk/sdk/core/openbb_core/api/router/commands.py +++ b/openbb_sdk/sdk/core/openbb_core/api/router/commands.py @@ -8,7 +8,7 @@ from fastapi.routing import APIRoute from openbb_core.api.dependency.user import get_user from openbb_core.app.command_runner import CommandRunner from openbb_core.app.model.command_context import CommandContext -from openbb_core.app.model.command_output import CommandOutput +from openbb_core.app.model.obbject import Obbject from openbb_core.app.model.user_settings import UserSettings from openbb_core.app.router import RouterLoader from openbb_core.app.service.system_service import SystemService @@ -76,22 +76,22 @@ def build_new_signature(func): ) -def validate_output(c_out: CommandOutput) -> CommandOutput: +def validate_output(c_out: Obbject) -> Obbject: """ - Validate CommandOutput object. - Checks against the CommandOutput schema and removes fields that contain the + Validate Obbject object. + Checks against the Obbject schema and removes fields that contain the `exclude_from_api` extra `pydantic.Field` kwarg. - Note that the modification to the `CommandOutput` object is done in-place. + Note that the modification to the `Obbject` object is done in-place. Parameters ---------- - c_out : CommandOutput - CommandOutput object to validate. + c_out : Obbject + Obbject object to validate. Returns ------- - CommandOutput - Validated CommandOutput object. + Obbject + Validated Obbject object. """ def is_model(type_): diff --git a/openbb_sdk/sdk/core/openbb_core/app/charting_manager.py b/openbb_sdk/sdk/core/openbb_core/app/charting_manager.py index ac09e4180e8..93eee1342c8 100644 --- a/openbb_sdk/sdk/core/openbb_core/app/charting_manager.py +++ b/openbb_sdk/sdk/core/openbb_core/app/charting_manager.py @@ -195,7 +195,7 @@ class ChartingManager(metaclass=SingletonMeta): user_settings: UserSettings, system_settings: SystemSettings, route: str, - command_output_item: Generic[T], + obbject_item: Generic[T], **kwargs, ): """ @@ -215,7 +215,7 @@ class ChartingManager(metaclass=SingletonMeta): User settings. route : str Route name, example: `/stocks/load`. - command_output_item + obbject_item Command output item. Returns ------- @@ -235,7 +235,7 @@ class ChartingManager(metaclass=SingletonMeta): self.handle_backend(self._charting_extension, self._charting_settings) - kwargs["command_output_item"] = command_output_item + kwargs["obbject_item"] = obbject_item kwargs["charting_settings"] = self._charting_settings charting_function = self.get_chart_function(self._charting_extension, route) diff --git a/openbb_sdk/sdk/core/openbb_core/app/command_runner.py b/openbb_sdk/sdk/core/openbb_core/app/command_runner.py index 5186bc22168..06adbc73cd0 100644 --- a/openbb_sdk/sdk/core/openbb_core/app/command_runner.py +++ b/openbb_sdk/sdk/core/openbb_core/app/command_runner.py @@ -15,7 +15,7 @@ from openbb_core.app.logs.logging_manager import LoggingManager from openbb_core.app.model.abstract.warning import cast_warning from openbb_core.app.model.charts.chart import Chart from openbb_core.app.model.command_context import CommandContext -from openbb_core.app.model.command_output import CommandOutput, Error +from openbb_core.app.model.obbject import Obbject, Error from openbb_core.app.model.journal import Journal from openbb_core.app.model.journal_entry import JournalEntry from openbb_core.app.model.journal_query import JournalQuery @@ -232,7 +232,7 @@ class StaticCommandRunner: charting_manager = ChartingManager() @staticmethod - def __run_in_isolation(func, args=None, kwargs=None) -> CommandOutput: + def __run_in_isolation(func, args=None, kwargs=None) -> Obbject: args = args or () kwargs = kwargs or {} @@ -244,7 +244,7 @@ class StaticCommandRunner: @classmethod def __command( cls, system_settings: SystemSettings, func: Callable, kwargs: Dict[str, Any] - ) -> CommandOutput: + ) -> Obbject: """Run a command and return the output""" try: context_manager: Union[warnings.catch_warnings, ContextManager[None]] = ( @@ -255,30 +255,30 @@ class StaticCommandRunner: with context_manager as warning_list: if system_settings.run_in_isolation: - command_output = cls.__run_in_isolation(func=func, kwargs=kwargs) + obbject = cls.__run_in_isolation(func=func, kwargs=kwargs) else: - command_output = func(**kwargs) + obbject = func(**kwargs) - command_output.provider = getattr( + obbject.provider = getattr( kwargs.get("provider_choices", None), "provider", None ) if warning_list: - command_output.warnings = list(map(cast_warning, warning_list)) + obbject.warnings = list(map(cast_warning, warning_list)) except Exception as e: - command_output = CommandOutput( + obbject = Obbject( error=Error(message=str(e), error_kind=e.__class__.__name__) ) if system_settings.debug_mode: raise - return command_output + return obbject @classmethod def __chart( cls, - command_output: CommandOutput, + obbject: Obbject, user_settings: UserSettings, system_settings: SystemSettings, route: str, @@ -286,15 +286,15 @@ class StaticCommandRunner: ) -> None: """Create a chart from the command output""" try: - command_output.chart = cls.charting_manager.chart( + obbject.chart = cls.charting_manager.chart( user_settings=user_settings, system_settings=system_settings, route=route, - command_output_item=command_output.results, + obbject_item=obbject.results, **kwargs, ) except Exception as e: - command_output.chart = Chart(error=Error(message=str(e))) + obbject.chart = Chart(error=Error(message=str(e))) if system_settings.debug_mode: raise @@ -306,7 +306,7 @@ class StaticCommandRunner: execution_context: ExecutionContext, func: Callable, kwargs: Dict[str, Any], - ) -> CommandOutput: + ) -> Obbject: """Execute a function and return the output""" user_settings = execution_context.user_settings system_settings = execution_context.system_settings @@ -332,15 +332,15 @@ class StaticCommandRunner: # commands.py and the function signature does not expect "chart" kwargs.pop("chart", None) - command_output = cls.__command( + obbject = cls.__command( system_settings=system_settings, func=func, kwargs=kwargs, ) - if chart and command_output.results: + if chart and obbject.results: cls.__chart( - command_output=command_output, + obbject=obbject, user_settings=user_settings, system_settings=system_settings, route=route, @@ -350,13 +350,13 @@ class StaticCommandRunner: cls.logging_manager.log( user_settings=user_settings, system_settings=system_settings, - command_output=command_output, + obbject=obbject, route=route, func=func, kwargs=kwargs, ) - return command_output + return obbject @classmethod def __update_managers_settings( @@ -388,7 +388,7 @@ class StaticCommandRunner: func = command_map.get_command(route=route) if func: - command_output = cls.__execute_func( + obbject = cls.__execute_func( route=route, args=args, # type: ignore execution_context=execution_context, @@ -404,7 +404,7 @@ class StaticCommandRunner: journal_id=journal.id, arguments=kwargs, duration=duration, - output=command_output, + output=obbject, route=route, timestamp=timestamp, ) diff --git a/openbb_sdk/sdk/core/openbb_core/app/logs/logging_manager.py b/openbb_sdk/sdk/core/openbb_core/app/logs/logging_manager.py index 697c488d0d5..a0b3fa620d1 100644 --- a/openbb_sdk/sdk/core/openbb_core/app/logs/logging_manager.py +++ b/openbb_sdk/sdk/core/openbb_core/app/logs/logging_manager.py @@ -10,7 +10,7 @@ from openbb_core.app.logs.formatters.formatter_with_exceptions import ( from openbb_core.app.logs.handlers_manager import HandlersManager from openbb_core.app.logs.models.logging_settings import LoggingSettings from openbb_core.app.model.abstract.singleton import SingletonMeta -from openbb_core.app.model.command_output import CommandOutput +from openbb_core.app.model.obbject import Obbject from openbb_core.app.model.system_settings import SystemSettings from openbb_core.app.model.user_settings import UserSettings @@ -42,7 +42,7 @@ class LoggingManager(metaclass=SingletonMeta): __init__(system_settings, user_settings) Logging Manager Constructor. - log(user_settings, system_settings, command_output, route, func, kwargs) + log(user_settings, system_settings, obbject, route, func, kwargs) Log command output and relevant information. logging_settings @@ -182,7 +182,7 @@ class LoggingManager(metaclass=SingletonMeta): self, user_settings: UserSettings, system_settings: SystemSettings, - command_output: CommandOutput, + obbject: Obbject, route: str, func: Callable, kwargs: Dict[str, Any], @@ -196,8 +196,8 @@ class LoggingManager(metaclass=SingletonMeta): User Settings object. system_settings : SystemSettings System Settings object. - command_output : CommandOutput - CommandOutput object containing command output and error information. + obbject : Obbject + Obbject object containing command output and error information. route : str Route for the command. func : Callable @@ -225,14 +225,14 @@ class LoggingManager(metaclass=SingletonMeta): # Truncate kwargs if too long kwargs = {k: str(v)[:100] for k, v in kwargs.items()} - log_level = logger.error if command_output.error else logger.info + log_level = logger.error if obbject.error else logger.info log_level( - "ERROR: %s" if command_output.error else "CMD: %s", + "ERROR: %s" if obbject.error else "CMD: %s", json.dumps( { "route": route, "input": kwargs, - "error": command_output.error, + "error": obbject.error, }, default=pydantic_encoder, ), diff --git a/openbb_sdk/sdk/core/openbb_core/app/model/journal_entry.py b/openbb_sdk/sdk/core/openbb_core/app/model/journal_entry.py index e1e9299487f..f21b1a85ef9 100644 --- a/openbb_sdk/sdk/core/openbb_core/app/model/journal_entry.py +++ b/openbb_sdk/sdk/core/openbb_core/app/model/journal_entry.py @@ -4,7 +4,7 @@ from typing import Any, Dict, List from pydantic import Field from openbb_core.app.model.abstract.tagged import Tagged -from openbb_core.app.model.command_output import CommandOutput +from openbb_core.app.model.obbject import Obbject class JournalEntry(Tagged): @@ -16,7 +16,7 @@ class JournalEntry(Tagged): duration: int = Field( description="Execution duration in nano second of the command." ) - output: CommandOutput = Field(description="Output of the command.") + output: Obbject = Field(description="Output of the command.") route: str = Field(description="Route of the command.") timestamp: datetime = Field(description="Execution starting timestamp.") alias_list: List[str] = Field( diff --git a/openbb_sdk/sdk/core/openbb_core/app/model/journal_query.py b/openbb_sdk/sdk/core/openbb_core/app/model/journal_query.py index 4a64f451c4d..38bac063c07 100644 --- a/openbb_sdk/sdk/core/openbb_core/app/model/journal_query.py +++ b/openbb_sdk/sdk/core/openbb_core/app/model/journal_query.py @@ -8,7 +8,7 @@ class JournalQuery(BaseModel): ) ignore_error_output: bool = Field( default=True, - description="Whether or not the JournalEntry with an CommandOutput.Error should be ignored.", + description="Whether or not the JournalEntry with an Obbject.Error should be ignored.", ) class Config: diff --git a/openbb_sdk/sdk/core/openbb_core/app/model/command_output.py b/openbb_sdk/sdk/core/openbb_core/app/model/obbject.py similarity index 98% rename from openbb_sdk/sdk/core/openbb_core/app/model/command_output.py rename to openbb_sdk/sdk/core/openbb_core/app/model/obbject.py index 618e17bd628..2708e3367a6 100644 --- a/openbb_sdk/sdk/core/openbb_core/app/model/command_output.py +++ b/openbb_sdk/sdk/core/openbb_core/app/model/obbject.py @@ -20,7 +20,7 @@ class OpenBBError(Exception): pass -class CommandOutput(GenericModel, Generic[T], Tagged): +class Obbject(GenericModel, Generic[T], Tagged): results: Optional[T] = Field( default=None, description="Serializable results.", diff --git a/openbb_sdk/sdk/core/openbb_core/app/router.py b/openbb_sdk/sdk/core/openbb_core/app/router.py index 3358e11aa68..36c8c640d6b 100644 --- a/openbb_sdk/sdk/core/openbb_core/app/router.py +++ b/openbb_sdk/sdk/core/openbb_core/app/router.py @@ -24,7 +24,7 @@ from typing_extensions import Annotated, _AnnotatedAlias from openbb_core.app.model.abstract.warning import OpenBBWarning from openbb_core.app.model.command_context import CommandContext -from openbb_core.app.model.command_output import CommandOutput +from openbb_core.app.model.obbject import Obbject from openbb_core.app.provider_interface import ( ExtraParams, ProviderChoices, @@ -125,7 +125,7 @@ class CommandValidator: sig = signature(func) return_type = sig.return_annotation - if issubclass(return_type, CommandOutput): + if issubclass(return_type, Obbject): results_type = get_type_hints(return_type)["results"] if isinstance(results_type, type(None)): valid_return_type = False @@ -144,7 +144,7 @@ class CommandValidator: "Invalid return type in signature:" f" {func.__name__}(...) -> {sig.return_annotation}:\n" "Allowed return type:" - f" {func.__name__}(...) -> CommandOutput[T] :\n" + f" {func.__name__}(...) -> Obbject[T] :\n" "If you need T = None, use an empty model instead.\n" ) @@ -166,9 +166,7 @@ class Router: self._api_router = APIRouter(prefix=prefix) @overload - def command( - self, func: Optional[Callable[P, CommandOutput]] - ) -> Callable[P, CommandOutput]: + def command(self, func: Optional[Callable[P, Obbject]]) -> Callable[P, Obbject]: pass @overload @@ -177,7 +175,7 @@ class Router: def command( self, - func: Optional[Callable[P, CommandOutput]] = None, + func: Optional[Callable[P, Obbject]] = None, **kwargs, ) -> Optional[Callable]: if func is None: @@ -217,8 +215,8 @@ class Router: class SignatureInspector: @classmethod def complete_signature( - cls, func: Callable[P, CommandOutput], model: str - ) -> Optional[Callable[P, CommandOutput]]: + cls, func: Callable[P, Obbject], model: str + ) -> Optional[Callable[P, Obbject]]: """Complete function signature.""" provider_interface = get_provider_interface() if model: @@ -259,7 +257,7 @@ class SignatureInspector: ) ReturnModel = provider_interface.return_schema[model] - func.__annotations__["return"] = CommandOutput[ReturnModel] # type: ignore + func.__annotations__["return"] = Obbject[ReturnModel] # type: ignore elif ( "provider_choices" in func.__annotations__ @@ -274,7 +272,7 @@ class SignatureInspector: @staticmethod def validate_signature( - func: Callable[P, CommandOutput], expected: Dict[str, type] + func: Callable[P, Obbject], expected: Dict[str, type] ) -> None: """Validate function signature before binding to model.""" for k, v in expected.items(): @@ -290,8 +288,8 @@ class SignatureInspector: @staticmethod def inject_dependency( - func: Callable[P, CommandOutput], arg: str, callable_: Any - ) -> Callable[P, CommandOutput]: + func: Callable[P, Obbject], arg: str, callable_: Any + ) -> Callable[P, Obbject]: """Annotate function with dependency injection.""" func.__annotations__[arg] = Annotated[callable_, Depends()] # type: ignore return func diff --git a/openbb_sdk/sdk/core/openbb_core/app/static/filters.py b/openbb_sdk/sdk/core/openbb_core/app/static/filters.py index 54fb66976f5..b1e96b7d627 100644 --- a/openbb_sdk/sdk/core/openbb_core/app/static/filters.py +++ b/openbb_sdk/sdk/core/openbb_core/app/static/filters.py @@ -7,7 +7,7 @@ import pandas as pd from pydantic import ValidationError from openbb_core.app.model.abstract.warning import OpenBBWarning -from openbb_core.app.model.command_output import CommandOutput +from openbb_core.app.model.obbject import Obbject from openbb_core.app.utils import df_to_basemodel @@ -48,19 +48,19 @@ def filter_inputs(**kwargs) -> dict: return kwargs -def filter_output(command_output: CommandOutput) -> CommandOutput: +def filter_output(obbject: Obbject) -> Obbject: """Filter command output.""" - if command_output.warnings: - for w in command_output.warnings: + if obbject.warnings: + for w in obbject.warnings: category = getattr(builtins, w.category, OpenBBWarning) print(f"{category.__name__}: {w.message}") - error = command_output.error + error = obbject.error if error: raise OpenBBError(error.message) - chart = command_output.chart + chart = obbject.chart if chart and chart.error: raise OpenBBError(chart.error.message) - return command_output + return obbject diff --git a/openbb_sdk/sdk/core/openbb_core/app/static/package/crypto.py b/openbb_sdk/sdk/core/openbb_core/app/static/package/crypto.py index 78b79d715db..0d8054bbb89 100644 --- a/openbb_sdk/sdk/core/openbb_core/app/static/package/crypto.py +++ b/openbb_sdk/sdk/core/openbb_core/app/static/package/crypto.py @@ -6,7 +6,7 @@ from typing import Annotated, Literal, Optional, Union from pydantic import validate_arguments -from openbb_core.app.model.command_output import CommandOutput +from openbb_core.app.model.obbject import Obbject from openbb_core.app.model.custom_parameter import OpenBBCustomParameter from openbb_core.app.static.container import Container from openbb_core.app.static.filters import filter_call, filter_inputs, filter_output @@ -35,7 +35,7 @@ class CLASS_crypto(Container): chart: bool = False, provider: Optional[Literal["polygon", "fmp"]] = None, **kwargs - ) -> CommandOutput[typing.List]: + ) -> Obbject[typing.List]: r"""Crypto Intraday Price. @@ -55,7 +55,7 @@ class CLASS_crypto(Container): Returns ------- - CommandOutput + Obbject results: List[Data] Serializable results. provider: Optional[PROVIDERS] diff --git a/openbb_sdk/sdk/core/openbb_core/app/static/package/economy.py b/openbb_sdk/sdk/core/openbb_core/app/static/package/economy.py index f948bd96570..101376987ff 100644 --- a/openbb_sdk/sdk/core/openbb_core/app/static/package/economy.py +++ b/openbb_sdk/sdk/core/openbb_core/app/static/package/economy.py @@ -8,7 +8,7 @@ from pydantic import validate_arguments import openbb_core.app.model.command_context import openbb_core.app.model.results.empty -from openbb_core.app.model.command_output import CommandOutput +from openbb_core.app.model.obbject import Obbject from openbb_core.app.model.custom_parameter import OpenBBCustomParameter from openbb_core.app.static.container import Container from openbb_core.app.static.filters import filter_call, filter_inputs, filter_output @@ -21,7 +21,7 @@ class CLASS_economy(Container): self, chart: bool = False, provider: Optional[Literal["benzinga", "fmp", "fred", "polygon"]] = None, - ) -> CommandOutput[openbb_core.app.model.results.empty.Empty]: + ) -> Obbject[openbb_core.app.model.results.empty.Empty]: """CORECPI.""" inputs = filter_inputs( provider_choices={ @@ -50,7 +50,7 @@ class CLASS_economy(Container): chart: bool = False, provider: Optional[Literal["fmp"]] = None, **kwargs - ) -> CommandOutput[typing.List]: + ) -> Obbject[typing.List]: """Get the constituents of an index. @@ -66,7 +66,7 @@ class CLASS_economy(Container): Returns ------- - CommandOutput + Obbject results: List[Data] Serializable results. provider: Optional[PROVIDERS] @@ -216,7 +216,7 @@ class CLASS_economy(Container): chart: bool = False, provider: Optional[Literal["fred"]] = None, **kwargs - ) -> CommandOutput[typing.List]: + ) -> Obbject[typing.List]: """CPI. @@ -242,7 +242,7 @@ class CLASS_economy(Container): Returns ------- - CommandOutput + Obbject results: List[Data] Serializable results. provider: Optional[PROVIDERS] @@ -306,7 +306,7 @@ class CLASS_economy(Container): self, chart: bool = False, provider: Optional[Literal["benzinga", "fmp", "fred", "polygon"]] = None, - ) -> CommandOutput[openbb_core.app.model.results.empty.Empty]: + ) -> Obbject[openbb_core.app.model.results.empty.Empty]: """Get the options for v3 cpi(options=True)""" inputs = filter_inputs( provider_choices={ @@ -344,7 +344,7 @@ class CLASS_economy(Container): chart: bool = False, provider: Optional[Literal["polygon", "fmp"]] = None, **kwargs - ) -> CommandOutput[typing.List]: + ) -> Obbject[typing.List]: r"""Get OHLCV data for an index. @@ -364,7 +364,7 @@ class CLASS_economy(Container): Returns ------- - CommandOutput + Obbject results: List[Data] Serializable results. provider: Optional[PROVIDERS] @@ -467,7 +467,7 @@ class CLASS_economy(Container): @validate_arguments def available_indices( self, chart: bool = False, provider: Optional[Literal["fmp"]] = None, **kwargs - ) -> CommandOutput[typing.List]: + ) -> Obbject[typing.List]: """AVAILABLE_INDICES. @@ -482,7 +482,7 @@ class CLASS_economy(Container): Returns ------- - CommandOutput + Obbject results: List[Data] Serializable results. provider: Optional[PROVIDERS] @@ -539,7 +539,7 @@ class CLASS_economy(Container): @validate_arguments def risk( self, chart: bool = False, provider: Optional[Literal["fmp"]] = None, **kwargs - ) -> CommandOutput[typing.List]: + ) -> Obbject[typing.List]: """Market Risk Premium. @@ -554,7 +554,7 @@ class CLASS_economy(Container): Returns ------- - CommandOutput + Obbject results: List[Data] Serializable results. provider: Optional[PROVIDERS] @@ -611,7 +611,7 @@ class CLASS_economy(Container): self, chart: bool = False, provider: Optional[Literal["benzinga", "fmp", "fred", "polygon"]] = None, - ) -> CommandOutput[openbb_core.app.model.results.empty.Empty]: + ) -> Obbject[openbb_core.app.model.results.empty.Empty]: """Query EconDB for macro data.""" inputs = filter_inputs( provider_choices={ @@ -633,7 +633,7 @@ class CLASS_economy(Container): self, chart: bool = False, provider: Optional[Literal["benzinga", "fmp", "fred", "polygon"]] = None, - ) -> CommandOutput[openbb_core.app.model.results.empty.Empty]: + ) -> Obbject[openbb_core.app.model.results.empty.Empty]: """MACRO_COUNTRIES.""" inputs = filter_inputs( provider_choices={ @@ -655,7 +655,7 @@ class CLASS_economy(Container): self, chart: bool = False, provider: Optional[Literal["benzinga", "fmp", "fred", "polygon"]] = None, - ) -> CommandOutput[openbb_core.app.model.results.empty.Empty]: + ) -> Obbject[openbb_core.app.model.results.empty.Empty]: """MACRO_PARAMETERS.""" inputs = filter_inputs( provider_choices={ @@ -677,7 +677,7 @@ class CLASS_economy(Container): self, chart: bool = False, provider: Optional[Literal["benzinga", "fmp", "fred", "polygon"]] = None, - ) -> CommandOutput[openbb_core.app.model.results.empty.Empty]: + ) -> Obbject[openbb_core.app.model.results.empty.Empty]: """BALANCE.""" inputs = filter_inputs( provider_choices={ @@ -699,7 +699,7 @@ class CLASS_economy(Container): self, chart: bool = False, provider: Optional[Literal["benzinga", "fmp", "fred", "polygon"]] = None, - ) -> CommandOutput[openbb_core.app.model.results.empty.Empty]: + ) -> Obbject[openbb_core.app.model.results.empty.Empty]: """BIGMAC.""" inputs = filter_inputs( provider_choices={ @@ -721,7 +721,7 @@ class CLASS_economy(Container): self, chart: bool = False, provider: Optional[Literal["benzinga", "fmp", "fred", "polygon"]] = None, - ) -> CommandOutput[openbb_core.app.model.results.empty.Empty]: + ) -> Obbject[openbb_core.app.model.results.empty.Empty]: """COUNTRY_CODES.""" inputs = filter_inputs( provider_choices={ @@ -743,7 +743,7 @@ class CLASS_economy(Container): self, chart: bool = False, provider: Optional[Literal["benzinga", "fmp", "fred", "polygon"]] = None, - ) -> CommandOutput[openbb_core.app.model.results.empty.Empty]: + ) -> Obbject[openbb_core.app.model.results.empty.Empty]: """CURRENCIES.""" inputs = filter_inputs( provider_choices={ @@ -765,7 +765,7 @@ class CLASS_economy(Container): self, chart: bool = False, provider: Optional[Literal["benzinga", "fmp", "fred", "polygon"]] = None, - ) -> CommandOutput[openbb_core.app.model.results.empty.Empty]: + ) -> Obbject[openbb_core.app.model.results.empty.Empty]: """DEBT.""" inputs = filter_inputs( provider_choices={ @@ -787,7 +787,7 @@ class CLASS_economy(Container): self, chart: bool = False, provider: Optional[Literal["benzinga", "fmp", "fred", "polygon"]] = None, - ) -> CommandOutput[openbb_core.app.model.results.empty.Empty]: + ) -> Obbject[openbb_core.app.model.results.empty.Empty]: """EVENTS.""" inputs = filter_inputs( provider_choices={ @@ -809,7 +809,7 @@ class CLASS_economy(Container): self, chart: bool = False, provider: Optional[Literal["benzinga", "fmp", "fred", "polygon"]] = None, - ) -> CommandOutput[openbb_core.app.model.results.empty.Empty]: + ) -> Obbject[openbb_core.app.model.results.empty.Empty]: """FGDP.""" inputs = filter_inputs( provider_choices={ @@ -831,7 +831,7 @@ class CLASS_economy(Container): self, chart: bool = False, provider: Optional[Literal["benzinga", "fmp", "fred", "polygon"]] = None, - ) -> CommandOutput[openbb_core.app.model.results.empty.Empty]: + ) -> Obbject[openbb_core.app.model.results.empty.Empty]: """FRED.""" inputs = filter_inputs( provider_choices={ @@ -853,7 +853,7 @@ class CLASS_economy(Container): self, chart: bool = False, provider: Optional[Literal["benzinga", "fmp", "fred", "polygon"]] = None, - ) -> CommandOutput[openbb_core.app.model.results.empty.Empty]: + ) -> Obbject[openbb_core.app.model.results.empty.Empty]: """FRED Search (was fred_notes).""" inputs = filter_inputs( provider_choices={ @@ -875,7 +875,7 @@ class CLASS_economy(Container): self, chart: bool = False, provider: Optional[Literal["benzinga", "fmp", "fred", "polygon"]] = None, - ) -> CommandOutput[openbb_core.app.model.results.empty.Empty]: + ) -> Obbject[openbb_core.app.model.results.empty.Empty]: """FUTURES. 2 sources""" inputs = filter_inputs( provider_choices={ @@ -897,7 +897,7 @@ class CLASS_economy(Container): self, chart: bool = False, provider: Optional[Literal["benzinga", "fmp", "fred", "polygon"]] = None, - ) -> CommandOutput[openbb_core.app.model.results.empty.Empty]: + ) -> Obbject[openbb_core.app.model.results.empty.Empty]: """GDP.""" inputs = filter_inputs( provider_choices={ @@ -919,7 +919,7 @@ class CLASS_economy(Container): self, chart: bool = False, provider: Optional[Literal["benzinga", "fmp", "fred", "polygon"]] = None, - ) -> CommandOutput[openbb_core.app.model.results.empty.Empty]: + ) -> Obbject[openbb_core.app.model.results.empty.Empty]: """GLBONDS.""" inputs = filter_inputs( provider_choices={ @@ -941,7 +941,7 @@ class CLASS_economy(Container): self, chart: bool = False, provider: Optional[Literal["benzinga", "fmp", "fred", "polygon"]] = None, - ) -> CommandOutput[openbb_core.app.model.results.empty.Empty]: + ) -> Obbject[openbb_core.app.model.results.empty.Empty]: """INDICES.""" inputs = filter_inputs( provider_choices={ @@ -963,7 +963,7 @@ class CLASS_economy(Container): self, chart: bool = False, provider: Optional[Literal["benzinga", "fmp", "fred", "polygon"]] = None, - ) -> CommandOutput[openbb_core.app.model.results.empty.Empty]: + ) -> Obbject[openbb_core.app.model.results.empty.Empty]: """OVERVIEW.""" inputs = filter_inputs( provider_choices={ @@ -985,7 +985,7 @@ class CLASS_economy(Container): self, chart: bool = False, provider: Optional[Literal["benzinga", "fmp", "fred", "polygon"]] = None, - ) -> CommandOutput[openbb_core.app.model.results.empty.Empty]: + ) -> Obbject[openbb_core.app.model.results.empty.Empty]: """PERFMAP.""" inputs = filter_inputs( provider_choices={ @@ -1007,7 +1007,7 @@ class CLASS_economy(Container): self, chart: bool = False, provider: Optional[Literal["benzinga", "fmp", "fred", "polygon"]] = None, - ) -> CommandOutput[openbb_core.app.model.results.empty.Empty]: + ) -> Obbject[openbb_core.app.model.results.empty.Empty]: """PERFORMANCE.""" inputs = filter_inputs( provider_choices={ @@ -1029,7 +1029,7 @@ class CLASS_economy(Container): self, chart: bool = False, provider: Optional[Literal["benzinga", "fmp", "fred", "polygon"]] = None, - ) -> CommandOutput[openbb_core.app.model.results.empty.Empty]: + ) -> Obbject[openbb_core.app.model.results.empty.Empty]: """REVENUE.""" inputs = filter_inputs( provider_choices={ @@ -1051,7 +1051,7 @@ class CLASS_economy(Container): self, chart: bool = False, provider: Optional[Literal["benzinga", "fmp", "fred", "polygon"]] = None, - ) -> CommandOutput[openbb_core.app.model.results.empty.Empty]: + ) -> Obbject[openbb_core.app.model.results.empty.Empty]: """RGDP.""" inputs = filter_inputs( provider_choices={ @@ -1073,7 +1073,7 @@ class CLASS_economy(Container): self, chart: bool = False, provider: Optional[Literal["benzinga", "fmp", "fred", "polygon"]] = None, - ) -> CommandOutput[openbb_core.app.model.results.empty.Empty]: + ) -> Obbject[openbb_core.app.model.results.empty.Empty]: """RTPS.""" inputs = filter_inputs( provider_choices={ @@ -1095,7 +1095,7 @@ class CLASS_economy(Container): self, chart: bool = False, provider: Optional[Literal["benzinga", "fmp", "fred", "polygon"]] = None, - ) -> CommandOutput[openbb_core.app.model.results.empty.Empty]: + ) -> Obbject[openbb_core.app.model.results.empty.Empty]: """SEARCH_INDEX.""" inputs = filter_inputs( provider_choices={ @@ -1117,7 +1117,7 @@ class CLASS_economy(Container): self, chart: bool = False, provider: Optional[Literal["benzinga", "fmp", "fred", "polygon"]] = None, - ) -> CommandOutput[openbb_core.app.model.results.empty.Empty]: + ) -> Obbject[openbb_core.app.model.results.empty.Empty]: """SPENDING.""" inputs = filter_inputs( provider_choices={ @@ -1139,7 +1139,7 @@ class CLASS_economy(Container): self, chart: bool = False, provider: Optional[Literal["benzinga", "fmp", "fred", "polygon"]] = None, - ) -> CommandOutput[openbb_core.app.model.results.empty.Empty]: + ) -> Obbject[openbb_core.app.model.results.empty.Empty]: """TRUST.""" inputs = filter_inputs( provider_choices={ @@ -1161,7 +1161,7 @@ class CLASS_economy(Container): self, chart: bool = False, provider: Optional[Literal["benzinga", "fmp", "fred", "polygon"]] = None, - ) -> CommandOutput[openbb_core.app.model.results.empty.Empty]: + ) -> Obbject[openbb_core.app.model.results.empty.Empty]: """USBONDS.""" inputs = filter_inputs( provider_choices={ @@ -1183,7 +1183,7 @@ class CLASS_economy(Container): self, chart: bool = False, provider: Optional[Literal["benzinga", "fmp", "fred", "polygon"]] = None, - ) -> CommandOutput[openbb_core.app.model.results.empty.Empty]: + ) -> Obbject[openbb_core.app.model.results.empty.Empty]: """VALUATION.""" inputs = filter_inputs( provider_choices={ diff --git a/openbb_sdk/sdk/core/openbb_core/app/static/package/fixedincome.py b/openbb_sdk/sdk/core/openbb_core/app/static/package/fixedincome.py index 3763cb95872..d92b3902284 100644 --- a/openbb_sdk/sdk/core/openbb_core/app/static/package/fixedincome.py +++ b/openbb_sdk/sdk/core/openbb_core/app/static/package/fixedincome.py @@ -8,7 +8,7 @@ from pydantic import validate_arguments import openbb_core.app.model.command_context import openbb_core.app.model.results.empty -from openbb_core.app.model.command_output import CommandOutput +from openbb_core.app.model.obbject import Obbject from openbb_core.app.model.custom_parameter import OpenBBCustomParameter from openbb_core.app.static.container import Container from openbb_core.app.static.filters import filter_call, filter_inputs, filter_output @@ -34,7 +34,7 @@ class CLASS_fixedincome(Container): chart: bool = False, provider: Optional[Literal["fmp"]] = None, **kwargs - ) -> CommandOutput[typing.List]: + ) -> Obbject[typing.List]: """Get treasury rates. @@ -52,7 +52,7 @@ class CLASS_fixedincome(Container): Returns ------- - CommandOutput + Obbject results: List[Data] Serializable results. provider: Optional[PROVIDERS] @@ -128,7 +128,7 @@ class CLASS_fixedincome(Container): @validate_arguments def ycrv( self, chart: bool = False - ) -> CommandOutput[openbb_core.app.model.results.empty.Empty]: + ) -> Obbject[openbb_core.app.model.results.empty.Empty]: """Yield curve.""" inputs = filter_inputs( chart=chart, diff --git a/openbb_sdk/sdk/core/openbb_core/app/static/package/forex.py b/openbb_sdk/sdk/core/openbb_core/app/static/package/forex.py index 21d30707bfb..c72985fde9c 100644 --- a/openbb_sdk/sdk/core/openbb_core/app/static/package/forex.py +++ b/openbb_sdk/sdk/core/openbb_core/app/static/package/forex.py @@ -6,7 +6,7 @@ from typing import Annotated, Literal, Optional, Union from pydantic import validate_arguments -from openbb_core.app.model.command_output import CommandOutput +from openbb_core.app.model.obbject import Obbject from openbb_core.app.model.custom_parameter import OpenBBCustomParameter from openbb_core.app.static.container import Container from openbb_core.app.static.filters import filter_call, filter_inputs, filter_output @@ -20,7 +20,7 @@ class CLASS_forex(Container): chart: bool = False, provider: Optional[Literal["polygon", "fmp"]] = None, **kwargs - ) -> CommandOutput[typing.List]: + ) -> Obbject[typing.List]: """Forex Available Pairs. @@ -35,7 +35,7 @@ class CLASS_forex(Container): Returns ------- - CommandOutput + Obbject results: List[Data] Serializable results. provider: Optional[PROVIDERS] @@ -149,7 +149,7 @@ class CLASS_forex(Container): chart: bool = False, provider: Optional[Literal["polygon", "fmp"]] = None, **kwargs - ) -> CommandOutput[typing.List]: + ) -> Obbject[typing.List]: r"""Forex Intraday Price. @@ -169,7 +169,7 @@ class CLASS_forex(Container): Returns ------- - CommandOutput + Obbject results: List[Data] Serializable results. provider: Optional[PROVIDERS] diff --git a/openbb_sdk/sdk/core/openbb_core/app/static/package/news.py b/openbb_sdk/sdk/core/openbb_core/app/static/package/news.py index 703fd2fd0ac..e2b47d10cd9 100644 --- a/openbb_sdk/sdk/core/openbb_core/app/static/package/news.py +++ b/openbb_sdk/sdk/core/openbb_core/app/static/package/news.py @@ -8,7 +8,7 @@ from pydantic import validate_arguments import openbb_core.app.model.command_context import openbb_core.app.model.results.empty -from openbb_core.app.model.command_output import CommandOutput +from openbb_core.app.model.obbject import Obbject from openbb_core.app.model.custom_parameter import OpenBBCustomParameter from openbb_core.app.static.container import Container from openbb_core.app.static.filters import filter_call, filter_inputs, filter_output @@ -26,7 +26,7 @@ class CLASS_news(Container): chart: bool = False, provider: Optional[Literal["benzinga", "fmp"]] = None, **kwargs - ) -> CommandOutput[typing.List]: + ) -> Obbject[typing.List]: """Global News. @@ -42,7 +42,7 @@ class CLASS_news(Container): Returns ------- - CommandOutput + Obbject results: List[Data] Serializable results. provider: Optional[PROVIDERS] @@ -143,7 +143,7 @@ class CLASS_news(Container): @validate_arguments def sectornews( self, chart: bool = False - ) -> CommandOutput[openbb_core.app.model.results.empty.Empty]: + ) -> Obbject[openbb_core.app.model.results.empty.Empty]: """Sector news.""" inputs = filter_inputs( chart=chart, diff --git a/openbb_sdk/sdk/core/openbb_core/app/static/package/qa.py b/openbb_sdk/sdk/core/openbb_core/app/static/package/qa.py index fd6710974cc..cfc6c340ff0 100644 --- a/openbb_sdk/sdk/core/openbb_core/app/static/package/qa.py +++ b/openbb_sdk/sdk/core/openbb_core/app/static/package/qa.py @@ -11,7 +11,7 @@ import pydantic.types from pydantic import validate_arguments import openbb_core.app.model.results.empty -from openbb_core.app.model.command_output import CommandOutput +from openbb_core.app.model.obbject import Obbject from openbb_core.app.static.container import Container from openbb_core.app.static.filters import filter_call, filter_inputs, filter_output @@ -24,7 +24,7 @@ class CLASS_qa(Container): data: Union[List[openbb_provider.abstract.data.Data], pandas.DataFrame], target: str, chart: bool = False, - ) -> CommandOutput[openbb_qa.qa_models.NormalityModel]: + ) -> Obbject[openbb_qa.qa_models.NormalityModel]: """ Normality Statistics. @@ -43,7 +43,7 @@ class CLASS_qa(Container): Returns ------- - CommandOutput[NormalityModel] + Obbject[NormalityModel] Normality tests summary. See qa_models.NormalityModel for details. """ inputs = filter_inputs( @@ -66,7 +66,7 @@ class CLASS_qa(Container): data: Union[List[openbb_provider.abstract.data.Data], pandas.DataFrame], target: str, chart: bool = False, - ) -> CommandOutput[openbb_qa.qa_models.CAPMModel]: + ) -> Obbject[openbb_qa.qa_models.CAPMModel]: """Capital Asset Pricing Model.""" inputs = filter_inputs( data=data, @@ -85,7 +85,7 @@ class CLASS_qa(Container): @validate_arguments def qqplot( self, chart: bool = False - ) -> CommandOutput[openbb_core.app.model.results.empty.Empty]: + ) -> Obbject[openbb_core.app.model.results.empty.Empty]: """QQ Plot.""" inputs = filter_inputs( chart=chart, @@ -107,7 +107,7 @@ class CLASS_qa(Container): threshold_start: float = 0.0, threshold_end: float = 1.5, chart: bool = False, - ) -> CommandOutput[typing.List]: + ) -> Obbject[typing.List]: """Omega Ratio. Parameters @@ -123,7 +123,7 @@ class CLASS_qa(Container): Returns ------- - CommandOutput[List[OmegaModel]] + Obbject[List[OmegaModel]] Omega ratios. """ inputs = filter_inputs( @@ -149,7 +149,7 @@ class CLASS_qa(Container): target: str, window: pydantic.types.PositiveInt, chart: bool = False, - ) -> CommandOutput[typing.List]: + ) -> Obbject[typing.List]: """Kurtosis. Parameters @@ -163,7 +163,7 @@ class CLASS_qa(Container): Returns ------- - CommandOutput[List[Data]] + Obbject[List[Data]] Kurtosis. """ inputs = filter_inputs( @@ -184,7 +184,7 @@ class CLASS_qa(Container): @validate_arguments def pick( self, chart: bool = False - ) -> CommandOutput[openbb_core.app.model.results.empty.Empty]: + ) -> Obbject[openbb_core.app.model.results.empty.Empty]: """Pick.""" inputs = filter_inputs( chart=chart, @@ -201,7 +201,7 @@ class CLASS_qa(Container): @validate_arguments def spread( self, chart: bool = False - ) -> CommandOutput[openbb_core.app.model.results.empty.Empty]: + ) -> Obbject[openbb_core.app.model.results.empty.Empty]: """Spread.""" inputs = filter_inputs( chart=chart, @@ -218,7 +218,7 @@ class CLASS_qa(Container): @validate_arguments def rolling( self, chart: bool = False - ) -> CommandOutput[openbb_core.app.model.results.empty.Empty]: + ) -> Obbject[openbb_core.app.model.results.empty.Empty]: """Rolling.""" inputs = filter_inputs( chart=chart, @@ -235,7 +235,7 @@ class CLASS_qa(Container): @validate_arguments def var( self, chart: bool = False - ) -> CommandOutput[openbb_core.app.model.results.empty.Empty]: + ) -> Obbject[openbb_core.app.model.results.empty.Empty]: """Value at Risk.""" inputs = filter_inputs( chart=chart, @@ -252,7 +252,7 @@ class CLASS_qa(Container): @validate_arguments def line( self, chart: bool = False - ) -> CommandOutput[openbb_core.app.model.results.empty.Empty]: + ) -> Obbject[openbb_core.app.model.results.empty.Empty]: """Line.""" inputs = filter_inputs( chart=chart, @@ -269,7 +269,7 @@ class CLASS_qa(Container): @validate_arguments def hist( self, chart: bool = False - ) -> CommandOutput[openbb_core.app.model.results.empty.Empty]: + ) -> Obbject[openbb_core.app.model.results.empty.Empty]: """Histogram.""" inputs = filter_inputs( chart=chart, @@ -291,7 +291,7 @@ class CLASS_qa(Container): fuller_reg: Literal["c", "ct", "ctt", "nc"] = "c", kpss_reg: Literal["c", "ct"] = "c", chart: bool = False, - ) -> CommandOutput[openbb_qa.qa_models.UnitRootModel]: + ) -> Obbject[openbb_qa.qa_models.UnitRootModel]: """Unit Root Test. Augmented Dickey-Fuller test for unit root. @@ -310,7 +310,7 @@ class CLASS_qa(Container): Returns ------- - CommandOutput[UnitRootModel] + Obbject[UnitRootModel] Unit root tests summary. """ inputs = filter_inputs( @@ -332,7 +332,7 @@ class CLASS_qa(Container): @validate_arguments def beta( self, chart: bool = False - ) -> CommandOutput[openbb_core.app.model.results.empty.Empty]: + ) -> Obbject[openbb_core.app.model.results.empty.Empty]: """Beta.""" inputs = filter_inputs( chart=chart, @@ -354,7 +354,7 @@ class CLASS_qa(Container): rfr: float = 0.0, window: pydantic.types.PositiveInt = 252, chart: bool = False, - ) -> CommandOutput[typing.List]: + ) -> Obbject[typing.List]: """Sharpe Ratio. Parameters @@ -370,7 +370,7 @@ class CLASS_qa(Container): Returns ------- - CommandOutput[List[Data]] + Obbject[List[Data]] Sharpe ratio. """ inputs = filter_inputs( @@ -398,7 +398,7 @@ class CLASS_qa(Container): window: pydantic.types.PositiveInt = 252, adjusted: bool = False, chart: bool = False, - ) -> CommandOutput[typing.List]: + ) -> Obbject[typing.List]: """Sortino Ratio. For method & terminology see: http://www.redrockcapital.com/Sortino__A__Sharper__Ratio_Red_Rock_Capital.pdf @@ -418,7 +418,7 @@ class CLASS_qa(Container): Returns ------- - CommandOutput[List[Data]] + Obbject[List[Data]] Sortino ratio. """ inputs = filter_inputs( @@ -441,7 +441,7 @@ class CLASS_qa(Container): @validate_arguments def cusum( self, chart: bool = False - ) -> CommandOutput[openbb_core.app.model.results.empty.Empty]: + ) -> Obbject[openbb_core.app.model.results.empty.Empty]: """Cumulative Sum.""" inputs = filter_inputs( chart=chart, @@ -458,7 +458,7 @@ class CLASS_qa(Container): @validate_arguments def raw( self, chart: bool = False - ) -> CommandOutput[openbb_core.app.model.results.empty.Empty]: + ) -> Obbject[openbb_core.app.model.results.empty.Empty]: """Raw.""" inputs = filter_inputs( chart=chart, @@ -475,7 +475,7 @@ class CLASS_qa(Container): @validate_arguments def cdf( self, chart: bool = False - ) -> CommandOutput[openbb_core.app.model.results.empty.Empty]: + ) -> Obbject[openbb_core.app.model.results.empty.Empty]: """Cumulative Distribution Function.""" inputs = filter_inputs( chart=chart, @@ -492,7 +492,7 @@ class CLASS_qa(Container): @validate_arguments def decompose( self, chart: bool = False - ) -> CommandOutput[openbb_core.app.model.results.empty.Empty]: + ) -> Obbject[openbb_core.app.model.results.empty.Empty]: """Decompose.""" inputs = filter_inputs( chart=chart, @@ -513,7 +513,7 @@ class CLASS_qa(Container): target: str, window: pydantic.types.PositiveInt, chart: bool = False, - ) -> CommandOutput[typing.List]: + ) -> Obbject[typing.List]: """Skewness. Parameters @@ -527,7 +527,7 @@ class CLASS_qa(Container): Returns ------- - CommandOutput[List[Data]] + Obbject[List[Data]] Skewness. """ inputs = filter_inputs( @@ -553,7 +553,7 @@ class CLASS_qa(Container): window: pydantic.types.PositiveInt, quantile_pct: pydantic.types.NonNegativeFloat = 0.5, chart: bool = False, - ) -> CommandOutput[typing.List]: + ) -> Obbject[typing.List]: """Quantile.""" inputs = filter_inputs( data=data, @@ -574,7 +574,7 @@ class CLASS_qa(Container): @validate_arguments def bw( self, chart: bool = False - ) -> CommandOutput[openbb_core.app.model.results.empty.Empty]: + ) -> Obbject[openbb_core.app.model.results.empty.Empty]: """Bandwidth.""" inputs = filter_inputs( chart=chart, @@ -591,7 +591,7 @@ class CLASS_qa(Container): @validate_arguments def es( self, chart: bool = False - ) -> CommandOutput[openbb_core.app.model.results.empty.Empty]: + ) -> Obbject[openbb_core.app.model.results.empty.Empty]: """Expected Shortfall.""" inputs = filter_inputs( chart=chart, @@ -608,7 +608,7 @@ class CLASS_qa(Container): @validate_arguments def acf( self, chart: bool = False - ) -> CommandOutput[openbb_core.app.model.results.empty.Empty]: + ) -> Obbject[openbb_core.app.model.results.empty.Empty]: """Autocorrelation Function.""" inputs = filter_inputs( chart=chart, @@ -628,7 +628,7 @@ class CLASS_qa(Container): data: Union[List[openbb_provider.abstract.data.Data], pandas.DataFrame], target: str, chart: bool = False, - ) -> CommandOutput[openbb_qa.qa_models.SummaryModel]: + ) -> Obbject[openbb_qa.qa_models.SummaryModel]: """Summary. Parameters @@ -640,7 +640,7 @@ class CLASS_qa(Container): Returns ------- - CommandOutput[SummaryModel] + Obbject[SummaryModel] Summary table. """ inputs = filter_inputs( diff --git a/openbb_sdk/sdk/core/openbb_core/app/static/package/stocks.py b/openbb_sdk/sdk/core/openbb_core/app/static/package/stocks.py index 8fd80da14ba..fc93db5e5a3 100644 --- a/openbb_sdk/sdk/core/openbb_core/app/static/package/stocks.py +++ b/openbb_sdk/sdk/core/openbb_core/app/static/package/stocks.py @@ -9,7 +9,7 @@ from pydantic import validate_arguments import openbb_core.app.model.command_context import openbb_core.app.model.results.empty -from openbb_core.app.model.command_output import CommandOutput +from openbb_core.app.model.obbject import Obbject from openbb_core.app.model.custom_parameter import OpenBBCustomParameter from openbb_core.app.static.container import Container from openbb_core.app.static.filters import filter_call, filter_inputs, filter_output @@ -102,7 +102,7 @@ class CLASS_stocks(Container): chart: bool = False, provider: Optional[Literal["polygon", "fmp"]] = None, **kwargs - ) -> CommandOutput[typing.List]: + ) -> Obbject[typing.List]: r"""Load stock data for a specific ticker. @@ -122,7 +122,7 @@ class CLASS_stocks(Container): Returns ------- - CommandOutput + Obbject results: List[Data] Serializable results. provider: Optional[PROVIDERS] @@ -239,7 +239,7 @@ class CLASS_stocks(Container): chart: bool = False, provider: Optional[Literal["benzinga", "polygon", "fmp"]] = None, **kwargs - ) -> CommandOutput[typing.List]: + ) -> Obbject[typing.List]: """Get news for one or more stock tickers. @@ -259,7 +259,7 @@ class CLASS_stocks(Container): Returns ------- - CommandOutput + Obbject results: List[Data] Serializable results. provider: Optional[PROVIDERS] @@ -417,7 +417,7 @@ class CLASS_stocks(Container): chart: bool = False, provider: Optional[Literal["fmp"]] = None, **kwargs - ) -> CommandOutput[typing.List]: + ) -> Obbject[typing.List]: """Get valuation multiples for a stock ticker. @@ -435,7 +435,7 @@ class CLASS_stocks(Container): Returns ------- - CommandOutput + Obbject results: List[Data] Serializable results. provider: Optional[PROVIDERS] @@ -599,7 +599,7 @@ class CLASS_stocks(Container): @validate_arguments def tob( self, chart: bool = False - ) -> CommandOutput[openbb_core.app.model.results.empty.Empty]: + ) -> Obbject[openbb_core.app.model.results.empty.Empty]: """View top of book for loaded ticker (US exchanges only).""" inputs = filter_inputs( chart=chart, @@ -616,7 +616,7 @@ class CLASS_stocks(Container): @validate_arguments def quote( self, chart: bool = False - ) -> CommandOutput[openbb_core.app.model.results.empty.Empty]: + ) -> Obbject[openbb_core.app.model.results.empty.Empty]: """View the current price for a specific stock ticker.""" inputs = filter_inputs( chart=chart, @@ -633,7 +633,7 @@ class CLASS_stocks(Container): @validate_arguments def search( self, chart: bool = False - ) -> CommandOutput[openbb_core.app.model.results.empty.Empty]: + ) -> Obbject[openbb_core.app.model.results.empty.Empty]: """Search a specific stock ticker for analysis.""" inputs = filter_inputs( chart=chart, diff --git a/openbb_sdk/sdk/core/openbb_core/app/static/package/stocks_ca.py b/openbb_sdk/sdk/core/openbb_core/app/static/package/stocks_ca.py index 1dbdff8769e..76dd20d17f1 100644 --- a/openbb_sdk/sdk/core/openbb_core/app/static/package/stocks_ca.py +++ b/openbb_sdk/sdk/core/openbb_core/app/static/package/stocks_ca.py @@ -7,7 +7,7 @@ from pydantic import validate_arguments import openbb_core.app.model.command_context import openbb_core.app.model.results.empty -from openbb_core.app.model.command_output import CommandOutput +from openbb_core.app.model.obbject import Obbject from openbb_core.app.model.custom_parameter import OpenBBCustomParameter from openbb_core.app.static.container import Container from openbb_core.app.static.filters import filter_call, filter_inputs, filter_output @@ -24,7 +24,7 @@ class CLASS_stocks_ca(Container): chart: bool = False, provider: Optional[Literal["fmp"]] = None, **kwargs - ) -> CommandOutput[typing.List]: + ) -> Obbject[typing.List]: """Company peers. @@ -40,7 +40,7 @@ class CLASS_stocks_ca(Container): Returns ------- - CommandOutput + Obbject results: List[Data] Serializable results. provider: Optional[PROVIDERS] @@ -93,7 +93,7 @@ class CLASS_stocks_ca(Container): @validate_arguments def balance( self, chart: bool = False - ) -> CommandOutput[openbb_core.app.model.results.empty.Empty]: + ) -> Obbject[openbb_core.app.model.results.empty.Empty]: """Company balance sheet.""" inputs = filter_inputs( chart=chart, @@ -110,7 +110,7 @@ class CLASS_stocks_ca(Container): @validate_arguments def cashflow( self, chart: bool = False - ) -> CommandOutput[openbb_core.app.model.results.empty.Empty]: + ) -> Obbject[openbb_core.app.model.results.empty.Empty]: """Company cashflow.""" inputs = filter_inputs( chart=chart, @@ -127,7 +127,7 @@ class CLASS_stocks_ca(Container): @validate_arguments def hcorr( self, chart: bool = False - ) -> CommandOutput[openbb_core.app.model.results.empty.Empty]: + ) -> Obbject[openbb_core.app.model.results.empty.Empty]: """Company historical correlation.""" inputs = filter_inputs( chart=chart, @@ -144,7 +144,7 @@ class CLASS_stocks_ca(Container): @validate_arguments def hist( self, chart: bool = False - ) -> CommandOutput[openbb_core.app.model.results.empty.Empty]: + ) -> Obbject[openbb_core.app.model.results.empty.Empty]: """Company historical prices.""" inputs = filter_inputs( chart=chart, @@ -161,7 +161,7 @@ class CLASS_stocks_ca(Container): @validate_arguments def income( self, chart: bool = False - ) -> CommandOutput[openbb_core.app.model.results.empty.Empty]: + ) -> Obbject[openbb_core.app.model.results.empty.Empty]: """Company income statement.""" inputs = filter_inputs( chart=chart, @@ -178,7 +178,7 @@ class CLASS_stocks_ca(Container): @validate_arguments def scorr( self, chart: bool = False - ) -> CommandOutput[openbb_core.app.model.results.empty.Empty]: + ) -> Obbject[openbb_core.app.model.results.empty.Empty]: """Company sector correlation.""" inputs = filter_inputs( chart=chart, @@ -195,7 +195,7 @@ class CLASS_stocks_ca(Container): @validate_arguments def screener( self, chart: bool = False - ) -> CommandOutput[openbb_core.app.model.results.empty.Empty]: + ) -> Obbject[openbb_core.app.model.results.empty.Empty]: """Company screener.""" inputs = filter_inputs( chart=chart, @@ -212,7 +212,7 @@ class CLASS_stocks_ca(Container): @validate_arguments def sentiment( self, chart: bool = False - ) -> CommandOutput[openbb_core.app.model.results.empty.Empty]: + ) -> Obbject[openbb_core.app.model.results.empty.Empty]: """Company sentiment.""" inputs = filter_inputs( chart=chart, @@ -229,7 +229,7 @@ class CLASS_stocks_ca(Container): @validate_arguments def similar( self, chart: bool = False - ) -> CommandOutput[openbb_core.app.model.results.empty.Empty]: + ) -> Obbject[openbb_core.app.model.results.empty.Empty]: """Company similar.""" inputs = filter_inputs( chart=chart, @@ -246,7 +246,7 @@ class CLASS_stocks_ca(Container): @validate_arguments def volume( self, chart: bool = False - ) -> CommandOutput[openbb_core.app.model.results.empty.Empty]: + ) -> Obbject[openbb_core.app.model.results.empty.Empty]: """Company volume.""" inputs = filter_inputs( chart=chart, diff --git a/openbb_sdk/sdk/core/openbb_core/app/static/package/stocks_dd.py b/openbb_sdk/sdk/core/openbb_core/app/static/package/stocks_dd.py index 792bc303908..391cb0a347e 100644 --- a/openbb_sdk/sdk/core/openbb_core/app/static/package/stocks_dd.py +++ b/openbb_sdk/sdk/core/openbb_core/app/static/package/stocks_dd.py @@ -5,7 +5,7 @@ from typing import Annotated, Literal, Optional from pydantic import validate_arguments -from openbb_core.app.model.command_output import CommandOutput +from openbb_core.app.model.obbject import Obbject from openbb_core.app.model.custom_parameter import OpenBBCustomParameter from openbb_core.app.static.container import Container from openbb_core.app.static.filters import filter_call, filter_inputs, filter_output @@ -135,7 +135,7 @@ class CLASS_stocks_dd(Container): chart: bool = False, provider: Optional[Literal["fmp"]] = None, **kwargs - ) -> CommandOutput[typing.List]: + ) -> Obbject[typing.List]: """SEC Filings. @@ -157,7 +157,7 @@ class CLASS_stocks_dd(Container): Returns ------- - CommandOutput + Obbject results: List[Data] Serializable results. provider: Optional[PROVIDERS] diff --git a/openbb_sdk/sdk/core/openbb_core/app/static/package/stocks_disc.py b/openbb_sdk/sdk/core/openbb_core/app/static/package/stocks_disc.py index 102a31df05e..4fdd4f85057 100644 --- a/openbb_sdk/sdk/core/openbb_core/app/static/package/stocks_disc.py +++ b/openbb_sdk/sdk/core/openbb_core/app/static/package/stocks_disc.py @@ -4,7 +4,7 @@ from pydantic import validate_arguments import openbb_core.app.model.results.empty -from openbb_core.app.model.command_output import CommandOutput +from openbb_core.app.model.obbject import Obbject from openbb_core.app.static.container import Container from openbb_core.app.static.filters import filter_call, filter_inputs, filter_output @@ -14,7 +14,7 @@ class CLASS_stocks_disc(Container): @validate_arguments def active( self, chart: bool = False - ) -> CommandOutput[openbb_core.app.model.results.empty.Empty]: + ) -> Obbject[openbb_core.app.model.results.empty.Empty]: """Most active stocks by intraday trade volumes.""" inputs = filter_inputs( chart=chart, @@ -31,7 +31,7 @@ class CLASS_stocks_disc(Container): @validate_arguments def arkord( self, chart: bool = False - ) -> CommandOutput[openbb_core.app.model.results.empty.Empty]: + ) -> Obbject[openbb_core.app.model.results.empty.Empty]: """Order by ARK INvestment Management LLC.""" inputs = filter_inputs( chart=chart, @@ -48,7 +48,7 @@ class CLASS_stocks_disc(Container): @validate_arguments def asc( self, chart: bool = False - ) -> CommandOutput[openbb_core.app.model.results.empty.Empty]: + ) -> Obbject[openbb_core.app.model.results.empty.Empty]: """Small cap stocks with revenue and earnings growth more than 25%.""" inputs = filter_inputs( chart=chart, @@ -65,7 +65,7 @@ class CLASS_stocks_disc(Container): @validate_arguments def dividends( self, chart: bool = False - ) -> CommandOutput[openbb_core.app.model.results.empty.Empty]: + ) -> Obbject[openbb_core.app.model.results.empty.Empty]: inputs = filter_inputs( chart=chart, ) @@ -81,7 +81,7 @@ class CLASS_stocks_disc(Container): @validate_arguments def filings( self, chart: bool = False - ) -> CommandOutput[openbb_core.app.model.results.empty.Empty]: + ) -> Obbject[openbb_core.app.model.results.empty.Empty]: """The most-recent form submissions to the SEC.""" inputs = filter_inputs( chart=chart, @@ -98,7 +98,7 @@ class CLASS_stocks_disc(Container): @validate_arguments def fipo( self, chart: bool = False - ) -> CommandOutput[openbb_core.app.model.results.empty.Empty]: + ) -> Obbject[openbb_core.app.model.results.empty.Empty]: """Future IPOs dates.""" inputs = filter_inputs( chart=chart, @@ -115,7 +115,7 @@ class CLASS_stocks_disc(Container): @validate_arguments def gainers( self, chart: bool = False - ) -> CommandOutput[openbb_core.app.model.results.empty.Empty]: + ) -> Obbject[openbb_core.app.model.results.empty.Empty]: """Show latest top gainers.""" inputs = filter_inputs( chart=chart, @@ -132,7 +132,7 @@ class CLASS_stocks_disc(Container): @validate_arguments def gtech( self, chart: bool = False - ) -> CommandOutput[openbb_core.app.model.results.empty.Empty]: + ) -> Obbject[openbb_core.app.model.results.empty.Empty]: """Tech stocks with revenue and earnings growth more than 25%.""" inputs = filter_inputs( chart=chart, @@ -149,7 +149,7 @@ class CLASS_stocks_disc(Container): @validate_arguments def hotpenny( self, chart: bool = False - ) -> CommandOutput[openbb_core.app.model.results.empty.Empty]: + ) -> Obbject[openbb_core.app.model.results.empty.Empty]: """Today's hot penny stocks.""" inputs = filter_inputs( chart=chart, @@ -166,7 +166,7 @@ class CLASS_stocks_disc(Container): @validate_arguments def ipo( self, chart: bool = False - ) -> CommandOutput[openbb_core.app.model.results.empty.Empty]: + ) -> Obbject[openbb_core.app.model.results.empty.Empty]: inputs = filter_inputs( chart=chart, ) @@ -182,7 +182,7 @@ class CLASS_stocks_disc(Container): @validate_arguments def losers( self, chart: bool = False - ) -> CommandOutput[openbb_core.app.model.results.empty.Empty]: + ) -> Obbject[openbb_core.app.model.results.empty.Empty]: """Show latest top losers.""" inputs = filter_inputs( chart=chart, @@ -199,7 +199,7 @@ class CLASS_stocks_disc(Container): @validate_arguments def lowfloat( self, chart: bool = False - ) -> CommandOutput[openbb_core.app.model.results.empty.Empty]: + ) -> Obbject[openbb_core.app.model.results.empty.Empty]: """Low float stocks under 10M shares float.""" inputs = filter_inputs( chart=chart, @@ -216,7 +216,7 @@ class CLASS_stocks_disc(Container): @validate_arguments def pipo( self, chart: bool = False - ) -> CommandOutput[openbb_core.app.model.results.empty.Empty]: + ) -> Obbject[openbb_core.app.model.results.empty.Empty]: """Past IPOs dates.""" inputs = filter_inputs( chart=chart, @@ -233,7 +233,7 @@ class CLASS_stocks_disc(Container): @validate_arguments def rtat( self, chart: bool = False - ) -> CommandOutput[openbb_core.app.model.results.empty.Empty]: + ) -> Obbject[openbb_core.app.model.results.empty.Empty]: """Top 10 retail traded stocks per day.""" inputs = filter_inputs( chart=chart, @@ -250,7 +250,7 @@ class CLASS_stocks_disc(Container): @validate_arguments def trending( self, chart: bool = False - ) -> CommandOutput[openbb_core.app.model.results.empty.Empty]: + ) -> Obbject[openbb_core.app.model.results.empty.Empty]: """Trending news.""" inputs = filter_inputs( chart=chart, @@ -267,7 +267,7 @@ class CLASS_stocks_disc(Container): @validate_arguments def ugs( self, chart: bool = False - ) -> CommandOutput[openbb_core.app.model.results.empty.Empty]: + ) -> Obbject[openbb_core.app.model.results.empty.Empty]: """Undervalued stocks with revenue and earnings growth above 25%.""" inputs = filter_inputs( chart=chart, @@ -284,7 +284,7 @@ class CLASS_stocks_disc(Container): @validate_arguments def ulc( self, chart: bool = False - ) -> CommandOutput[openbb_core.app.model.results.empty.Empty]: + ) -> Obbject[openbb_core.app.model.results.empty.Empty]: """Potentially undervalued large cap stocks.""" inputs = filter_inputs( chart=chart, @@ -301,7 +301,7 @@ class CLASS_stocks_disc(Container): @validate_arguments def upcoming( self, chart: bool = False - ) -> CommandOutput[openbb_core.app.model.results.empty.Empty]: + ) -> Obbject[openbb_core.app.model.results.empty.Empty]: """Upcoming earnings release dates.""" inputs = filter_inputs( chart=chart, diff --git a/openbb_sdk/sdk/core/openbb_core/app/static/package/stocks_dps.py b/openbb_sdk/sdk/core/openbb_core/app/static/package/stocks_dps.py index 2c003020af9..ebb575ffbb2 100644 --- a/openbb_sdk/sdk/core/openbb_core/app/static/package/stocks_dps.py +++ b/openbb_sdk/sdk/core/openbb_core/app/static/package/stocks_dps.py @@ -4,7 +4,7 @@ from pydantic import validate_arguments import openbb_core.app.model.results.empty -from openbb_core.app.model.command_output import CommandOutput +from openbb_core.app.model.obbject import Obbject from openbb_core.app.static.container import Container from openbb_core.app.static.filters import filter_call, filter_inputs, filter_output @@ -14,7 +14,7 @@ class CLASS_stocks_dps(Container): @validate_arguments def psi( self, chart: bool = False - ) -> CommandOutput[openbb_core.app.model.results.empty.Empty]: + ) -> Obbject[openbb_core.app.model.results.empty.Empty]: """Price vs short interest volume""" inputs = filter_inputs( chart=chart, @@ -31,7 +31,7 @@ class CLASS_stocks_dps(Container): @validate_arguments def ctb( self, chart: bool = False - ) -> CommandOutput[openbb_core.app.model.results.empty.Empty]: + ) -> Obbject[openbb_core.app.model.results.empty.Empty]: """Cost to borrow of stocks.""" inputs = filter_inputs( chart=chart, @@ -48,7 +48,7 @@ class CLASS_stocks_dps(Container): @validate_arguments def dpotc( self, chart: bool = False - ) -> CommandOutput[openbb_core.app.model.results.empty.Empty]: + ) -> Obbject[openbb_core.app.model.results.empty.Empty]: """Dark pools (ATS) vs OTC data.""" inputs = filter_inputs( chart=chart, @@ -65,7 +65,7 @@ class CLASS_stocks_dps(Container): @validate_arguments def ftd( self, chart: bool = False - ) -> CommandOutput[openbb_core.app.model.results.empty.Empty]: + ) -> Obbject[openbb_core.app.model.results.empty.Empty]: """Fails-to-deliver data.""" inputs = filter_inputs( chart=chart, @@ -82,7 +82,7 @@ class CLASS_stocks_dps(Container): @validate_arguments def hsi( self, chart: bool = False - ) -> CommandOutput[openbb_core.app.model.results.empty.Empty]: + ) -> Obbject[openbb_core.app.model.results.empty.Empty]: """Show top high short interest stocks of over 20% ratio.""" inputs = filter_inputs( chart=chart, @@ -99,7 +99,7 @@ class CLASS_stocks_dps(Container): @validate_arguments def pos( self, chart: bool = False - ) -> CommandOutput[openbb_core.app.model.results.empty.Empty]: + ) -> Obbject[openbb_core.app.model.results.empty.Empty]: """Dark pool short position.""" inputs = filter_inputs( chart=chart, @@ -116,7 +116,7 @@ class CLASS_stocks_dps(Container): @validate_arguments def prom( self, chart: bool = False - ) -> CommandOutput[openbb_core.app.model.results.empty.Empty]: + ) -> Obbject[openbb_core.app.model.results.empty.Empty]: """Promising tickers based on dark pool shares regression.""" inputs = filter_inputs( chart=chart, @@ -133,7 +133,7 @@ class CLASS_stocks_dps(Container): @validate_arguments def psi_q( self, chart: bool = False - ) -> CommandOutput[openbb_core.app.model.results.empty.Empty]: + ) -> Obbject[openbb_core.app.model.results.empty.Empty]: inputs = filter_inputs( chart=chart, ) @@ -149,7 +149,7 @@ class CLASS_stocks_dps(Container): @validate_arguments def psi_sg( self, chart: bool = False - ) -> CommandOutput[openbb_core.app.model.results.empty.Empty]: + ) -> Obbject[openbb_core.app.model.results.empty.Empty]: inputs = filter_inputs( chart=chart, ) @@ -165,7 +165,7 @@ class CLASS_stocks_dps(Container): @validate_arguments def shorted( self, chart: bool = False - ) -> CommandOutput[openbb_core.app.model.results.empty.Empty]: + ) -> Obbject[openbb_core.app.model.results.empty.Empty]: """Most shorted stocks.""" inputs = filter_inputs( chart=chart, @@ -182,7 +182,7 @@ class CLASS_stocks_dps(Container): @validate_arguments def sidtc( self, chart: bool = False - ) -> CommandOutput[openbb_core.app.model.results.empty.Empty]: + ) -> Obbject[openbb_core.app.model.results.empty.Empty]: """Short interest and days to cover.""" inputs = filter_inputs( chart=chart, @@ -199,7 +199,7 @@ class CLASS_stocks_dps(Container): @validate_arguments def spos( self, chart: bool = False - ) -> CommandOutput[openbb_core.app.model.results.empty.Empty]: + ) -> Obbject[openbb_core.app.model.results.empty.Empty]: """Net short vs position.""" inputs = filter_inputs( chart=chart, diff --git a/openbb_sdk/sdk/core/openbb_core/app/static/package/stocks_fa.py b/openbb_sdk/sdk/core/openbb_core/app/static/package/stocks_fa.py index aa9abebcde3..6bb66b79b82 100644 --- a/openbb_sdk/sdk/core/openbb_core/app/static/package/stocks_fa.py +++ b/openbb_sdk/sdk/core/openbb_core/app/static/package/stocks_fa.py @@ -9,7 +9,7 @@ from pydantic import validate_arguments import openbb_core.app.model.command_context import openbb_core.app.model.results.empty -from openbb_core.app.model.command_output import CommandOutput +from openbb_core.app.model.obbject import Obbject from openbb_core.app.model.custom_parameter import OpenBBCustomParameter from openbb_core.app.static.container import Container from openbb_core.app.static.filters import filter_call, filter_inputs, filter_output @@ -20,7 +20,7 @@ class CLASS_stocks_fa(Container): @validate_arguments def analysis( self, chart: bool = False - ) -> CommandOutput[openbb_core.app.model.results.empty.Empty]: + ) -> Obbject[openbb_core.app.model.results.empty.Empty]: """Analyse SEC filings with the help of machine learning.""" inputs = filter_inputs( chart=chart, @@ -53,7 +53,7 @@ class CLASS_stocks_fa(Container): chart: bool = False, provider: Optional[Literal["polygon", "fmp"]] = None, **kwargs - ) -> CommandOutput[typing.List]: + ) -> Obbject[typing.List]: """Balance Sheet. @@ -73,7 +73,7 @@ class CLASS_stocks_fa(Container): Returns ------- - CommandOutput + Obbject results: List[Data] Serializable results. provider: Optional[PROVIDERS] @@ -287,7 +287,7 @@ class CLASS_stocks_fa(Container): chart: bool = False, provider: Optional[Literal["fmp"]] = None, **kwargs - ) -> CommandOutput[typing.List]: + ) -> Obbject[typing.List]: """Balance Sheet Statement Growth. @@ -305,7 +305,7 @@ class CLASS_stocks_fa(Container): Returns ------- - CommandOutput + Obbject results: List[Data] Serializable results. provider: Optional[PROVIDERS] @@ -454,7 +454,7 @@ class CLASS_stocks_fa(Container): chart: bool = False, provider: Optional[Literal["fmp"]] = None, **kwargs - ) -> CommandOutput[typing.List]: + ) -> Obbject[typing.List]: """Show Dividend Calendar for a given start and end dates. @@ -472,7 +472,7 @@ class CLASS_stocks_fa(Container): Returns ------- - CommandOutput + Obbject results: List[Data] Serializable results. provider: Optional[PROVIDERS] @@ -554,7 +554,7 @@ class CLASS_stocks_fa(Container): chart: bool = False, provider: Optional[Literal["polygon", "fmp"]] = None, **kwargs - ) -> CommandOutput[typing.List]: + ) -> Obbject[typing.List]: """Cash Flow Statement. @@ -574,7 +574,7 @@ class CLASS_stocks_fa(Container): Returns ------- - CommandOutput + Obbject results: List[Data] Serializable results. provider: Optional[PROVIDERS] @@ -750,7 +750,7 @@ class CLASS_stocks_fa(Container): chart: bool = False, provider: Optional[Literal["fmp"]] = None, **kwargs - ) -> CommandOutput[typing.List]: + ) -> Obbject[typing.List]: """Cash Flow Statement Growth. @@ -768,7 +768,7 @@ class CLASS_stocks_fa(Container): Returns ------- - CommandOutput + Obbject results: List[Data] Serializable results. provider: Optional[PROVIDERS] @@ -890,7 +890,7 @@ class CLASS_stocks_fa(Container): chart: bool = False, provider: Optional[Literal["fmp"]] = None, **kwargs - ) -> CommandOutput[typing.List]: + ) -> Obbject[typing.List]: """Executive Compensation. @@ -906,7 +906,7 @@ class CLASS_stocks_fa(Container): Returns ------- - CommandOutput + Obbject results: List[Data] Serializable results. provider: Optional[PROVIDERS] @@ -996,7 +996,7 @@ class CLASS_stocks_fa(Container): chart: bool = False, provider: Optional[Literal["fmp"]] = None, **kwargs - ) -> CommandOutput[typing.List]: + ) -> Obbject[typing.List]: """Stock Split Calendar. @@ -1014,7 +1014,7 @@ class CLASS_stocks_fa(Container): Returns ------- - CommandOutput + Obbject results: List[Data] Serializable results. provider: Optional[PROVIDERS] @@ -1074,7 +1074,7 @@ class CLASS_stocks_fa(Container): @validate_arguments def customer( self, chart: bool = False - ) -> CommandOutput[openbb_core.app.model.results.empty.Empty]: + ) -> Obbject[openbb_core.app.model.results.empty.Empty]: """List of customers of the company.""" inputs = filter_inputs( chart=chart, @@ -1091,7 +1091,7 @@ class CLASS_stocks_fa(Container): @validate_arguments def dcfc( self, chart: bool = False - ) -> CommandOutput[openbb_core.app.model.results.empty.Empty]: + ) -> Obbject[openbb_core.app.model.results.empty.Empty]: """Determine the (historical) discounted cash flow.""" inputs = filter_inputs( chart=chart, @@ -1114,7 +1114,7 @@ class CLASS_stocks_fa(Container): chart: bool = False, provider: Optional[Literal["fmp"]] = None, **kwargs - ) -> CommandOutput[typing.List]: + ) -> Obbject[typing.List]: """Historical Dividends. @@ -1130,7 +1130,7 @@ class CLASS_stocks_fa(Container): Returns ------- - CommandOutput + Obbject results: List[Data] Serializable results. provider: Optional[PROVIDERS] @@ -1193,7 +1193,7 @@ class CLASS_stocks_fa(Container): @validate_arguments def dupont( self, chart: bool = False - ) -> CommandOutput[openbb_core.app.model.results.empty.Empty]: + ) -> Obbject[openbb_core.app.model.results.empty.Empty]: """Detailed breakdown for Return on Equity (RoE).""" inputs = filter_inputs( chart=chart, @@ -1220,7 +1220,7 @@ class CLASS_stocks_fa(Container): chart: bool = False, provider: Optional[Literal["fmp"]] = None, **kwargs - ) -> CommandOutput[typing.List]: + ) -> Obbject[typing.List]: """Earnings Calendar. @@ -1238,7 +1238,7 @@ class CLASS_stocks_fa(Container): Returns ------- - CommandOutput + Obbject results: List[Data] Serializable results. provider: Optional[PROVIDERS] @@ -1312,7 +1312,7 @@ class CLASS_stocks_fa(Container): chart: bool = False, provider: Optional[Literal["fmp"]] = None, **kwargs - ) -> CommandOutput[typing.List]: + ) -> Obbject[typing.List]: """Number of Employees. @@ -1328,7 +1328,7 @@ class CLASS_stocks_fa(Container): Returns ------- - CommandOutput + Obbject results: List[Data] Serializable results. provider: Optional[PROVIDERS] @@ -1395,7 +1395,7 @@ class CLASS_stocks_fa(Container): @validate_arguments def enterprise( self, chart: bool = False - ) -> CommandOutput[openbb_core.app.model.results.empty.Empty]: + ) -> Obbject[openbb_core.app.model.results.empty.Empty]: """Enterprise value.""" inputs = filter_inputs( chart=chart, @@ -1412,7 +1412,7 @@ class CLASS_stocks_fa(Container): @validate_arguments def epsfc( self, chart: bool = False - ) -> CommandOutput[openbb_core.app.model.results.empty.Empty]: + ) -> Obbject[openbb_core.app.model.results.empty.Empty]: """Earnings Estimate by Analysts - EPS.""" inputs = filter_inputs( chart=chart, @@ -1445,7 +1445,7 @@ class CLASS_stocks_fa(Container): chart: bool = False, provider: Optional[Literal["fmp"]] = None, **kwargs - ) -> CommandOutput[typing.List]: + ) -> Obbject[typing.List]: """Analyst Estimates. @@ -1465,7 +1465,7 @@ class CLASS_stocks_fa(Container): Returns ------- - CommandOutput + Obbject results: List[Data] Serializable results. provider: Optional[PROVIDERS] @@ -1560,7 +1560,7 @@ class CLASS_stocks_fa(Container): @validate_arguments def fama_coe( self, chart: bool = False - ) -> CommandOutput[openbb_core.app.model.results.empty.Empty]: + ) -> Obbject[openbb_core.app.model.results.empty.Empty]: """Fama French 3 Factor Model - Coefficient of Earnings.""" inputs = filter_inputs( chart=chart, @@ -1577,7 +1577,7 @@ class CLASS_stocks_fa(Container): @validate_arguments def fama_raw( self, chart: bool = False - ) -> CommandOutput[openbb_core.app.model.results.empty.Empty]: + ) -> Obbject[openbb_core.app.model.results.empty.Empty]: """Fama French 3 Factor Model - Raw Data.""" inputs = filter_inputs( chart=chart, @@ -1594,7 +1594,7 @@ class CLASS_stocks_fa(Container): @validate_arguments def fraud( self, chart: bool = False - ) -> CommandOutput[openbb_core.app.model.results.empty.Empty]: + ) -> Obbject[openbb_core.app.model.results.empty.Empty]: """Key fraud ratios including M-score, Z-score and McKee.""" inputs = filter_inputs( chart=chart, @@ -1611,7 +1611,7 @@ class CLASS_stocks_fa(Container): @validate_arguments def growth( self, chart: bool = False - ) -> CommandOutput[openbb_core.app.model.results.empty.Empty]: + ) -> Obbject[openbb_core.app.model.results.empty.Empty]: """Growth of financial statement items and ratios.""" inputs = filter_inputs( chart=chart, @@ -1628,7 +1628,7 @@ class CLASS_stocks_fa(Container): @validate_arguments def historical_5( self, chart: bool = False - ) -> CommandOutput[openbb_core.app.model.results.empty.Empty]: + ) -> Obbject[openbb_core.app.model.results.empty.Empty]: inputs = filter_inputs( chart=chart, ) @@ -1660,7 +1660,7 @@ class CLASS_stocks_fa(Container): chart: bool = False, provider: Optional[Literal["polygon", "fmp"]] = None, **kwargs - ) -> CommandOutput[typing.List]: + ) -> Obbject[typing.List]: """Income Statement. @@ -1680,7 +1680,7 @@ class CLASS_stocks_fa(Container): Returns ------- - CommandOutput + Obbject results: List[Data] Serializable results. provider: Optional[PROVIDERS] @@ -1877,7 +1877,7 @@ class CLASS_stocks_fa(Container): chart: bool = False, provider: Optional[Literal["fmp"]] = None, **kwargs - ) -> CommandOutput[typing.List]: + ) -> Obbject[typing.List]: """Income Statement Growth. @@ -1897,7 +1897,7 @@ class CLASS_stocks_fa(Container): Returns ------- - CommandOutput + Obbject results: List[Data] Serializable results. provider: Optional[PROVIDERS] @@ -2051,7 +2051,7 @@ class CLASS_stocks_fa(Container): chart: bool = False, provider: Optional[Literal["fmp"]] = None, **kwargs - ) -> CommandOutput[typing.List]: + ) -> Obbject[typing.List]: """Stock Insider Trading. @@ -2075,7 +2075,7 @@ class CLASS_stocks_fa(Container): Returns ------- - CommandOutput + Obbject results: List[Data] Serializable results. provider: Optional[PROVIDERS] @@ -2171,7 +2171,7 @@ class CLASS_stocks_fa(Container): chart: bool = False, provider: Optional[Literal["fmp"]] = None, **kwargs - ) -> CommandOutput[typing.List]: + ) -> Obbject[typing.List]: """Institutional Ownership. @@ -2191,7 +2191,7 @@ class CLASS_stocks_fa(Container): Returns ------- - CommandOutput + Obbject results: List[Data] Serializable results. provider: Optional[PROVIDERS] @@ -2314,7 +2314,7 @@ class CLASS_stocks_fa(Container): @validate_arguments def key( self, chart: bool = False - ) -> CommandOutput[openbb_core.app.model.results.empty.Empty]: + ) -> Obbject[openbb_core.app.model.results.empty.Empty]: inputs = filter_inputs( chart=chart, ) @@ -2346,7 +2346,7 @@ class CLASS_stocks_fa(Container): chart: bool = False, provider: Optional[Literal["fmp"]] = None, **kwargs - ) -> CommandOutput[typing.List]: + ) -> Obbject[typing.List]: """Key Metrics. @@ -2366,7 +2366,7 @@ class CLASS_stocks_fa(Container): Returns ------- - CommandOutput + Obbject results: List[Data] Serializable results. provider: Optional[PROVIDERS] @@ -2543,7 +2543,7 @@ class CLASS_stocks_fa(Container): chart: bool = False, provider: Optional[Literal["fmp"]] = None, **kwargs - ) -> CommandOutput[typing.List]: + ) -> Obbject[typing.List]: """Key Executives. @@ -2559,7 +2559,7 @@ class CLASS_stocks_fa(Container): Returns ------- - CommandOutput + Obbject results: List[Data] Serializable results. provider: Optional[PROVIDERS] @@ -2622,7 +2622,7 @@ class CLASS_stocks_fa(Container): @validate_arguments def mktcap( self, chart: bool = False - ) -> CommandOutput[openbb_core.app.model.results.empty.Empty]: + ) -> Obbject[openbb_core.app.model.results.empty.Empty]: """Obtain the market capitalization or enterprise value.""" inputs = filter_inputs( chart=chart, @@ -2639,7 +2639,7 @@ class CLASS_stocks_fa(Container): @validate_arguments def news( self, chart: bool = False - ) -> CommandOutput[openbb_core.app.model.results.empty.Empty]: + ) -> Obbject[openbb_core.app.model.results.empty.Empty]: inputs = filter_inputs( chart=chart, ) @@ -2661,7 +2661,7 @@ class CLASS_stocks_fa(Container): chart: bool = False, provider: Optional[Literal["fmp"]] = None, **kwargs - ) -> CommandOutput[typing.List]: + ) -> Obbject[typing.List]: """Company Overview. @@ -2677,7 +2677,7 @@ class CLASS_stocks_fa(Container): Returns ------- - CommandOutput + Obbject results: List[Data] Serializable results. provider: Optional[PROVIDERS] @@ -2812,7 +2812,7 @@ class CLASS_stocks_fa(Container): chart: bool = False, provider: Optional[Literal["fmp"]] = None, **kwargs - ) -> CommandOutput[typing.List]: + ) -> Obbject[typing.List]: """Stock Ownership. @@ -2832,7 +2832,7 @@ class CLASS_stocks_fa(Container): Returns ------- - CommandOutput + Obbject results: List[Data] Serializable results. provider: Optional[PROVIDERS] @@ -2967,7 +2967,7 @@ class CLASS_stocks_fa(Container): chart: bool = False, provider: Optional[Literal["fmp"]] = None, **kwargs - ) -> CommandOutput[typing.List]: + ) -> Obbject[typing.List]: """Price Target Consensus. @@ -2983,7 +2983,7 @@ class CLASS_stocks_fa(Container): Returns ------- - CommandOutput + Obbject results: List[Data] Serializable results. provider: Optional[PROVIDERS] @@ -3048,7 +3048,7 @@ class CLASS_stocks_fa(Container): chart: bool = False, provider: Optional[Literal["fmp"]] = None, **kwargs - ) -> CommandOutput[typing.List]: + ) -> Obbject[typing.List]: """Price Target. @@ -3064,7 +3064,7 @@ class CLASS_stocks_fa(Container): Returns ------- - CommandOutput + Obbject results: List[Data] Serializable results. provider: Optional[PROVIDERS] @@ -3135,7 +3135,7 @@ class CLASS_stocks_fa(Container): @validate_arguments def rating( self, chart: bool = False - ) -> CommandOutput[openbb_core.app.model.results.empty.Empty]: + ) -> Obbject[openbb_core.app.model.results.empty.Empty]: """Analyst prices and ratings over time of the company.""" inputs = filter_inputs( chart=chart, @@ -3152,7 +3152,7 @@ class CLASS_stocks_fa(Container): @validate_arguments def ratios( self, chart: bool = False - ) -> CommandOutput[openbb_core.app.model.results.empty.Empty]: + ) -> Obbject[openbb_core.app.model.results.empty.Empty]: """Extensive set of ratios over time.""" inputs = filter_inputs( chart=chart, @@ -3169,7 +3169,7 @@ class CLASS_stocks_fa(Container): @validate_arguments def revfc( self, chart: bool = False - ) -> CommandOutput[openbb_core.app.model.results.empty.Empty]: + ) -> Obbject[openbb_core.app.model.results.empty.Empty]: """Earning Estimate by Analysts - Revenue.""" inputs = filter_inputs( chart=chart, @@ -3202,7 +3202,7 @@ class CLASS_stocks_fa(Container): chart: bool = False, provider: Optional[Literal["fmp"]] = None, **kwargs - ) -> CommandOutput[typing.List]: + ) -> Obbject[typing.List]: """Revenue Geographic. @@ -3222,7 +3222,7 @@ class CLASS_stocks_fa(Container): Returns ------- - CommandOutput + Obbject results: List[Data] Serializable results. provider: Optional[PROVIDERS] @@ -3301,7 +3301,7 @@ class CLASS_stocks_fa(Container): chart: bool = False, provider: Optional[Literal["fmp"]] = None, **kwargs - ) -> CommandOutput[typing.List]: + ) -> Obbject[typing.List]: """Revenue Business Line. @@ -3321,7 +3321,7 @@ class CLASS_stocks_fa(Container): Returns ------- - CommandOutput + Obbject results: List[Data] Serializable results. provider: Optional[PROVIDERS] @@ -3376,7 +3376,7 @@ class CLASS_stocks_fa(Container): @validate_arguments def rot( self, chart: bool = False - ) -> CommandOutput[openbb_core.app.model.results.empty.Empty]: + ) -> Obbject[openbb_core.app.model.results.empty.Empty]: """Number of analyst ratings over time on a monthly basis.""" inputs = filter_inputs( chart=chart, @@ -3393,7 +3393,7 @@ class CLASS_stocks_fa(Container): @validate_arguments def score( self, chart: bool = False - ) -> CommandOutput[openbb_core.app.model.results.empty.Empty]: + ) -> Obbject[openbb_core.app.model.results.empty.Empty]: """Value investing scores for any time period.""" inputs = filter_inputs( chart=chart, @@ -3410,7 +3410,7 @@ class CLASS_stocks_fa(Container): @validate_arguments def sec( self, chart: bool = False - ) -> CommandOutput[openbb_core.app.model.results.empty.Empty]: + ) -> Obbject[openbb_core.app.model.results.empty.Empty]: inputs = filter_inputs( chart=chart, ) @@ -3426,7 +3426,7 @@ class CLASS_stocks_fa(Container): @validate_arguments def shares( self, chart: bool = False - ) -> CommandOutput[openbb_core.app.model.results.empty.Empty]: + ) -> Obbject[openbb_core.app.model.results.empty.Empty]: inputs = filter_inputs( chart=chart, ) @@ -3448,7 +3448,7 @@ class CLASS_stocks_fa(Container): chart: bool = False, provider: Optional[Literal["fmp"]] = None, **kwargs - ) -> CommandOutput[typing.List]: + ) -> Obbject[typing.List]: """Share Statistics. @@ -3464,7 +3464,7 @@ class CLASS_stocks_fa(Container): Returns ------- - CommandOutput + Obbject results: List[Data] Serializable results. provider: Optional[PROVIDERS] @@ -3531,7 +3531,7 @@ class CLASS_stocks_fa(Container): chart: bool = False, provider: Optional[Literal["fmp"]] = None, **kwargs - ) -> CommandOutput[typing.List]: + ) -> Obbject[typing.List]: """Historical Stock Splits. @@ -3547,7 +3547,7 @@ class CLASS_stocks_fa(Container): Returns ------- - CommandOutput + Obbject results: List[Data] Serializable results. provider: Optional[PROVIDERS] @@ -3604,7 +3604,7 @@ class CLASS_stocks_fa(Container): @validate_arguments def supplier( self, chart: bool = False - ) -> CommandOutput[openbb_core.app.model.results.empty.Empty]: + ) -> Obbject[openbb_core.app.model.results.empty.Empty]: """List of suppliers of the company.""" inputs = filter_inputs( chart=chart, @@ -3639,7 +3639,7 @@ class CLASS_stocks_fa(Container): chart: bool = False, provider: Optional[Literal["fmp"]] = None, **kwargs - ) -> CommandOutput[typing.List]: + ) -> Obbject[typing.List]: """Earnings Call Transcript. @@ -3659,7 +3659,7 @@ class CLASS_stocks_fa(Container): Returns ------- - CommandOutput + Obbject results: List[Data] Serializable results. provider: Optional[PROVIDERS] diff --git a/openbb_sdk/sdk/core/openbb_core/app/static/package/stocks_gov.py b/openbb_sdk/sdk/core/openbb_core/app/static/package/stocks_gov.py index dd8dcd12eb0..c43689bd272 100644 --- a/openbb_sdk/sdk/core/openbb_core/app/static/package/stocks_gov.py +++ b/openbb_sdk/sdk/core/openbb_core/app/static/package/stocks_gov.py @@ -4,7 +4,7 @@ from pydantic import validate_arguments import openbb_core.app.model.results.empty -from openbb_core.app.model.command_output import CommandOutput +from openbb_core.app.model.obbject import Obbject from openbb_core.app.static.container import Container from openbb_core.app.static.filters import filter_call, filter_inputs, filter_output @@ -14,7 +14,7 @@ class CLASS_stocks_gov(Container): @validate_arguments def contracts( self, chart: bool = False - ) -> CommandOutput[openbb_core.app.model.results.empty.Empty]: + ) -> Obbject[openbb_core.app.model.results.empty.Empty]: """Return government contracts.""" inputs = filter_inputs( chart=chart, @@ -31,7 +31,7 @@ class CLASS_stocks_gov(Container): @validate_arguments def government_trading( self, chart: bool = False - ) -> CommandOutput[openbb_core.app.model.results.empty.Empty]: + ) -> Obbject[openbb_core.app.model.results.empty.Empty]: """Return government trading.""" inputs = filter_inputs( chart=chart, @@ -48,7 +48,7 @@ class CLASS_stocks_gov(Container): @validate_arguments def gtrades( self, chart: bool = False - ) -> CommandOutput[openbb_core.app.model.results.empty.Empty]: + ) -> Obbject[openbb_core.app.model.results.empty.Empty]: """Return government trades.""" inputs = filter_inputs( chart=chart, @@ -65,7 +65,7 @@ class CLASS_stocks_gov(Container): @validate_arguments def histcont( self, chart: bool = False - ) -> CommandOutput[openbb_core.app.model.results.empty.Empty]: + ) -> Obbject[openbb_core.app.model.results.empty.Empty]: """Historical quarterly government contracts.""" inputs = filter_inputs( chart=chart, @@ -82,7 +82,7 @@ class CLASS_stocks_gov(Container): @validate_arguments def lastcontracts( self, chart: bool = False - ) -> CommandOutput[openbb_core.app.model.results.empty.Empty]: + ) -> Obbject[openbb_core.app.model.results.empty.Empty]: """Return last government contracts given out.""" inputs = filter_inputs( chart=chart, @@ -99,7 +99,7 @@ class CLASS_stocks_gov(Container): @validate_arguments def lasttrades( self, chart: bool = False - ) -> CommandOutput[openbb_core.app.model.results.empty.Empty]: + ) -> Obbject[openbb_core.app.model.results.empty.Empty]: """Last trades.""" inputs = filter_inputs( chart=chart, @@ -116,7 +116,7 @@ class CLASS_stocks_gov(Container): @validate_arguments def lobbying( self, chart: bool = False - ) -> CommandOutput[openbb_core.app.model.results.empty.Empty]: + ) -> Obbject[openbb_core.app.model.results.empty.Empty]: """Corporate lobbying details.""" inputs = filter_inputs( chart=chart, @@ -133,7 +133,7 @@ class CLASS_stocks_gov(Container): @validate_arguments def qtrcontracts( self, chart: bool = False - ) -> CommandOutput[openbb_core.app.model.results.empty.Empty]: + ) -> Obbject[openbb_core.app.model.results.empty.Empty]: """Quarterly government contracts analysis.""" inputs = filter_inputs( chart=chart, @@ -150,7 +150,7 @@ class CLASS_stocks_gov(Container): @validate_arguments def topbuys( self, chart: bool = False - ) -> CommandOutput[openbb_core.app.model.results.empty.Empty]: + ) -> Obbject[openbb_core.app.model.results.empty.Empty]: """Show most purchased stocks.""" inputs = filter_inputs( chart=chart, @@ -167,7 +167,7 @@ class CLASS_stocks_gov(Container): @validate_arguments def toplobbying( self, chart: bool = False - ) -> CommandOutput[openbb_core.app.model.results.empty.Empty]: + ) -> Obbject[openbb_core.app.model.results.empty.Empty]: """Top corporate lobbying tickers.""" inputs = filter_inputs( chart=chart, @@ -184,7 +184,7 @@ class CLASS_stocks_gov(Container): @validate_arguments def topsells( self, chart: bool = False - ) -> CommandOutput[openbb_core.app.model.results.empty.Empty]: + ) -> Obbject[openbb_core.app.model.results.empty.Empty]: """Show most sold stocks.""" inputs = filter_inputs( chart=chart, diff --git a/openbb_sdk/sdk/core/openbb_core/app/static/package/stocks_ins.py b/openbb_sdk/sdk/core/openbb_core/app/static/package/stocks_ins.py index 7626488acd4..07ad1e47983 100644 --- a/openbb_sdk/sdk/core/openbb_core/app/static/package/stocks_ins.py +++ b/openbb_sdk/sdk/core/openbb_core/app/static/package/stocks_ins.py @@ -4,7 +4,7 @@ from pydantic import validate_arguments import openbb_core.app.model.results.empty -from openbb_core.app.model.command_output import CommandOutput +from openbb_core.app.model.obbject import Obbject from openbb_core.app.static.container import Container from openbb_core.app.static.filters import filter_call, filter_inputs, filter_output @@ -14,7 +14,7 @@ class CLASS_stocks_ins(Container): @validate_arguments def act( self, chart: bool = False - ) -> CommandOutput[openbb_core.app.model.results.empty.Empty]: + ) -> Obbject[openbb_core.app.model.results.empty.Empty]: """Insider activity over time.""" inputs = filter_inputs( chart=chart, @@ -31,7 +31,7 @@ class CLASS_stocks_ins(Container): @validate_arguments def blcp( self, chart: bool = False - ) -> CommandOutput[openbb_core.app.model.results.empty.Empty]: + ) -> Obbject[openbb_core.app.model.results.empty.Empty]: """Big latest CEO/CFO purchaces ($25k+).""" inputs = filter_inputs( chart=chart, @@ -48,7 +48,7 @@ class CLASS_stocks_ins(Container): @validate_arguments def blcs( self, chart: bool = False - ) -> CommandOutput[openbb_core.app.model.results.empty.Empty]: + ) -> Obbject[openbb_core.app.model.results.empty.Empty]: """Big latest CEO/CFO sales ($100k+).""" inputs = filter_inputs( chart=chart, @@ -65,7 +65,7 @@ class CLASS_stocks_ins(Container): @validate_arguments def blip( self, chart: bool = False - ) -> CommandOutput[openbb_core.app.model.results.empty.Empty]: + ) -> Obbject[openbb_core.app.model.results.empty.Empty]: """Big latest insider purchaces ($25+).""" inputs = filter_inputs( chart=chart, @@ -82,7 +82,7 @@ class CLASS_stocks_ins(Container): @validate_arguments def blis( self, chart: bool = False - ) -> CommandOutput[openbb_core.app.model.results.empty.Empty]: + ) -> Obbject[openbb_core.app.model.results.empty.Empty]: """Big latest insider sales ($100k+).""" inputs = filter_inputs( chart=chart, @@ -99,7 +99,7 @@ class CLASS_stocks_ins(Container): @validate_arguments def blop( self, chart: bool = False - ) -> CommandOutput[openbb_core.app.model.results.empty.Empty]: + ) -> Obbject[openbb_core.app.model.results.empty.Empty]: """Big latest officer purchaces ($25k+).""" inputs = filter_inputs( chart=chart, @@ -116,7 +116,7 @@ class CLASS_stocks_ins(Container): @validate_arguments def blos( self, chart: bool = False - ) -> CommandOutput[openbb_core.app.model.results.empty.Empty]: + ) -> Obbject[openbb_core.app.model.results.empty.Empty]: """Big latest officer sales ($100k+).""" inputs = filter_inputs( chart=chart, @@ -133,7 +133,7 @@ class CLASS_stocks_ins(Container): @validate_arguments def filt( self, chart: bool = False - ) -> CommandOutput[openbb_core.app.model.results.empty.Empty]: + ) -> Obbject[openbb_core.app.model.results.empty.Empty]: """Filter insiders based on preset.""" inputs = filter_inputs( chart=chart, @@ -150,7 +150,7 @@ class CLASS_stocks_ins(Container): @validate_arguments def lcb( self, chart: bool = False - ) -> CommandOutput[openbb_core.app.model.results.empty.Empty]: + ) -> Obbject[openbb_core.app.model.results.empty.Empty]: """Latest cluster buys.""" inputs = filter_inputs( chart=chart, @@ -167,7 +167,7 @@ class CLASS_stocks_ins(Container): @validate_arguments def lins( self, chart: bool = False - ) -> CommandOutput[openbb_core.app.model.results.empty.Empty]: + ) -> Obbject[openbb_core.app.model.results.empty.Empty]: """Last insider trading of the company.""" inputs = filter_inputs( chart=chart, @@ -184,7 +184,7 @@ class CLASS_stocks_ins(Container): @validate_arguments def lip( self, chart: bool = False - ) -> CommandOutput[openbb_core.app.model.results.empty.Empty]: + ) -> Obbject[openbb_core.app.model.results.empty.Empty]: """Latest insider purchaces.""" inputs = filter_inputs( chart=chart, @@ -201,7 +201,7 @@ class CLASS_stocks_ins(Container): @validate_arguments def lis( self, chart: bool = False - ) -> CommandOutput[openbb_core.app.model.results.empty.Empty]: + ) -> Obbject[openbb_core.app.model.results.empty.Empty]: """Latest insider sales.""" inputs = filter_inputs( chart=chart, @@ -218,7 +218,7 @@ class CLASS_stocks_ins(Container): @validate_arguments def lit( self, chart: bool = False - ) -> CommandOutput[openbb_core.app.model.results.empty.Empty]: + ) -> Obbject[openbb_core.app.model.results.empty.Empty]: """Latest insider trading (all filings).""" inputs = filter_inputs( chart=chart, @@ -235,7 +235,7 @@ class CLASS_stocks_ins(Container): @validate_arguments def lpsb( self, chart: bool = False - ) -> CommandOutput[openbb_core.app.model.results.empty.Empty]: + ) -> Obbject[openbb_core.app.model.results.empty.Empty]: """Latest penny stock buys.""" inputs = filter_inputs( chart=chart, @@ -252,7 +252,7 @@ class CLASS_stocks_ins(Container): @validate_arguments def print_insider_data( self, chart: bool = False - ) -> CommandOutput[openbb_core.app.model.results.empty.Empty]: + ) -> Obbject[openbb_core.app.model.results.empty.Empty]: """Print insider data.""" inputs = filter_inputs( chart=chart, @@ -269,7 +269,7 @@ class CLASS_stocks_ins(Container): @validate_arguments def stats( self, chart: bool = False - ) -> CommandOutput[openbb_core.app.model.results.empty.Empty]: + ) -> Obbject[openbb_core.app.model.results.empty.Empty]: """Insider stats of the company.""" inputs = filter_inputs( chart=chart, diff --git a/openbb_sdk/sdk/core/openbb_core/app/static/package/stocks_options.py b/openbb_sdk/sdk/core/openbb_core/app/static/package/stocks_options.py index 3af5f2e87e8..bc3cbb6c59d 100644 --- a/openbb_sdk/sdk/core/openbb_core/app/static/package/stocks_options.py +++ b/openbb_sdk/sdk/core/openbb_core/app/static/package/stocks_options.py @@ -4,7 +4,7 @@ from pydantic import validate_arguments import openbb_core.app.model.results.empty -from openbb_core.app.model.command_output import CommandOutput +from openbb_core.app.model.obbject import Obbject from openbb_core.app.static.container import Container from openbb_core.app.static.filters import filter_call, filter_inputs, filter_output @@ -14,7 +14,7 @@ class CLASS_stocks_options(Container): @validate_arguments def chains( self, chart: bool = False - ) -> CommandOutput[openbb_core.app.model.results.empty.Empty]: + ) -> Obbject[openbb_core.app.model.results.empty.Empty]: """Return options chains with greeks.""" inputs = filter_inputs( chart=chart, @@ -31,7 +31,7 @@ class CLASS_stocks_options(Container): @validate_arguments def dte( self, chart: bool = False - ) -> CommandOutput[openbb_core.app.model.results.empty.Empty]: + ) -> Obbject[openbb_core.app.model.results.empty.Empty]: inputs = filter_inputs( chart=chart, ) @@ -47,7 +47,7 @@ class CLASS_stocks_options(Container): @validate_arguments def eodchain( self, chart: bool = False - ) -> CommandOutput[openbb_core.app.model.results.empty.Empty]: + ) -> Obbject[openbb_core.app.model.results.empty.Empty]: """Gets option chain at a specific date.""" inputs = filter_inputs( chart=chart, @@ -64,7 +64,7 @@ class CLASS_stocks_options(Container): @validate_arguments def expirations( self, chart: bool = False - ) -> CommandOutput[openbb_core.app.model.results.empty.Empty]: + ) -> Obbject[openbb_core.app.model.results.empty.Empty]: """Return options expirations.""" inputs = filter_inputs( chart=chart, @@ -81,7 +81,7 @@ class CLASS_stocks_options(Container): @validate_arguments def grhist( self, chart: bool = False - ) -> CommandOutput[openbb_core.app.model.results.empty.Empty]: + ) -> Obbject[openbb_core.app.model.results.empty.Empty]: """Plot option greek history.""" inputs = filter_inputs( chart=chart, @@ -98,7 +98,7 @@ class CLASS_stocks_options(Container): @validate_arguments def hist( self, chart: bool = False - ) -> CommandOutput[openbb_core.app.model.results.empty.Empty]: + ) -> Obbject[openbb_core.app.model.results.empty.Empty]: """Plot option history.""" inputs = filter_inputs( chart=chart, @@ -115,7 +115,7 @@ class CLASS_stocks_options(Container): @validate_arguments def info( self, chart: bool = False - ) -> CommandOutput[openbb_core.app.model.results.empty.Empty]: + ) -> Obbject[openbb_core.app.model.results.empty.Empty]: """Display option information (volatility, IV rank, etc.).""" inputs = filter_inputs( chart=chart, @@ -132,7 +132,7 @@ class CLASS_stocks_options(Container): @validate_arguments def last_price( self, chart: bool = False - ) -> CommandOutput[openbb_core.app.model.results.empty.Empty]: + ) -> Obbject[openbb_core.app.model.results.empty.Empty]: """Return last price of an option.""" inputs = filter_inputs( chart=chart, @@ -149,7 +149,7 @@ class CLASS_stocks_options(Container): @validate_arguments def oi( self, chart: bool = False - ) -> CommandOutput[openbb_core.app.model.results.empty.Empty]: + ) -> Obbject[openbb_core.app.model.results.empty.Empty]: """Plot option open interest.""" inputs = filter_inputs( chart=chart, @@ -166,7 +166,7 @@ class CLASS_stocks_options(Container): @validate_arguments def pcr( self, chart: bool = False - ) -> CommandOutput[openbb_core.app.model.results.empty.Empty]: + ) -> Obbject[openbb_core.app.model.results.empty.Empty]: """Display put/call ratio for ticker.""" inputs = filter_inputs( chart=chart, @@ -183,7 +183,7 @@ class CLASS_stocks_options(Container): @validate_arguments def price( self, chart: bool = False - ) -> CommandOutput[openbb_core.app.model.results.empty.Empty]: + ) -> Obbject[openbb_core.app.model.results.empty.Empty]: inputs = filter_inputs( chart=chart, ) @@ -199,7 +199,7 @@ class CLASS_stocks_options(Container): @validate_arguments def unu( self, chart: bool = False - ) -> CommandOutput[openbb_core.app.model.results.empty.Empty]: + ) -> Obbject[openbb_core.app.model.results.empty.Empty]: """Show unusual options activity.""" inputs = filter_inputs( chart=chart, @@ -216,7 +216,7 @@ class CLASS_stocks_options(Container): @validate_arguments def voi( self, chart: bool = False - ) -> CommandOutput[openbb_core.app.model.results.empty.Empty]: + ) -> Obbject[openbb_core.app.model.results.empty.Empty]: """Plot volume and open interest.""" inputs = filter_inputs( chart=chart, @@ -233,7 +233,7 @@ class CLASS_stocks_options(Container): @validate_arguments def vol( self, chart: bool = False - ) -> CommandOutput[openbb_core.app.model.results.empty.Empty]: + ) -> Obbject[openbb_core.app.model.results.empty.Empty]: """Plot volume.""" inputs = filter_inputs( chart=chart, @@ -250,7 +250,7 @@ class CLASS_stocks_options(Container): @validate_arguments def vsurf( self, chart: bool = False - ) -> CommandOutput[openbb_core.app.model.results.empty.Empty]: + ) -> Obbject[openbb_core.app.model.results.empty.Empty]: """Show 3D volatility surface.""" inputs = filter_inputs( chart=chart, diff --git a/openbb_sdk/sdk/core/openbb_core/app/static/package/ta.py b/openbb_sdk/sdk/core/openbb_core/app/static/package/ta.py index 1e82589462e..efdde43592a 100644 --- a/openbb_sdk/sdk/core/openbb_core/app/static/package/ta.py +++ b/openbb_sdk/sdk/core/openbb_core/app/static/package/ta.py @@ -10,7 +10,7 @@ import pydantic.types from pydantic import validate_arguments import openbb_core.app.model.results.empty -from openbb_core.app.model.command_output import CommandOutput +from openbb_core.app.model.obbject import Obbject from openbb_core.app.static.container import Container from openbb_core.app.static.filters import filter_call, filter_inputs, filter_output @@ -27,7 +27,7 @@ class CLASS_ta(Container): drift: pydantic.types.NonNegativeInt = 1, offset: int = 0, chart: bool = False, - ) -> CommandOutput[typing.List]: + ) -> Obbject[typing.List]: """ Average True Range is used to measure volatility, especially volatility caused by gaps or limit moves. @@ -49,7 +49,7 @@ class CLASS_ta(Container): Returns ------- - CommandOutput[List[Data]] + Obbject[List[Data]] List of data with the indicator applied. Examples @@ -86,7 +86,7 @@ class CLASS_ta(Container): start_date: Optional[str] = None, end_date: Optional[str] = None, chart: bool = False, - ) -> CommandOutput[typing.List]: + ) -> Obbject[typing.List]: """ Fibonacci Retracement Levels. @@ -101,7 +101,7 @@ class CLASS_ta(Container): Returns ------- - CommandOutput[List[Data]] + Obbject[List[Data]] List of data with the indicator applied. Examples @@ -135,7 +135,7 @@ class CLASS_ta(Container): index: str = "date", offset: int = 0, chart: bool = False, - ) -> CommandOutput[typing.List]: + ) -> Obbject[typing.List]: """ The On Balance Volume (OBV) is a cumulative total of the up and down volume. When the close is higher than the previous close, the volume is added @@ -158,7 +158,7 @@ class CLASS_ta(Container): Returns ------- - CommandOutput[List[Data]] + Obbject[List[Data]] List of data with the indicator applied. Examples @@ -190,7 +190,7 @@ class CLASS_ta(Container): length: pydantic.types.PositiveInt = 14, signal: pydantic.types.PositiveInt = 1, chart: bool = False, - ) -> CommandOutput[typing.List]: + ) -> Obbject[typing.List]: """ The Fisher Transform is a technical indicator created by John F. Ehlers that converts prices into a Gaussian normal distribution.1 The indicator @@ -211,7 +211,7 @@ class CLASS_ta(Container): Returns ------- - CommandOutput[List[Data]] + Obbject[List[Data]] List of data with the indicator applied. Examples @@ -245,7 +245,7 @@ class CLASS_ta(Container): slow: pydantic.types.PositiveInt = 10, offset: int = 0, chart: bool = False, - ) -> CommandOutput[typing.List]: + ) -> Obbject[typing.List]: """ Accumulation/Distribution Oscillator, also known as the Chaikin Oscillator is essentially a momentum indicator, but of the Accumulation-Distribution line @@ -268,7 +268,7 @@ class CLASS_ta(Container): Returns ------- - CommandOutput[List[Data]] + Obbject[List[Data]] Examples -------- @@ -296,7 +296,7 @@ class CLASS_ta(Container): @validate_arguments def tv( self, chart: bool = False - ) -> CommandOutput[openbb_core.app.model.results.empty.Empty]: + ) -> Obbject[openbb_core.app.model.results.empty.Empty]: """TradingView.""" inputs = filter_inputs( chart=chart, @@ -321,7 +321,7 @@ class CLASS_ta(Container): mamode: Literal["sma", "ema", "wma", "rma"] = "sma", offset: int = 0, chart: bool = False, - ) -> CommandOutput[typing.List]: + ) -> Obbject[typing.List]: """ Bollinger Bands consist of three lines. The middle band is a simple moving average (generally 20 periods) of the typical price (TP). The upper and lower @@ -355,7 +355,7 @@ class CLASS_ta(Container): Returns ------- - CommandOutput[List[Data]] + Obbject[List[Data]] The calculated data. Examples @@ -388,7 +388,7 @@ class CLASS_ta(Container): @validate_arguments def multi( self, chart: bool = False - ) -> CommandOutput[openbb_core.app.model.results.empty.Empty]: + ) -> Obbject[openbb_core.app.model.results.empty.Empty]: """Plot multiple indicators on the same chart.""" inputs = filter_inputs( chart=chart, @@ -411,7 +411,7 @@ class CLASS_ta(Container): length: int = 50, offset: int = 0, chart: bool = False, - ) -> CommandOutput[typing.List]: + ) -> Obbject[typing.List]: """ The zero lag exponential moving average (ZLEMA) indicator was created by John Ehlers and Ric Way. The idea is do a @@ -436,7 +436,7 @@ class CLASS_ta(Container): Returns ------- - CommandOutput[List[Data]] + Obbject[List[Data]] The calculated data. Examples @@ -470,7 +470,7 @@ class CLASS_ta(Container): length: int = 25, scalar: int = 100, chart: bool = False, - ) -> CommandOutput[typing.List]: + ) -> Obbject[typing.List]: """ The word aroon is Sanskrit for "dawn's early light." The Aroon indicator attempts to show when a new trend is dawning. The indicator consists @@ -498,7 +498,7 @@ class CLASS_ta(Container): Returns ------- - CommandOutput[List[Data]] + Obbject[List[Data]] The calculated data. Examples @@ -532,7 +532,7 @@ class CLASS_ta(Container): length: int = 50, offset: int = 0, chart: bool = False, - ) -> CommandOutput[typing.List]: + ) -> Obbject[typing.List]: """ Moving Averages are used to smooth the data in an array to help eliminate noise and identify trends. The Simple Moving Average is literally @@ -557,7 +557,7 @@ class CLASS_ta(Container): Returns ------- - CommandOutput[List[Data]] + Obbject[List[Data]] The calculated data. Examples @@ -593,7 +593,7 @@ class CLASS_ta(Container): asint: bool = False, offset: int = 0, chart: bool = False, - ) -> CommandOutput[typing.List]: + ) -> Obbject[typing.List]: """ Demark sequential indicator @@ -614,7 +614,7 @@ class CLASS_ta(Container): Returns ------- - CommandOutput[List[Data]] + Obbject[List[Data]] The calculated data. Examples @@ -649,7 +649,7 @@ class CLASS_ta(Container): anchor: str = "D", offset: int = 0, chart: bool = False, - ) -> CommandOutput[typing.List]: + ) -> Obbject[typing.List]: """ The Volume Weighted Average Price that measures the average typical price by volume. It is typically used with intraday charts to identify general direction. @@ -669,7 +669,7 @@ class CLASS_ta(Container): Returns ------- - CommandOutput[List[Data]] + Obbject[List[Data]] The calculated data. Examples @@ -697,7 +697,7 @@ class CLASS_ta(Container): @validate_arguments def recom( self, chart: bool = False - ) -> CommandOutput[openbb_core.app.model.results.empty.Empty]: + ) -> Obbject[openbb_core.app.model.results.empty.Empty]: """Recommendation.""" inputs = filter_inputs( chart=chart, @@ -721,7 +721,7 @@ class CLASS_ta(Container): slow: int = 26, signal: int = 9, chart: bool = False, - ) -> CommandOutput[typing.List]: + ) -> Obbject[typing.List]: """ The Moving Average Convergence Divergence (MACD) is the difference between two Exponential Moving Averages. The Signal line is an Exponential Moving @@ -750,7 +750,7 @@ class CLASS_ta(Container): Returns ------- - CommandOutput[List[Data]] + Obbject[List[Data]] The calculated data. Examples @@ -786,7 +786,7 @@ class CLASS_ta(Container): length: int = 50, offset: int = 0, chart: bool = False, - ) -> CommandOutput[typing.List]: + ) -> Obbject[typing.List]: """ The Hull Moving Average solves the age old dilemma of making a moving average more responsive to current price activity whilst maintaining curve smoothness. @@ -808,7 +808,7 @@ class CLASS_ta(Container): Returns ------- - CommandOutput[List[Data]] + Obbject[List[Data]] The calculated data. Examples @@ -843,7 +843,7 @@ class CLASS_ta(Container): upper_length: pydantic.types.PositiveInt = 20, offset: int = 0, chart: bool = False, - ) -> CommandOutput[typing.List]: + ) -> Obbject[typing.List]: """ Donchian Channels are three lines generated by moving average calculations that comprise an indicator formed by upper and lower @@ -867,7 +867,7 @@ class CLASS_ta(Container): Returns ------- - CommandOutput[List[Data]] + Obbject[List[Data]] The calculated data. Examples @@ -904,7 +904,7 @@ class CLASS_ta(Container): offset: pydantic.types.PositiveInt = 26, lookahead: bool = False, chart: bool = False, - ) -> CommandOutput[typing.List]: + ) -> Obbject[typing.List]: """ The Ichimoku Cloud, also known as Ichimoku Kinko Hyo, is a versatile indicator that defines support and resistance, identifies trend direction, gauges momentum and provides @@ -955,7 +955,7 @@ class CLASS_ta(Container): target: str = "adj_close", period: pydantic.types.PositiveInt = 90, chart: bool = False, - ) -> CommandOutput[typing.List]: + ) -> Obbject[typing.List]: """ Clenow Volatility Adjusted Momentum. @@ -972,7 +972,7 @@ class CLASS_ta(Container): Returns ------- - CommandOutput[List[Data]] + Obbject[List[Data]] The calculated data. Examples @@ -1004,7 +1004,7 @@ class CLASS_ta(Container): index: str = "date", offset: int = 0, chart: bool = False, - ) -> CommandOutput[typing.List]: + ) -> Obbject[typing.List]: """ The Accumulation/Distribution Line is similar to the On Balance Volume (OBV), which sums the volume times +1/-1 based on whether the close is @@ -1030,7 +1030,7 @@ class CLASS_ta(Container): Returns ------- - CommandOutput[List[Data]] + Obbject[List[Data]] Examples -------- @@ -1062,7 +1062,7 @@ class CLASS_ta(Container): scalar: float = 100.0, drift: int = 1, chart: bool = False, - ) -> CommandOutput[typing.List]: + ) -> Obbject[typing.List]: """ The ADX is a Welles Wilder style moving average of the Directional Movement Index (DX). The values range from 0 to 100, but rarely get above 60. To interpret the ADX, consider @@ -1083,7 +1083,7 @@ class CLASS_ta(Container): Returns ------- - CommandOutput[List[Data]] + Obbject[List[Data]] The calculated data. Examples @@ -1118,7 +1118,7 @@ class CLASS_ta(Container): length: int = 50, offset: int = 0, chart: bool = False, - ) -> CommandOutput[typing.List]: + ) -> Obbject[typing.List]: """ A Weighted Moving Average puts more weight on recent data and less on past data. This is done by multiplying each bar’s price by a weighting factor. Because of its @@ -1140,7 +1140,7 @@ class CLASS_ta(Container): Returns ------- - CommandOutput[List[Data]] + Obbject[List[Data]] The WMA data. Examples @@ -1174,7 +1174,7 @@ class CLASS_ta(Container): length: pydantic.types.PositiveInt = 14, scalar: pydantic.types.PositiveFloat = 0.015, chart: bool = False, - ) -> CommandOutput[typing.List]: + ) -> Obbject[typing.List]: """ The CCI is designed to detect beginning and ending market trends. The range of 100 to -100 is the normal trading range. CCI values outside of this @@ -1195,7 +1195,7 @@ class CLASS_ta(Container): Returns ------- - CommandOutput[List[Data]] + Obbject[List[Data]] The CCI data. """ inputs = filter_inputs( @@ -1224,7 +1224,7 @@ class CLASS_ta(Container): scalar: float = 100.0, drift: int = 1, chart: bool = False, - ) -> CommandOutput[typing.List]: + ) -> Obbject[typing.List]: """ The Relative Strength Index (RSI) calculates a ratio of the recent upward price movements to the absolute price movement. The RSI ranges @@ -1249,7 +1249,7 @@ class CLASS_ta(Container): Returns ------- - CommandOutput[List[Data]] + Obbject[List[Data]] The RSI data. Examples @@ -1279,7 +1279,7 @@ class CLASS_ta(Container): @validate_arguments def summary( self, chart: bool = False - ) -> CommandOutput[openbb_core.app.model.results.empty.Empty]: + ) -> Obbject[openbb_core.app.model.results.empty.Empty]: """Summary.""" inputs = filter_inputs( chart=chart, @@ -1302,7 +1302,7 @@ class CLASS_ta(Container): slow_d_period: pydantic.types.NonNegativeInt = 3, slow_k_period: pydantic.types.NonNegativeInt = 3, chart: bool = False, - ) -> CommandOutput[typing.List]: + ) -> Obbject[typing.List]: """ The Stochastic Oscillator measures where the close is in relation to the recent trading range. The values range from zero to 100. %D values over 75 @@ -1326,7 +1326,7 @@ class CLASS_ta(Container): Returns ------- - CommandOutput[List[Data]] + Obbject[List[Data]] The Stochastic Oscillator data. Examples @@ -1355,7 +1355,7 @@ class CLASS_ta(Container): @validate_arguments def rsp( self, chart: bool = False - ) -> CommandOutput[openbb_core.app.model.results.empty.Empty]: + ) -> Obbject[openbb_core.app.model.results.empty.Empty]: """Relative Strength Performance.""" inputs = filter_inputs( chart=chart, @@ -1379,7 +1379,7 @@ class CLASS_ta(Container): mamode: Literal["ema", "sma", "wma", "hma", "zlma"] = "ema", offset: pydantic.types.NonNegativeInt = 0, chart: bool = False, - ) -> CommandOutput[typing.List]: + ) -> Obbject[typing.List]: """ Keltner Channels are volatility-based bands that are placed on either side of an asset's price and can aid in determining @@ -1404,7 +1404,7 @@ class CLASS_ta(Container): Returns ------- - CommandOutput[List[Data]] + Obbject[List[Data]] The Keltner Channels data. Examples @@ -1438,7 +1438,7 @@ class CLASS_ta(Container): index: str = "date", length: pydantic.types.PositiveInt = 14, chart: bool = False, - ) -> CommandOutput[typing.List]: + ) -> Obbject[typing.List]: """ The Center of Gravity indicator, in short, is used to anticipate future price movements and to trade on price reversals as soon as they happen. However, just like other oscillators, @@ -1457,7 +1457,7 @@ class CLASS_ta(Container): Returns ------- - CommandOutput[List[Data]] + Obbject[List[Data]] The COG data. Examples @@ -1498,7 +1498,7 @@ class CLASS_ta(Container): ] = "STD", is_crypto: bool = False, chart: bool = False, - ) -> CommandOutput[typing.List]: + ) -> Obbject[typing.List]: """Calculate the realized volatility quantiles over rolling windows of time. The model for calculating volatility is selectable. @@ -1540,7 +1540,7 @@ class CLASS_ta(Container): Returns ------- - CommandOutput[List[Data]] + Obbject[List[Data]] The cones data. Examples @@ -1576,7 +1576,7 @@ class CLASS_ta(Container): length: int = 50, offset: int = 0, chart: bool = False, - ) -> CommandOutput[typing.List]: + ) -> Obbject[typing.List]: """ The Exponential Moving Average is a staple of technical analysis and is used in countless technical indicators. In a Simple Moving @@ -1602,7 +1602,7 @@ class CLASS_ta(Container): Returns ------- - CommandOutput[List[Data]] + Obbject[List[Data]] The calculated data. Examples diff --git a/openbb_sdk/sdk/core/openbb_core/app/static/package_builder.py b/openbb_sdk/sdk/core/openbb_core/app/static/package_builder.py index bd32af3258a..d4baa02c884 100644 --- a/openbb_sdk/sdk/core/openbb_core/app/static/package_builder.py +++ b/openbb_sdk/sdk/core/openbb_core/app/static/package_builder.py @@ -179,7 +179,7 @@ class ImportDefinition: """Build the import definition.""" hint_type_list = cls.get_path_hint_type_list(path=path) code = "\nfrom openbb_core.app.static.container import Container" - code += "\nfrom openbb_core.app.model.command_output import CommandOutput" + code += "\nfrom openbb_core.app.model.obbject import Obbject" code += ( "\nfrom openbb_core.app.model.custom_parameter import OpenBBCustomParameter" ) @@ -242,12 +242,12 @@ class DocstringGenerator: """Dynamically generate docstrings for the commands.""" @staticmethod - def get_command_output_description() -> str: + def get_obbject_description() -> str: """Get the command output description.""" - command_output_description = ( + obbject_description = ( "\nReturns\n" "-------\n" - "CommandOutput\n" + "Obbject\n" " results: List[Data]\n" " Serializable results.\n" " provider: Optional[PROVIDERS]\n" @@ -260,7 +260,7 @@ class DocstringGenerator: " Chart object.\n" ) - return command_output_description + return obbject_description @staticmethod def get_available_providers(query_mapping: dict) -> str: @@ -326,7 +326,7 @@ class DocstringGenerator: section_docstring += f"{padding}{field_description}\n" if provider == "openbb" and section_name == "QueryParams": - section_docstring += cls.get_command_output_description() + section_docstring += cls.get_obbject_description() return section_docstring @@ -582,20 +582,18 @@ class MethodDefinition: else: item_type = get_args(get_type_hints(return_type)["results"])[0] if item_type.__module__ == "builtins": - func_returns = f"CommandOutput[{item_type.__name__}]" + func_returns = f"Obbject[{item_type.__name__}]" # elif get_origin(item_type) == list: # inner_type = get_args(item_type)[0] # select = f"[{inner_type.__module__}.{inner_type.__name__}]" - # func_returns = f"CommandOutput[{item_type.__module__}.{item_type.__name__}[{select}]]" + # func_returns = f"Obbject[{item_type.__module__}.{item_type.__name__}[{select}]]" else: inner_type_name = ( item_type.__name__ if hasattr(item_type, "__name__") else item_type._name ) - func_returns = ( - f"CommandOutput[{item_type.__module__}.{inner_type_name}]" - ) + func_returns = f"Obbject[{item_type.__module__}.{inner_type_name}]" return func_returns diff --git a/openbb_sdk/sdk/core/tests/app/logs/test_logging_manager.py b/openbb_sdk/sdk/core/tests/app/logs/test_logging_manager.py index b409b3489aa..35c6d2c6019 100644 --- a/openbb_sdk/sdk/core/tests/app/logs/test_logging_manager.py +++ b/openbb_sdk/sdk/core/tests/app/logs/test_logging_manager.py @@ -13,7 +13,7 @@ class MockLoggingSettings: self.user_settings = user_settings -class MockCommandOutput(BaseModel): +class MockObbject(BaseModel): output: Optional[str] error: Optional[str] @@ -103,12 +103,12 @@ def test_log_startup(logging_manager): @pytest.mark.parametrize( - "user_settings, system_settings, command_output, route, func, kwargs", + "user_settings, system_settings, obbject, route, func, kwargs", [ ( "mock_settings", "mock_system", - MockCommandOutput(output="mock_output"), + MockObbject(output="mock_output"), "mock_route", "mock_func", {}, @@ -116,7 +116,7 @@ def test_log_startup(logging_manager): ( "mock_settings", "mock_system", - MockCommandOutput(error="mock_error"), + MockObbject(error="mock_error"), "mock_route", "mock_func", {}, @@ -124,7 +124,7 @@ def test_log_startup(logging_manager): ( "mock_settings", "mock_system", - MockCommandOutput(error="mock_error"), + MockObbject(error="mock_error"), "login", "mock_func", {}, @@ -132,7 +132,7 @@ def test_log_startup(logging_manager): ], ) def test_log( - logging_manager, user_settings, system_settings, command_output, route, func, kwargs + logging_manager, user_settings, system_settings, obbject, route, func, kwargs ): with patch( "openbb_core.app.logs.logging_manager.LoggingSettings", @@ -145,7 +145,7 @@ def test_log( logging_manager.log( user_settings=user_settings, system_settings=system_settings, - command_output=command_output, + obbject=obbject, route=route, func=func, kwargs=kwargs, @@ -162,7 +162,7 @@ def test_log( logging_manager.log( user_settings=user_settings, system_settings=system_settings, - command_output=command_output, + obbject=obbject, route=route, func=mock_callable, kwargs=kwargs, @@ -171,10 +171,10 @@ def test_log( expected_log_data = { "route": route, "input": kwargs, - "error": command_output.error, + "error": obbject.error, } - if command_output.error: + if obbject.error: mock_error.assert_called_once_with( "ERROR: %s", json.dumps(expected_log_data), diff --git a/openbb_sdk/sdk/core/tests/app/model/test_command_output.py b/openbb_sdk/sdk/core/tests/app/model/test_obbject.py similarity index 89% rename from openbb_sdk/sdk/core/tests/app/model/test_command_output.py rename to openbb_sdk/sdk/core/tests/app/model/test_obbject.py index 82a9ea57322..3cb1252d0e5 100644 --- a/openbb_sdk/sdk/core/tests/app/model/test_command_output.py +++ b/openbb_sdk/sdk/core/tests/app/model/test_obbject.py @@ -2,16 +2,16 @@ from unittest.mock import MagicMock, patch import pandas as pd import pytest -from openbb_core.app.model.command_output import Chart, CommandOutput, OpenBBError +from openbb_core.app.model.command_output import Chart, Obbject, OpenBBError def test_command_output(): - co = CommandOutput() - assert isinstance(co, CommandOutput) + co = Obbject() + assert isinstance(co, Obbject) def test_fields(): - fields = CommandOutput.__fields__.keys() + fields = Obbject.__fields__.keys() assert "results" in fields assert "provider" in fields @@ -21,7 +21,7 @@ def test_fields(): def test_to_dataframe_no_results(): - co = CommandOutput() + co = Obbject() with pytest.raises(Exception): co.to_dataframe() @@ -50,7 +50,7 @@ def test_to_dataframe_no_results(): ) def test_to_dataframe(results, expected_df): # Arrange - co = CommandOutput(results=results) + co = Obbject(results=results) # Act and Assert if isinstance(expected_df, pd.DataFrame): @@ -87,7 +87,7 @@ def test_to_dataframe(results, expected_df): ) def test_to_dict(results, expected): # Arrange - co = CommandOutput(results=results) + co = Obbject(results=results) # Act result = co.to_dict() @@ -101,7 +101,7 @@ def test_to_dict(results, expected): @patch("openbb_core.app.model.command_output.Chart") def test_to_plotly_json_with_existing_chart(mock_chart, mock_charting_manager): # Arrange - mock_instance = CommandOutput() + mock_instance = Obbject() mock_instance.chart = Chart(content={"existing_chart_data": "some_data"}) # Act @@ -115,7 +115,7 @@ def test_to_plotly_json_with_existing_chart(mock_chart, mock_charting_manager): mock_chart.assert_not_called() -@patch("openbb_core.app.model.command_output.CommandOutput.to_dataframe") +@patch("openbb_core.app.model.command_output.Obbject.to_dataframe") @patch("openbb_core.app.model.command_output.ChartingManager") @patch("openbb_core.app.model.command_output.Chart") def test_to_plotly_json_with_new_chart( @@ -133,7 +133,7 @@ def test_to_plotly_json_with_new_chart( return pd.DataFrame(data) # Arrange - mock_instance = CommandOutput() + mock_instance = Obbject() mock_charting_manager_instance = mock_charting_manager.return_value mock_charting_manager_instance.to_plotly_json.return_value = { "new_chart_data": "some_data" @@ -161,7 +161,7 @@ def test_to_plotly_json_with_new_chart( def test_show_chart_exists(): - mock_instance = CommandOutput() + mock_instance = Obbject() # Arrange mock_instance.chart = MagicMock(spec=Chart) @@ -173,7 +173,7 @@ def test_show_chart_exists(): def test_show_chart_not_found(): - mock_instance = CommandOutput() + mock_instance = Obbject() # Arrange mock_instance.chart = None diff --git a/openbb_sdk/sdk/core/tests/app/static/test_filters.py b/openbb_sdk/sdk/core/tests/app/static/test_filters.py index 5b014933991..c1bcb6e6dbc 100644 --- a/openbb_sdk/sdk/core/tests/app/static/test_filters.py +++ b/openbb_sdk/sdk/core/tests/app/static/test_filters.py @@ -1,7 +1,7 @@ """Test the filters.py file.""" import pytest -from openbb_core.app.model.command_output import CommandOutput +from openbb_core.app.model.obbject import Obbject from openbb_core.app.static.filters import filter_call, filter_inputs, filter_output from pandas import DataFrame @@ -39,6 +39,6 @@ def test_filter_inputs_df(): def test_filter_output(): """Test filter_output.""" - command_output = filter_output(CommandOutput()) + obbject = filter_output(Obbject()) - assert command_output is not None + assert obbject is not None diff --git a/openbb_sdk/sdk/core/tests/app/test_router.py b/openbb_sdk/sdk/core/tests/app/test_router.py index d09eac2a633..a501a26553b 100644 --- a/openbb_sdk/sdk/core/tests/app/test_router.py +++ b/openbb_sdk/sdk/core/tests/app/test_router.py @@ -5,7 +5,7 @@ import pytest from openbb_core.app.model.command_context import CommandContext -from openbb_core.app.model.command_output import CommandOutput +from openbb_core.app.model.obbject import Obbject from openbb_core.app.provider_interface import ( ExtraParams, ProviderChoices, @@ -105,8 +105,8 @@ def test_check_return_error(command_validator): def test_check_return(command_validator): """Test check_return.""" - def valid_function() -> CommandOutput[int]: - return CommandOutput(results=[1, 2, 3]) + def valid_function() -> Obbject[int]: + return Obbject(results=[1, 2, 3]) assert command_validator.check_return(valid_function) is None @@ -114,8 +114,8 @@ def test_check_return(command_validator): def test_check(command_validator): """Test check.""" - def valid_function() -> CommandOutput[int]: - return CommandOutput(results=[1, 2, 3]) + def valid_function() -> Obbject[int]: + return Obbject(results=[1, 2, 3]) assert command_validator.check(valid_function) is None @@ -135,8 +135,8 @@ def test_command(router): """Test command.""" @router.command - def valid_function() -> CommandOutput[int]: - return CommandOutput(results=[1, 2, 3]) + def valid_function() -> Obbject[int]: + return Obbject(results=[1, 2, 3]) assert valid_function @@ -182,7 +182,7 @@ def test_complete_signature(signature_inspector): provider_choices: ProviderChoices, standard_params: StandardParams, extra_params: ExtraParams, - ) -> CommandOutput: + ) -> Obbject: pass model = "StockEOD" @@ -193,8 +193,8 @@ def test_complete_signature(signature_inspector): def test_complete_signature_error(signature_inspector): """Test complete_signature.""" - def valid_function() -> CommandOutput[int]: - return CommandOutput(results=[1, 2, 3]) + def valid_function() -> Obbject[int]: + return Obbject(results=[1, 2, 3]) with pytest.raises(AttributeError): signature_inspector.complete_signature(valid_function, "invalid_model") @@ -208,7 +208,7 @@ def test_validate_signature(signature_inspector): provider_choices: ProviderChoices, standard_params: StandardParams, extra_params: ExtraParams, - ) -> CommandOutput: + ) -> Obbject: pass expected_signature = { @@ -232,7 +232,7 @@ def test_inject_dependency(signature_inspector): provider_choices: ProviderChoices, standard_params: StandardParams, extra_params: ExtraParams, - ) -> CommandOutput: + ) -> Obbject: pass assert signature_inspector.inject_dependency(sample_function, "cc", CommandContext) diff --git a/openbb_sdk/sdk/core/tests/test_router.py b/openbb_sdk/sdk/core/tests/test_router.py index d09eac2a633..a501a26553b 100644 --- a/openbb_sdk/sdk/core/tests/test_router.py +++ b/openbb_sdk/sdk/core/tests/test_router.py @@ -5,7 +5,7 @@ import pytest from openbb_core.app.model.command_context import CommandContext -from openbb_core.app.model.command_output import CommandOutput +from openbb_core.app.model.obbject import Obbject from openbb_core.app.provider_interface import ( ExtraParams, ProviderChoices, @@ -105,8 +105,8 @@ def test_check_return_error(command_validator): def test_check_return(command_validator): """Test check_return.""" - def valid_function() -> CommandOutput[int]: - return CommandOutput(results=[1, 2, 3]) + def valid_function() -> Obbject[int]: + return Obbject(results=[1, 2, 3]) assert command_validator.check_return(valid_function) is None @@ -114,8 +114,8 @@ def test_check_return(command_validator): def test_check(command_validator): """Test check.""" - def valid_function() -> CommandOutput[int]: - return CommandOutput(results=[1, 2, 3]) + def valid_function() -> Obbject[int]: + return Obbject(results=[1, 2, 3]) assert command_validator.check(valid_function) is None @@ -135,8 +135,8 @@ def test_command(router): """Test command.""" @router.command - def valid_function() -> CommandOutput[int]: - return CommandOutput(results=[1, 2, 3]) + def valid_function() -> Obbject[int]: + return Obbject(results=[1, 2, 3]) assert valid_function @@ -182,7 +182,7 @@ def test_complete_signature(signature_inspector): provider_choices: ProviderChoices, standard_params: StandardParams, extra_params: ExtraParams, - ) -> CommandOutput: + ) -> Obbject: pass model = "StockEOD" @@ -193,8 +193,8 @@ def test_complete_signature(signature_inspector): def test_complete_signature_error(signature_inspector): """Test complete_signature.""" - def valid_function() -> CommandOutput[int]: - return CommandOutput(results=[1, 2, 3]) + def valid_function() -> Obbject[int]: + return Obbject(results=[1, 2, 3]) with pytest.raises(AttributeError): signature_inspector.complete_signature(valid_function, "invalid_model") @@ -208,7 +208,7 @@ def test_validate_signature(signature_inspector): provider_choices: ProviderChoices, standard_params: StandardParams, extra_params: ExtraParams, - ) -> CommandOutput: + ) -> Obbject: pass expected_signature = { @@ -232,7 +232,7 @@ def test_inject_dependency(signature_inspector): provider_choices: ProviderChoices, standard_params: StandardParams, extra_params: ExtraParams, - ) -> CommandOutput: + ) -> Obbject: pass assert signature_inspector.inject_dependency(sample_function, "cc", CommandContext)