diff --git a/openbb_sdk/extensions/charting/openbb_charting/__init__.py b/openbb_sdk/extensions/charting/openbb_charting/__init__.py index 9d60f0e2e6f..494d7d40b75 100644 --- a/openbb_sdk/extensions/charting/openbb_charting/__init__.py +++ b/openbb_sdk/extensions/charting/openbb_charting/__init__.py @@ -3,4 +3,4 @@ from openbb_charting.core.backend import ( create_backend, get_backend, ) -from openbb_charting.core.to_plotly_json import to_plotly_json +from openbb_charting.core.to_chart import to_chart diff --git a/openbb_sdk/extensions/charting/openbb_charting/builder.py b/openbb_sdk/extensions/charting/openbb_charting/builder.py index 75b5710f8bc..90351e6bd5d 100644 --- a/openbb_sdk/extensions/charting/openbb_charting/builder.py +++ b/openbb_sdk/extensions/charting/openbb_charting/builder.py @@ -1,9 +1,12 @@ from inspect import getmembers, isfunction from typing import List +from openbb_charting import charting_router from openbb_core.app.router import RouterLoader -CHARTING_ROUTER = "./charting_router.py" +# refers to the root of the repo, not the root of the extension +# this script should be run from the root of the repo +CHARTING_ROUTER = "openbb_sdk/extensions/charting/openbb_charting/charting_router.py" def get_routes() -> List[str]: @@ -18,15 +21,13 @@ def create_charting_functions_w_routes(routes_to_add: List[str]): f.write( f""" -def {route}(**kwargs): +def {route}(**kwargs) -> Tuple[OpenBBFigure, Dict[str, Any]]: raise NotImplementedError("Command `{original_route}` does not have a charting function") """ ) def get_charting_functions() -> List[str]: - from . import charting_router # pylint: disable=import-outside-toplevel - functions = getmembers(charting_router, isfunction) if functions: return [function[0] for function in functions] diff --git a/openbb_sdk/extensions/charting/openbb_charting/charting_router.py b/openbb_sdk/extensions/charting/openbb_charting/charting_router.py index 59f640d8f32..10d1b9fcf1a 100644 --- a/openbb_sdk/extensions/charting/openbb_charting/charting_router.py +++ b/openbb_sdk/extensions/charting/openbb_charting/charting_router.py @@ -1,3 +1,7 @@ +from typing import Any, Dict, Tuple + +from openbb_charting.core.openbb_figure import OpenBBFigure +from openbb_charting.core.openbb_figure_table import OpenBBFigureTable from openbb_charting.core.plotly_ta.ta_class import PlotlyTA from openbb_core.app.model.charts.chart import ChartFormat from openbb_core.app.router import Router @@ -14,1645 +18,1801 @@ CHART_FORMAT = ChartFormat.plotly # pylint: disable=too-many-lines -def crypto_load(**kwargs): +def crypto_load(**kwargs) -> Tuple[OpenBBFigure, Dict[str, Any]]: raise NotImplementedError("Command `crypto/load` does not have a charting function") -def economy_corecpi(**kwargs): +def economy_corecpi(**kwargs) -> Tuple[OpenBBFigure, Dict[str, Any]]: raise NotImplementedError( "Command `economy/corecpi` does not have a charting function" ) -def economy_cpi(**kwargs): +def economy_cpi(**kwargs) -> Tuple[OpenBBFigure, Dict[str, Any]]: raise NotImplementedError("Command `economy/cpi` does not have a charting function") -def economy_cpi_options(**kwargs): +def economy_cpi_options(**kwargs) -> Tuple[OpenBBFigure, Dict[str, Any]]: raise NotImplementedError( "Command `economy/cpi/options` does not have a charting function" ) -def economy_index(**kwargs): +def economy_index(**kwargs) -> Tuple[OpenBBFigure, Dict[str, Any]]: raise NotImplementedError( "Command `economy/index` does not have a charting function" ) -def economy_available_indices(**kwargs): +def economy_available_indices(**kwargs) -> Tuple[OpenBBFigure, Dict[str, Any]]: raise NotImplementedError( "Command `economy/available/indices` does not have a charting function" ) -def economy_macro(**kwargs): +def economy_macro(**kwargs) -> Tuple[OpenBBFigure, Dict[str, Any]]: raise NotImplementedError( "Command `economy/macro` does not have a charting function" ) -def economy_macro_countries(**kwargs): +def economy_macro_countries(**kwargs) -> Tuple[OpenBBFigure, Dict[str, Any]]: raise NotImplementedError( "Command `economy/macro/countries` does not have a charting function" ) -def economy_macro_parameters(**kwargs): +def economy_macro_parameters(**kwargs) -> Tuple[OpenBBFigure, Dict[str, Any]]: raise NotImplementedError( "Command `economy/macro/parameters` does not have a charting function" ) -def economy_balance(**kwargs): +def economy_balance(**kwargs) -> Tuple[OpenBBFigure, Dict[str, Any]]: raise NotImplementedError( "Command `economy/balance` does not have a charting function" ) -def economy_bigmac(**kwargs): +def economy_bigmac(**kwargs) -> Tuple[OpenBBFigure, Dict[str, Any]]: raise NotImplementedError( "Command `economy/bigmac` does not have a charting function" ) -def economy_country_codes(**kwargs): +def economy_country_codes(**kwargs) -> Tuple[OpenBBFigure, Dict[str, Any]]: raise NotImplementedError( "Command `economy/country/codes` does not have a charting function" ) -def economy_currencies(**kwargs): +def economy_currencies(**kwargs) -> Tuple[OpenBBFigure, Dict[str, Any]]: raise NotImplementedError( "Command `economy/currencies` does not have a charting function" ) -def economy_debt(**kwargs): +def economy_debt(**kwargs) -> Tuple[OpenBBFigure, Dict[str, Any]]: raise NotImplementedError( "Command `economy/debt` does not have a charting function" ) -def economy_events(**kwargs): +def economy_events(**kwargs) -> Tuple[OpenBBFigure, Dict[str, Any]]: raise NotImplementedError( "Command `economy/events` does not have a charting function" ) -def economy_fgdp(**kwargs): +def economy_fgdp(**kwargs) -> Tuple[OpenBBFigure, Dict[str, Any]]: raise NotImplementedError( "Command `economy/fgdp` does not have a charting function" ) -def economy_fred(**kwargs): +def economy_fred(**kwargs) -> Tuple[OpenBBFigure, Dict[str, Any]]: raise NotImplementedError( "Command `economy/fred` does not have a charting function" ) -def economy_fred_search(**kwargs): +def economy_fred_search(**kwargs) -> Tuple[OpenBBFigure, Dict[str, Any]]: raise NotImplementedError( "Command `economy/fred/search` does not have a charting function" ) -def economy_futures(**kwargs): +def economy_futures(**kwargs) -> Tuple[OpenBBFigure, Dict[str, Any]]: raise NotImplementedError( "Command `economy/futures` does not have a charting function" ) -def economy_gdp(**kwargs): +def economy_gdp(**kwargs) -> Tuple[OpenBBFigure, Dict[str, Any]]: raise NotImplementedError("Command `economy/gdp` does not have a charting function") -def economy_glbonds(**kwargs): +def economy_glbonds(**kwargs) -> Tuple[OpenBBFigure, Dict[str, Any]]: raise NotImplementedError( "Command `economy/glbonds` does not have a charting function" ) -def economy_indices(**kwargs): +def economy_indices(**kwargs) -> Tuple[OpenBBFigure, Dict[str, Any]]: raise NotImplementedError( "Command `economy/indices` does not have a charting function" ) -def economy_overview(**kwargs): +def economy_overview(**kwargs) -> Tuple[OpenBBFigure, Dict[str, Any]]: raise NotImplementedError( "Command `economy/overview` does not have a charting function" ) -def economy_perfmap(**kwargs): +def economy_perfmap(**kwargs) -> Tuple[OpenBBFigure, Dict[str, Any]]: raise NotImplementedError( "Command `economy/perfmap` does not have a charting function" ) -def economy_performance(**kwargs): +def economy_performance(**kwargs) -> Tuple[OpenBBFigure, Dict[str, Any]]: raise NotImplementedError( "Command `economy/performance` does not have a charting function" ) -def economy_revenue(**kwargs): +def economy_revenue(**kwargs) -> Tuple[OpenBBFigure, Dict[str, Any]]: raise NotImplementedError( "Command `economy/revenue` does not have a charting function" ) -def economy_rgdp(**kwargs): +def economy_rgdp(**kwargs) -> Tuple[OpenBBFigure, Dict[str, Any]]: raise NotImplementedError( "Command `economy/rgdp` does not have a charting function" ) -def economy_rtps(**kwargs): +def economy_rtps(**kwargs) -> Tuple[OpenBBFigure, Dict[str, Any]]: raise NotImplementedError( "Command `economy/rtps` does not have a charting function" ) -def economy_search_index(**kwargs): +def economy_search_index(**kwargs) -> Tuple[OpenBBFigure, Dict[str, Any]]: raise NotImplementedError( "Command `economy/search/index` does not have a charting function" ) -def economy_spending(**kwargs): +def economy_spending(**kwargs) -> Tuple[OpenBBFigure, Dict[str, Any]]: raise NotImplementedError( "Command `economy/spending` does not have a charting function" ) -def economy_trust(**kwargs): +def economy_trust(**kwargs) -> Tuple[OpenBBFigure, Dict[str, Any]]: raise NotImplementedError( "Command `economy/trust` does not have a charting function" ) -def economy_usbonds(**kwargs): +def economy_usbonds(**kwargs) -> Tuple[OpenBBFigure, Dict[str, Any]]: raise NotImplementedError( "Command `economy/usbonds` does not have a charting function" ) -def economy_valuation(**kwargs): +def economy_valuation(**kwargs) -> Tuple[OpenBBFigure, Dict[str, Any]]: raise NotImplementedError( "Command `economy/valuation` does not have a charting function" ) -def fixedincome_treasury(**kwargs): +def fixedincome_treasury(**kwargs) -> Tuple[OpenBBFigure, Dict[str, Any]]: raise NotImplementedError( "Command `fixedincome/treasury` does not have a charting function" ) -def fixedincome_ycrv(**kwargs): +def fixedincome_ycrv(**kwargs) -> Tuple[OpenBBFigure, Dict[str, Any]]: raise NotImplementedError( "Command `fixedincome/ycrv` does not have a charting function" ) -def forex_load(**kwargs): +def forex_load(**kwargs) -> Tuple[OpenBBFigure, Dict[str, Any]]: raise NotImplementedError("Command `forex/load` does not have a charting function") -def news_globalnews(**kwargs): +def news_globalnews(**kwargs) -> Tuple[OpenBBFigure, Dict[str, Any]]: raise NotImplementedError( "Command `news/globalnews` does not have a charting function" ) -def news_sectornews(**kwargs): +def news_sectornews(**kwargs) -> Tuple[OpenBBFigure, Dict[str, Any]]: raise NotImplementedError( "Command `news/sectornews` does not have a charting function" ) -def providers_benzinga_global_news_standardized(**kwargs): +def providers_benzinga_global_news_standardized( + **kwargs, +) -> Tuple[OpenBBFigure, Dict[str, Any]]: raise NotImplementedError( "Command `providers/benzinga/global/news/standardized` does not have a charting function" ) -def providers_benzinga_stock_news_standardized(**kwargs): +def providers_benzinga_stock_news_standardized( + **kwargs, +) -> Tuple[OpenBBFigure, Dict[str, Any]]: raise NotImplementedError( "Command `providers/benzinga/stock/news/standardized` does not have a charting function" ) -def providers_fmp_key_executives_standardized(**kwargs): +def providers_fmp_key_executives_standardized( + **kwargs, +) -> Tuple[OpenBBFigure, Dict[str, Any]]: raise NotImplementedError( "Command `providers/fmp/key/executives/standardized` does not have a charting function" ) -def providers_fmp_stock_eod_standardized(**kwargs): +def providers_fmp_stock_eod_standardized( + **kwargs, +) -> Tuple[OpenBBFigure, Dict[str, Any]]: raise NotImplementedError( "Command `providers/fmp/stock/eod/standardized` does not have a charting function" ) -def providers_fmp_global_news_standardized(**kwargs): +def providers_fmp_global_news_standardized( + **kwargs, +) -> Tuple[OpenBBFigure, Dict[str, Any]]: raise NotImplementedError( "Command `providers/fmp/global/news/standardized` does not have a charting function" ) -def providers_fmp_stock_news_standardized(**kwargs): +def providers_fmp_stock_news_standardized( + **kwargs, +) -> Tuple[OpenBBFigure, Dict[str, Any]]: raise NotImplementedError( "Command `providers/fmp/stock/news/standardized` does not have a charting function" ) -def providers_fmp_income_statement_standardized(**kwargs): +def providers_fmp_income_statement_standardized( + **kwargs, +) -> Tuple[OpenBBFigure, Dict[str, Any]]: raise NotImplementedError( "Command `providers/fmp/income/statement/standardized` does not have a charting function" ) -def providers_fmp_balance_sheet_standardized(**kwargs): +def providers_fmp_balance_sheet_standardized( + **kwargs, +) -> Tuple[OpenBBFigure, Dict[str, Any]]: raise NotImplementedError( "Command `providers/fmp/balance/sheet/standardized` does not have a charting function" ) -def providers_fmp_cash_flow_statement_standardized(**kwargs): +def providers_fmp_cash_flow_statement_standardized( + **kwargs, +) -> Tuple[OpenBBFigure, Dict[str, Any]]: raise NotImplementedError( "Command `providers/fmp/cash/flow/statement/standardized` does not have a charting function" ) -def providers_fmp_share_statistics_standardized(**kwargs): +def providers_fmp_share_statistics_standardized( + **kwargs, +) -> Tuple[OpenBBFigure, Dict[str, Any]]: raise NotImplementedError( "Command `providers/fmp/share/statistics/standardized` does not have a charting function" ) -def providers_fmp_major_indices_eod_standardized(**kwargs): +def providers_fmp_major_indices_eod_standardized( + **kwargs, +) -> Tuple[OpenBBFigure, Dict[str, Any]]: raise NotImplementedError( "Command `providers/fmp/major/indices/eod/standardized` does not have a charting function" ) -def providers_fmp_revenue_geographic_standardized(**kwargs): +def providers_fmp_revenue_geographic_standardized( + **kwargs, +) -> Tuple[OpenBBFigure, Dict[str, Any]]: raise NotImplementedError( "Command `providers/fmp/revenue/geographic/standardized` does not have a charting function" ) -def providers_fmp_revenue_business_line_standardized(**kwargs): +def providers_fmp_revenue_business_line_standardized( + **kwargs, +) -> Tuple[OpenBBFigure, Dict[str, Any]]: raise NotImplementedError( "Command `providers/fmp/revenue/business/line/standardized` does not have a charting function" ) -def providers_fmp_institutional_ownership_standardized(**kwargs): +def providers_fmp_institutional_ownership_standardized( + **kwargs, +) -> Tuple[OpenBBFigure, Dict[str, Any]]: raise NotImplementedError( "Command `providers/fmp/institutional/ownership/standardized` does not have a charting function" ) -def providers_fmp_company_overview_standardized(**kwargs): +def providers_fmp_company_overview_standardized( + **kwargs, +) -> Tuple[OpenBBFigure, Dict[str, Any]]: raise NotImplementedError( "Command `providers/fmp/company/overview/standardized` does not have a charting function" ) -def providers_fmp_stock_insider_trading_standardized(**kwargs): +def providers_fmp_stock_insider_trading_standardized( + **kwargs, +) -> Tuple[OpenBBFigure, Dict[str, Any]]: raise NotImplementedError( "Command `providers/fmp/stock/insider/trading/standardized` does not have a charting function" ) -def providers_fmp_stock_ownership_standardized(**kwargs): +def providers_fmp_stock_ownership_standardized( + **kwargs, +) -> Tuple[OpenBBFigure, Dict[str, Any]]: raise NotImplementedError( "Command `providers/fmp/stock/ownership/standardized` does not have a charting function" ) -def providers_fmp_e_s_g_score_standardized(**kwargs): +def providers_fmp_e_s_g_score_standardized( + **kwargs, +) -> Tuple[OpenBBFigure, Dict[str, Any]]: raise NotImplementedError( "Command `providers/fmp/e/s/g/score/standardized` does not have a charting function" ) -def providers_fmp_e_s_g_sector_standardized(**kwargs): +def providers_fmp_e_s_g_sector_standardized( + **kwargs, +) -> Tuple[OpenBBFigure, Dict[str, Any]]: raise NotImplementedError( "Command `providers/fmp/e/s/g/sector/standardized` does not have a charting function" ) -def providers_fmp_e_s_g_risk_rating_standardized(**kwargs): +def providers_fmp_e_s_g_risk_rating_standardized( + **kwargs, +) -> Tuple[OpenBBFigure, Dict[str, Any]]: raise NotImplementedError( "Command `providers/fmp/e/s/g/risk/rating/standardized` does not have a charting function" ) -def providers_fmp_stock_price_standardized(**kwargs): +def providers_fmp_stock_price_standardized( + **kwargs, +) -> Tuple[OpenBBFigure, Dict[str, Any]]: raise NotImplementedError( "Command `providers/fmp/stock/price/standardized` does not have a charting function" ) -def providers_fmp_price_target_consensus_standardized(**kwargs): +def providers_fmp_price_target_consensus_standardized( + **kwargs, +) -> Tuple[OpenBBFigure, Dict[str, Any]]: raise NotImplementedError( "Command `providers/fmp/price/target/consensus/standardized` does not have a charting function" ) -def providers_fmp_price_target_standardized(**kwargs): +def providers_fmp_price_target_standardized( + **kwargs, +) -> Tuple[OpenBBFigure, Dict[str, Any]]: raise NotImplementedError( "Command `providers/fmp/price/target/standardized` does not have a charting function" ) -def providers_fmp_analyst_estimates_standardized(**kwargs): +def providers_fmp_analyst_estimates_standardized( + **kwargs, +) -> Tuple[OpenBBFigure, Dict[str, Any]]: raise NotImplementedError( "Command `providers/fmp/analyst/estimates/standardized` does not have a charting function" ) -def providers_fmp_earnings_calendar_standardized(**kwargs): +def providers_fmp_earnings_calendar_standardized( + **kwargs, +) -> Tuple[OpenBBFigure, Dict[str, Any]]: raise NotImplementedError( "Command `providers/fmp/earnings/calendar/standardized` does not have a charting function" ) -def providers_fmp_earnings_call_transcript_standardized(**kwargs): +def providers_fmp_earnings_call_transcript_standardized( + **kwargs, +) -> Tuple[OpenBBFigure, Dict[str, Any]]: raise NotImplementedError( "Command `providers/fmp/earnings/call/transcript/standardized` does not have a charting function" ) -def providers_fmp_historical_stock_splits_standardized(**kwargs): +def providers_fmp_historical_stock_splits_standardized( + **kwargs, +) -> Tuple[OpenBBFigure, Dict[str, Any]]: raise NotImplementedError( "Command `providers/fmp/historical/stock/splits/standardized` does not have a charting function" ) -def providers_fmp_historical_dividends_standardized(**kwargs): +def providers_fmp_historical_dividends_standardized( + **kwargs, +) -> Tuple[OpenBBFigure, Dict[str, Any]]: raise NotImplementedError( "Command `providers/fmp/historical/dividends/standardized` does not have a charting function" ) -def providers_fmp_key_metrics_standardized(**kwargs): +def providers_fmp_key_metrics_standardized( + **kwargs, +) -> Tuple[OpenBBFigure, Dict[str, Any]]: raise NotImplementedError( "Command `providers/fmp/key/metrics/standardized` does not have a charting function" ) -def providers_fmp_s_e_c_filings_standardized(**kwargs): +def providers_fmp_s_e_c_filings_standardized( + **kwargs, +) -> Tuple[OpenBBFigure, Dict[str, Any]]: raise NotImplementedError( "Command `providers/fmp/s/e/c/filings/standardized` does not have a charting function" ) -def providers_fmp_treasury_rates_standardized(**kwargs): +def providers_fmp_treasury_rates_standardized( + **kwargs, +) -> Tuple[OpenBBFigure, Dict[str, Any]]: raise NotImplementedError( "Command `providers/fmp/treasury/rates/standardized` does not have a charting function" ) -def providers_fmp_executive_compensation_standardized(**kwargs): +def providers_fmp_executive_compensation_standardized( + **kwargs, +) -> Tuple[OpenBBFigure, Dict[str, Any]]: raise NotImplementedError( "Command `providers/fmp/executive/compensation/standardized` does not have a charting function" ) -def providers_fmp_crypto_price_standardized(**kwargs): +def providers_fmp_crypto_price_standardized( + **kwargs, +) -> Tuple[OpenBBFigure, Dict[str, Any]]: raise NotImplementedError( "Command `providers/fmp/crypto/price/standardized` does not have a charting function" ) -def providers_fmp_crypto_eod_standardized(**kwargs): +def providers_fmp_crypto_eod_standardized( + **kwargs, +) -> Tuple[OpenBBFigure, Dict[str, Any]]: raise NotImplementedError( "Command `providers/fmp/crypto/eod/standardized` does not have a charting function" ) -def providers_fmp_major_indices_price_standardized(**kwargs): +def providers_fmp_major_indices_price_standardized( + **kwargs, +) -> Tuple[OpenBBFigure, Dict[str, Any]]: raise NotImplementedError( "Command `providers/fmp/major/indices/price/standardized` does not have a charting function" ) -def providers_fmp_forex_eod_standardized(**kwargs): +def providers_fmp_forex_eod_standardized( + **kwargs, +) -> Tuple[OpenBBFigure, Dict[str, Any]]: raise NotImplementedError( "Command `providers/fmp/forex/eod/standardized` does not have a charting function" ) -def providers_polygon_stock_eod_standardized(**kwargs): +def providers_polygon_stock_eod_standardized( + **kwargs, +) -> Tuple[OpenBBFigure, Dict[str, Any]]: raise NotImplementedError( "Command `providers/polygon/stock/eod/standardized` does not have a charting function" ) -def providers_polygon_stock_news_standardized(**kwargs): +def providers_polygon_stock_news_standardized( + **kwargs, +) -> Tuple[OpenBBFigure, Dict[str, Any]]: raise NotImplementedError( "Command `providers/polygon/stock/news/standardized` does not have a charting function" ) -def providers_polygon_balance_sheet_standardized(**kwargs): +def providers_polygon_balance_sheet_standardized( + **kwargs, +) -> Tuple[OpenBBFigure, Dict[str, Any]]: raise NotImplementedError( "Command `providers/polygon/balance/sheet/standardized` does not have a charting function" ) -def providers_polygon_income_statement_standardized(**kwargs): +def providers_polygon_income_statement_standardized( + **kwargs, +) -> Tuple[OpenBBFigure, Dict[str, Any]]: raise NotImplementedError( "Command `providers/polygon/income/statement/standardized` does not have a charting function" ) -def providers_polygon_cash_flow_statement_standardized(**kwargs): +def providers_polygon_cash_flow_statement_standardized( + **kwargs, +) -> Tuple[OpenBBFigure, Dict[str, Any]]: raise NotImplementedError( "Command `providers/polygon/cash/flow/statement/standardized` does not have a charting function" ) -def providers_polygon_stock_price_standardized(**kwargs): +def providers_polygon_stock_price_standardized( + **kwargs, +) -> Tuple[OpenBBFigure, Dict[str, Any]]: raise NotImplementedError( "Command `providers/polygon/stock/price/standardized` does not have a charting function" ) -def providers_polygon_crypto_price_standardized(**kwargs): +def providers_polygon_crypto_price_standardized( + **kwargs, +) -> Tuple[OpenBBFigure, Dict[str, Any]]: raise NotImplementedError( "Command `providers/polygon/crypto/price/standardized` does not have a charting function" ) -def providers_polygon_crypto_eod_standardized(**kwargs): +def providers_polygon_crypto_eod_standardized( + **kwargs, +) -> Tuple[OpenBBFigure, Dict[str, Any]]: raise NotImplementedError( "Command `providers/polygon/crypto/eod/standardized` does not have a charting function" ) -def providers_polygon_major_indices_eod_standardized(**kwargs): +def providers_polygon_major_indices_eod_standardized( + **kwargs, +) -> Tuple[OpenBBFigure, Dict[str, Any]]: raise NotImplementedError( "Command `providers/polygon/major/indices/eod/standardized` does not have a charting function" ) -def providers_polygon_major_indices_price_standardized(**kwargs): +def providers_polygon_major_indices_price_standardized( + **kwargs, +) -> Tuple[OpenBBFigure, Dict[str, Any]]: raise NotImplementedError( "Command `providers/polygon/major/indices/price/standardized` does not have a charting function" ) -def providers_benzinga_global_news_simple(**kwargs): +def providers_benzinga_global_news_simple( + **kwargs, +) -> Tuple[OpenBBFigure, Dict[str, Any]]: raise NotImplementedError( "Command `providers/benzinga/global/news/simple` does not have a charting function" ) -def providers_benzinga_stock_news_simple(**kwargs): +def providers_benzinga_stock_news_simple( + **kwargs, +) -> Tuple[OpenBBFigure, Dict[str, Any]]: raise NotImplementedError( "Command `providers/benzinga/stock/news/simple` does not have a charting function" ) -def providers_fmp_key_executives_simple(**kwargs): +def providers_fmp_key_executives_simple( + **kwargs, +) -> Tuple[OpenBBFigure, Dict[str, Any]]: raise NotImplementedError( "Command `providers/fmp/key/executives/simple` does not have a charting function" ) -def providers_fmp_stock_eod_simple(**kwargs): +def providers_fmp_stock_eod_simple(**kwargs) -> Tuple[OpenBBFigure, Dict[str, Any]]: raise NotImplementedError( "Command `providers/fmp/stock/eod/simple` does not have a charting function" ) -def providers_fmp_global_news_simple(**kwargs): +def providers_fmp_global_news_simple(**kwargs) -> Tuple[OpenBBFigure, Dict[str, Any]]: raise NotImplementedError( "Command `providers/fmp/global/news/simple` does not have a charting function" ) -def providers_fmp_stock_news_simple(**kwargs): +def providers_fmp_stock_news_simple(**kwargs) -> Tuple[OpenBBFigure, Dict[str, Any]]: raise NotImplementedError( "Command `providers/fmp/stock/news/simple` does not have a charting function" ) -def providers_fmp_income_statement_simple(**kwargs): +def providers_fmp_income_statement_simple( + **kwargs, +) -> Tuple[OpenBBFigure, Dict[str, Any]]: raise NotImplementedError( "Command `providers/fmp/income/statement/simple` does not have a charting function" ) -def providers_fmp_balance_sheet_simple(**kwargs): +def providers_fmp_balance_sheet_simple(**kwargs) -> Tuple[OpenBBFigure, Dict[str, Any]]: raise NotImplementedError( "Command `providers/fmp/balance/sheet/simple` does not have a charting function" ) -def providers_fmp_cash_flow_statement_simple(**kwargs): +def providers_fmp_cash_flow_statement_simple( + **kwargs, +) -> Tuple[OpenBBFigure, Dict[str, Any]]: raise NotImplementedError( "Command `providers/fmp/cash/flow/statement/simple` does not have a charting function" ) -def providers_fmp_share_statistics_simple(**kwargs): +def providers_fmp_share_statistics_simple( + **kwargs, +) -> Tuple[OpenBBFigure, Dict[str, Any]]: raise NotImplementedError( "Command `providers/fmp/share/statistics/simple` does not have a charting function" ) -def providers_fmp_major_indices_eod_simple(**kwargs): +def providers_fmp_major_indices_eod_simple( + **kwargs, +) -> Tuple[OpenBBFigure, Dict[str, Any]]: raise NotImplementedError( "Command `providers/fmp/major/indices/eod/simple` does not have a charting function" ) -def providers_fmp_revenue_geographic_simple(**kwargs): +def providers_fmp_revenue_geographic_simple( + **kwargs, +) -> Tuple[OpenBBFigure, Dict[str, Any]]: raise NotImplementedError( "Command `providers/fmp/revenue/geographic/simple` does not have a charting function" ) -def providers_fmp_revenue_business_line_simple(**kwargs): +def providers_fmp_revenue_business_line_simple( + **kwargs, +) -> Tuple[OpenBBFigure, Dict[str, Any]]: raise NotImplementedError( "Command `providers/fmp/revenue/business/line/simple` does not have a charting function" ) -def providers_fmp_institutional_ownership_simple(**kwargs): +def providers_fmp_institutional_ownership_simple( + **kwargs, +) -> Tuple[OpenBBFigure, Dict[str, Any]]: raise NotImplementedError( "Command `providers/fmp/institutional/ownership/simple` does not have a charting function" ) -def providers_fmp_company_overview_simple(**kwargs): +def providers_fmp_company_overview_simple( + **kwargs, +) -> Tuple[OpenBBFigure, Dict[str, Any]]: raise NotImplementedError( "Command `providers/fmp/company/overview/simple` does not have a charting function" ) -def providers_fmp_stock_insider_trading_simple(**kwargs): +def providers_fmp_stock_insider_trading_simple( + **kwargs, +) -> Tuple[OpenBBFigure, Dict[str, Any]]: raise NotImplementedError( "Command `providers/fmp/stock/insider/trading/simple` does not have a charting function" ) -def providers_fmp_stock_ownership_simple(**kwargs): +def providers_fmp_stock_ownership_simple( + **kwargs, +) -> Tuple[OpenBBFigure, Dict[str, Any]]: raise NotImplementedError( "Command `providers/fmp/stock/ownership/simple` does not have a charting function" ) -def providers_fmp_e_s_g_score_simple(**kwargs): +def providers_fmp_e_s_g_score_simple(**kwargs) -> Tuple[OpenBBFigure, Dict[str, Any]]: raise NotImplementedError( "Command `providers/fmp/e/s/g/score/simple` does not have a charting function" ) -def providers_fmp_e_s_g_sector_simple(**kwargs): +def providers_fmp_e_s_g_sector_simple(**kwargs) -> Tuple[OpenBBFigure, Dict[str, Any]]: raise NotImplementedError( "Command `providers/fmp/e/s/g/sector/simple` does not have a charting function" ) -def providers_fmp_e_s_g_risk_rating_simple(**kwargs): +def providers_fmp_e_s_g_risk_rating_simple( + **kwargs, +) -> Tuple[OpenBBFigure, Dict[str, Any]]: raise NotImplementedError( "Command `providers/fmp/e/s/g/risk/rating/simple` does not have a charting function" ) -def providers_fmp_stock_price_simple(**kwargs): +def providers_fmp_stock_price_simple(**kwargs) -> Tuple[OpenBBFigure, Dict[str, Any]]: raise NotImplementedError( "Command `providers/fmp/stock/price/simple` does not have a charting function" ) -def providers_fmp_price_target_consensus_simple(**kwargs): +def providers_fmp_price_target_consensus_simple( + **kwargs, +) -> Tuple[OpenBBFigure, Dict[str, Any]]: raise NotImplementedError( "Command `providers/fmp/price/target/consensus/simple` does not have a charting function" ) -def providers_fmp_price_target_simple(**kwargs): +def providers_fmp_price_target_simple(**kwargs) -> Tuple[OpenBBFigure, Dict[str, Any]]: raise NotImplementedError( "Command `providers/fmp/price/target/simple` does not have a charting function" ) -def providers_fmp_analyst_estimates_simple(**kwargs): +def providers_fmp_analyst_estimates_simple( + **kwargs, +) -> Tuple[OpenBBFigure, Dict[str, Any]]: raise NotImplementedError( "Command `providers/fmp/analyst/estimates/simple` does not have a charting function" ) -def providers_fmp_earnings_calendar_simple(**kwargs): +def providers_fmp_earnings_calendar_simple( + **kwargs, +) -> Tuple[OpenBBFigure, Dict[str, Any]]: raise NotImplementedError( "Command `providers/fmp/earnings/calendar/simple` does not have a charting function" ) -def providers_fmp_earnings_call_transcript_simple(**kwargs): +def providers_fmp_earnings_call_transcript_simple( + **kwargs, +) -> Tuple[OpenBBFigure, Dict[str, Any]]: raise NotImplementedError( "Command `providers/fmp/earnings/call/transcript/simple` does not have a charting function" ) -def providers_fmp_historical_stock_splits_simple(**kwargs): +def providers_fmp_historical_stock_splits_simple( + **kwargs, +) -> Tuple[OpenBBFigure, Dict[str, Any]]: raise NotImplementedError( "Command `providers/fmp/historical/stock/splits/simple` does not have a charting function" ) -def providers_fmp_historical_dividends_simple(**kwargs): +def providers_fmp_historical_dividends_simple( + **kwargs, +) -> Tuple[OpenBBFigure, Dict[str, Any]]: raise NotImplementedError( "Command `providers/fmp/historical/dividends/simple` does not have a charting function" ) -def providers_fmp_key_metrics_simple(**kwargs): +def providers_fmp_key_metrics_simple(**kwargs) -> Tuple[OpenBBFigure, Dict[str, Any]]: raise NotImplementedError( "Command `providers/fmp/key/metrics/simple` does not have a charting function" ) -def providers_fmp_s_e_c_filings_simple(**kwargs): +def providers_fmp_s_e_c_filings_simple(**kwargs) -> Tuple[OpenBBFigure, Dict[str, Any]]: raise NotImplementedError( "Command `providers/fmp/s/e/c/filings/simple` does not have a charting function" ) -def providers_fmp_treasury_rates_simple(**kwargs): +def providers_fmp_treasury_rates_simple( + **kwargs, +) -> Tuple[OpenBBFigure, Dict[str, Any]]: raise NotImplementedError( "Command `providers/fmp/treasury/rates/simple` does not have a charting function" ) -def providers_fmp_executive_compensation_simple(**kwargs): +def providers_fmp_executive_compensation_simple( + **kwargs, +) -> Tuple[OpenBBFigure, Dict[str, Any]]: raise NotImplementedError( "Command `providers/fmp/executive/compensation/simple` does not have a charting function" ) -def providers_fmp_crypto_price_simple(**kwargs): +def providers_fmp_crypto_price_simple(**kwargs) -> Tuple[OpenBBFigure, Dict[str, Any]]: raise NotImplementedError( "Command `providers/fmp/crypto/price/simple` does not have a charting function" ) -def providers_fmp_crypto_eod_simple(**kwargs): +def providers_fmp_crypto_eod_simple(**kwargs) -> Tuple[OpenBBFigure, Dict[str, Any]]: raise NotImplementedError( "Command `providers/fmp/crypto/eod/simple` does not have a charting function" ) -def providers_fmp_major_indices_price_simple(**kwargs): +def providers_fmp_major_indices_price_simple( + **kwargs, +) -> Tuple[OpenBBFigure, Dict[str, Any]]: raise NotImplementedError( "Command `providers/fmp/major/indices/price/simple` does not have a charting function" ) -def providers_fmp_forex_eod_simple(**kwargs): +def providers_fmp_forex_eod_simple(**kwargs) -> Tuple[OpenBBFigure, Dict[str, Any]]: raise NotImplementedError( "Command `providers/fmp/forex/eod/simple` does not have a charting function" ) -def providers_polygon_stock_eod_simple(**kwargs): +def providers_polygon_stock_eod_simple(**kwargs) -> Tuple[OpenBBFigure, Dict[str, Any]]: raise NotImplementedError( "Command `providers/polygon/stock/eod/simple` does not have a charting function" ) -def providers_polygon_stock_news_simple(**kwargs): +def providers_polygon_stock_news_simple( + **kwargs, +) -> Tuple[OpenBBFigure, Dict[str, Any]]: raise NotImplementedError( "Command `providers/polygon/stock/news/simple` does not have a charting function" ) -def providers_polygon_balance_sheet_simple(**kwargs): +def providers_polygon_balance_sheet_simple( + **kwargs, +) -> Tuple[OpenBBFigure, Dict[str, Any]]: raise NotImplementedError( "Command `providers/polygon/balance/sheet/simple` does not have a charting function" ) -def providers_polygon_income_statement_simple(**kwargs): +def providers_polygon_income_statement_simple( + **kwargs, +) -> Tuple[OpenBBFigure, Dict[str, Any]]: raise NotImplementedError( "Command `providers/polygon/income/statement/simple` does not have a charting function" ) -def providers_polygon_cash_flow_statement_simple(**kwargs): +def providers_polygon_cash_flow_statement_simple( + **kwargs, +) -> Tuple[OpenBBFigure, Dict[str, Any]]: raise NotImplementedError( "Command `providers/polygon/cash/flow/statement/simple` does not have a charting function" ) -def providers_polygon_stock_price_simple(**kwargs): +def providers_polygon_stock_price_simple( + **kwargs, +) -> Tuple[OpenBBFigure, Dict[str, Any]]: raise NotImplementedError( "Command `providers/polygon/stock/price/simple` does not have a charting function" ) -def providers_polygon_crypto_price_simple(**kwargs): +def providers_polygon_crypto_price_simple( + **kwargs, +) -> Tuple[OpenBBFigure, Dict[str, Any]]: raise NotImplementedError( "Command `providers/polygon/crypto/price/simple` does not have a charting function" ) -def providers_polygon_crypto_eod_simple(**kwargs): +def providers_polygon_crypto_eod_simple( + **kwargs, +) -> Tuple[OpenBBFigure, Dict[str, Any]]: raise NotImplementedError( "Command `providers/polygon/crypto/eod/simple` does not have a charting function" ) -def providers_polygon_major_indices_eod_simple(**kwargs): +def providers_polygon_major_indices_eod_simple( + **kwargs, +) -> Tuple[OpenBBFigure, Dict[str, Any]]: raise NotImplementedError( "Command `providers/polygon/major/indices/eod/simple` does not have a charting function" ) -def providers_polygon_major_indices_price_simple(**kwargs): +def providers_polygon_major_indices_price_simple( + **kwargs, +) -> Tuple[OpenBBFigure, Dict[str, Any]]: raise NotImplementedError( "Command `providers/polygon/major/indices/price/simple` does not have a charting function" ) -def qa_normality(**kwargs): +def qa_normality(**kwargs) -> Tuple[OpenBBFigure, Dict[str, Any]]: raise NotImplementedError( "Command `qa/normality` does not have a charting function" ) -def qa_capm(**kwargs): +def qa_capm(**kwargs) -> Tuple[OpenBBFigure, Dict[str, Any]]: raise NotImplementedError("Command `qa/capm` does not have a charting function") -def qa_qqplot(**kwargs): +def qa_qqplot(**kwargs) -> Tuple[OpenBBFigure, Dict[str, Any]]: raise NotImplementedError("Command `qa/qqplot` does not have a charting function") -def qa_om(**kwargs): +def qa_om(**kwargs) -> Tuple[OpenBBFigure, Dict[str, Any]]: raise NotImplementedError("Command `qa/om` does not have a charting function") -def qa_kurtosis(**kwargs): +def qa_kurtosis(**kwargs) -> Tuple[OpenBBFigure, Dict[str, Any]]: raise NotImplementedError("Command `qa/kurtosis` does not have a charting function") -def qa_pick(**kwargs): +def qa_pick(**kwargs) -> Tuple[OpenBBFigure, Dict[str, Any]]: raise NotImplementedError("Command `qa/pick` does not have a charting function") -def qa_spread(**kwargs): +def qa_spread(**kwargs) -> Tuple[OpenBBFigure, Dict[str, Any]]: raise NotImplementedError("Command `qa/spread` does not have a charting function") -def qa_rolling(**kwargs): +def qa_rolling(**kwargs) -> Tuple[OpenBBFigure, Dict[str, Any]]: raise NotImplementedError("Command `qa/rolling` does not have a charting function") -def qa_var(**kwargs): +def qa_var(**kwargs) -> Tuple[OpenBBFigure, Dict[str, Any]]: raise NotImplementedError("Command `qa/var` does not have a charting function") -def qa_line(**kwargs): +def qa_line(**kwargs) -> Tuple[OpenBBFigure, Dict[str, Any]]: raise NotImplementedError("Command `qa/line` does not have a charting function") -def qa_hist(**kwargs): +def qa_hist(**kwargs) -> Tuple[OpenBBFigure, Dict[str, Any]]: raise NotImplementedError("Command `qa/hist` does not have a charting function") -def qa_unitroot(**kwargs): +def qa_unitroot(**kwargs) -> Tuple[OpenBBFigure, Dict[str, Any]]: raise NotImplementedError("Command `qa/unitroot` does not have a charting function") -def qa_beta(**kwargs): +def qa_beta(**kwargs) -> Tuple[OpenBBFigure, Dict[str, Any]]: raise NotImplementedError("Command `qa/beta` does not have a charting function") -def qa_sh(**kwargs): +def qa_sh(**kwargs) -> Tuple[OpenBBFigure, Dict[str, Any]]: raise NotImplementedError("Command `qa/sh` does not have a charting function") -def qa_so(**kwargs): +def qa_so(**kwargs) -> Tuple[OpenBBFigure, Dict[str, Any]]: raise NotImplementedError("Command `qa/so` does not have a charting function") -def qa_cusum(**kwargs): +def qa_cusum(**kwargs) -> Tuple[OpenBBFigure, Dict[str, Any]]: raise NotImplementedError("Command `qa/cusum` does not have a charting function") -def qa_raw(**kwargs): +def qa_raw(**kwargs) -> Tuple[OpenBBFigure, Dict[str, Any]]: raise NotImplementedError("Command `qa/raw` does not have a charting function") -def qa_cdf(**kwargs): +def qa_cdf(**kwargs) -> Tuple[OpenBBFigure, Dict[str, Any]]: raise NotImplementedError("Command `qa/cdf` does not have a charting function") -def qa_decompose(**kwargs): +def qa_decompose(**kwargs) -> Tuple[OpenBBFigure, Dict[str, Any]]: raise NotImplementedError( "Command `qa/decompose` does not have a charting function" ) -def qa_skew(**kwargs): +def qa_skew(**kwargs) -> Tuple[OpenBBFigure, Dict[str, Any]]: raise NotImplementedError("Command `qa/skew` does not have a charting function") -def qa_quantile(**kwargs): +def qa_quantile(**kwargs) -> Tuple[OpenBBFigure, Dict[str, Any]]: raise NotImplementedError("Command `qa/quantile` does not have a charting function") -def qa_bw(**kwargs): +def qa_bw(**kwargs) -> Tuple[OpenBBFigure, Dict[str, Any]]: raise NotImplementedError("Command `qa/bw` does not have a charting function") -def qa_es(**kwargs): +def qa_es(**kwargs) -> Tuple[OpenBBFigure, Dict[str, Any]]: raise NotImplementedError("Command `qa/es` does not have a charting function") -def qa_acf(**kwargs): +def qa_acf(**kwargs) -> Tuple[OpenBBFigure, Dict[str, Any]]: raise NotImplementedError("Command `qa/acf` does not have a charting function") -def qa_summary(**kwargs): +def qa_summary(**kwargs) -> Tuple[OpenBBFigure, Dict[str, Any]]: raise NotImplementedError("Command `qa/summary` does not have a charting function") -def stocks_fa_balance(**kwargs): +def stocks_fa_balance(**kwargs) -> Tuple[OpenBBFigure, Dict[str, Any]]: raise NotImplementedError( "Command `stocks/fa/balance` does not have a charting function" ) -def stocks_fa_cash(**kwargs): +def stocks_fa_cash(**kwargs) -> Tuple[OpenBBFigure, Dict[str, Any]]: raise NotImplementedError( "Command `stocks/fa/cash` does not have a charting function" ) -def stocks_fa_comp(**kwargs): +def stocks_fa_comp(**kwargs) -> Tuple[OpenBBFigure, Dict[str, Any]]: raise NotImplementedError( "Command `stocks/fa/comp` does not have a charting function" ) -def stocks_fa_earning(**kwargs): +def stocks_fa_earning(**kwargs) -> Tuple[OpenBBFigure, Dict[str, Any]]: raise NotImplementedError( "Command `stocks/fa/earning` does not have a charting function" ) -def stocks_fa_emp(**kwargs): +def stocks_fa_emp(**kwargs) -> Tuple[OpenBBFigure, Dict[str, Any]]: raise NotImplementedError( "Command `stocks/fa/emp` does not have a charting function" ) -def stocks_fa_est(**kwargs): +def stocks_fa_est(**kwargs) -> Tuple[OpenBBFigure, Dict[str, Any]]: raise NotImplementedError( "Command `stocks/fa/est` does not have a charting function" ) -def stocks_fa_income(**kwargs): +def stocks_fa_income(**kwargs) -> Tuple[OpenBBFigure, Dict[str, Any]]: raise NotImplementedError( "Command `stocks/fa/income` does not have a charting function" ) -def stocks_fa_ins(**kwargs): +def stocks_fa_ins(**kwargs) -> Tuple[OpenBBFigure, Dict[str, Any]]: raise NotImplementedError( "Command `stocks/fa/ins` does not have a charting function" ) -def stocks_fa_metrics(**kwargs): +def stocks_fa_metrics(**kwargs) -> Tuple[OpenBBFigure, Dict[str, Any]]: raise NotImplementedError( "Command `stocks/fa/metrics` does not have a charting function" ) -def stocks_fa_mgmt(**kwargs): +def stocks_fa_mgmt(**kwargs) -> Tuple[OpenBBFigure, Dict[str, Any]]: raise NotImplementedError( "Command `stocks/fa/mgmt` does not have a charting function" ) -def stocks_fa_overview(**kwargs): +def stocks_fa_overview(**kwargs) -> Tuple[OpenBBFigure, Dict[str, Any]]: raise NotImplementedError( "Command `stocks/fa/overview` does not have a charting function" ) -def stocks_fa_own(**kwargs): +def stocks_fa_own(**kwargs) -> Tuple[OpenBBFigure, Dict[str, Any]]: raise NotImplementedError( "Command `stocks/fa/own` does not have a charting function" ) -def stocks_fa_pta(**kwargs): +def stocks_fa_pta(**kwargs) -> Tuple[OpenBBFigure, Dict[str, Any]]: raise NotImplementedError( "Command `stocks/fa/pta` does not have a charting function" ) -def stocks_fa_pt(**kwargs): +def stocks_fa_pt(**kwargs) -> Tuple[OpenBBFigure, Dict[str, Any]]: raise NotImplementedError( "Command `stocks/fa/pt` does not have a charting function" ) -def stocks_fa_revgeo(**kwargs): +def stocks_fa_revgeo(**kwargs) -> Tuple[OpenBBFigure, Dict[str, Any]]: raise NotImplementedError( "Command `stocks/fa/revgeo` does not have a charting function" ) -def stocks_fa_revseg(**kwargs): +def stocks_fa_revseg(**kwargs) -> Tuple[OpenBBFigure, Dict[str, Any]]: raise NotImplementedError( "Command `stocks/fa/revseg` does not have a charting function" ) -def stocks_fa_shrs(**kwargs): +def stocks_fa_shrs(**kwargs) -> Tuple[OpenBBFigure, Dict[str, Any]]: raise NotImplementedError( "Command `stocks/fa/shrs` does not have a charting function" ) -def stocks_fa_shares(**kwargs): +def stocks_fa_shares(**kwargs) -> Tuple[OpenBBFigure, Dict[str, Any]]: raise NotImplementedError( "Command `stocks/fa/shares` does not have a charting function" ) -def stocks_fa_transcript(**kwargs): +def stocks_fa_transcript(**kwargs) -> Tuple[OpenBBFigure, Dict[str, Any]]: raise NotImplementedError( "Command `stocks/fa/transcript` does not have a charting function" ) -def stocks_fa_split(**kwargs): +def stocks_fa_split(**kwargs) -> Tuple[OpenBBFigure, Dict[str, Any]]: raise NotImplementedError( "Command `stocks/fa/split` does not have a charting function" ) -def stocks_fa_cal(**kwargs): +def stocks_fa_cal(**kwargs) -> Tuple[OpenBBFigure, Dict[str, Any]]: raise NotImplementedError( "Command `stocks/fa/cal` does not have a charting function" ) -def stocks_fa_customer(**kwargs): +def stocks_fa_customer(**kwargs) -> Tuple[OpenBBFigure, Dict[str, Any]]: raise NotImplementedError( "Command `stocks/fa/customer` does not have a charting function" ) -def stocks_fa_divs(**kwargs): +def stocks_fa_divs(**kwargs) -> Tuple[OpenBBFigure, Dict[str, Any]]: raise NotImplementedError( "Command `stocks/fa/divs` does not have a charting function" ) -def stocks_fa_dcfc(**kwargs): +def stocks_fa_dcfc(**kwargs) -> Tuple[OpenBBFigure, Dict[str, Any]]: raise NotImplementedError( "Command `stocks/fa/dcfc` does not have a charting function" ) -def stocks_fa_dupont(**kwargs): +def stocks_fa_dupont(**kwargs) -> Tuple[OpenBBFigure, Dict[str, Any]]: raise NotImplementedError( "Command `stocks/fa/dupont` does not have a charting function" ) -def stocks_fa_enterprise(**kwargs): +def stocks_fa_enterprise(**kwargs) -> Tuple[OpenBBFigure, Dict[str, Any]]: raise NotImplementedError( "Command `stocks/fa/enterprise` does not have a charting function" ) -def stocks_fa_epsfc(**kwargs): +def stocks_fa_epsfc(**kwargs) -> Tuple[OpenBBFigure, Dict[str, Any]]: raise NotImplementedError( "Command `stocks/fa/epsfc` does not have a charting function" ) -def stocks_fa_analysis(**kwargs): +def stocks_fa_analysis(**kwargs) -> Tuple[OpenBBFigure, Dict[str, Any]]: raise NotImplementedError( "Command `stocks/fa/analysis` does not have a charting function" ) -def stocks_fa_fama_coe(**kwargs): +def stocks_fa_fama_coe(**kwargs) -> Tuple[OpenBBFigure, Dict[str, Any]]: raise NotImplementedError( "Command `stocks/fa/fama/coe` does not have a charting function" ) -def stocks_fa_fama_raw(**kwargs): +def stocks_fa_fama_raw(**kwargs) -> Tuple[OpenBBFigure, Dict[str, Any]]: raise NotImplementedError( "Command `stocks/fa/fama/raw` does not have a charting function" ) -def stocks_fa_fraud(**kwargs): +def stocks_fa_fraud(**kwargs) -> Tuple[OpenBBFigure, Dict[str, Any]]: raise NotImplementedError( "Command `stocks/fa/fraud` does not have a charting function" ) -def stocks_fa_growth(**kwargs): +def stocks_fa_growth(**kwargs) -> Tuple[OpenBBFigure, Dict[str, Any]]: raise NotImplementedError( "Command `stocks/fa/growth` does not have a charting function" ) -def stocks_fa_historical_5(**kwargs): +def stocks_fa_historical_5(**kwargs) -> Tuple[OpenBBFigure, Dict[str, Any]]: raise NotImplementedError( "Command `stocks/fa/historical/5` does not have a charting function" ) -def stocks_fa_key(**kwargs): +def stocks_fa_key(**kwargs) -> Tuple[OpenBBFigure, Dict[str, Any]]: raise NotImplementedError( "Command `stocks/fa/key` does not have a charting function" ) -def stocks_fa_mktcap(**kwargs): +def stocks_fa_mktcap(**kwargs) -> Tuple[OpenBBFigure, Dict[str, Any]]: raise NotImplementedError( "Command `stocks/fa/mktcap` does not have a charting function" ) -def stocks_fa_news(**kwargs): +def stocks_fa_news(**kwargs) -> Tuple[OpenBBFigure, Dict[str, Any]]: raise NotImplementedError( "Command `stocks/fa/news` does not have a charting function" ) -def stocks_fa_rating(**kwargs): +def stocks_fa_rating(**kwargs) -> Tuple[OpenBBFigure, Dict[str, Any]]: raise NotImplementedError( "Command `stocks/fa/rating` does not have a charting function" ) -def stocks_fa_ratios(**kwargs): +def stocks_fa_ratios(**kwargs) -> Tuple[OpenBBFigure, Dict[str, Any]]: raise NotImplementedError( "Command `stocks/fa/ratios` does not have a charting function" ) -def stocks_fa_revfc(**kwargs): +def stocks_fa_revfc(**kwargs) -> Tuple[OpenBBFigure, Dict[str, Any]]: raise NotImplementedError( "Command `stocks/fa/revfc` does not have a charting function" ) -def stocks_fa_rot(**kwargs): +def stocks_fa_rot(**kwargs) -> Tuple[OpenBBFigure, Dict[str, Any]]: raise NotImplementedError( "Command `stocks/fa/rot` does not have a charting function" ) -def stocks_fa_score(**kwargs): +def stocks_fa_score(**kwargs) -> Tuple[OpenBBFigure, Dict[str, Any]]: raise NotImplementedError( "Command `stocks/fa/score` does not have a charting function" ) -def stocks_fa_sec(**kwargs): +def stocks_fa_sec(**kwargs) -> Tuple[OpenBBFigure, Dict[str, Any]]: raise NotImplementedError( "Command `stocks/fa/sec` does not have a charting function" ) -def stocks_fa_supplier(**kwargs): +def stocks_fa_supplier(**kwargs) -> Tuple[OpenBBFigure, Dict[str, Any]]: raise NotImplementedError( "Command `stocks/fa/supplier` does not have a charting function" ) -def stocks_ca_get(**kwargs): +def stocks_ca_get(**kwargs) -> Tuple[OpenBBFigure, Dict[str, Any]]: raise NotImplementedError( "Command `stocks/ca/get` does not have a charting function" ) -def stocks_ca_balance(**kwargs): +def stocks_ca_balance(**kwargs) -> Tuple[OpenBBFigure, Dict[str, Any]]: raise NotImplementedError( "Command `stocks/ca/balance` does not have a charting function" ) -def stocks_ca_cashflow(**kwargs): +def stocks_ca_cashflow(**kwargs) -> Tuple[OpenBBFigure, Dict[str, Any]]: raise NotImplementedError( "Command `stocks/ca/cashflow` does not have a charting function" ) -def stocks_ca_hcorr(**kwargs): +def stocks_ca_hcorr(**kwargs) -> Tuple[OpenBBFigure, Dict[str, Any]]: raise NotImplementedError( "Command `stocks/ca/hcorr` does not have a charting function" ) -def stocks_ca_hist(**kwargs): +def stocks_ca_hist(**kwargs) -> Tuple[OpenBBFigure, Dict[str, Any]]: raise NotImplementedError( "Command `stocks/ca/hist` does not have a charting function" ) -def stocks_ca_income(**kwargs): +def stocks_ca_income(**kwargs) -> Tuple[OpenBBFigure, Dict[str, Any]]: raise NotImplementedError( "Command `stocks/ca/income` does not have a charting function" ) -def stocks_ca_scorr(**kwargs): +def stocks_ca_scorr(**kwargs) -> Tuple[OpenBBFigure, Dict[str, Any]]: raise NotImplementedError( "Command `stocks/ca/scorr` does not have a charting function" ) -def stocks_ca_screener(**kwargs): +def stocks_ca_screener(**kwargs) -> Tuple[OpenBBFigure, Dict[str, Any]]: raise NotImplementedError( "Command `stocks/ca/screener` does not have a charting function" ) -def stocks_ca_sentiment(**kwargs): +def stocks_ca_sentiment(**kwargs) -> Tuple[OpenBBFigure, Dict[str, Any]]: raise NotImplementedError( "Command `stocks/ca/sentiment` does not have a charting function" ) -def stocks_ca_similar(**kwargs): +def stocks_ca_similar(**kwargs) -> Tuple[OpenBBFigure, Dict[str, Any]]: raise NotImplementedError( "Command `stocks/ca/similar` does not have a charting function" ) -def stocks_ca_volume(**kwargs): +def stocks_ca_volume(**kwargs) -> Tuple[OpenBBFigure, Dict[str, Any]]: raise NotImplementedError( "Command `stocks/ca/volume` does not have a charting function" ) -def stocks_dd_sec(**kwargs): +def stocks_dd_sec(**kwargs) -> Tuple[OpenBBFigure, Dict[str, Any]]: raise NotImplementedError( "Command `stocks/dd/sec` does not have a charting function" ) -def stocks_dps_psi(**kwargs): +def stocks_dps_psi(**kwargs) -> Tuple[OpenBBFigure, Dict[str, Any]]: raise NotImplementedError( "Command `stocks/dps/psi` does not have a charting function" ) -def stocks_dps_ctb(**kwargs): +def stocks_dps_ctb(**kwargs) -> Tuple[OpenBBFigure, Dict[str, Any]]: raise NotImplementedError( "Command `stocks/dps/ctb` does not have a charting function" ) -def stocks_dps_dpotc(**kwargs): +def stocks_dps_dpotc(**kwargs) -> Tuple[OpenBBFigure, Dict[str, Any]]: raise NotImplementedError( "Command `stocks/dps/dpotc` does not have a charting function" ) -def stocks_dps_ftd(**kwargs): +def stocks_dps_ftd(**kwargs) -> Tuple[OpenBBFigure, Dict[str, Any]]: raise NotImplementedError( "Command `stocks/dps/ftd` does not have a charting function" ) -def stocks_dps_hsi(**kwargs): +def stocks_dps_hsi(**kwargs) -> Tuple[OpenBBFigure, Dict[str, Any]]: raise NotImplementedError( "Command `stocks/dps/hsi` does not have a charting function" ) -def stocks_dps_pos(**kwargs): +def stocks_dps_pos(**kwargs) -> Tuple[OpenBBFigure, Dict[str, Any]]: raise NotImplementedError( "Command `stocks/dps/pos` does not have a charting function" ) -def stocks_dps_prom(**kwargs): +def stocks_dps_prom(**kwargs) -> Tuple[OpenBBFigure, Dict[str, Any]]: raise NotImplementedError( "Command `stocks/dps/prom` does not have a charting function" ) -def stocks_dps_psi_q(**kwargs): +def stocks_dps_psi_q(**kwargs) -> Tuple[OpenBBFigure, Dict[str, Any]]: raise NotImplementedError( "Command `stocks/dps/psi/q` does not have a charting function" ) -def stocks_dps_psi_sg(**kwargs): +def stocks_dps_psi_sg(**kwargs) -> Tuple[OpenBBFigure, Dict[str, Any]]: raise NotImplementedError( "Command `stocks/dps/psi/sg` does not have a charting function" ) -def stocks_dps_shorted(**kwargs): +def stocks_dps_shorted(**kwargs) -> Tuple[OpenBBFigure, Dict[str, Any]]: raise NotImplementedError( "Command `stocks/dps/shorted` does not have a charting function" ) -def stocks_dps_sidtc(**kwargs): +def stocks_dps_sidtc(**kwargs) -> Tuple[OpenBBFigure, Dict[str, Any]]: raise NotImplementedError( "Command `stocks/dps/sidtc` does not have a charting function" ) -def stocks_dps_spos(**kwargs): +def stocks_dps_spos(**kwargs) -> Tuple[OpenBBFigure, Dict[str, Any]]: raise NotImplementedError( "Command `stocks/dps/spos` does not have a charting function" ) -def stocks_disc_active(**kwargs): +def stocks_disc_active(**kwargs) -> Tuple[OpenBBFigure, Dict[str, Any]]: raise NotImplementedError( "Command `stocks/disc/active` does not have a charting function" ) -def stocks_disc_arkord(**kwargs): +def stocks_disc_arkord(**kwargs) -> Tuple[OpenBBFigure, Dict[str, Any]]: raise NotImplementedError( "Command `stocks/disc/arkord` does not have a charting function" ) -def stocks_disc_asc(**kwargs): +def stocks_disc_asc(**kwargs) -> Tuple[OpenBBFigure, Dict[str, Any]]: raise NotImplementedError( "Command `stocks/disc/asc` does not have a charting function" ) -def stocks_disc_dividends(**kwargs): +def stocks_disc_dividends(**kwargs) -> Tuple[OpenBBFigure, Dict[str, Any]]: raise NotImplementedError( "Command `stocks/disc/dividends` does not have a charting function" ) -def stocks_disc_filings(**kwargs): +def stocks_disc_filings(**kwargs) -> Tuple[OpenBBFigure, Dict[str, Any]]: raise NotImplementedError( "Command `stocks/disc/filings` does not have a charting function" ) -def stocks_disc_fipo(**kwargs): +def stocks_disc_fipo(**kwargs) -> Tuple[OpenBBFigure, Dict[str, Any]]: raise NotImplementedError( "Command `stocks/disc/fipo` does not have a charting function" ) -def stocks_disc_gainers(**kwargs): +def stocks_disc_gainers(**kwargs) -> Tuple[OpenBBFigure, Dict[str, Any]]: raise NotImplementedError( "Command `stocks/disc/gainers` does not have a charting function" ) -def stocks_disc_gtech(**kwargs): +def stocks_disc_gtech(**kwargs) -> Tuple[OpenBBFigure, Dict[str, Any]]: raise NotImplementedError( "Command `stocks/disc/gtech` does not have a charting function" ) -def stocks_disc_hotpenny(**kwargs): +def stocks_disc_hotpenny(**kwargs) -> Tuple[OpenBBFigure, Dict[str, Any]]: raise NotImplementedError( "Command `stocks/disc/hotpenny` does not have a charting function" ) -def stocks_disc_ipo(**kwargs): +def stocks_disc_ipo(**kwargs) -> Tuple[OpenBBFigure, Dict[str, Any]]: raise NotImplementedError( "Command `stocks/disc/ipo` does not have a charting function" ) -def stocks_disc_losers(**kwargs): +def stocks_disc_losers(**kwargs) -> Tuple[OpenBBFigure, Dict[str, Any]]: raise NotImplementedError( "Command `stocks/disc/losers` does not have a charting function" ) -def stocks_disc_lowfloat(**kwargs): +def stocks_disc_lowfloat(**kwargs) -> Tuple[OpenBBFigure, Dict[str, Any]]: raise NotImplementedError( "Command `stocks/disc/lowfloat` does not have a charting function" ) -def stocks_disc_pipo(**kwargs): +def stocks_disc_pipo(**kwargs) -> Tuple[OpenBBFigure, Dict[str, Any]]: raise NotImplementedError( "Command `stocks/disc/pipo` does not have a charting function" ) -def stocks_disc_rtat(**kwargs): +def stocks_disc_rtat(**kwargs) -> Tuple[OpenBBFigure, Dict[str, Any]]: raise NotImplementedError( "Command `stocks/disc/rtat` does not have a charting function" ) -def stocks_disc_trending(**kwargs): +def stocks_disc_trending(**kwargs) -> Tuple[OpenBBFigure, Dict[str, Any]]: raise NotImplementedError( "Command `stocks/disc/trending` does not have a charting function" ) -def stocks_disc_ugs(**kwargs): +def stocks_disc_ugs(**kwargs) -> Tuple[OpenBBFigure, Dict[str, Any]]: raise NotImplementedError( "Command `stocks/disc/ugs` does not have a charting function" ) -def stocks_disc_ulc(**kwargs): +def stocks_disc_ulc(**kwargs) -> Tuple[OpenBBFigure, Dict[str, Any]]: raise NotImplementedError( "Command `stocks/disc/ulc` does not have a charting function" ) -def stocks_disc_upcoming(**kwargs): +def stocks_disc_upcoming(**kwargs) -> Tuple[OpenBBFigure, Dict[str, Any]]: raise NotImplementedError( "Command `stocks/disc/upcoming` does not have a charting function" ) -def stocks_gov_contracts(**kwargs): +def stocks_gov_contracts(**kwargs) -> Tuple[OpenBBFigure, Dict[str, Any]]: raise NotImplementedError( "Command `stocks/gov/contracts` does not have a charting function" ) -def stocks_gov_government_trading(**kwargs): +def stocks_gov_government_trading(**kwargs) -> Tuple[OpenBBFigure, Dict[str, Any]]: raise NotImplementedError( "Command `stocks/gov/government/trading` does not have a charting function" ) -def stocks_gov_gtrades(**kwargs): +def stocks_gov_gtrades(**kwargs) -> Tuple[OpenBBFigure, Dict[str, Any]]: raise NotImplementedError( "Command `stocks/gov/gtrades` does not have a charting function" ) -def stocks_gov_histcont(**kwargs): +def stocks_gov_histcont(**kwargs) -> Tuple[OpenBBFigure, Dict[str, Any]]: raise NotImplementedError( "Command `stocks/gov/histcont` does not have a charting function" ) -def stocks_gov_lastcontracts(**kwargs): +def stocks_gov_lastcontracts(**kwargs) -> Tuple[OpenBBFigure, Dict[str, Any]]: raise NotImplementedError( "Command `stocks/gov/lastcontracts` does not have a charting function" ) -def stocks_gov_lasttrades(**kwargs): +def stocks_gov_lasttrades(**kwargs) -> Tuple[OpenBBFigure, Dict[str, Any]]: raise NotImplementedError( "Command `stocks/gov/lasttrades` does not have a charting function" ) -def stocks_gov_lobbying(**kwargs): +def stocks_gov_lobbying(**kwargs) -> Tuple[OpenBBFigure, Dict[str, Any]]: raise NotImplementedError( "Command `stocks/gov/lobbying` does not have a charting function" ) -def stocks_gov_qtrcontracts(**kwargs): +def stocks_gov_qtrcontracts(**kwargs) -> Tuple[OpenBBFigure, Dict[str, Any]]: raise NotImplementedError( "Command `stocks/gov/qtrcontracts` does not have a charting function" ) -def stocks_gov_topbuys(**kwargs): +def stocks_gov_topbuys(**kwargs) -> Tuple[OpenBBFigure, Dict[str, Any]]: raise NotImplementedError( "Command `stocks/gov/topbuys` does not have a charting function" ) -def stocks_gov_toplobbying(**kwargs): +def stocks_gov_toplobbying(**kwargs) -> Tuple[OpenBBFigure, Dict[str, Any]]: raise NotImplementedError( "Command `stocks/gov/toplobbying` does not have a charting function" ) -def stocks_gov_topsells(**kwargs): +def stocks_gov_topsells(**kwargs) -> Tuple[OpenBBFigure, Dict[str, Any]]: raise NotImplementedError( "Command `stocks/gov/topsells` does not have a charting function" ) -def stocks_ins_act(**kwargs): +def stocks_ins_act(**kwargs) -> Tuple[OpenBBFigure, Dict[str, Any]]: raise NotImplementedError( "Command `stocks/ins/act` does not have a charting function" ) -def stocks_ins_blcp(**kwargs): +def stocks_ins_blcp(**kwargs) -> Tuple[OpenBBFigure, Dict[str, Any]]: raise NotImplementedError( "Command `stocks/ins/blcp` does not have a charting function" ) -def stocks_ins_blcs(**kwargs): +def stocks_ins_blcs(**kwargs) -> Tuple[OpenBBFigure, Dict[str, Any]]: raise NotImplementedError( "Command `stocks/ins/blcs` does not have a charting function" ) -def stocks_ins_blip(**kwargs): +def stocks_ins_blip(**kwargs) -> Tuple[OpenBBFigure, Dict[str, Any]]: raise NotImplementedError( "Command `stocks/ins/blip` does not have a charting function" ) -def stocks_ins_blis(**kwargs): +def stocks_ins_blis(**kwargs) -> Tuple[OpenBBFigure, Dict[str, Any]]: raise NotImplementedError( "Command `stocks/ins/blis` does not have a charting function" ) -def stocks_ins_blop(**kwargs): +def stocks_ins_blop(**kwargs) -> Tuple[OpenBBFigure, Dict[str, Any]]: raise NotImplementedError( "Command `stocks/ins/blop` does not have a charting function" ) -def stocks_ins_blos(**kwargs): +def stocks_ins_blos(**kwargs) -> Tuple[OpenBBFigure, Dict[str, Any]]: raise NotImplementedError( "Command `stocks/ins/blos` does not have a charting function" ) -def stocks_ins_filter(**kwargs): +def stocks_ins_filter(**kwargs) -> Tuple[OpenBBFigure, Dict[str, Any]]: raise NotImplementedError( "Command `stocks/ins/filter` does not have a charting function" ) -def stocks_ins_lcb(**kwargs): +def stocks_ins_lcb(**kwargs) -> Tuple[OpenBBFigure, Dict[str, Any]]: raise NotImplementedError( "Command `stocks/ins/lcb` does not have a charting function" ) -def stocks_ins_lins(**kwargs): +def stocks_ins_lins(**kwargs) -> Tuple[OpenBBFigure, Dict[str, Any]]: raise NotImplementedError( "Command `stocks/ins/lins` does not have a charting function" ) -def stocks_ins_lip(**kwargs): +def stocks_ins_lip(**kwargs) -> Tuple[OpenBBFigure, Dict[str, Any]]: raise NotImplementedError( "Command `stocks/ins/lip` does not have a charting function" ) -def stocks_ins_lis(**kwargs): +def stocks_ins_lis(**kwargs) -> Tuple[OpenBBFigure, Dict[str, Any]]: raise NotImplementedError( "Command `stocks/ins/lis` does not have a charting function" ) -def stocks_ins_lit(**kwargs): +def stocks_ins_lit(**kwargs) -> Tuple[OpenBBFigure, Dict[str, Any]]: raise NotImplementedError( "Command `stocks/ins/lit` does not have a charting function" ) -def stocks_ins_lpsb(**kwargs): +def stocks_ins_lpsb(**kwargs) -> Tuple[OpenBBFigure, Dict[str, Any]]: raise NotImplementedError( "Command `stocks/ins/lpsb` does not have a charting function" ) -def stocks_ins_print_insider_data(**kwargs): +def stocks_ins_print_insider_data(**kwargs) -> Tuple[OpenBBFigure, Dict[str, Any]]: raise NotImplementedError( "Command `stocks/ins/print/insider/data` does not have a charting function" ) -def stocks_ins_stats(**kwargs): +def stocks_ins_stats(**kwargs) -> Tuple[OpenBBFigure, Dict[str, Any]]: raise NotImplementedError( "Command `stocks/ins/stats` does not have a charting function" ) -def stocks_options_chains(**kwargs): +def stocks_options_chains(**kwargs) -> Tuple[OpenBBFigure, Dict[str, Any]]: raise NotImplementedError( "Command `stocks/options/chains` does not have a charting function" ) -def stocks_options_dte(**kwargs): +def stocks_options_dte(**kwargs) -> Tuple[OpenBBFigure, Dict[str, Any]]: raise NotImplementedError( "Command `stocks/options/dte` does not have a charting function" ) -def stocks_options_eodchain(**kwargs): +def stocks_options_eodchain(**kwargs) -> Tuple[OpenBBFigure, Dict[str, Any]]: raise NotImplementedError( "Command `stocks/options/eodchain` does not have a charting function" ) -def stocks_options_expirations(**kwargs): +def stocks_options_expirations(**kwargs) -> Tuple[OpenBBFigure, Dict[str, Any]]: raise NotImplementedError( "Command `stocks/options/expirations` does not have a charting function" ) -def stocks_options_grhist(**kwargs): +def stocks_options_grhist(**kwargs) -> Tuple[OpenBBFigure, Dict[str, Any]]: raise NotImplementedError( "Command `stocks/options/grhist` does not have a charting function" ) -def stocks_options_hist(**kwargs): +def stocks_options_hist(**kwargs) -> Tuple[OpenBBFigure, Dict[str, Any]]: raise NotImplementedError( "Command `stocks/options/hist` does not have a charting function" ) -def stocks_options_info(**kwargs): +def stocks_options_info(**kwargs) -> Tuple[OpenBBFigure, Dict[str, Any]]: raise NotImplementedError( "Command `stocks/options/info` does not have a charting function" ) -def stocks_options_last_price(**kwargs): +def stocks_options_last_price(**kwargs) -> Tuple[OpenBBFigure, Dict[str, Any]]: raise NotImplementedError( "Command `stocks/options/last/price` does not have a charting function" ) -def stocks_options_oi(**kwargs): +def stocks_options_oi(**kwargs) -> Tuple[OpenBBFigure, Dict[str, Any]]: raise NotImplementedError( "Command `stocks/options/oi` does not have a charting function" ) -def stocks_options_pcr(**kwargs): +def stocks_options_pcr(**kwargs) -> Tuple[OpenBBFigure, Dict[str, Any]]: raise NotImplementedError( "Command `stocks/options/pcr` does not have a charting function" ) -def stocks_options_price(**kwargs): +def stocks_options_price(**kwargs) -> Tuple[OpenBBFigure, Dict[str, Any]]: raise NotImplementedError( "Command `stocks/options/price` does not have a charting function" ) -def stocks_options_unu(**kwargs): +def stocks_options_unu(**kwargs) -> Tuple[OpenBBFigure, Dict[str, Any]]: raise NotImplementedError( "Command `stocks/options/unu` does not have a charting function" ) -def stocks_options_voi(**kwargs): +def stocks_options_voi(**kwargs) -> Tuple[OpenBBFigure, Dict[str, Any]]: raise NotImplementedError( "Command `stocks/options/voi` does not have a charting function" ) -def stocks_options_vol(**kwargs): +def stocks_options_vol(**kwargs) -> Tuple[OpenBBFigure, Dict[str, Any]]: raise NotImplementedError( "Command `stocks/options/vol` does not have a charting function" ) -def stocks_options_vsurf(**kwargs): +def stocks_options_vsurf(**kwargs) -> Tuple[OpenBBFigure, Dict[str, Any]]: raise NotImplementedError( "Command `stocks/options/vsurf` does not have a charting function" ) -def stocks_load(**kwargs): +def stocks_load(**kwargs) -> Tuple[OpenBBFigure, Dict[str, Any]]: def handle_indicators(ma): k = {} if ma: @@ -1674,25 +1834,35 @@ def stocks_load(**kwargs): symbol=f"{symbol} historical data", prepost=prepost, ) + content = fig.show(external=True).to_plotly_json() - return fig.show(external=True).to_plotly_json() + return fig, content -def stocks_news(**kwargs): - raise NotImplementedError("Command `stocks/news` does not have a charting function") +def stocks_news(**kwargs) -> Tuple[OpenBBFigure, Dict[str, Any]]: + data = basemodel_to_df( + kwargs["command_output_item"], index=kwargs.get("index", "date") + ) + standard_params = kwargs["standard_params"].__dict__ + columnwidth = standard_params.get("columnwidth", None) + + tbl_fig = OpenBBFigureTable(tabular_data=data, columnwidth=columnwidth) + content = tbl_fig.to_table().show(external=True).to_plotly_json() + + return tbl_fig, content -def stocks_tob(**kwargs): +def stocks_tob(**kwargs) -> Tuple[OpenBBFigure, Dict[str, Any]]: raise NotImplementedError("Command `stocks/tob` does not have a charting function") -def stocks_quote(**kwargs): +def stocks_quote(**kwargs) -> Tuple[OpenBBFigure, Dict[str, Any]]: raise NotImplementedError( "Command `stocks/quote` does not have a charting function" ) -def stocks_search(**kwargs): +def stocks_search(**kwargs) -> Tuple[OpenBBFigure, Dict[str, Any]]: raise NotImplementedError( "Command `stocks/search` does not have a charting function" ) @@ -1700,7 +1870,7 @@ def stocks_search(**kwargs): def _ta_ma(ma_type: str, **kwargs): data = basemodel_to_df(kwargs["data"], index=kwargs.get("index", "date")) - window = kwargs.get("window", 50) + window = kwargs.get("windowstocks_load", 50) offset = kwargs.get("offset", 0) symbol = kwargs.get("symbol", "") @@ -1712,48 +1882,49 @@ def _ta_ma(ma_type: str, **kwargs): False, volume=False, ) + content = fig.show(external=True).to_plotly_json() - return fig.show(external=True).to_plotly_json() + return fig, content -def ta_atr(**kwargs): +def ta_atr(**kwargs) -> Tuple[OpenBBFigure, Dict[str, Any]]: raise NotImplementedError("Command `ta/atr` does not have a charting function") -def ta_fib(**kwargs): +def ta_fib(**kwargs) -> Tuple[OpenBBFigure, Dict[str, Any]]: raise NotImplementedError("Command `ta/fib` does not have a charting function") -def ta_obv(**kwargs): +def ta_obv(**kwargs) -> Tuple[OpenBBFigure, Dict[str, Any]]: raise NotImplementedError("Command `ta/obv` does not have a charting function") -def ta_fisher(**kwargs): +def ta_fisher(**kwargs) -> Tuple[OpenBBFigure, Dict[str, Any]]: raise NotImplementedError("Command `ta/fisher` does not have a charting function") -def ta_adosc(**kwargs): +def ta_adosc(**kwargs) -> Tuple[OpenBBFigure, Dict[str, Any]]: raise NotImplementedError("Command `ta/adosc` does not have a charting function") -def ta_tv(**kwargs): +def ta_tv(**kwargs) -> Tuple[OpenBBFigure, Dict[str, Any]]: raise NotImplementedError("Command `ta/tv` does not have a charting function") -def ta_bbands(**kwargs): +def ta_bbands(**kwargs) -> Tuple[OpenBBFigure, Dict[str, Any]]: raise NotImplementedError("Command `ta/bbands` does not have a charting function") -def ta_multi(**kwargs): +def ta_multi(**kwargs) -> Tuple[OpenBBFigure, Dict[str, Any]]: raise NotImplementedError("Command `ta/multi` does not have a charting function") -def ta_zlma(**kwargs): +def ta_zlma(**kwargs) -> Tuple[OpenBBFigure, Dict[str, Any]]: ma_type = "zlma" return _ta_ma(ma_type, **kwargs) -def ta_aroon(**kwargs): +def ta_aroon(**kwargs) -> Tuple[OpenBBFigure, Dict[str, Any]]: data = basemodel_to_df(kwargs["data"], index=kwargs.get("index", "date")) length = kwargs.get("length", 25) scalar = kwargs.get("scalar", 100) @@ -1767,28 +1938,29 @@ def ta_aroon(**kwargs): False, volume=False, ) + content = fig.show(external=True).to_plotly_json() - return fig.show(external=True).to_plotly_json() + return fig, content -def ta_sma(**kwargs): +def ta_sma(**kwargs) -> Tuple[OpenBBFigure, Dict[str, Any]]: ma_type = "sma" return _ta_ma(ma_type, **kwargs) -def ta_demark(**kwargs): +def ta_demark(**kwargs) -> Tuple[OpenBBFigure, Dict[str, Any]]: raise NotImplementedError("Command `ta/demark` does not have a charting function") -def ta_vwap(**kwargs): +def ta_vwap(**kwargs) -> Tuple[OpenBBFigure, Dict[str, Any]]: raise NotImplementedError("Command `ta/vwap` does not have a charting function") -def ta_recom(**kwargs): +def ta_recom(**kwargs) -> Tuple[OpenBBFigure, Dict[str, Any]]: raise NotImplementedError("Command `ta/recom` does not have a charting function") -def ta_macd(**kwargs): +def ta_macd(**kwargs) -> Tuple[OpenBBFigure, Dict[str, Any]]: data = basemodel_to_df(kwargs["data"], index=kwargs.get("index", "date")) fast = kwargs.get("fast", 12) slow = kwargs.get("slow", 26) @@ -1803,32 +1975,33 @@ def ta_macd(**kwargs): False, volume=False, ) + content = fig.show(external=True).to_plotly_json() - return fig.show(external=True).to_plotly_json() + return fig, content -def ta_hma(**kwargs): +def ta_hma(**kwargs) -> Tuple[OpenBBFigure, Dict[str, Any]]: ma_type = "hma" return _ta_ma(ma_type, **kwargs) -def ta_donchian(**kwargs): +def ta_donchian(**kwargs) -> Tuple[OpenBBFigure, Dict[str, Any]]: raise NotImplementedError("Command `ta/donchian` does not have a charting function") -def ta_ichimoku(**kwargs): +def ta_ichimoku(**kwargs) -> Tuple[OpenBBFigure, Dict[str, Any]]: raise NotImplementedError("Command `ta/ichimoku` does not have a charting function") -def ta_clenow(**kwargs): +def ta_clenow(**kwargs) -> Tuple[OpenBBFigure, Dict[str, Any]]: raise NotImplementedError("Command `ta/clenow` does not have a charting function") -def ta_ad(**kwargs): +def ta_ad(**kwargs) -> Tuple[OpenBBFigure, Dict[str, Any]]: raise NotImplementedError("Command `ta/ad` does not have a charting function") -def ta_adx(**kwargs): +def ta_adx(**kwargs) -> Tuple[OpenBBFigure, Dict[str, Any]]: data = basemodel_to_df(kwargs["data"], index=kwargs.get("index", "date")) length = kwargs.get("length", 14) scalar = kwargs.get("scalar", 100.0) @@ -1843,20 +2016,21 @@ def ta_adx(**kwargs): False, volume=False, ) + content = fig.show(external=True).to_plotly_json() - return fig.show(external=True).to_plotly_json() + return fig, content -def ta_wma(**kwargs): +def ta_wma(**kwargs) -> Tuple[OpenBBFigure, Dict[str, Any]]: ma_type = "wma" return _ta_ma(ma_type, **kwargs) -def ta_cci(**kwargs): +def ta_cci(**kwargs) -> Tuple[OpenBBFigure, Dict[str, Any]]: raise NotImplementedError("Command `ta/cci` does not have a charting function") -def ta_rsi(**kwargs): +def ta_rsi(**kwargs) -> Tuple[OpenBBFigure, Dict[str, Any]]: data = basemodel_to_df(kwargs["data"], index=kwargs.get("index", "date")) window = kwargs.get("window", 14) scalar = kwargs.get("scalar", 100.0) @@ -1871,34 +2045,76 @@ def ta_rsi(**kwargs): False, volume=False, ) + content = fig.show(external=True).to_plotly_json() - return fig.show(external=True).to_plotly_json() + return fig, content -def ta_summary(**kwargs): +def ta_summary(**kwargs) -> Tuple[OpenBBFigure, Dict[str, Any]]: raise NotImplementedError("Command `ta/summary` does not have a charting function") -def ta_stoch(**kwargs): +def ta_stoch(**kwargs) -> Tuple[OpenBBFigure, Dict[str, Any]]: raise NotImplementedError("Command `ta/stoch` does not have a charting function") -def ta_rsp(**kwargs): +def ta_rsp(**kwargs) -> Tuple[OpenBBFigure, Dict[str, Any]]: raise NotImplementedError("Command `ta/rsp` does not have a charting function") -def ta_kc(**kwargs): +def ta_kc(**kwargs) -> Tuple[OpenBBFigure, Dict[str, Any]]: raise NotImplementedError("Command `ta/kc` does not have a charting function") -def ta_cg(**kwargs): +def ta_cg(**kwargs) -> Tuple[OpenBBFigure, Dict[str, Any]]: raise NotImplementedError("Command `ta/cg` does not have a charting function") -def ta_cones(**kwargs): +def ta_cones(**kwargs) -> Tuple[OpenBBFigure, Dict[str, Any]]: raise NotImplementedError("Command `ta/cones` does not have a charting function") -def ta_ema(**kwargs): +def ta_ema(**kwargs) -> Tuple[OpenBBFigure, Dict[str, Any]]: ma_type = "ema" return _ta_ma(ma_type, **kwargs) + + +def forex_pairs(**kwargs) -> Tuple[OpenBBFigure, Dict[str, Any]]: + raise NotImplementedError("Command `forex/pairs` does not have a charting function") + + +def economy_const(**kwargs) -> Tuple[OpenBBFigure, Dict[str, Any]]: + raise NotImplementedError( + "Command `economy/const` does not have a charting function" + ) + + +def economy_risk(**kwargs) -> Tuple[OpenBBFigure, Dict[str, Any]]: + raise NotImplementedError( + "Command `economy/risk` does not have a charting function" + ) + + +def stocks_fa_comsplit(**kwargs) -> Tuple[OpenBBFigure, Dict[str, Any]]: + raise NotImplementedError( + "Command `stocks/fa/comsplit` does not have a charting function" + ) + + +def stocks_ins_filt(**kwargs) -> Tuple[OpenBBFigure, Dict[str, Any]]: + raise NotImplementedError( + "Command `stocks/ins/filt` does not have a charting function" + ) + + +def stocks_multiples(**kwargs) -> Tuple[OpenBBFigure, Dict[str, Any]]: + data = basemodel_to_df( + kwargs["command_output_item"], index=kwargs.get("index", "date") + ) + standard_params = kwargs["standard_params"].__dict__ + columnwidth = standard_params.get("columnwidth", None) + + tbl_fig = OpenBBFigureTable(tabular_data=data, columnwidth=columnwidth) + content = tbl_fig.to_table().show(external=True).to_plotly_json() + + return tbl_fig, content diff --git a/openbb_sdk/extensions/charting/openbb_charting/core/chart_style.py b/openbb_sdk/extensions/charting/openbb_charting/core/chart_style.py index eb52de74e08..e90491b95af 100644 --- a/openbb_sdk/extensions/charting/openbb_charting/core/chart_style.py +++ b/openbb_sdk/extensions/charting/openbb_charting/core/chart_style.py @@ -137,7 +137,7 @@ class ChartStyle: for attr, ext in zip( ["plt_styles_available", "console_styles_available"], - [".pltstyle", ".richstyle.json"], + [".pltstyle.json", ".richstyle.json"], ): for file in folder.rglob(f"*{ext}"): getattr(self, attr)[file.name.replace(ext, "")] = file diff --git a/openbb_sdk/extensions/charting/openbb_charting/core/openbb_figure.py b/openbb_sdk/extensions/charting/openbb_charting/core/openbb_figure.py index 718bb7d1c3e..fd35d1238f5 100644 --- a/openbb_sdk/extensions/charting/openbb_charting/core/openbb_figure.py +++ b/openbb_sdk/extensions/charting/openbb_charting/core/openbb_figure.py @@ -338,9 +338,7 @@ class OpenBBFigure(go.Figure): for i, (x_i, name_i, color_i) in enumerate(zip(valid_x, name, colors)): if not color_i: color_i = ( # noqa: PLW2901 - self._self._theme.up_color - if i % 2 == 0 - else self._self._theme.down_color + self._theme.up_color if i % 2 == 0 else self._theme.down_color ) res_mean, res_std = np.mean(x_i), np.std(x_i) @@ -386,7 +384,7 @@ class OpenBBFigure(go.Figure): name=name_i if len(name) < 2 else name[1], mode="markers", marker=dict( - color=self._self._theme.down_color, + color=self._theme.down_color, symbol="line-ns-open", size=8, ), @@ -1381,7 +1379,7 @@ class OpenBBFigure(go.Figure): height = kwargs.pop("height", len(data.index) * 28 + 25) width = kwargs.pop("width", sum(columnwidth) * 8.7) - fig: OpenBBFigure = cls() + fig = OpenBBFigure(**kwargs) fig.add_table( header=dict(values=header_values), cells=dict( diff --git a/openbb_sdk/extensions/charting/openbb_charting/core/openbb_figure_table.py b/openbb_sdk/extensions/charting/openbb_charting/core/openbb_figure_table.py new file mode 100644 index 00000000000..b0d131a7251 --- /dev/null +++ b/openbb_sdk/extensions/charting/openbb_charting/core/openbb_figure_table.py @@ -0,0 +1,95 @@ +from typing import List, Optional, Union + +import pandas as pd + +from openbb_sdk.extensions.charting.openbb_charting.core.openbb_figure import ( + OpenBBFigure, +) + + +class OpenBBFigureTable(OpenBBFigure): + def __init__( + self, + tabular_data: pd.DataFrame, + columnwidth: Optional[List[Union[int, float]]] = None, + ): + super().__init__() + self._tabular_data = tabular_data + self._columnwidth = columnwidth + + def show( + self, + show_index: Optional[bool] = True, + index_name: Optional[str] = "", + headers: Optional[Union[List[str], pd.Index]] = None, + title: Optional[str] = "", + source: Optional[str] = "", + external: Optional[bool] = False, + ) -> Optional["OpenBBFigureTable"]: + if external: + return self + + if not self._backend.isatty: + tmp_fig = self.to_table() + tmp_fig.show() + else: + # Make a copy of the dataframe to avoid SettingWithCopyWarning + df = self._tabular_data.copy() + + show_index = not isinstance(df.index, pd.RangeIndex) and show_index + # convert non-str that are not timestamp or int into str + # eg) praw.models.reddit.subreddit.Subreddit + for col in df.columns: + try: + if not any( + isinstance(df[col].iloc[x], pd.Timestamp) + for x in range(min(10, len(df))) + ): + df[col] = pd.to_numeric(df[col], errors="ignore") + except (ValueError, TypeError): + df[col] = df[col].astype(str) + + def _get_headers(_headers: Union[List[str], pd.Index]) -> List[str]: + """Check if headers are valid and return them.""" + output = _headers + if isinstance(_headers, pd.Index): + output = list(_headers) + if len(output) != len(df.columns): + raise ( + ValueError( + "Length of headers does not match length of DataFrame" + ) + ) + return output + + df_outgoing = df.copy() + # If headers are provided, use them + if headers is not None: + # We check if headers are valid + df_outgoing.columns = _get_headers(headers) + + if show_index and index_name not in df_outgoing.columns: + # If index name is provided, we use it + df_outgoing.index.name = index_name or "Index" + df_outgoing = df_outgoing.reset_index() + + for col in df_outgoing.columns: + if col == "": + df_outgoing = df_outgoing.rename(columns={col: " "}) + + self._backend.send_table( + df_table=df_outgoing, + title=title, + source=source, # type: ignore + theme=self._charting_settings.table_style, + ) + + def to_table( + self, + print_index: bool = True, + **kwargs, + ) -> "OpenBBFigure": + data = self._tabular_data + columnwidth = self._columnwidth + + return super().to_table(data, columnwidth, print_index, **kwargs) diff --git a/openbb_sdk/extensions/charting/openbb_charting/core/to_plotly_json.py b/openbb_sdk/extensions/charting/openbb_charting/core/to_chart.py similarity index 88% rename from openbb_sdk/extensions/charting/openbb_charting/core/to_plotly_json.py rename to openbb_sdk/extensions/charting/openbb_charting/core/to_chart.py index 2a5745ae08b..f707a6aaab2 100644 --- a/openbb_sdk/extensions/charting/openbb_charting/core/to_plotly_json.py +++ b/openbb_sdk/extensions/charting/openbb_charting/core/to_chart.py @@ -1,12 +1,13 @@ -from typing import Any, Dict, Optional, Union +from typing import Any, Dict, Optional, Tuple, Union import pandas as pd +from openbb_charting.core.openbb_figure import OpenBBFigure from openbb_charting.core.plotly_ta.data_classes import ChartIndicators from openbb_charting.core.plotly_ta.ta_class import PlotlyTA from openbb_core.app.model.charts.charting_settings import ChartingSettings -def to_plotly_json( +def to_chart( charting_settings: ChartingSettings, data: Union[pd.DataFrame, pd.Series], indicators: Optional[Union[ChartIndicators, Dict[str, Dict[str, Any]]]] = None, @@ -15,7 +16,7 @@ def to_plotly_json( volume: bool = True, prepost: bool = False, volume_ticks_x: int = 7, -) -> str: +) -> Tuple[OpenBBFigure, Dict[str, Any]]: """ Returns the plotly json representation of the chart. This function is used so it can be called at the module level and used out of the box, @@ -57,5 +58,6 @@ def to_plotly_json( prepost=prepost, volume_ticks_x=volume_ticks_x, ) + content = fig.show(external=True).to_plotly_json() - return fig.show(external=True).to_plotly_json() + return fig, content diff --git a/openbb_sdk/extensions/charting/openbb_charting/styles/default/dark.pltstyle b/openbb_sdk/extensions/charting/openbb_charting/styles/default/dark.pltstyle.json similarity index 100% rename from openbb_sdk/extensions/charting/openbb_charting/styles/default/dark.pltstyle rename to openbb_sdk/extensions/charting/openbb_charting/styles/default/dark.pltstyle.json diff --git a/openbb_sdk/extensions/charting/openbb_charting/styles/default/light.pltstyle b/openbb_sdk/extensions/charting/openbb_charting/styles/default/light.pltstyle.json similarity index 100% rename from openbb_sdk/extensions/charting/openbb_charting/styles/default/light.pltstyle rename to openbb_sdk/extensions/charting/openbb_charting/styles/default/light.pltstyle.json diff --git a/openbb_sdk/extensions/charting/openbb_charting/styles/default/tables.pltstyle.json b/openbb_sdk/extensions/charting/openbb_charting/styles/default/tables.pltstyle.json new file mode 100644 index 00000000000..69f80ef4d88 --- /dev/null +++ b/openbb_sdk/extensions/charting/openbb_charting/styles/default/tables.pltstyle.json @@ -0,0 +1,102 @@ +{ + "data": { + "candlestick": [ + { + "decreasing": { + "fillcolor": "#e4003a", + "line": { + "color": "#e4003a" + } + }, + "increasing": { + "fillcolor": "#00ACFF", + "line": { + "color": "#00ACFF" + } + }, + "type": "candlestick" + } + ] + }, + "layout": { + "annotationdefaults": { + "showarrow": false + }, + "autotypenumbers": "strict", + "colorway": [ + "#ffed00", + "#ef7d00", + "#e4003a", + "#c13246", + "#822661", + "#48277c", + "#005ca9", + "#00aaff", + "#9b30d9", + "#af005f", + "#5f00af", + "#af87ff" + ], + "dragmode": "pan", + "font": { + "family": "Fira Code", + "size": 18 + }, + "hoverlabel": { + "align": "left" + }, + "mapbox": { + "style": "light" + }, + "hovermode": "x", + "legend": { + "bgcolor": "rgba(0, 0, 0, 0)", + "x": 0.01, + "xanchor": "left", + "y": 0.99, + "yanchor": "top", + "font": { + "size": 15 + } + }, + "paper_bgcolor": "white", + "plot_bgcolor": "white", + "xaxis": { + "automargin": true, + "autorange": true, + "rangeslider": { + "visible": false + }, + "showgrid": true, + "showline": true, + "tickfont": { + "size": 14 + }, + "zeroline": false, + "tick0": 1, + "title": { + "standoff": 20 + }, + "linecolor": "#F5EFF3", + "mirror": true, + "ticks": "outside" + }, + "yaxis": { + "anchor": "x", + "automargin": true, + "fixedrange": false, + "zeroline": false, + "showgrid": true, + "showline": true, + "side": "right", + "tick0": 0.5, + "title": { + "standoff": 20 + }, + "gridcolor": "#283442", + "linecolor": "#F5EFF3", + "mirror": true, + "ticks": "outside" + } + } +} diff --git a/openbb_sdk/providers/fmp/openbb_fmp/models/crypto_eod.py b/openbb_sdk/providers/fmp/openbb_fmp/models/crypto_eod.py index a0fb3f16505..ee191c4f965 100644 --- a/openbb_sdk/providers/fmp/openbb_fmp/models/crypto_eod.py +++ b/openbb_sdk/providers/fmp/openbb_fmp/models/crypto_eod.py @@ -20,7 +20,7 @@ class FMPCryptoEODQueryParams(CryptoEODQueryParams): """FMP Crypto end of day Query. Source: - https://site.financialmodelingprep.com/developer/docs/cryptocurrency-historical-data-api/#Historical-Daily-Prices + https://site.financialmodelingprep.com/developer/docs/cryptocurrency-historical-data-api/#Historical-Daily-Prices """ timeseries: Optional[NonNegativeInt] = Field( 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 a3c1c00b2b2..49ee6a65c5a 100644 --- a/openbb_sdk/sdk/core/openbb_core/api/router/commands.py +++ b/openbb_sdk/sdk/core/openbb_core/api/router/commands.py @@ -1,3 +1,4 @@ +import inspect from functools import partial, wraps from inspect import Parameter, Signature, signature from typing import Any, Callable, Dict, Tuple, TypeVar @@ -7,9 +8,11 @@ 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.user_settings import UserSettings from openbb_core.app.router import RouterLoader from openbb_core.app.service.system_service import SystemService +from pydantic import BaseModel from typing_extensions import Annotated, ParamSpec T = TypeVar("T") @@ -73,6 +76,52 @@ def build_new_signature(func): ) +def validate_output(c_out: CommandOutput) -> CommandOutput: + """ + Validate CommandOutput object. + Checks against the CommandOutput 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. + + Parameters + ---------- + c_out : CommandOutput + CommandOutput object to validate. + + Returns + ------- + CommandOutput + Validated CommandOutput object. + """ + + def is_model(type_): + return inspect.isclass(type_) and issubclass(type_, BaseModel) + + def exclude_fields_from_api(key: str, value: Any): + type_ = type(value) + + # case where 1st layer field needs to be excluded + if key in c_out.__fields__ and c_out.__fields__[key].field_info.extra.get( + "exclude_from_api", None + ): + delattr(c_out, key) + + # if it's a model with nested fields + elif is_model(type_): + for field in type_.__fields__.values(): + if field.field_info.extra.get("exclude_from_api", None): + delattr(value, field.name) + + # if it's a yet a nested model we need to go deeper in the recursion + elif is_model(field.type_): + exclude_fields_from_api(field.name, getattr(value, field.name)) + + for k, v in c_out: + exclude_fields_from_api(k, v) + + return c_out + + def build_api_wrapper( command_runner: CommandRunner, route: APIRoute, @@ -97,7 +146,7 @@ def build_api_wrapper( execute = partial(command_runner.run_once, user_settings, path) journal_entry = execute(*args, **kwargs) - return journal_entry.output + return validate_output(journal_entry.output) return wrapper 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 5f6fc25289f..d0f8188d7a8 100644 --- a/openbb_sdk/sdk/core/openbb_core/app/charting_manager.py +++ b/openbb_sdk/sdk/core/openbb_core/app/charting_manager.py @@ -144,10 +144,28 @@ class ChartingManager(metaclass=SingletonMeta): create_backend_func(charting_settings=charting_settings) get_backend_func().start(debug=charting_settings.debug_mode) - def to_plotly_json(self, **kwargs) -> str: + def to_chart(self, **kwargs) -> Chart: """ - Returns the plotly json representation of the chart. + Returns the chart object. + + Parameters + ---------- + **kwargs + Keyword arguments to be passed to the charting extension. + + Returns + ------- + Chart + Chart object. + + Raises + ------ + ChartingManagerError + If charting extension is not installed. + Exception + If the charting extension module does not contain the `to_chart` function. """ + if not self._charting_extension_installed: raise ChartingManagerError( f"Charting extension `{self._charting_extension}` is not installed" @@ -156,12 +174,19 @@ class ChartingManager(metaclass=SingletonMeta): # Dynamically import the charting module backend_module = import_module(self._charting_extension) - # Get the plotly json function from the charting module - to_plotly_json_func = getattr(backend_module, "to_plotly_json") + # Get the `to_chart` function from the charting module + to_chart_func = getattr(backend_module, "to_chart") + # Add the charting settings to the kwargs kwargs["charting_settings"] = self._charting_settings - return to_plotly_json_func(**kwargs) + fig, content = to_chart_func(**kwargs) + + return Chart( + content=content, + format=self.get_chart_format(self._charting_extension), + fig=fig, + ) def chart( self, @@ -211,7 +236,11 @@ class ChartingManager(metaclass=SingletonMeta): kwargs["command_output_item"] = command_output_item kwargs["charting_settings"] = self._charting_settings + charting_function = self.get_chart_function(self._charting_extension, route) + fig, content = charting_function(**kwargs) + return Chart( - content=self.get_chart_function(self._charting_extension, route)(**kwargs), + content=content, format=self.get_chart_format(self._charting_extension), + fig=fig, ) diff --git a/openbb_sdk/sdk/core/openbb_core/app/model/charts/chart.py b/openbb_sdk/sdk/core/openbb_core/app/model/charts/chart.py index e29559a9895..76eabc1cace 100644 --- a/openbb_sdk/sdk/core/openbb_core/app/model/charts/chart.py +++ b/openbb_sdk/sdk/core/openbb_core/app/model/charts/chart.py @@ -2,7 +2,7 @@ from enum import Enum from typing import Any, Dict, Optional from openbb_core.app.model.abstract.error import Error -from pydantic import BaseModel +from pydantic import BaseModel, Field class ChartFormat(str, Enum): @@ -10,28 +10,30 @@ class ChartFormat(str, Enum): class Chart(BaseModel): - content: Optional[Dict[str, Any]] = None - format: Optional[ChartFormat] = ChartFormat.plotly - error: Optional[Error] = None + content: Optional[Dict[str, Any]] = Field( + default=None, + description="Raw textual representation of the chart.", + ) + format: Optional[ChartFormat] = Field( + default=ChartFormat.plotly, + description="Complementary attribute to the `content` attribute. It specifies the format of the chart.", + ) + error: Optional[Error] = Field( + default=None, + description="Exception caught during the computation of the `Chart`.", + ) + fig: Optional[Any] = Field( + default=None, + description="The figure object.", + exclude_from_api=True, + ) class Config: validate_assignment = True - def show(self): - """Shows the chart in PyWry, browser or notebook.""" - - # TODO : this method should be handled by the ChartingManager so that - # this model class doesn't have specific knowledge on the charting extension - - # pylint: disable=import-outside-toplevel - if self.format == ChartFormat.plotly: - from openbb_charting.core.openbb_figure import OpenBBFigure - - chart = OpenBBFigure() - - chart.update(self.content) - - chart.show() - - else: - raise ValueError(f"Chart format {self.format} not supported.") + def __repr__(self) -> str: + return ( + self.__class__.__name__ + + "\n\n" + + "\n".join([f"{k}: {v}" for k, v in self.dict().items()]) + ) diff --git a/openbb_sdk/sdk/core/openbb_core/app/model/charts/charting_settings.py b/openbb_sdk/sdk/core/openbb_core/app/model/charts/charting_settings.py index f0ab0d68466..45f423acab1 100644 --- a/openbb_sdk/sdk/core/openbb_core/app/model/charts/charting_settings.py +++ b/openbb_sdk/sdk/core/openbb_core/app/model/charts/charting_settings.py @@ -43,9 +43,8 @@ class ChartingSettings: self.user_uuid: Optional[str] = ( user_settings.profile.hub_session.user_uuid if has_hub else None ) - self.user_exports_directory: str = user_settings.preferences.export_directory - self.user_styles_directory: str = ( - user_settings.preferences.user_styles_directory - ) + self.user_exports_directory = user_settings.preferences.export_directory + self.user_styles_directory = user_settings.preferences.user_styles_directory # Theme self.chart_style: str = user_settings.preferences.chart_style + self.table_style = user_settings.preferences.table_style diff --git a/openbb_sdk/sdk/core/openbb_core/app/model/command_output.py b/openbb_sdk/sdk/core/openbb_core/app/model/command_output.py index 96eb5492209..51c89912c37 100644 --- a/openbb_sdk/sdk/core/openbb_core/app/model/command_output.py +++ b/openbb_sdk/sdk/core/openbb_core/app/model/command_output.py @@ -1,4 +1,4 @@ -from typing import Any, Dict, Generic, List, Optional, TypeVar, Union +from typing import Dict, Generic, List, Optional, TypeVar, Union import pandas as pd from pydantic import Field @@ -8,7 +8,7 @@ from openbb_core.app.charting_manager import ChartingManager from openbb_core.app.model.abstract.error import Error from openbb_core.app.model.abstract.tagged import Tagged from openbb_core.app.model.abstract.warning import Warning_ -from openbb_core.app.model.charts.chart import Chart, ChartFormat +from openbb_core.app.model.charts.chart import Chart from openbb_core.app.provider_interface import get_provider_interface from openbb_core.app.utils import basemodel_to_df @@ -109,41 +109,31 @@ class CommandOutput(GenericModel, Generic[T], Tagged): return results - def to_plotly_json( - self, create_chart: bool = True, **kwargs - ) -> Optional[Dict[str, Any]]: + def to_chart(self, **kwargs): """ - Returns the plotly json representation of the chart. - If the chart was already computed it return the plotly json representation of the chart. - Otherwise it computes the chart based on the available data and provided kwargs. + Create or update the `Chart`. + Note that the `chart` attribute is composed by: `content`, `format` and `fig`. Parameters ---------- - create_chart : bool, optional - If True, it creates the chart object and populates the respective field on the object, by default True. **kwargs Keyword arguments to be passed to the charting extension. - This implies that the user has to know the charting extension API; this is the case - because the charting extension may vary on user settings. + This implies that the user has some knowledge on the charting extension API. + This is the case because the charting extension may vary on user preferences. + + Returns + ------- + chart.fig + The chart figure. """ + cm = ChartingManager() + kwargs["data"] = self.to_dataframe() - if self.chart and not kwargs: - plotly_json = self.chart.content - else: - cm = ChartingManager() - kwargs["data"] = self.to_dataframe() - plotly_json = cm.to_plotly_json(**kwargs) - - if create_chart: - try: - self.chart = Chart(content=plotly_json, format=ChartFormat.plotly) - except Exception as e: - self.chart = Chart(error=Error(message=str(e))) - - return plotly_json + self.chart = cm.to_chart(**kwargs) + return self.chart.fig def show(self): """Displays chart.""" - if not self.chart: + if not self.chart and not self.chart.fig: raise OpenBBError("Chart not found.") - self.chart.show() + self.chart.fig.show() diff --git a/openbb_sdk/sdk/core/openbb_core/app/model/custom_parameter.py b/openbb_sdk/sdk/core/openbb_core/app/model/custom_parameter.py new file mode 100644 index 00000000000..0bd65b27060 --- /dev/null +++ b/openbb_sdk/sdk/core/openbb_core/app/model/custom_parameter.py @@ -0,0 +1,11 @@ +from typing import Optional +from pydantic import BaseModel + + +class OpenBBCustomParameter(BaseModel): + """Custom parameter for OpenBB.""" + + description: Optional[str] = None + + class Config: + frozen = True diff --git a/openbb_sdk/sdk/core/openbb_core/app/model/preferences.py b/openbb_sdk/sdk/core/openbb_core/app/model/preferences.py index e26af23900d..d897ed8ae71 100644 --- a/openbb_sdk/sdk/core/openbb_core/app/model/preferences.py +++ b/openbb_sdk/sdk/core/openbb_core/app/model/preferences.py @@ -16,6 +16,7 @@ class Preferences(BaseModel): plot_open_export: bool = ( False # Whether to open plot image exports after they are created ) + table_style: Literal["dark", "light"] = "dark" request_timeout: PositiveInt = 15 class Config: diff --git a/openbb_sdk/sdk/core/openbb_core/app/static/package/__extensions__.py b/openbb_sdk/sdk/core/openbb_core/app/static/package/__extensions__.py index fc3fea757a4..10f2b50a9ae 100644 --- a/openbb_sdk/sdk/core/openbb_core/app/static/package/__extensions__.py +++ b/openbb_sdk/sdk/core/openbb_core/app/static/package/__extensions__.py @@ -1,23 +1,16 @@ ### THIS FILE IS AUTO-GENERATED. DO NOT EDIT. ### + from openbb_core.app.static.container import Container class Extensions(Container): @property - def crypto(self): # route = "/crypto" - from openbb_core.app.static.package import crypto + def news(self): # route = "/news" + from openbb_core.app.static.package import news - return crypto.CLASS_crypto(command_runner_session=self._command_runner_session) - - @property - def economy(self): # route = "/economy" - from openbb_core.app.static.package import economy - - return economy.CLASS_economy( - command_runner_session=self._command_runner_session - ) + return news.CLASS_news(command_runner_session=self._command_runner_session) @property def fixedincome(self): # route = "/fixedincome" @@ -34,16 +27,18 @@ class Extensions(Container): return forex.CLASS_forex(command_runner_session=self._command_runner_session) @property - def news(self): # route = "/news" - from openbb_core.app.static.package import news + def economy(self): # route = "/economy" + from openbb_core.app.static.package import economy - return news.CLASS_news(command_runner_session=self._command_runner_session) + return economy.CLASS_economy( + command_runner_session=self._command_runner_session + ) @property - def qa(self): # route = "/qa" - from openbb_core.app.static.package import qa + def crypto(self): # route = "/crypto" + from openbb_core.app.static.package import crypto - return qa.CLASS_qa(command_runner_session=self._command_runner_session) + return crypto.CLASS_crypto(command_runner_session=self._command_runner_session) @property def stocks(self): # route = "/stocks" @@ -51,6 +46,12 @@ class Extensions(Container): return stocks.CLASS_stocks(command_runner_session=self._command_runner_session) + @property + def qa(self): # route = "/qa" + from openbb_core.app.static.package import qa + + return qa.CLASS_qa(command_runner_session=self._command_runner_session) + @property def ta(self): # route = "/ta" from openbb_core.app.static.package import ta 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 be2360703d4..00ab364f1a2 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 @@ -2,11 +2,12 @@ import datetime import typing -from typing import Literal, Optional, Union +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.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 @@ -16,11 +17,23 @@ class CLASS_crypto(Container): @validate_arguments def load( self, - symbol: str, - start_date: Union[datetime.date, None, str] = None, - end_date: Union[datetime.date, None, str] = None, + symbol: typing.Annotated[ + str, OpenBBCustomParameter(description="Symbol to get data for.") + ], + start_date: Annotated[ + Union[datetime.date, None, str], + OpenBBCustomParameter( + description="Start date of the data, in YYYY-MM-DD format." + ), + ] = None, + end_date: Annotated[ + Union[datetime.date, None, str], + OpenBBCustomParameter( + description="End date of the data, in YYYY-MM-DD format." + ), + ] = None, chart: bool = False, - provider: Optional[Literal["fmp", "polygon"]] = None, + provider: Optional[Literal["polygon", "fmp"]] = None, **kwargs, ) -> CommandOutput[typing.List]: """Crypto Intraday Price. @@ -31,7 +44,7 @@ class CLASS_crypto(Container): Parameters ---------- - provider: Literal[fmp, polygon] + provider: Literal[polygon, fmp] The provider to use for the query. symbol : ConstrainedStrValue Symbol to get data for. @@ -72,6 +85,28 @@ class CLASS_crypto(Container): vwap : PositiveFloat Volume Weighted Average Price of the symbol. + polygon + ======= + + Parameters + ---------- + timespan : Literal['minute', 'hour', 'day', 'week', 'month', 'quarter', 'year'] + The timespan of the data. + sort : Literal['asc', 'desc'] + Sort order of the data. + limit : PositiveInt + The number of data entries to return. + adjusted : bool + Whether the data is adjusted. + multiplier : PositiveInt + The multiplier of the timespan. + + + CryptoEOD + --------- + n : PositiveInt + The number of transactions for the symbol in the time period. + fmp === @@ -94,29 +129,7 @@ class CLASS_crypto(Container): label : str Human readable format of the date. changeOverTime : float - Change \\% in the price of the symbol over a period of time. - - polygon - ======= - - Parameters - ---------- - timespan : Literal['minute', 'hour', 'day', 'week', 'month', 'quarter', 'year'] - The timespan of the data. - sort : Literal['asc', 'desc'] - Sort order of the data. - limit : PositiveInt - The number of data entries to return. - adjusted : bool - Whether the data is adjusted. - multiplier : PositiveInt - The multiplier of the timespan. - - - CryptoEOD - --------- - n : PositiveInt - The number of transactions for the symbol in the time period.""" # noqa: E501 + Change \\% in the price of the symbol over a period of time.""" inputs = filter_inputs( provider_choices={ "provider": provider, 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 99f4c39e37d..82e50a8eeb9 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 @@ -2,13 +2,14 @@ import datetime import typing -from typing import List, Literal, Optional, Union +from typing import Annotated, List, Literal, Optional, Union from pydantic import BaseModel, 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.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 @@ -40,7 +41,12 @@ class CLASS_economy(Container): @validate_arguments def const( self, - index: Literal["nasdaq", "sp500", "dowjones"] = "dowjones", + index: Annotated[ + Literal["nasdaq", "sp500", "dowjones"], + OpenBBCustomParameter( + description="The index for which we want to fetch the constituents." + ), + ] = "dowjones", chart: bool = False, provider: Optional[Literal["fmp"]] = None, **kwargs, @@ -125,64 +131,88 @@ class CLASS_economy(Container): @validate_arguments def cpi( self, - countries: List[ - Literal[ - "australia", - "austria", - "belgium", - "brazil", - "bulgaria", - "canada", - "chile", - "china", - "croatia", - "cyprus", - "czech_republic", - "denmark", - "estonia", - "euro_area", - "finland", - "france", - "germany", - "greece", - "hungary", - "iceland", - "india", - "indonesia", - "ireland", - "israel", - "italy", - "japan", - "korea", - "latvia", - "lithuania", - "luxembourg", - "malta", - "mexico", - "netherlands", - "new_zealand", - "norway", - "poland", - "portugal", - "romania", - "russian_federation", - "slovak_republic", - "slovakia", - "slovenia", - "south_africa", - "spain", - "sweden", - "switzerland", - "turkey", - "united_kingdom", - "united_states", - ] + countries: Annotated[ + List[ + Literal[ + "australia", + "austria", + "belgium", + "brazil", + "bulgaria", + "canada", + "chile", + "china", + "croatia", + "cyprus", + "czech_republic", + "denmark", + "estonia", + "euro_area", + "finland", + "france", + "germany", + "greece", + "hungary", + "iceland", + "india", + "indonesia", + "ireland", + "israel", + "italy", + "japan", + "korea", + "latvia", + "lithuania", + "luxembourg", + "malta", + "mexico", + "netherlands", + "new_zealand", + "norway", + "poland", + "portugal", + "romania", + "russian_federation", + "slovak_republic", + "slovakia", + "slovenia", + "south_africa", + "spain", + "sweden", + "switzerland", + "turkey", + "united_kingdom", + "united_states", + ] + ], + OpenBBCustomParameter(description="The country or countries to get data."), ], - units: Literal["growth_previous", "growth_same", "index_2015"] = "growth_same", - frequency: Literal["monthly", "quarterly", "annual"] = "monthly", - harmonized: bool = False, - start_date: Union[datetime.date, None, str] = None, - end_date: Union[datetime.date, None, str] = None, + units: Annotated[ + Literal["growth_previous", "growth_same", "index_2015"], + OpenBBCustomParameter(description="The data units."), + ] = "growth_same", + frequency: Annotated[ + Literal["monthly", "quarterly", "annual"], + OpenBBCustomParameter(description="The data time frequency."), + ] = "monthly", + harmonized: typing.Annotated[ + bool, + OpenBBCustomParameter( + description="Whether you wish to obtain harmonized data." + ), + ] = False, + start_date: Annotated[ + Union[datetime.date, None, str], + OpenBBCustomParameter( + description="Start date of the data, in YYYY-MM-DD format." + ), + ] = None, + end_date: Annotated[ + Union[datetime.date, None, str], + OpenBBCustomParameter( + description="End date of the data, in YYYY-MM-DD format." + ), + ] = None, chart: bool = False, provider: Optional[Literal["fred"]] = None, **kwargs, @@ -296,11 +326,23 @@ class CLASS_economy(Container): @validate_arguments def index( self, - symbol: str, - start_date: Union[datetime.date, None, str] = None, - end_date: Union[datetime.date, None, str] = None, + symbol: typing.Annotated[ + str, OpenBBCustomParameter(description="Symbol to get data for.") + ], + start_date: Annotated[ + Union[datetime.date, None, str], + OpenBBCustomParameter( + description="Start date of the data, in YYYY-MM-DD format." + ), + ] = None, + end_date: Annotated[ + Union[datetime.date, None, str], + OpenBBCustomParameter( + description="End date of the data, in YYYY-MM-DD format." + ), + ] = None, chart: bool = False, - provider: Optional[Literal["fmp", "polygon"]] = None, + provider: Optional[Literal["polygon", "fmp"]] = None, **kwargs, ) -> CommandOutput[typing.List]: """Get OHLCV data for an index. @@ -311,7 +353,7 @@ class CLASS_economy(Container): Parameters ---------- - provider: Literal[fmp, polygon] + provider: Literal[polygon, fmp] The provider to use for the query. symbol : ConstrainedStrValue Symbol to get data for. @@ -352,6 +394,32 @@ class CLASS_economy(Container): vwap : Optional[float] Volume Weighted Average Price of the symbol. + polygon + ======= + + Parameters + ---------- + timespan : Literal['minute', 'hour', 'day', 'week', 'month', 'quarter', 'year'] + The timespan of the data. + sort : Literal['asc', 'desc'] + Sort order of the data. + limit : PositiveInt + The number of data entries to return. + adjusted : bool + Whether the data is adjusted. + multiplier : PositiveInt + The multiplier of the timespan. + + + MajorIndicesEOD + --------------- + t : datetime + The timestamp of the data. + n : PositiveInt + The number of transactions for the symbol in the time period. + vw : PositiveFloat + The volume weighted average price of the symbol. + fmp === @@ -375,30 +443,8 @@ class CLASS_economy(Container): Change \\% in the price of the symbol. label : Optional[str] Human readable format of the date. - changeOverTime : Optional[float] - Change \\% in the price of the symbol over a period of time. - - polygon - ======= - - Parameters - ---------- - timespan : Literal['minute', 'hour', 'day', 'week', 'month', 'quarter', 'year'] - The timespan of the data. - sort : Literal['asc', 'desc'] - Sort order of the data. - limit : PositiveInt - The number of data entries to return. - adjusted : bool - Whether the data is adjusted. - multiplier : PositiveInt - The multiplier of the timespan. - - - MajorIndicesEOD - --------------- - n : PositiveInt - The number of transactions for the symbol in the time period.""" # noqa: E501 + changeOverTime : float + Change \\% in the price of the symbol over a period of time.""" inputs = filter_inputs( provider_choices={ "provider": provider, 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 f7a319c5e29..842219cf7bb 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 @@ -2,13 +2,14 @@ import datetime import typing -from typing import Literal, Optional, Union +from typing import Annotated, Literal, Optional, Union 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.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 @@ -18,8 +19,18 @@ class CLASS_fixedincome(Container): @validate_arguments def treasury( self, - start_date: Union[datetime.date, None, str] = None, - end_date: Union[datetime.date, None, str] = None, + start_date: Annotated[ + Union[datetime.date, None, str], + OpenBBCustomParameter( + description="Start date of the data, in YYYY-MM-DD format." + ), + ] = None, + end_date: Annotated[ + Union[datetime.date, None, str], + OpenBBCustomParameter( + description="End date of the data, in YYYY-MM-DD format." + ), + ] = None, chart: bool = False, provider: Optional[Literal["fmp"]] = None, **kwargs, 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 f77c65ff330..d42c9ecdaa4 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 @@ -2,11 +2,12 @@ import datetime import typing -from typing import Literal, Optional, Union +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.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 @@ -17,7 +18,7 @@ class CLASS_forex(Container): def pairs( self, chart: bool = False, - provider: Optional[Literal["fmp", "polygon"]] = None, + provider: Optional[Literal["polygon", "fmp"]] = None, **kwargs, ) -> CommandOutput[typing.List]: """Forex Available Pairs. @@ -28,7 +29,7 @@ class CLASS_forex(Container): Parameters ---------- - provider: Literal[fmp, polygon] + provider: Literal[polygon, fmp] The provider to use for the query. All fields are standardized. @@ -52,25 +53,6 @@ class CLASS_forex(Container): name : str The name of the currency pair. - fmp - === - - Parameters - ---------- - All fields are standardized. - - - ForexPairs - ---------- - symbol : str - The symbol of the currency pair. - currency : str - The base currency of the currency pair. - 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. - polygon ======= @@ -109,7 +91,26 @@ class CLASS_forex(Container): last_updated_utc : datetime The last updated timestamp in UTC. delisted_utc : Optional[datetime] - The delisted timestamp in UTC.""" # noqa: E501 + The delisted timestamp in UTC. + + fmp + === + + Parameters + ---------- + All fields are standardized. + + + ForexPairs + ---------- + symbol : str + The symbol of the currency pair. + currency : str + The base currency of the currency pair. + 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.""" inputs = filter_inputs( provider_choices={ "provider": provider, @@ -130,11 +131,23 @@ class CLASS_forex(Container): @validate_arguments def load( self, - symbol: str, - start_date: Union[datetime.date, None, str] = None, - end_date: Union[datetime.date, None, str] = None, + symbol: typing.Annotated[ + str, OpenBBCustomParameter(description="Symbol to get data for.") + ], + start_date: Annotated[ + Union[datetime.date, None, str], + OpenBBCustomParameter( + description="Start date of the data, in YYYY-MM-DD format." + ), + ] = None, + end_date: Annotated[ + Union[datetime.date, None, str], + OpenBBCustomParameter( + description="End date of the data, in YYYY-MM-DD format." + ), + ] = None, chart: bool = False, - provider: Optional[Literal["fmp", "polygon"]] = None, + provider: Optional[Literal["polygon", "fmp"]] = None, **kwargs, ) -> CommandOutput[typing.List]: """Forex Intraday Price. @@ -145,7 +158,7 @@ class CLASS_forex(Container): Parameters ---------- - provider: Literal[fmp, polygon] + provider: Literal[polygon, fmp] The provider to use for the query. symbol : ConstrainedStrValue Symbol to get data for. @@ -186,6 +199,28 @@ class CLASS_forex(Container): vwap : Optional[PositiveFloat] Volume Weighted Average Price of the symbol. + polygon + ======= + + Parameters + ---------- + timespan : Literal['minute', 'hour', 'day', 'week', 'month', 'quarter', 'year'] + The timespan of the data. + sort : Literal['asc', 'desc'] + Sort order of the data. + limit : PositiveInt + The number of data entries to return. + adjusted : bool + Whether the data is adjusted. + multiplier : PositiveInt + The multiplier of the timespan. + + + ForexEOD + -------- + n : PositiveInt + The number of transactions for the symbol in the time period. + fmp === @@ -207,29 +242,7 @@ class CLASS_forex(Container): label : str Human readable format of the date. changeOverTime : float - Change \\% in the price of the symbol over a period of time. - - polygon - ======= - - Parameters - ---------- - timespan : Literal['minute', 'hour', 'day', 'week', 'month', 'quarter', 'year'] - The timespan of the data. - sort : Literal['asc', 'desc'] - Sort order of the data. - limit : PositiveInt - The number of data entries to return. - adjusted : bool - Whether the data is adjusted. - multiplier : PositiveInt - The multiplier of the timespan. - - - ForexEOD - -------- - n : PositiveInt - The number of transactions for the symbol in the time period.""" # noqa: E501 + Change \\% in the price of the symbol over a period of time.""" inputs = filter_inputs( provider_choices={ "provider": provider, diff --git a/openbb_sdk/sdk/core/openbb_core/app/static/package/module_map.json b/openbb_sdk/sdk/core/openbb_core/app/static/package/module_map.json index bf446f9d0a8..ac2ed2ad833 100644 --- a/openbb_sdk/sdk/core/openbb_core/app/static/package/module_map.json +++ b/openbb_sdk/sdk/core/openbb_core/app/static/package/module_map.json @@ -1,7 +1,14 @@ { - "crypto_load": "/crypto/load", + "news_globalnews": "/news/globalnews", "__extensions__": "", - "crypto": "/crypto", + "news": "/news", + "news_sectornews": "/news/sectornews", + "fixedincome_treasury": "/fixedincome/treasury", + "fixedincome": "/fixedincome", + "fixedincome_ycrv": "/fixedincome/ycrv", + "forex_pairs": "/forex/pairs", + "forex": "/forex", + "forex_load": "/forex/load", "economy_corecpi": "/economy/corecpi", "economy": "/economy", "economy_const": "/economy/const", @@ -37,41 +44,8 @@ "economy_trust": "/economy/trust", "economy_usbonds": "/economy/usbonds", "economy_valuation": "/economy/valuation", - "fixedincome_treasury": "/fixedincome/treasury", - "fixedincome": "/fixedincome", - "fixedincome_ycrv": "/fixedincome/ycrv", - "forex_pairs": "/forex/pairs", - "forex": "/forex", - "forex_load": "/forex/load", - "news_globalnews": "/news/globalnews", - "news": "/news", - "news_sectornews": "/news/sectornews", - "qa_normality": "/qa/normality", - "qa": "/qa", - "qa_capm": "/qa/capm", - "qa_qqplot": "/qa/qqplot", - "qa_om": "/qa/om", - "qa_kurtosis": "/qa/kurtosis", - "qa_pick": "/qa/pick", - "qa_spread": "/qa/spread", - "qa_rolling": "/qa/rolling", - "qa_var": "/qa/var", - "qa_line": "/qa/line", - "qa_hist": "/qa/hist", - "qa_unitroot": "/qa/unitroot", - "qa_beta": "/qa/beta", - "qa_sh": "/qa/sh", - "qa_so": "/qa/so", - "qa_cusum": "/qa/cusum", - "qa_raw": "/qa/raw", - "qa_cdf": "/qa/cdf", - "qa_decompose": "/qa/decompose", - "qa_skew": "/qa/skew", - "qa_quantile": "/qa/quantile", - "qa_bw": "/qa/bw", - "qa_es": "/qa/es", - "qa_acf": "/qa/acf", - "qa_summary": "/qa/summary", + "crypto_load": "/crypto/load", + "crypto": "/crypto", "stocks_fa_analysis": "/stocks/fa/analysis", "stocks": "/stocks", "stocks_fa": "/stocks/fa", @@ -219,6 +193,32 @@ "stocks_tob": "/stocks/tob", "stocks_quote": "/stocks/quote", "stocks_search": "/stocks/search", + "qa_normality": "/qa/normality", + "qa": "/qa", + "qa_capm": "/qa/capm", + "qa_qqplot": "/qa/qqplot", + "qa_om": "/qa/om", + "qa_kurtosis": "/qa/kurtosis", + "qa_pick": "/qa/pick", + "qa_spread": "/qa/spread", + "qa_rolling": "/qa/rolling", + "qa_var": "/qa/var", + "qa_line": "/qa/line", + "qa_hist": "/qa/hist", + "qa_unitroot": "/qa/unitroot", + "qa_beta": "/qa/beta", + "qa_sh": "/qa/sh", + "qa_so": "/qa/so", + "qa_cusum": "/qa/cusum", + "qa_raw": "/qa/raw", + "qa_cdf": "/qa/cdf", + "qa_decompose": "/qa/decompose", + "qa_skew": "/qa/skew", + "qa_quantile": "/qa/quantile", + "qa_bw": "/qa/bw", + "qa_es": "/qa/es", + "qa_acf": "/qa/acf", + "qa_summary": "/qa/summary", "ta_atr": "/ta/atr", "ta": "/ta", "ta_fib": "/ta/fib", 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 d83ca59d4d0..c590bfc350a 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 @@ -9,6 +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.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 @@ -18,7 +19,10 @@ class CLASS_news(Container): @validate_arguments def globalnews( self, - page: pydantic.types.NonNegativeInt = 0, + page: typing.Annotated[ + pydantic.types.NonNegativeInt, + OpenBBCustomParameter(description="The page of the global news."), + ] = 0, chart: bool = False, provider: Optional[Literal["benzinga", "fmp"]] = None, **kwargs, 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 0e98c4a924c..634ea551f1f 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 @@ -2,7 +2,7 @@ import datetime import typing -from typing import Literal, Optional, Union +from typing import Annotated, Literal, Optional, Union import pydantic from pydantic import validate_arguments @@ -10,6 +10,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.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 @@ -83,11 +84,23 @@ class CLASS_stocks(Container): @validate_arguments def load( self, - symbol: str, - start_date: Union[datetime.date, None, str] = None, - end_date: Union[datetime.date, None, str] = None, + symbol: typing.Annotated[ + str, OpenBBCustomParameter(description="Symbol to get data for.") + ], + start_date: Annotated[ + Union[datetime.date, None, str], + OpenBBCustomParameter( + description="Start date of the data, in YYYY-MM-DD format." + ), + ] = None, + end_date: Annotated[ + Union[datetime.date, None, str], + OpenBBCustomParameter( + description="End date of the data, in YYYY-MM-DD format." + ), + ] = None, chart: bool = False, - provider: Optional[Literal["fmp", "polygon"]] = None, + provider: Optional[Literal["polygon", "fmp"]] = None, **kwargs, ) -> CommandOutput[typing.List]: """Load stock data for a specific ticker. @@ -98,7 +111,7 @@ class CLASS_stocks(Container): Parameters ---------- - provider: Literal[fmp, polygon] + provider: Literal[polygon, fmp] The provider to use for the query. symbol : ConstrainedStrValue Symbol to get data for. @@ -134,11 +147,33 @@ class CLASS_stocks(Container): The low price of the symbol. close : PositiveFloat The close price of the symbol. - volume : float + volume : NonNegativeFloat The volume of the symbol. - vwap : Optional[float] + vwap : Optional[PositiveFloat] Volume Weighted Average Price of the symbol. + polygon + ======= + + Parameters + ---------- + timespan : Literal['minute', 'hour', 'day', 'week', 'month', 'quarter', 'year'] + The timespan of the data. + sort : Literal['asc', 'desc'] + Sort order of the data. + limit : PositiveInt + The number of data entries to return. + adjusted : bool + Whether the data is adjusted. + multiplier : PositiveInt + The multiplier of the timespan. + + + StockEOD + -------- + n : PositiveInt + The number of transactions for the symbol in the time period. + fmp === @@ -162,30 +197,8 @@ class CLASS_stocks(Container): Change \\% in the price of the symbol. label : Optional[str] Human readable format of the date. - changeOverTime : Optional[float] - Change \\% in the price of the symbol over a period of time. - - polygon - ======= - - Parameters - ---------- - timespan : Literal['minute', 'hour', 'day', 'week', 'month', 'quarter', 'year'] - The timespan of the data. - sort : Literal['asc', 'desc'] - Sort order of the data. - limit : PositiveInt - The number of data entries to return. - adjusted : bool - Whether the data is adjusted. - multiplier : PositiveInt - The multiplier of the timespan. - - - StockEOD - -------- - n : Optional[PositiveInt] - The number of transactions for the symbol in the time period.""" # noqa: E501 + changeOverTime : float + Change \\% in the price of the symbol over a period of time.""" inputs = filter_inputs( provider_choices={ "provider": provider, @@ -210,11 +223,23 @@ class CLASS_stocks(Container): @validate_arguments def news( self, - symbols: str, - page: int = 0, - limit: Optional[pydantic.types.NonNegativeInt] = 15, + symbols: typing.Annotated[ + str, OpenBBCustomParameter(description="Symbol to get data for.") + ], + page: typing.Annotated[ + int, + OpenBBCustomParameter( + description="The page of the stock news to be retrieved." + ), + ] = 0, + limit: Annotated[ + Optional[pydantic.types.NonNegativeInt], + OpenBBCustomParameter( + description="The number of results to return per page." + ), + ] = 15, chart: bool = False, - provider: Optional[Literal["benzinga", "fmp", "polygon"]] = None, + provider: Optional[Literal["benzinga", "polygon", "fmp"]] = None, **kwargs, ) -> CommandOutput[typing.List]: """Get news for one or more stock tickers. @@ -225,7 +250,7 @@ class CLASS_stocks(Container): Parameters ---------- - provider: Literal[benzinga, fmp, polygon] + provider: Literal[benzinga, polygon, fmp] The provider to use for the query. symbols : ConstrainedStrValue Symbol to get data for. @@ -306,23 +331,6 @@ class CLASS_stocks(Container): teaser : Optional[str] The teaser of the news. - fmp - === - - Parameters - ---------- - All fields are standardized. - - - StockNews - --------- - symbol : str - Ticker of the fetched news. - image : Optional[str] - URL to the image of the news source. - site : str - Name of the news source. - polygon ======= @@ -367,7 +375,24 @@ class CLASS_stocks(Container): publisher : PolygonPublisher Publisher of the article. tickers : List[str] - Tickers covered in the article.""" # noqa: E501 + Tickers covered in the article. + + fmp + === + + Parameters + ---------- + All fields are standardized. + + + StockNews + --------- + symbol : str + Ticker of the fetched news. + image : Optional[str] + URL to the image of the news source. + site : str + Name of the news source.""" inputs = filter_inputs( provider_choices={ "provider": provider, @@ -392,8 +417,13 @@ class CLASS_stocks(Container): @validate_arguments def multiples( self, - symbol: str, - limit: Optional[int] = 100, + symbol: typing.Annotated[ + str, OpenBBCustomParameter(description="Symbol to get data for.") + ], + limit: Annotated[ + Optional[int], + OpenBBCustomParameter(description="The number of data entries to return."), + ] = 100, chart: bool = False, provider: Optional[Literal["fmp"]] = None, **kwargs, 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 e1fbe933515..5f36a68d099 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,6 +7,7 @@ from pydantic import BaseModel, 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.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 @@ -16,7 +17,9 @@ class CLASS_stocks_ca(Container): @validate_arguments def peers( self, - symbol: str, + symbol: typing.Annotated[ + str, OpenBBCustomParameter(description="Symbol to get data for.") + ], chart: bool = False, provider: Optional[Literal["fmp"]] = None, **kwargs, 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 9fa117f2f25..1b7f86c0acd 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 @@ -1,11 +1,12 @@ ### THIS FILE IS AUTO-GENERATED. DO NOT EDIT. ### import typing -from typing import Literal, Optional +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.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 @@ -15,111 +16,122 @@ class CLASS_stocks_dd(Container): @validate_arguments def sec( self, - symbol: str, - type: Literal[ - "1", - "1-A", - "1-E", - "1-K", - "1-N", - "1-SA", - "1-U", - "1-Z", - "10", - "10-D", - "10-K", - "10-M", - "10-Q", - "11-K", - "12b-25", - "13F", - "13H", - "144", - "15", - "15F", - "17-H", - "18", - "18-K", - "19b-4", - "19b-4(e)", - "19b-7", - "2-E", - "20-F", - "24F-2", - "25", - "3", - "4", - "40-F", - "5", - "6-K", - "7-M", - "8-A", - "8-K", - "8-M", - "9-M", - "ABS-15G", - "ABS-EE", - "ABS DD-15E", - "ADV", - "ADV-E", - "ADV-H", - "ADV-NR", - "ADV-W", - "ATS", - "ATS-N", - "ATS-R", - "BD", - "BD-N", - "BDW", - "C", - "CA-1", - "CB", - "CFPORTAL", - "CRS", - "CUSTODY", - "D", - "F-1", - "F-10", - "F-3", - "F-4", - "F-6", - "F-7", - "F-8", - "F-80", - "F-N", - "F-X", - "ID", - "MA", - "MA-I", - "MA-NR", - "MA-W", - "MSD", - "MSDW", - "N-14", - "N-17D-1", - "N-17f-1", - "N-17f-2", - "N-18f-1", - "N-1A", - "N-2", - "N-23c-3", - "N-27D-1", - "N-3", - "N-4", - "N-5", - "N-54A", - "N-54C", - "N-6", - "N-6EI-1", - "N-6F", - "N-8A", - "N-8B-2", - "N-8B-4", - "N-8F", - "N-CEN", + symbol: typing.Annotated[ + str, OpenBBCustomParameter(description="Symbol to get data for.") + ], + type: Annotated[ + Literal[ + "1", + "1-A", + "1-E", + "1-K", + "1-N", + "1-SA", + "1-U", + "1-Z", + "10", + "10-D", + "10-K", + "10-M", + "10-Q", + "11-K", + "12b-25", + "13F", + "13H", + "144", + "15", + "15F", + "17-H", + "18", + "18-K", + "19b-4", + "19b-4(e)", + "19b-7", + "2-E", + "20-F", + "24F-2", + "25", + "3", + "4", + "40-F", + "5", + "6-K", + "7-M", + "8-A", + "8-K", + "8-M", + "9-M", + "ABS-15G", + "ABS-EE", + "ABS DD-15E", + "ADV", + "ADV-E", + "ADV-H", + "ADV-NR", + "ADV-W", + "ATS", + "ATS-N", + "ATS-R", + "BD", + "BD-N", + "BDW", + "C", + "CA-1", + "CB", + "CFPORTAL", + "CRS", + "CUSTODY", + "D", + "F-1", + "F-10", + "F-3", + "F-4", + "F-6", + "F-7", + "F-8", + "F-80", + "F-N", + "F-X", + "ID", + "MA", + "MA-I", + "MA-NR", + "MA-W", + "MSD", + "MSDW", + "N-14", + "N-17D-1", + "N-17f-1", + "N-17f-2", + "N-18f-1", + "N-1A", + "N-2", + "N-23c-3", + "N-27D-1", + "N-3", + "N-4", + "N-5", + "N-54A", + "N-54C", + "N-6", + "N-6EI-1", + "N-6F", + "N-8A", + "N-8B-2", + "N-8B-4", + "N-8F", + "N-CEN", + ], + OpenBBCustomParameter(description="The type of the SEC filing form."), ] = "10-K", - page: Optional[int] = 0, - limit: Optional[int] = 100, + page: Annotated[ + Optional[int], + OpenBBCustomParameter(description="Page number of the results."), + ] = 0, + limit: Annotated[ + Optional[int], + OpenBBCustomParameter(description="The number of data entries to return."), + ] = 100, chart: bool = False, provider: Optional[Literal["fmp"]] = None, **kwargs, 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 a5541a3cff4..116299e8830 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 @@ -2,7 +2,7 @@ import datetime import typing -from typing import List, Literal, Optional, Union +from typing import Annotated, List, Literal, Optional, Union import pydantic from pydantic import BaseModel, validate_arguments @@ -10,6 +10,7 @@ from pydantic import BaseModel, 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.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 @@ -36,11 +37,21 @@ class CLASS_stocks_fa(Container): @validate_arguments def balance( self, - symbol: str, - period: Literal["annually", "quarterly"] = "annually", - limit: Optional[pydantic.types.NonNegativeInt] = 12, + symbol: typing.Annotated[ + str, OpenBBCustomParameter(description="Symbol to get data for.") + ], + period: Annotated[ + Literal["annually", "quarterly"], + OpenBBCustomParameter( + description="Period of the data to return (quarterly or annually)." + ), + ] = "annually", + limit: Annotated[ + Optional[pydantic.types.NonNegativeInt], + OpenBBCustomParameter(description="The number of data entries to return."), + ] = 12, chart: bool = False, - provider: Optional[Literal["fmp", "polygon"]] = None, + provider: Optional[Literal["polygon", "fmp"]] = None, **kwargs, ) -> CommandOutput[typing.List]: """Balance Sheet. @@ -51,7 +62,7 @@ class CLASS_stocks_fa(Container): Parameters ---------- - provider: Literal[fmp, polygon] + provider: Literal[polygon, fmp] The provider to use for the query. symbol : ConstrainedStrValue Symbol to get data for. @@ -164,42 +175,6 @@ class CLASS_stocks_fa(Container): total_liabilities_and_total_equity : Optional[int] None - fmp - === - - Parameters - ---------- - cik : Optional[str] - None - - - BalanceSheet - ------------ - calendarYear : Optional[int] - None - link : Optional[str] - None - finalLink : Optional[str] - None - cashAndShortTermInvestments : Optional[int] - None - goodwillAndIntangibleAssets : Optional[int] - None - deferredRevenueNonCurrent : Optional[int] - None - totalInvestments : Optional[int] - None - capitalLeaseObligations : Optional[int] - None - deferredTaxLiabilitiesNonCurrent : Optional[int] - None - totalNonCurrentLiabilities : Optional[int] - None - totalDebt : Optional[int] - None - netDebt : Optional[int] - None - polygon ======= @@ -241,7 +216,43 @@ class CLASS_stocks_fa(Container): BalanceSheet ------------ - All fields are standardized.""" # noqa: E501 + All fields are standardized. + + fmp + === + + Parameters + ---------- + cik : Optional[str] + None + + + BalanceSheet + ------------ + calendarYear : Optional[int] + None + link : Optional[str] + None + finalLink : Optional[str] + None + cashAndShortTermInvestments : Optional[int] + None + goodwillAndIntangibleAssets : Optional[int] + None + deferredRevenueNonCurrent : Optional[int] + None + totalInvestments : Optional[int] + None + capitalLeaseObligations : Optional[int] + None + deferredTaxLiabilitiesNonCurrent : Optional[int] + None + totalNonCurrentLiabilities : Optional[int] + None + totalDebt : Optional[int] + None + netDebt : Optional[int] + None""" inputs = filter_inputs( provider_choices={ "provider": provider, @@ -266,8 +277,13 @@ class CLASS_stocks_fa(Container): @validate_arguments def balance_growth( self, - symbol: str, - limit: int = 10, + symbol: typing.Annotated[ + str, OpenBBCustomParameter(description="Symbol to get data for.") + ], + limit: typing.Annotated[ + int, + OpenBBCustomParameter(description="The number of data entries to return."), + ] = 10, chart: bool = False, provider: Optional[Literal["fmp"]] = None, **kwargs, @@ -423,8 +439,18 @@ class CLASS_stocks_fa(Container): @validate_arguments def cal( self, - start_date: Union[datetime.date, None, str] = None, - end_date: Union[datetime.date, None, str] = None, + start_date: Annotated[ + Union[datetime.date, None, str], + OpenBBCustomParameter( + description="Start date of the data, in YYYY-MM-DD format." + ), + ] = None, + end_date: Annotated[ + Union[datetime.date, None, str], + OpenBBCustomParameter( + description="End date of the data, in YYYY-MM-DD format." + ), + ] = None, chart: bool = False, provider: Optional[Literal["fmp"]] = None, **kwargs, @@ -512,11 +538,21 @@ class CLASS_stocks_fa(Container): @validate_arguments def cash( self, - symbol: str, - period: Literal["annually", "quarterly"] = "annually", - limit: Optional[pydantic.types.NonNegativeInt] = 12, + symbol: typing.Annotated[ + str, OpenBBCustomParameter(description="Symbol to get data for.") + ], + period: Annotated[ + Literal["annually", "quarterly"], + OpenBBCustomParameter( + description="Period of the data to return (quarterly or annually)." + ), + ] = "annually", + limit: Annotated[ + Optional[pydantic.types.NonNegativeInt], + OpenBBCustomParameter(description="The number of data entries to return."), + ] = 12, chart: bool = False, - provider: Optional[Literal["fmp", "polygon"]] = None, + provider: Optional[Literal["polygon", "fmp"]] = None, **kwargs, ) -> CommandOutput[typing.List]: """Cash Flow Statement. @@ -527,7 +563,7 @@ class CLASS_stocks_fa(Container): Parameters ---------- - provider: Literal[fmp, polygon] + provider: Literal[polygon, fmp] The provider to use for the query. symbol : ConstrainedStrValue Symbol to get data for. @@ -620,24 +656,6 @@ class CLASS_stocks_fa(Container): cash_at_end_of_period : Optional[int] None - fmp - === - - Parameters - ---------- - cik : Optional[str] - Central Index Key (CIK) of the company. - - - CashFlowStatement - ----------------- - calendarYear : Optional[int] - None - link : Optional[str] - None - finalLink : Optional[str] - None - polygon ======= @@ -679,7 +697,25 @@ class CLASS_stocks_fa(Container): CashFlowStatement ----------------- - All fields are standardized.""" # noqa: E501 + All fields are standardized. + + fmp + === + + Parameters + ---------- + cik : Optional[str] + Central Index Key (CIK) of the company. + + + CashFlowStatement + ----------------- + calendarYear : Optional[int] + None + link : Optional[str] + None + finalLink : Optional[str] + None""" inputs = filter_inputs( provider_choices={ "provider": provider, @@ -704,8 +740,13 @@ class CLASS_stocks_fa(Container): @validate_arguments def cash_growth( self, - symbol: str, - limit: int = 10, + symbol: typing.Annotated[ + str, OpenBBCustomParameter(description="Symbol to get data for.") + ], + limit: typing.Annotated[ + int, + OpenBBCustomParameter(description="The number of data entries to return."), + ] = 10, chart: bool = False, provider: Optional[Literal["fmp"]] = None, **kwargs, @@ -843,7 +884,9 @@ class CLASS_stocks_fa(Container): @validate_arguments def comp( self, - symbol: str, + symbol: typing.Annotated[ + str, OpenBBCustomParameter(description="Symbol to get data for.") + ], chart: bool = False, provider: Optional[Literal["fmp"]] = None, **kwargs, @@ -938,8 +981,18 @@ class CLASS_stocks_fa(Container): @validate_arguments def comsplit( self, - start_date: Union[datetime.date, None, str] = None, - end_date: Union[datetime.date, None, str] = None, + start_date: Annotated[ + Union[datetime.date, None, str], + OpenBBCustomParameter( + description="Start date of the data, in YYYY-MM-DD format." + ), + ] = None, + end_date: Annotated[ + Union[datetime.date, None, str], + OpenBBCustomParameter( + description="End date of the data, in YYYY-MM-DD format." + ), + ] = None, chart: bool = False, provider: Optional[Literal["fmp"]] = None, **kwargs, @@ -1055,7 +1108,9 @@ class CLASS_stocks_fa(Container): @validate_arguments def divs( self, - symbol: str, + symbol: typing.Annotated[ + str, OpenBBCustomParameter(description="Symbol to get data for.") + ], chart: bool = False, provider: Optional[Literal["fmp"]] = None, **kwargs, @@ -1155,8 +1210,13 @@ class CLASS_stocks_fa(Container): @validate_arguments def earning( self, - symbol: str, - limit: Optional[int] = 50, + symbol: typing.Annotated[ + str, OpenBBCustomParameter(description="Symbol to get data for.") + ], + limit: Annotated[ + Optional[int], + OpenBBCustomParameter(description="The number of data entries to return."), + ] = 50, chart: bool = False, provider: Optional[Literal["fmp"]] = None, **kwargs, @@ -1246,7 +1306,9 @@ class CLASS_stocks_fa(Container): @validate_arguments def emp( self, - symbol: str, + symbol: typing.Annotated[ + str, OpenBBCustomParameter(description="Symbol to get data for.") + ], chart: bool = False, provider: Optional[Literal["fmp"]] = None, **kwargs, @@ -1367,9 +1429,19 @@ class CLASS_stocks_fa(Container): @validate_arguments def est( self, - symbol: str, - period: Literal["quarterly", "annually"] = "annually", - limit: int = 30, + symbol: typing.Annotated[ + str, OpenBBCustomParameter(description="Symbol to get data for.") + ], + period: Annotated[ + Literal["quarterly", "annually"], + OpenBBCustomParameter( + description="Period of the data to return (quarterly or annually)." + ), + ] = "annually", + limit: typing.Annotated[ + int, + OpenBBCustomParameter(description="The number of data entries to return."), + ] = 30, chart: bool = False, provider: Optional[Literal["fmp"]] = None, **kwargs, @@ -1572,11 +1644,21 @@ class CLASS_stocks_fa(Container): @validate_arguments def income( self, - symbol: str, - period: Literal["annually", "quarterly"] = "annually", - limit: Optional[pydantic.types.NonNegativeInt] = 12, + symbol: typing.Annotated[ + str, OpenBBCustomParameter(description="Symbol to get data for.") + ], + period: Annotated[ + Literal["annually", "quarterly"], + OpenBBCustomParameter( + description="Period of the data to return (quarterly or annually)." + ), + ] = "annually", + limit: Annotated[ + Optional[pydantic.types.NonNegativeInt], + OpenBBCustomParameter(description="The number of data entries to return."), + ] = 12, chart: bool = False, - provider: Optional[Literal["fmp", "polygon"]] = None, + provider: Optional[Literal["polygon", "fmp"]] = None, **kwargs, ) -> CommandOutput[typing.List]: """Income Statement. @@ -1587,7 +1669,7 @@ class CLASS_stocks_fa(Container): Parameters ---------- - provider: Literal[fmp, polygon] + provider: Literal[polygon, fmp] The provider to use for the query. symbol : ConstrainedStrValue Symbol to get data for. @@ -1690,19 +1772,6 @@ class CLASS_stocks_fa(Container): final_link : Optional[str] Final link to the income statement. - fmp - === - - Parameters - ---------- - cik : Optional[str] - The CIK of the company if no symbol is provided. - - - IncomeStatement - --------------- - All fields are standardized. - polygon ======= @@ -1757,7 +1826,35 @@ class CLASS_stocks_fa(Container): participating_securities_distributed_and_undistributed_earnings_loss_basic : Optional[float] None preferred_stock_dividends_and_other_adjustments : Optional[float] - None""" # noqa: E501 + None + + fmp + === + + Parameters + ---------- + cik : Optional[str] + The CIK of the company if no symbol is provided. + + + IncomeStatement + --------------- + calendarYear : Optional[int] + None + grossProfitRatio : Optional[float] + None + ebitdaratio : Optional[float] + None + operatingIncomeRatio : Optional[float] + None + incomeBeforeTaxRatio : Optional[float] + None + netIncomeRatio : Optional[float] + None + link : Optional[str] + None + finalLink : Optional[str] + None""" inputs = filter_inputs( provider_choices={ "provider": provider, @@ -1782,9 +1879,19 @@ class CLASS_stocks_fa(Container): @validate_arguments def income_growth( self, - symbol: str, - limit: int = 10, - period: Literal["annually", "quarterly"] = "annually", + symbol: typing.Annotated[ + str, OpenBBCustomParameter(description="Symbol to get data for.") + ], + limit: typing.Annotated[ + int, + OpenBBCustomParameter(description="The number of data entries to return."), + ] = 10, + period: Annotated[ + Literal["annually", "quarterly"], + OpenBBCustomParameter( + description="Period of the data to return (quarterly or annually)." + ), + ] = "annually", chart: bool = False, provider: Optional[Literal["fmp"]] = None, **kwargs, @@ -1917,34 +2024,48 @@ class CLASS_stocks_fa(Container): @validate_arguments def ins( self, - symbol: str, - 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", + symbol: typing.Annotated[ + str, OpenBBCustomParameter(description="Symbol to get data for.") + ], + transactionType: Annotated[ + 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", + ] ] - ] + ], + OpenBBCustomParameter(description="The type of the transaction."), ] = ["P-Purchase"], - reportingCik: Optional[int] = None, - companyCik: Optional[int] = None, - page: Optional[int] = 0, + reportingCik: Annotated[ + Optional[int], + OpenBBCustomParameter(description="The CIK of the reporting owner."), + ] = None, + companyCik: Annotated[ + Optional[int], + OpenBBCustomParameter(description="The CIK of the company owner."), + ] = None, + page: Annotated[ + Optional[int], + OpenBBCustomParameter(description="The page number of the data to fetch."), + ] = 0, chart: bool = False, provider: Optional[Literal["fmp"]] = None, **kwargs, @@ -2055,9 +2176,16 @@ class CLASS_stocks_fa(Container): @validate_arguments def ins_own( self, - symbol: str, - include_current_quarter: bool = False, - date: Optional[datetime.date] = None, + symbol: typing.Annotated[ + str, OpenBBCustomParameter(description="Symbol to get data for.") + ], + include_current_quarter: typing.Annotated[ + bool, OpenBBCustomParameter(description="Include current quarter data.") + ] = False, + date: Annotated[ + Optional[datetime.date], + OpenBBCustomParameter(description="A specific date to get data for."), + ] = None, chart: bool = False, provider: Optional[Literal["fmp"]] = None, **kwargs, @@ -2220,9 +2348,19 @@ class CLASS_stocks_fa(Container): @validate_arguments def metrics( self, - symbol: str, - period: Literal["annually", "quarterly"] = "annually", - limit: Optional[int] = 100, + symbol: typing.Annotated[ + str, OpenBBCustomParameter(description="Symbol to get data for.") + ], + period: Annotated[ + Literal["annually", "quarterly"], + OpenBBCustomParameter( + description="Period of the data to return (quarterly or annually)." + ), + ] = "annually", + limit: Annotated[ + Optional[int], + OpenBBCustomParameter(description="The number of data entries to return."), + ] = 100, chart: bool = False, provider: Optional[Literal["fmp"]] = None, **kwargs, @@ -2417,7 +2555,9 @@ class CLASS_stocks_fa(Container): @validate_arguments def mgmt( self, - symbol: str, + symbol: typing.Annotated[ + str, OpenBBCustomParameter(description="Symbol to get data for.") + ], chart: bool = False, provider: Optional[Literal["fmp"]] = None, **kwargs, @@ -2533,7 +2673,9 @@ class CLASS_stocks_fa(Container): @validate_arguments def overview( self, - symbol: str, + symbol: typing.Annotated[ + str, OpenBBCustomParameter(description="Symbol to get data for.") + ], chart: bool = False, provider: Optional[Literal["fmp"]] = None, **kwargs, @@ -2674,9 +2816,17 @@ class CLASS_stocks_fa(Container): @validate_arguments def own( self, - symbol: str, - date: datetime.date, - page: Optional[int] = 0, + symbol: typing.Annotated[ + str, OpenBBCustomParameter(description="Symbol to get data for.") + ], + date: typing.Annotated[ + datetime.date, + OpenBBCustomParameter(description="A specific date to get data for."), + ], + page: Annotated[ + Optional[int], + OpenBBCustomParameter(description="The page number of the data to fetch."), + ] = 0, chart: bool = False, provider: Optional[Literal["fmp"]] = None, **kwargs, @@ -2829,7 +2979,9 @@ class CLASS_stocks_fa(Container): @validate_arguments def pt( self, - symbol: str, + symbol: typing.Annotated[ + str, OpenBBCustomParameter(description="Symbol to get data for.") + ], chart: bool = False, provider: Optional[Literal["fmp"]] = None, **kwargs, @@ -2908,7 +3060,9 @@ class CLASS_stocks_fa(Container): @validate_arguments def pta( self, - symbol: str, + symbol: typing.Annotated[ + str, OpenBBCustomParameter(description="Symbol to get data for.") + ], chart: bool = False, provider: Optional[Literal["fmp"]] = None, **kwargs, @@ -3051,9 +3205,19 @@ class CLASS_stocks_fa(Container): @validate_arguments def revgeo( self, - symbol: str, - period: Literal["quarterly", "annually"] = "annually", - structure: Literal["hierarchical", "flat"] = "flat", + symbol: typing.Annotated[ + str, OpenBBCustomParameter(description="Symbol to get data for.") + ], + period: Annotated[ + Literal["quarterly", "annually"], + OpenBBCustomParameter( + description="Period of the data to return (quarterly or annually)." + ), + ] = "annually", + structure: Annotated[ + Literal["hierarchical", "flat"], + OpenBBCustomParameter(description="The structure of the returned data."), + ] = "flat", chart: bool = False, provider: Optional[Literal["fmp"]] = None, **kwargs, @@ -3142,9 +3306,19 @@ class CLASS_stocks_fa(Container): @validate_arguments def revseg( self, - symbol: str, - period: Literal["quarterly", "annually"] = "annually", - structure: Literal["hierarchical", "flat"] = "flat", + symbol: typing.Annotated[ + str, OpenBBCustomParameter(description="Symbol to get data for.") + ], + period: Annotated[ + Literal["quarterly", "annually"], + OpenBBCustomParameter( + description="Period of the data to return (quarterly or annually)." + ), + ] = "annually", + structure: Annotated[ + Literal["hierarchical", "flat"], + OpenBBCustomParameter(description="The structure of the returned data."), + ] = "flat", chart: bool = False, provider: Optional[Literal["fmp"]] = None, **kwargs, @@ -3289,7 +3463,9 @@ class CLASS_stocks_fa(Container): @validate_arguments def shrs( self, - symbol: str, + symbol: typing.Annotated[ + str, OpenBBCustomParameter(description="Symbol to get data for.") + ], chart: bool = False, provider: Optional[Literal["fmp"]] = None, **kwargs, @@ -3370,7 +3546,9 @@ class CLASS_stocks_fa(Container): @validate_arguments def split( self, - symbol: str, + symbol: typing.Annotated[ + str, OpenBBCustomParameter(description="Symbol to get data for.") + ], chart: bool = False, provider: Optional[Literal["fmp"]] = None, **kwargs, @@ -3464,9 +3642,21 @@ class CLASS_stocks_fa(Container): @validate_arguments def transcript( self, - symbol: str, - year: int, - quarter: Literal[1, 2, 3, 4] = 1, + symbol: typing.Annotated[ + str, OpenBBCustomParameter(description="Symbol to get data for.") + ], + year: typing.Annotated[ + int, + OpenBBCustomParameter( + description="The year of the earnings call transcript." + ), + ], + quarter: Annotated[ + Literal[1, 2, 3, 4], + OpenBBCustomParameter( + description="The quarter of the earnings call transcript." + ), + ] = 1, chart: bool = False, provider: Optional[Literal["fmp"]] = None, **kwargs, 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 48e9d9db9d8..1e82589462e 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 @@ -57,7 +57,7 @@ class CLASS_ta(Container): >>> from openbb import obb >>> stock_data = obb.stocks.load(symbol="TSLA", start_date="2023-01-01", provider="fmp") >>> atr_data = obb.ta.atr(data=stock_data.results) - """ # noqa: E501 + """ inputs = filter_inputs( data=data, index=index, @@ -109,7 +109,7 @@ class CLASS_ta(Container): >>> from openbb import obb >>> stock_data = obb.stocks.load(symbol="TSLA", start_date="2023-01-01", provider="fmp") >>> fib_data = obb.ta.fib(data=stock_data.results, period=120) - """ # noqa: E501 + """ inputs = filter_inputs( data=data, index=index, @@ -166,7 +166,7 @@ class CLASS_ta(Container): >>> from openbb import obb >>> stock_data = obb.stocks.load(symbol="TSLA", start_date="2023-01-01", provider="fmp") >>> obv_data = obb.ta.obv(data=stock_data.results, offset=0) - """ # noqa: E501 + """ inputs = filter_inputs( data=data, index=index, @@ -219,7 +219,7 @@ class CLASS_ta(Container): >>> from openbb import obb >>> stock_data = obb.stocks.load(symbol="TSLA", start_date="2023-01-01", provider="fmp") >>> fisher_data = obb.ta.fisher(data=stock_data.results, length=14, signal=1) - """ # noqa: E501 + """ inputs = filter_inputs( data=data, index=index, @@ -275,7 +275,7 @@ class CLASS_ta(Container): >>> from openbb import obb >>> stock_data = obb.stocks.load(symbol="TSLA", start_date="2023-01-01", provider="fmp") >>> adosc_data = obb.ta.adosc(data=stock_data.results, fast=3, slow=10, offset=0) - """ # noqa: E501 + """ inputs = filter_inputs( data=data, index=index, @@ -297,7 +297,7 @@ class CLASS_ta(Container): def tv( self, chart: bool = False ) -> CommandOutput[openbb_core.app.model.results.empty.Empty]: - """TradingView.""" # noqa: E501 + """TradingView.""" inputs = filter_inputs( chart=chart, ) @@ -365,7 +365,7 @@ class CLASS_ta(Container): >>> bbands = obb.ta.bbands( >>> data=stock_data.results, target="close", length=50, std=2, mamode="sma", offset=0 >>> ) - """ # noqa: E501 + """ inputs = filter_inputs( data=data, target=target, @@ -389,7 +389,7 @@ class CLASS_ta(Container): def multi( self, chart: bool = False ) -> CommandOutput[openbb_core.app.model.results.empty.Empty]: - """Plot multiple indicators on the same chart.""" # noqa: E501 + """Plot multiple indicators on the same chart.""" inputs = filter_inputs( chart=chart, ) @@ -444,7 +444,7 @@ class CLASS_ta(Container): >>> from openbb import obb >>> stock_data = obb.stocks.load(symbol="TSLA", start_date="2023-01-01", provider="fmp") >>> zlma_data = obb.ta.zlma(data=stock_data.results, target="close", length=50, offset=0) - """ # noqa: E501 + """ inputs = filter_inputs( data=data, target=target, @@ -506,7 +506,7 @@ class CLASS_ta(Container): >>> from openbb import obb >>> stock_data = obb.stocks.load(symbol="TSLA", start_date="2023-01-01", provider="fmp") >>> aroon_data = obb.ta.aroon(data=stock_data.results, length=25, scalar=100) - """ # noqa: E501 + """ inputs = filter_inputs( data=data, index=index, @@ -565,7 +565,7 @@ class CLASS_ta(Container): >>> from openbb import obb >>> stock_data = obb.stocks.load(symbol="TSLA", start_date="2023-01-01", provider="fmp") >>> sma_data = obb.ta.sma(data=stock_data.results,target="close",length=50,offset=0) - """ # noqa: E501 + """ inputs = filter_inputs( data=data, target=target, @@ -622,7 +622,7 @@ class CLASS_ta(Container): >>> from openbb import obb >>> stock_data = obb.stocks.load(symbol="TSLA", start_date="2023-01-01", provider="fmp") >>> demark_data = obb.ta.demark(data=stock_data.results,offset=0) - """ # noqa: E501 + """ inputs = filter_inputs( data=data, index=index, @@ -677,7 +677,7 @@ class CLASS_ta(Container): >>> from openbb import obb >>> stock_data = obb.stocks.load(symbol="TSLA", start_date="2023-01-01", provider="fmp") >>> vwap_data = obb.ta.vwap(data=stock_data.results,anchor="D",offset=0) - """ # noqa: E501 + """ inputs = filter_inputs( data=data, index=index, @@ -698,7 +698,7 @@ class CLASS_ta(Container): def recom( self, chart: bool = False ) -> CommandOutput[openbb_core.app.model.results.empty.Empty]: - """Recommendation.""" # noqa: E501 + """Recommendation.""" inputs = filter_inputs( chart=chart, ) @@ -758,7 +758,7 @@ class CLASS_ta(Container): >>> from openbb import obb >>> stock_data = obb.stocks.load(symbol="TSLA", start_date="2023-01-01", provider="fmp") >>> macd_data = obb.ta.macd(data=stock_data.results,target="close",fast=12,slow=26,signal=9) - """ # noqa: E501 + """ inputs = filter_inputs( data=data, target=target, @@ -816,7 +816,7 @@ class CLASS_ta(Container): >>> from openbb import obb >>> stock_data = obb.stocks.load(symbol="TSLA", start_date="2023-01-01", provider="fmp") >>> hma_data = obb.ta.hma(data=stock_data.results,target="close",length=50,offset=0) - """ # noqa: E501 + """ inputs = filter_inputs( data=data, target=target, @@ -875,7 +875,7 @@ class CLASS_ta(Container): >>> from openbb import obb >>> stock_data = obb.stocks.load(symbol="TSLA", start_date="2023-01-01", provider="fmp") >>> donchian_data = obb.ta.donchian(data=stock_data.results,lower_length=20,upper_length=20,offset=0) - """ # noqa: E501 + """ inputs = filter_inputs( data=data, index=index, @@ -927,7 +927,7 @@ class CLASS_ta(Container): Number of periods for the offset, by default 26. lookahead : bool, optional drops the Chikou Span Column to prevent potential data leak - """ # noqa: E501 + """ inputs = filter_inputs( data=data, index=index, @@ -980,7 +980,7 @@ class CLASS_ta(Container): >>> from openbb import obb >>> stock_data = obb.stocks.load(symbol="TSLA", start_date="2023-01-01", provider="fmp") >>> clenow_data = obb.ta.clenow(data=stock_data.results,period=90) - """ # noqa: E501 + """ inputs = filter_inputs( data=data, index=index, @@ -1037,7 +1037,7 @@ class CLASS_ta(Container): >>> from openbb import obb >>> stock_data = obb.stocks.load(symbol="TSLA", start_date="2023-01-01", provider="fmp") >>> ad_data = obb.ta.ad(data=stock_data.results,offset=0) - """ # noqa: E501 + """ inputs = filter_inputs( data=data, index=index, @@ -1091,7 +1091,7 @@ class CLASS_ta(Container): >>> from openbb import obb >>> stock_data = obb.stocks.load(symbol="TSLA", start_date="2023-01-01", provider="fmp") >>> adx_data = obb.ta.adx(data=stock_data.results,length=50,scalar=100.0,drift=1) - """ # noqa: E501 + """ inputs = filter_inputs( data=data, index=index, @@ -1148,7 +1148,7 @@ class CLASS_ta(Container): >>> from openbb import obb >>> stock_data = obb.stocks.load(symbol="TSLA", start_date="2023-01-01", provider="fmp") >>> wma_data = obb.ta.wma(data=stock_data.results, target="close", length=50, offset=0) - """ # noqa: E501 + """ inputs = filter_inputs( data=data, target=target, @@ -1197,7 +1197,7 @@ class CLASS_ta(Container): ------- CommandOutput[List[Data]] The CCI data. - """ # noqa: E501 + """ inputs = filter_inputs( data=data, index=index, @@ -1257,7 +1257,7 @@ class CLASS_ta(Container): >>> from openbb import obb >>> stock_data = obb.stocks.load(symbol="TSLA", start_date="2023-01-01", provider="fmp") >>> rsi_data = obb.ta.rsi(data=stock_data.results, target="close", length=14, scalar=100.0, drift=1) - """ # noqa: E501 + """ inputs = filter_inputs( data=data, target=target, @@ -1280,7 +1280,7 @@ class CLASS_ta(Container): def summary( self, chart: bool = False ) -> CommandOutput[openbb_core.app.model.results.empty.Empty]: - """Summary.""" # noqa: E501 + """Summary.""" inputs = filter_inputs( chart=chart, ) @@ -1334,7 +1334,7 @@ class CLASS_ta(Container): >>> from openbb import obb >>> stock_data = obb.stocks.load(symbol="TSLA", start_date="2023-01-01", provider="fmp") >>> stoch_data = obb.ta.stoch(data=stock_data.results, fast_k_period=14, slow_d_period=3, slow_k_period=3) - """ # noqa: E501 + """ inputs = filter_inputs( data=data, index=index, @@ -1356,7 +1356,7 @@ class CLASS_ta(Container): def rsp( self, chart: bool = False ) -> CommandOutput[openbb_core.app.model.results.empty.Empty]: - """Relative Strength Performance.""" # noqa: E501 + """Relative Strength Performance.""" inputs = filter_inputs( chart=chart, ) @@ -1412,7 +1412,7 @@ class CLASS_ta(Container): >>> from openbb import obb >>> stock_data = obb.stocks.load(symbol="TSLA", start_date="2023-01-01", provider="fmp") >>> kc_data = obb.ta.kc(data=stock_data.results, length=20, scalar=20, ma_mode="ema", offset=0) - """ # noqa: E501 + """ inputs = filter_inputs( data=data, index=index, @@ -1465,7 +1465,7 @@ class CLASS_ta(Container): >>> from openbb import obb >>> stock_data = obb.stocks.load(symbol="TSLA", start_date="2023-01-01", provider="fmp") >>> cg_data = obb.ta.cg(data=stock_data.results, length=14) - """ # noqa: E501 + """ inputs = filter_inputs( data=data, index=index, @@ -1548,7 +1548,7 @@ class CLASS_ta(Container): >>> from openbb import obb >>> stock_data = obb.stocks.load(symbol="TSLA", start_date="2023-01-01", provider="fmp") >>> cones_data = obb.ta.cones(data=stock_data.results, lower_q=0.25, upper_q=0.75, model="STD") - """ # noqa: E501 + """ inputs = filter_inputs( data=data, index=index, @@ -1611,7 +1611,7 @@ class CLASS_ta(Container): >>> stock_data = obb.stocks.load(symbol="TSLA", start_date="2023-01-01", provider="fmp") >>> ema_data = obb.ta.ema(data=stock_data.results,target="close",length=50,offset=0) - """ # noqa: E501 + """ inputs = filter_inputs( data=data, target=target, 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 f41d459fca7..73978442214 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 @@ -21,8 +21,9 @@ from typing import ( import pandas as pd from pydantic.fields import ModelField from starlette.routing import BaseRoute -from typing_extensions import _AnnotatedAlias +from typing_extensions import Annotated, _AnnotatedAlias +from openbb_core.app.model.custom_parameter import OpenBBCustomParameter from openbb_core.app.provider_interface import get_provider_interface from openbb_core.app.router import RouterLoader @@ -179,6 +180,9 @@ class ImportDefinition: 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.custom_parameter import OpenBBCustomParameter" + ) # These imports were not detected before build, so we add them manually and # ruff --fix the resulting code to remove unused imports. @@ -189,7 +193,7 @@ class ImportDefinition: code += "\nimport pydantic" code += "\nfrom pydantic import validate_arguments, BaseModel" code += "\nfrom inspect import Parameter" - code += "\nfrom typing import List, Dict, Union, Optional, Literal" + code += "\nfrom typing import List, Dict, Union, Optional, Literal, Annotated" code += "\nfrom openbb_core.app.utils import df_to_basemodel" code += "\nfrom openbb_core.app.static.filters import filter_call, filter_inputs, filter_output\n" @@ -347,6 +351,7 @@ class DocstringGenerator: section_docstring += ( f"{cls.get_available_providers(query_mapping)}" ) + # TODO: How do we know if the model has a chart parameter? elif section_name == "Data": underline = "-" * len(model_name) section_docstring += f"\n{model_name}\n{underline}\n" @@ -366,23 +371,26 @@ class DocstringGenerator: return docstring @classmethod - def generate_command_docstring(cls, func: Callable, model_name: str) -> Callable: + def generate_command_docstring( + cls, func: Callable, model_name: Optional[str] = None + ) -> Callable: """Generate the docstring for the command.""" - provider_interface_mapping = get_provider_interface().map - query_mapping = provider_interface_mapping.get(model_name, None) - if query_mapping: - docstring = func.__doc__ or "" - docstring += "\n\n" + if model_name: + provider_interface_mapping = get_provider_interface().map + query_mapping = provider_interface_mapping.get(model_name, None) + if query_mapping: + docstring = func.__doc__ or "" + docstring += "\n\n" - query_mapping_ordered = cls.reorder_dictionary(query_mapping, "openbb") - docstring = cls.generate_provider_docstrings( - docstring=docstring, - query_mapping=query_mapping_ordered, - model_name=model_name, - provider_interface_mapping=provider_interface_mapping, - ) + query_mapping_ordered = cls.reorder_dictionary(query_mapping, "openbb") + docstring = cls.generate_provider_docstrings( + docstring=docstring, + query_mapping=query_mapping_ordered, + model_name=model_name, + provider_interface_mapping=provider_interface_mapping, + ) - func.__doc__ = docstring + func.__doc__ = docstring return func @@ -453,7 +461,7 @@ class MethodDefinition: @staticmethod def format_params( parameter_map: Dict[str, Parameter] - ) -> "OrderedDict[str, Parameter]": + ) -> OrderedDict[str, Parameter]: """Format the params.""" # These are types we want to expand. # For example, start_date is always a 'date', but we also accept 'str' as input. @@ -517,9 +525,45 @@ class MethodDefinition: return MethodDefinition.reorder_params(params=formatted) @staticmethod - def build_func_params(parameter_map: Dict[str, Parameter]) -> str: - """Build the function parameters.""" + def add_field_descriptions( + od: OrderedDict[str, Parameter], model_name: Optional[str] = None + ) -> OrderedDict[str, Parameter]: + """Add the field description to the param signature.""" + + if model_name: + available_fields = ( + get_provider_interface() + .map[model_name]["openbb"]["QueryParams"]["fields"] + .keys() + ) + + for param, value in od.items(): + if param not in available_fields: + continue + + description = ( + get_provider_interface() + .map[model_name]["openbb"]["QueryParams"]["fields"][param] + .field_info.description + ) + + new_value = value.replace( + annotation=Annotated[ + value.annotation, OpenBBCustomParameter(description=description) + ] + ) + + od[param] = new_value + + @staticmethod + def build_func_params( + parameter_map: Dict[str, Parameter], model_name: Optional[str] = None + ) -> str: od = MethodDefinition.format_params(parameter_map=parameter_map) + MethodDefinition.add_field_descriptions( + od=od, model_name=model_name + ) # this modified `od` in place + func_params = ", ".join(str(param) for param in od.values()) func_params = func_params.replace("NoneType", "None") func_params = func_params.replace( @@ -560,10 +604,12 @@ class MethodDefinition: @staticmethod def build_command_method_signature( - func_name: str, parameter_map: Dict[str, Parameter], return_type: type + func_name: str, + parameter_map: Dict[str, Parameter], + return_type: type, + model_name: Optional[str] = None, ) -> str: - """Build the command method signature.""" - func_params = MethodDefinition.build_func_params(parameter_map) + func_params = MethodDefinition.build_func_params(parameter_map, model_name) func_returns = MethodDefinition.build_func_returns(return_type) code = "\n @filter_call" @@ -622,7 +668,7 @@ class MethodDefinition: @classmethod def build_command_method( - cls, path: str, func: Callable, model_name: Optional[str] + cls, path: str, func: Callable, model_name: Optional[str] = None ) -> str: """Build the command method.""" func_name = func.__name__ @@ -630,15 +676,15 @@ class MethodDefinition: sig = signature(func) parameter_map = dict(sig.parameters) - if model_name: - func = DocstringGenerator.generate_command_docstring( - func=func, model_name=model_name - ) + func = DocstringGenerator.generate_command_docstring( + func=func, model_name=model_name + ) code = cls.build_command_method_signature( func_name=func_name, parameter_map=parameter_map, return_type=sig.return_annotation, + model_name=model_name, ) code += cls.build_command_method_doc(func=func) code += cls.build_command_method_implementation(path=path, func=func) diff --git a/openbb_sdk/sdk/provider/openbb_provider/standard_models/balance_sheet.py b/openbb_sdk/sdk/provider/openbb_provider/standard_models/balance_sheet.py index 91a12a0b4cc..8093cad0043 100644 --- a/openbb_sdk/sdk/provider/openbb_provider/standard_models/balance_sheet.py +++ b/openbb_sdk/sdk/provider/openbb_provider/standard_models/balance_sheet.py @@ -60,8 +60,9 @@ class BalanceSheetData(Data): description="Accrued income taxes, other deferred revenue" ) short_term_debt: Optional[int] = Field( - description="Short-term borrowings, Long-term debt due within one year," - " Operating lease obligations due within one year, Finance lease obligations due within one year" + description="Short-term borrowings, Long-term debt due within one year, " + "Operating lease obligations due within one year, " + "Finance lease obligations due within one year" ) current_liabilities: Optional[int] diff --git a/openbb_sdk/sdk/provider/openbb_provider/standard_models/institutional_ownership.py b/openbb_sdk/sdk/provider/openbb_provider/standard_models/institutional_ownership.py index 05088c11fe2..0b3aed1e0f3 100644 --- a/openbb_sdk/sdk/provider/openbb_provider/standard_models/institutional_ownership.py +++ b/openbb_sdk/sdk/provider/openbb_provider/standard_models/institutional_ownership.py @@ -91,8 +91,8 @@ class InstitutionalOwnershipData(Data, BaseSymbol): description="Total number of call options contracts traded for Apple Inc. on the previous reporting date." ) total_calls_change: int = Field( - description="Change in the total number of call options contracts " - "traded between the current and previous reporting dates." + description="Change in the total number of call options contracts traded between " + "the current and previous reporting dates." ) total_puts: int = Field( description="Total number of put options contracts traded for Apple Inc. on the specified date." @@ -101,12 +101,12 @@ class InstitutionalOwnershipData(Data, BaseSymbol): description="Total number of put options contracts traded for Apple Inc. on the previous reporting date." ) total_puts_change: int = Field( - description="Change in the total number of put options contracts traded between the current and " - "previous reporting dates." + description="Change in the total number of put " + "options contracts traded between the current and previous reporting dates." ) put_call_ratio: float = Field( - description="The put-call ratio, which is the ratio of the total number of put " - "options to call options traded on the specified date." + description="The put-call ratio, which is the ratio of the total number of " + "put options to call options traded on the specified date." ) last_put_call_ratio: float = Field( description="The put-call ratio on the previous reporting date." diff --git a/openbb_sdk/sdk/provider/openbb_provider/standard_models/stock_eod.py b/openbb_sdk/sdk/provider/openbb_provider/standard_models/stock_eod.py index d548551e538..cab19842a02 100644 --- a/openbb_sdk/sdk/provider/openbb_provider/standard_models/stock_eod.py +++ b/openbb_sdk/sdk/provider/openbb_provider/standard_models/stock_eod.py @@ -32,4 +32,4 @@ class StockEODData(Data): low: PositiveFloat = Field(description=DATA_DESCRIPTIONS.get("low", "")) close: PositiveFloat = Field(description=DATA_DESCRIPTIONS.get("close", "")) volume: float = Field(description=DATA_DESCRIPTIONS.get("volume", "")) - vwap: Optional[float] = Field(description=DATA_DESCRIPTIONS.get("vwap", "")) + vwap: Optional[PositiveFloat] = Field(description=DATA_DESCRIPTIONS.get("vwap", "")) diff --git a/openbb_terminal/common/behavioural_analysis/reddit_view.py b/openbb_terminal/common/behavioural_analysis/reddit_view.py index 8fc49af7506..2855c5349cc 100644 --- a/openbb_terminal/common/behavioural_analysis/reddit_view.py +++ b/openbb_terminal/common/behavioural_analysis/reddit_view.py @@ -282,8 +282,8 @@ def display_redditsent( Optionally specify the name of the sheet the data is exported to. export: str Format to export data - external_axes: Optional[List[plt.Axes]] - If supplied, expect 1 external axis + external_axes : bool, optional + Whether to return the figure object or not, by default False """ fig = OpenBBFigure() diff --git a/openbb_terminal/fixedincome/fred_view.py b/openbb_terminal/fixedincome/fred_view.py index 97b279c0128..b5ba7cb9b0a 100644 --- a/openbb_terminal/fixedincome/fred_view.py +++ b/openbb_terminal/fixedincome/fred_view.py @@ -975,8 +975,8 @@ def display_yield_curve( ---------- date: str Date to get curve for. If None, gets most recent date (format yyyy-mm-dd) - external_axes : Optional[List[plt.Axes]], optional - External axes (1 axis is expected in the list), by default None + external_axes : bool, optional + Whether to return the figure object or not, by default False raw : bool Output only raw data export : str diff --git a/openbb_terminal/forecast/brnn_view.py b/openbb_terminal/forecast/brnn_view.py index 9fcf49e5428..b59c06abefc 100644 --- a/openbb_terminal/forecast/brnn_view.py +++ b/openbb_terminal/forecast/brnn_view.py @@ -48,72 +48,67 @@ def display_brnn_forecast( ) -> Union[OpenBBFigure, None]: """Display BRNN forecast - Parameters - ---------- - data: Union[pd.Series, pd.DataFrame] - Input Data - target_column: str - Target column to forecast. Defaults to "close". - dataset_name: str - The name of the ticker to be predicted - n_predict: int - Days to predict. Defaults to 5. - train_split: float - Train/val split. Defaults to 0.85. - past_covariates: str - Multiple secondary columns to factor in when forecasting. Defaults to None. - forecast_horizon: int - Forecast horizon when performing historical forecasting. Defaults to 5. - input_chunk_length: int - Number of past time steps that are fed to the forecasting module at prediction time. Defaults to 14. - output_chunk_length: int - The length of the forecast of the model. Defaults to 5. - model_type: str - Either a string specifying the RNN module type ("RNN", "LSTM" or "GRU"). Defaults to "LSTM". - n_rnn_layers: int - Number of layers in the RNN module. Defaults to 1. - dropout: float - Fraction of neurons affected by Dropout. Defaults to 0.0. - batch_size: int - Number of time series (input and output sequences) used in each training pass. Defaults to 32. - n_epochs: int - Number of epochs over which to train the model. Defaults to 101. - learning_rate: float - Defaults to 1e-3. - model_save_name: str - Name for model. Defaults to "brnn_model". - force_reset: bool - If set to True, any previously-existing model with the same name will be reset - (all checkpoints will be discarded). Defaults to True. - save_checkpoints: bool - Whether or not to automatically save the untrained model and checkpoints from training. - Defaults to True. - sheet_name: str - Optionally specify the name of the sheet the data is exported to. - export: str - Format to export data - residuals: bool - Whether to show residuals for the model. Defaults to False. - forecast_only: bool - Whether to only show dates in the forecasting range. Defaults to False. - start_date: Optional[datetime] - The starting date to perform analysis, data before this is trimmed. Defaults to None. - end_date: Optional[datetime] - The ending date to perform analysis, data after this is trimmed. Defaults to None. - naive: bool - Whether to show the naive baseline. This just assumes the closing price will be the same - as the previous day's closing price. Defaults to False. - <<<<<<< HEAD - external_axes : bool, optional - Whether to return the figure object or not, by default False - ======= - export_pred_raw: bool - Whether to export the raw predicted values. Defaults to False. - metric: str - The metric to use for the model. Defaults to "mape". - external_axes: Optional[List[plt.axes]] - External axes to plot on - >>>>>>> OpenBBTerminal-main + Parameters + ---------- + data: Union[pd.Series, pd.DataFrame] + Input Data + target_column: str + Target column to forecast. Defaults to "close". + dataset_name: str + The name of the ticker to be predicted + n_predict: int + Days to predict. Defaults to 5. + train_split: float + Train/val split. Defaults to 0.85. + past_covariates: str + Multiple secondary columns to factor in when forecasting. Defaults to None. + forecast_horizon: int + Forecast horizon when performing historical forecasting. Defaults to 5. + input_chunk_length: int + Number of past time steps that are fed to the forecasting module at prediction time. Defaults to 14. + output_chunk_length: int + The length of the forecast of the model. Defaults to 5. + model_type: str + Either a string specifying the RNN module type ("RNN", "LSTM" or "GRU"). Defaults to "LSTM". + n_rnn_layers: int + Number of layers in the RNN module. Defaults to 1. + dropout: float + Fraction of neurons affected by Dropout. Defaults to 0.0. + batch_size: int + Number of time series (input and output sequences) used in each training pass. Defaults to 32. + n_epochs: int + Number of epochs over which to train the model. Defaults to 101. + learning_rate: float + Defaults to 1e-3. + model_save_name: str + Name for model. Defaults to "brnn_model". + force_reset: bool + If set to True, any previously-existing model with the same name will be reset + (all checkpoints will be discarded). Defaults to True. + save_checkpoints: bool + Whether or not to automatically save the untrained model and checkpoints from training. + Defaults to True. + sheet_name: str + Optionally specify the name of the sheet the data is exported to. + export: str + Format to export data + residuals: bool + Whether to show residuals for the model. Defaults to False. + forecast_only: bool + Whether to only show dates in the forecasting range. Defaults to False. + start_date: Optional[datetime] + The starting date to perform analysis, data before this is trimmed. Defaults to None. + end_date: Optional[datetime] + The ending date to perform analysis, data after this is trimmed. Defaults to None. + naive: bool + Whether to show the naive baseline. This just assumes the closing price will be the same + as the previous day's closing price. Defaults to False. + export_pred_raw: bool + Whether to export the raw predicted values. Defaults to False. + metric: str + The metric to use for the model. Defaults to "mape". + external_axes : bool, optional + Whether to return the figure object or not, by default False """ data = helpers.clean_data( data, start_date, end_date, target_column, past_covariates diff --git a/openbb_terminal/forecast/expo_view.py b/openbb_terminal/forecast/expo_view.py index 7231cd76aed..ab6d82b30b4 100644 --- a/openbb_terminal/forecast/expo_view.py +++ b/openbb_terminal/forecast/expo_view.py @@ -41,57 +41,52 @@ def display_expo_forecast( ) -> Union[OpenBBFigure, None]: """Display Probabilistic Exponential Smoothing forecast - Parameters - ---------- - data : Union[pd.Series, np.array] - Data to forecast - dataset_name: str - The name of the ticker to be predicted - target_column: Optional[str]: - Target column to forecast. Defaults to "close". - trend: str - Trend component. One of [N, A, M] - Defaults to ADDITIVE. - seasonal: str - Seasonal component. One of [N, A, M] - Defaults to ADDITIVE. - seasonal_periods: int - Number of seasonal periods in a year - If not set, inferred from frequency of the series. - dampen: str - Dampen the function - n_predict: int - Number of days to forecast - start_window: float - Size of sliding window from start of timeseries and onwards - forecast_horizon: int - Number of days to forecast when backtesting and retraining historical - sheet_name: str - Optionally specify the name of the sheet the data is exported to. - export: str - Format to export data - residuals: bool - Whether to show residuals for the model. Defaults to False. - forecast_only: bool - Whether to only show dates in the forecasting range. Defaults to False. - start_date: Optional[datetime] - The starting date to perform analysis, data before this is trimmed. Defaults to None. - end_date: Optional[datetime] - The ending date to perform analysis, data after this is trimmed. Defaults to None. - naive: bool - Whether to show the naive baseline. This just assumes the closing price will be the same - as the previous day's closing price. Defaults to False. - <<<<<<< HEAD - external_axes : bool, optional - Whether to return the figure object or not, by default False - ======= - export_pred_raw: bool - Whether to export the raw predicted values. Defaults to False. - metric: str - The metric to use when backtesting. Defaults to "mape". - external_axes: Optional[List[plt.axes]] - External axes to plot on - >>>>>>> OpenBBTerminal-main + Parameters + ---------- + data : Union[pd.Series, np.array] + Data to forecast + dataset_name: str + The name of the ticker to be predicted + target_column: Optional[str]: + Target column to forecast. Defaults to "close". + trend: str + Trend component. One of [N, A, M] + Defaults to ADDITIVE. + seasonal: str + Seasonal component. One of [N, A, M] + Defaults to ADDITIVE. + seasonal_periods: int + Number of seasonal periods in a year + If not set, inferred from frequency of the series. + dampen: str + Dampen the function + n_predict: int + Number of days to forecast + start_window: float + Size of sliding window from start of timeseries and onwards + forecast_horizon: int + Number of days to forecast when backtesting and retraining historical + sheet_name: str + Optionally specify the name of the sheet the data is exported to. + export: str + Format to export data + residuals: bool + Whether to show residuals for the model. Defaults to False. + forecast_only: bool + Whether to only show dates in the forecasting range. Defaults to False. + start_date: Optional[datetime] + The starting date to perform analysis, data before this is trimmed. Defaults to None. + end_date: Optional[datetime] + The ending date to perform analysis, data after this is trimmed. Defaults to None. + naive: bool + Whether to show the naive baseline. This just assumes the closing price will be the same + as the previous day's closing price. Defaults to False. + export_pred_raw: bool + Whether to export the raw predicted values. Defaults to False. + metric: str + The metric to use when backtesting. Defaults to "mape". + external_axes : bool, optional + Whether to return the figure object or not, by default False """ data = helpers.clean_data(data, start_date, end_date, target_column, None) if not helpers.check_data(data, target_column, None): diff --git a/openbb_terminal/stocks/behavioural_analysis/news_sentiment_model.py b/openbb_terminal/stocks/behavioural_analysis/news_sentiment_model.py index 4afdabf9aa9..a1346f6a459 100644 --- a/openbb_terminal/stocks/behavioural_analysis/news_sentiment_model.py +++ b/openbb_terminal/stocks/behavioural_analysis/news_sentiment_model.py @@ -40,7 +40,7 @@ def get_data( query_params = { "all_feilds": "False", - "ordering": "-published_on,-share_of_article,-pagerank", + "ordering": "-published_on,-entity_score,-share_of_article,-pagerank", } if ticker: query_params["ticker"] = ticker @@ -70,7 +70,7 @@ def get_data( query_params["offset"] = offset # type:ignore response = requests.get( - "https://althub-backend.invisagealpha.com/api/OnclusiveSentiment/", + "https://data-access.althub.com/api/OnclusiveSentiment/", headers=headers, params=query_params, timeout=5,