From 72f40324de2d78fd9b176bcb90be3f0099601c7f Mon Sep 17 00:00:00 2001 From: Igor Radovanovic <74266147+IgorWounds@users.noreply.github.com> Date: Mon, 11 Sep 2023 12:42:22 +0200 Subject: [PATCH 1/9] Preserve order --- openbb_sdk/openbb/package/__extensions__.py | 7 - openbb_sdk/openbb/package/crypto.py | 28 +- openbb_sdk/openbb/package/economy.py | 86 ++-- openbb_sdk/openbb/package/extension_map.json | 36 +- openbb_sdk/openbb/package/fixedincome.py | 98 ++-- openbb_sdk/openbb/package/forex.py | 54 +- openbb_sdk/openbb/package/futures.py | 40 +- openbb_sdk/openbb/package/module_map.json | 15 - openbb_sdk/openbb/package/news.py | 50 +- openbb_sdk/openbb/package/qa.py | 2 +- openbb_sdk/openbb/package/stocks.py | 238 +++------ openbb_sdk/openbb/package/stocks_ca.py | 12 +- openbb_sdk/openbb/package/stocks_dd.py | 26 +- openbb_sdk/openbb/package/stocks_fa.py | 461 +++++++++--------- openbb_sdk/openbb/package/stocks_options.py | 51 +- openbb_sdk/openbb/package/ta.py | 6 +- .../sdk/core/openbb_core/app/model/obbject.py | 17 +- openbb_sdk/sdk/core/openbb_core/app/utils.py | 13 +- 18 files changed, 544 insertions(+), 696 deletions(-) diff --git a/openbb_sdk/openbb/package/__extensions__.py b/openbb_sdk/openbb/package/__extensions__.py index 445cb6fa972..b72edde1849 100644 --- a/openbb_sdk/openbb/package/__extensions__.py +++ b/openbb_sdk/openbb/package/__extensions__.py @@ -7,7 +7,6 @@ from openbb_core.app.static.container import Container class Extensions(Container): """ /crypto - /econometrics /economy /fixedincome /forex @@ -27,12 +26,6 @@ class Extensions(Container): return crypto.CLASS_crypto(command_runner=self._command_runner) - @property - def econometrics(self): # route = "/econometrics" - from . import econometrics - - return econometrics.CLASS_econometrics(command_runner=self._command_runner) - @property def economy(self): # route = "/economy" from . import economy diff --git a/openbb_sdk/openbb/package/crypto.py b/openbb_sdk/openbb/package/crypto.py index b6d602bd724..3937c437fac 100644 --- a/openbb_sdk/openbb/package/crypto.py +++ b/openbb_sdk/openbb/package/crypto.py @@ -1,14 +1,14 @@ ### THIS FILE IS AUTO-GENERATED. DO NOT EDIT. ### import datetime -from typing import List, Literal, Union +from typing import List, Literal, Optional, Union -import typing_extensions from openbb_core.app.model.custom_parameter import OpenBBCustomParameter from openbb_core.app.model.obbject import OBBject from openbb_core.app.static.container import Container from openbb_core.app.static.filters import filter_inputs from pydantic import validate_arguments +from typing_extensions import Annotated class CLASS_crypto(Container): @@ -22,26 +22,26 @@ class CLASS_crypto(Container): @validate_arguments def load( self, - symbol: typing_extensions.Annotated[ + symbol: Annotated[ Union[str, List[str]], OpenBBCustomParameter(description="Symbol to get data for."), ], - start_date: typing_extensions.Annotated[ + start_date: Annotated[ Union[datetime.date, None, str], OpenBBCustomParameter( description="Start date of the data, in YYYY-MM-DD format." ), ] = None, - end_date: typing_extensions.Annotated[ + end_date: Annotated[ Union[datetime.date, None, str], OpenBBCustomParameter( description="End date of the data, in YYYY-MM-DD format." ), ] = None, - provider: Union[Literal["fmp", "polygon", "yfinance"], None] = None, + provider: Optional[Literal["fmp", "polygon", "yfinance"]] = None, **kwargs ) -> OBBject[List]: - """Crypto Historical Price. + r"""Crypto Historical Price. Parameters ---------- @@ -51,11 +51,11 @@ class CLASS_crypto(Container): Start date of the data, in YYYY-MM-DD format. end_date : Union[datetime.date, NoneType, str] End date of the data, in YYYY-MM-DD format. - provider : Union[Literal['fmp', 'polygon', 'yfinance'], NoneType] + provider : Optional[Literal['fmp', 'polygon', 'yfinance']] The provider to use for the query, by default None. If None, the provider specified in defaults is selected or 'fmp' if there is no default. - timeseries : Union[pydantic.types.NonNegativeInt, NoneType] + timeseries : Optional[pydantic.types.NonNegativeInt] Number of days to look back. (provider: fmp) timespan : Literal['minute', 'hour', 'day', 'week', 'month', 'quarter', 'year'] Timespan of the data. (provider: polygon) @@ -67,9 +67,9 @@ class CLASS_crypto(Container): Whether the data is adjusted. (provider: polygon) multiplier : PositiveInt Multiplier of the timespan. (provider: polygon) - interval : Union[Literal['1m', '2m', '5m', '15m', '30m', '60m', '90m', '1h', '1d', '5d', '1wk', '1mo', '3mo'], NoneType] + interval : Optional[Literal['1m', '2m', '5m', '15m', '30m', '60m', '90m', '1h', '1d', '5d', '1wk', '1mo', '3mo']] Data granularity. (provider: yfinance) - period : Union[Literal['1d', '5d', '1mo', '3mo', '6mo', '1y', '2y', '5y', '10y', 'ytd', 'max'], NoneType] + period : Optional[Literal['1d', '5d', '1mo', '3mo', '6mo', '1y', '2y', '5y', '10y', 'ytd', 'max']] Period of the data to return. (provider: yfinance) prepost : bool Include Pre and Post market data. (provider: yfinance) @@ -83,7 +83,7 @@ class CLASS_crypto(Container): OBBject results : List[CryptoHistorical] Serializable results. - provider : Union[Literal['fmp', 'polygon', 'yfinance'], NoneType] + provider : Optional[Literal['fmp', 'polygon', 'yfinance']] Provider name. warnings : Optional[List[Warning_]] List of warnings. @@ -115,11 +115,11 @@ class CLASS_crypto(Container): change : Optional[float] Change in the price of the symbol from the previous day. (provider: fmp) change_percent : Optional[float] - Change \\% in the price of the symbol. (provider: fmp) + Change \% in the price of the symbol. (provider: fmp) label : Optional[str] Human readable format of the date. (provider: fmp) change_over_time : Optional[float] - Change \\% in the price of the symbol over a period of time. (provider: fmp) + Change \% in the price of the symbol over a period of time. (provider: fmp) n : Optional[PositiveInt] Number of transactions for the symbol in the time period. (provider: polygon) """ # noqa: E501 diff --git a/openbb_sdk/openbb/package/economy.py b/openbb_sdk/openbb/package/economy.py index 12b5d5c5e98..a25ad79064b 100644 --- a/openbb_sdk/openbb/package/economy.py +++ b/openbb_sdk/openbb/package/economy.py @@ -1,14 +1,14 @@ ### THIS FILE IS AUTO-GENERATED. DO NOT EDIT. ### import datetime -from typing import List, Literal, Union +from typing import List, Literal, Optional, Union -import typing_extensions from openbb_core.app.model.custom_parameter import OpenBBCustomParameter from openbb_core.app.model.obbject import OBBject from openbb_core.app.static.container import Container from openbb_core.app.static.filters import filter_inputs from pydantic import validate_arguments +from typing_extensions import Annotated class CLASS_economy(Container): @@ -27,13 +27,13 @@ class CLASS_economy(Container): @validate_arguments def available_indices( - self, provider: Union[Literal["cboe", "fmp", "yfinance"], None] = None, **kwargs + self, provider: Optional[Literal["cboe", "fmp", "yfinance"]] = None, **kwargs ) -> OBBject[List]: """Lists of available indices from a provider. Parameters ---------- - provider : Union[Literal['cboe', 'fmp', 'yfinance'], NoneType] + provider : Optional[Literal['cboe', 'fmp', 'yfinance']] The provider to use for the query, by default None. If None, the provider specified in defaults is selected or 'cboe' if there is no default. @@ -45,7 +45,7 @@ class CLASS_economy(Container): OBBject results : List[AvailableIndices] Serializable results. - provider : Union[Literal['cboe', 'fmp', 'yfinance'], NoneType] + provider : Optional[Literal['cboe', 'fmp', 'yfinance']] Provider name. warnings : Optional[List[Warning_]] List of warnings. @@ -105,13 +105,13 @@ class CLASS_economy(Container): @validate_arguments def const( self, - index: typing_extensions.Annotated[ + index: Annotated[ Literal["nasdaq", "sp500", "dowjones"], OpenBBCustomParameter( description="Index for which we want to fetch the constituents." ), ] = "dowjones", - provider: Union[Literal["fmp"], None] = None, + provider: Optional[Literal["fmp"]] = None, **kwargs ) -> OBBject[List]: """Get the constituents of an index. @@ -120,7 +120,7 @@ class CLASS_economy(Container): ---------- index : Literal['nasdaq', 'sp500', 'dowjones'] Index for which we want to fetch the constituents. - provider : Union[Literal['fmp'], NoneType] + provider : Optional[Literal['fmp']] The provider to use for the query, by default None. If None, the provider specified in defaults is selected or 'fmp' if there is no default. @@ -130,7 +130,7 @@ class CLASS_economy(Container): OBBject results : List[MajorIndicesConstituents] Serializable results. - provider : Union[Literal['fmp'], NoneType] + provider : Optional[Literal['fmp']] Provider name. warnings : Optional[List[Warning_]] List of warnings. @@ -176,7 +176,7 @@ class CLASS_economy(Container): @validate_arguments def cpi( self, - countries: typing_extensions.Annotated[ + countries: Annotated[ List[ Literal[ "australia", @@ -232,33 +232,33 @@ class CLASS_economy(Container): ], OpenBBCustomParameter(description="The country or countries to get data."), ], - units: typing_extensions.Annotated[ + units: Annotated[ Literal["growth_previous", "growth_same", "index_2015"], OpenBBCustomParameter(description="The data units."), ] = "growth_same", - frequency: typing_extensions.Annotated[ + frequency: Annotated[ Literal["monthly", "quarter", "annual"], OpenBBCustomParameter(description="The data time frequency."), ] = "monthly", - harmonized: typing_extensions.Annotated[ + harmonized: Annotated[ bool, OpenBBCustomParameter( description="Whether you wish to obtain harmonized data." ), ] = False, - start_date: typing_extensions.Annotated[ + start_date: Annotated[ Union[datetime.date, None, str], OpenBBCustomParameter( description="Start date of the data, in YYYY-MM-DD format." ), ] = None, - end_date: typing_extensions.Annotated[ + end_date: Annotated[ Union[datetime.date, None, str], OpenBBCustomParameter( description="End date of the data, in YYYY-MM-DD format." ), ] = None, - provider: Union[Literal["fred"], None] = None, + provider: Optional[Literal["fred"]] = None, **kwargs ) -> OBBject[List]: """CPI. @@ -277,7 +277,7 @@ class CLASS_economy(Container): Start date of the data, in YYYY-MM-DD format. end_date : Union[datetime.date, NoneType, str] End date of the data, in YYYY-MM-DD format. - provider : Union[Literal['fred'], NoneType] + provider : Optional[Literal['fred']] The provider to use for the query, by default None. If None, the provider specified in defaults is selected or 'fred' if there is no default. @@ -287,7 +287,7 @@ class CLASS_economy(Container): OBBject results : List[CPI] Serializable results. - provider : Union[Literal['fred'], NoneType] + provider : Optional[Literal['fred']] Provider name. warnings : Optional[List[Warning_]] List of warnings. @@ -330,23 +330,23 @@ class CLASS_economy(Container): @validate_arguments def european_index( self, - symbol: typing_extensions.Annotated[ + symbol: Annotated[ Union[str, List[str]], OpenBBCustomParameter(description="Symbol to get data for."), ], - start_date: typing_extensions.Annotated[ + start_date: Annotated[ Union[datetime.date, None, str], OpenBBCustomParameter( description="Start date of the data, in YYYY-MM-DD format." ), ] = None, - end_date: typing_extensions.Annotated[ + end_date: Annotated[ Union[datetime.date, None, str], OpenBBCustomParameter( description="End date of the data, in YYYY-MM-DD format." ), ] = None, - provider: Union[Literal["cboe"], None] = None, + provider: Optional[Literal["cboe"]] = None, **kwargs ) -> OBBject[List]: """Get historical close values for select European indices. @@ -359,11 +359,11 @@ class CLASS_economy(Container): Start date of the data, in YYYY-MM-DD format. end_date : Union[datetime.date, NoneType, str] End date of the data, in YYYY-MM-DD format. - provider : Union[Literal['cboe'], NoneType] + provider : Optional[Literal['cboe']] The provider to use for the query, by default None. If None, the provider specified in defaults is selected or 'cboe' if there is no default. - interval : Union[Literal['1d', '1m'], NoneType] + interval : Optional[Literal['1d', '1m']] Data granularity. (provider: cboe) Returns @@ -371,7 +371,7 @@ class CLASS_economy(Container): OBBject results : List[EuropeanIndexHistorical] Serializable results. - provider : Union[Literal['cboe'], NoneType] + provider : Optional[Literal['cboe']] Provider name. warnings : Optional[List[Warning_]] List of warnings. @@ -415,11 +415,11 @@ class CLASS_economy(Container): @validate_arguments def european_index_constituents( self, - symbol: typing_extensions.Annotated[ + symbol: Annotated[ Union[str, List[str]], OpenBBCustomParameter(description="Symbol to get data for."), ], - provider: Union[Literal["cboe"], None] = None, + provider: Optional[Literal["cboe"]] = None, **kwargs ) -> OBBject[List]: """Get current levels for constituents of select European indices. @@ -428,7 +428,7 @@ class CLASS_economy(Container): ---------- symbol : Union[str, List[str]] Symbol to get data for. - provider : Union[Literal['cboe'], NoneType] + provider : Optional[Literal['cboe']] The provider to use for the query, by default None. If None, the provider specified in defaults is selected or 'cboe' if there is no default. @@ -438,7 +438,7 @@ class CLASS_economy(Container): OBBject results : List[EuropeanIndexConstituents] Serializable results. - provider : Union[Literal['cboe'], NoneType] + provider : Optional[Literal['cboe']] Provider name. warnings : Optional[List[Warning_]] List of warnings. @@ -498,26 +498,26 @@ class CLASS_economy(Container): @validate_arguments def index( self, - symbol: typing_extensions.Annotated[ + symbol: Annotated[ Union[str, List[str]], OpenBBCustomParameter(description="Symbol to get data for."), ], - start_date: typing_extensions.Annotated[ + start_date: Annotated[ Union[datetime.date, None, str], OpenBBCustomParameter( description="Start date of the data, in YYYY-MM-DD format." ), ] = None, - end_date: typing_extensions.Annotated[ + end_date: Annotated[ Union[datetime.date, None, str], OpenBBCustomParameter( description="End date of the data, in YYYY-MM-DD format." ), ] = None, - provider: Union[Literal["cboe", "fmp", "polygon", "yfinance"], None] = None, + provider: Optional[Literal["cboe", "fmp", "polygon", "yfinance"]] = None, **kwargs ) -> OBBject[List]: - """Get historical levels for an index. + r"""Get historical levels for an index. Parameters ---------- @@ -527,13 +527,13 @@ class CLASS_economy(Container): Start date of the data, in YYYY-MM-DD format. end_date : Union[datetime.date, NoneType, str] End date of the data, in YYYY-MM-DD format. - provider : Union[Literal['cboe', 'fmp', 'polygon', 'yfinance'], NoneType] + provider : Optional[Literal['cboe', 'fmp', 'polygon', 'yfinance']] The provider to use for the query, by default None. If None, the provider specified in defaults is selected or 'cboe' if there is no default. interval : Union[Literal['1d', '1m'], NoneType, Literal['1min', '5min', '15min', '30min', '1hour', '4hour', '1day'], Literal['1m', '2m', '5m', '15m', '30m', '60m', '90m', '1h', '1d', '5d', '1wk', '1mo', '3mo']] Data granularity. (provider: cboe, fmp, yfinance) - timeseries : Union[pydantic.types.NonNegativeInt, NoneType] + timeseries : Optional[pydantic.types.NonNegativeInt] Number of days to look back. (provider: fmp) timespan : Literal['minute', 'hour', 'day', 'week', 'month', 'quarter', 'year'] Timespan of the data. (provider: polygon) @@ -545,7 +545,7 @@ class CLASS_economy(Container): Whether the data is adjusted. (provider: polygon) multiplier : PositiveInt Multiplier of the timespan. (provider: polygon) - period : Union[Literal['1d', '5d', '1mo', '3mo', '6mo', '1y', '2y', '5y', '10y', 'ytd', 'max'], NoneType] + period : Optional[Literal['1d', '5d', '1mo', '3mo', '6mo', '1y', '2y', '5y', '10y', 'ytd', 'max']] Period of the data to return. (provider: yfinance) prepost : bool Include Pre and Post market data. (provider: yfinance) @@ -559,7 +559,7 @@ class CLASS_economy(Container): OBBject results : List[MajorIndicesHistorical] Serializable results. - provider : Union[Literal['cboe', 'fmp', 'polygon', 'yfinance'], NoneType] + provider : Optional[Literal['cboe', 'fmp', 'polygon', 'yfinance']] Provider name. warnings : Optional[List[Warning_]] List of warnings. @@ -595,11 +595,11 @@ class CLASS_economy(Container): change : Optional[float] Change in the price of the symbol from the previous day. (provider: fmp) change_percent : Optional[float] - Change \\% in the price of the symbol. (provider: fmp) + Change \% in the price of the symbol. (provider: fmp) label : Optional[str] Human readable format of the date. (provider: fmp) change_over_time : Optional[float] - Change \\% in the price of the symbol over a period of time. (provider: fmp) + Change \% in the price of the symbol over a period of time. (provider: fmp) """ # noqa: E501 inputs = filter_inputs( @@ -621,13 +621,13 @@ class CLASS_economy(Container): @validate_arguments def risk( - self, provider: Union[Literal["fmp"], None] = None, **kwargs + self, provider: Optional[Literal["fmp"]] = None, **kwargs ) -> OBBject[List]: """Market Risk Premium. Parameters ---------- - provider : Union[Literal['fmp'], NoneType] + provider : Optional[Literal['fmp']] The provider to use for the query, by default None. If None, the provider specified in defaults is selected or 'fmp' if there is no default. @@ -637,7 +637,7 @@ class CLASS_economy(Container): OBBject results : List[RiskPremium] Serializable results. - provider : Union[Literal['fmp'], NoneType] + provider : Optional[Literal['fmp']] Provider name. warnings : Optional[List[Warning_]] List of warnings. diff --git a/openbb_sdk/openbb/package/extension_map.json b/openbb_sdk/openbb/package/extension_map.json index b11b4e0560d..cf5a80bf118 100644 --- a/openbb_sdk/openbb/package/extension_map.json +++ b/openbb_sdk/openbb/package/extension_map.json @@ -1,26 +1,22 @@ { "openbb_core_extension": [ - "crypto@0.1.0a0", - "econometrics@0.1.0a0", - "economy@0.1.0a0", - "fixedincome@0.1.0a0", - "forex@0.1.0a0", - "futures@0.1.0a0", - "news@0.1.0a0", - "openbb_charting@0.1.0a1", - "qa@0.1.0a0", - "stocks@0.1.0a0", - "ta@0.1.0a0" + "crypto@0.1.1", + "economy@0.1.1", + "fixedincome@0.1.1", + "forex@0.1.1", + "futures@0.1.1", + "news@0.1.1", + "openbb_charting@0.1.0", + "qa@0.1.0", + "stocks@0.1.0", + "ta@0.1.0" ], "openbb_provider_extension": [ - "alpha_vantage@0.1.0a0", - "benzinga@0.1.0a0", - "cboe@0.1.0a0", - "fmp@0.1.0a0", - "fred@0.1.0a0", - "intrinio@0.1.0a0", - "polygon@0.1.0a0", - "quandl@0.1.0a0", - "yfinance@0.1.0a0" + "benzinga@0.1.1", + "cboe@0.1.1", + "fmp@0.1.1", + "fred@0.1.1", + "polygon@0.1.1", + "yfinance@0.1.1" ] } \ No newline at end of file diff --git a/openbb_sdk/openbb/package/fixedincome.py b/openbb_sdk/openbb/package/fixedincome.py index 50bf2542345..c1854d40f13 100644 --- a/openbb_sdk/openbb/package/fixedincome.py +++ b/openbb_sdk/openbb/package/fixedincome.py @@ -1,14 +1,14 @@ ### THIS FILE IS AUTO-GENERATED. DO NOT EDIT. ### import datetime -from typing import List, Literal, Union +from typing import List, Literal, Optional, Union -import typing_extensions from openbb_core.app.model.custom_parameter import OpenBBCustomParameter from openbb_core.app.model.obbject import OBBject from openbb_core.app.static.container import Container from openbb_core.app.static.filters import filter_inputs from pydantic import validate_arguments +from typing_extensions import Annotated class CLASS_fixedincome(Container): @@ -30,19 +30,19 @@ class CLASS_fixedincome(Container): @validate_arguments def ameribor( self, - start_date: typing_extensions.Annotated[ + start_date: Annotated[ Union[datetime.date, None, str], OpenBBCustomParameter( description="Start date of the data, in YYYY-MM-DD format." ), ] = None, - end_date: typing_extensions.Annotated[ + end_date: Annotated[ Union[datetime.date, None, str], OpenBBCustomParameter( description="End date of the data, in YYYY-MM-DD format." ), ] = None, - provider: Union[Literal["fred"], None] = None, + provider: Optional[Literal["fred"]] = None, **kwargs ) -> OBBject[List]: """ @@ -56,7 +56,7 @@ class CLASS_fixedincome(Container): Start date of the data, in YYYY-MM-DD format. end_date : Union[datetime.date, NoneType, str] End date of the data, in YYYY-MM-DD format. - provider : Union[Literal['fred'], NoneType] + provider : Optional[Literal['fred']] The provider to use for the query, by default None. If None, the provider specified in defaults is selected or 'fred' if there is no default. @@ -68,7 +68,7 @@ class CLASS_fixedincome(Container): OBBject results : List[AMERIBOR] Serializable results. - provider : Union[Literal['fred'], NoneType] + provider : Optional[Literal['fred']] Provider name. warnings : Optional[List[Warning_]] List of warnings. @@ -103,19 +103,19 @@ class CLASS_fixedincome(Container): @validate_arguments def estr( self, - start_date: typing_extensions.Annotated[ + start_date: Annotated[ Union[datetime.date, None, str], OpenBBCustomParameter( description="Start date of the data, in YYYY-MM-DD format." ), ] = None, - end_date: typing_extensions.Annotated[ + end_date: Annotated[ Union[datetime.date, None, str], OpenBBCustomParameter( description="End date of the data, in YYYY-MM-DD format." ), ] = None, - provider: Union[Literal["fred"], None] = None, + provider: Optional[Literal["fred"]] = None, **kwargs ) -> OBBject[List]: """ @@ -130,7 +130,7 @@ class CLASS_fixedincome(Container): Start date of the data, in YYYY-MM-DD format. end_date : Union[datetime.date, NoneType, str] End date of the data, in YYYY-MM-DD format. - provider : Union[Literal['fred'], NoneType] + provider : Optional[Literal['fred']] The provider to use for the query, by default None. If None, the provider specified in defaults is selected or 'fred' if there is no default. @@ -142,7 +142,7 @@ class CLASS_fixedincome(Container): OBBject results : List[ESTR] Serializable results. - provider : Union[Literal['fred'], NoneType] + provider : Optional[Literal['fred']] Provider name. warnings : Optional[List[Warning_]] List of warnings. @@ -177,19 +177,19 @@ class CLASS_fixedincome(Container): @validate_arguments def fed( self, - start_date: typing_extensions.Annotated[ + start_date: Annotated[ Union[datetime.date, None, str], OpenBBCustomParameter( description="Start date of the data, in YYYY-MM-DD format." ), ] = None, - end_date: typing_extensions.Annotated[ + end_date: Annotated[ Union[datetime.date, None, str], OpenBBCustomParameter( description="End date of the data, in YYYY-MM-DD format." ), ] = None, - provider: Union[Literal["fred"], None] = None, + provider: Optional[Literal["fred"]] = None, **kwargs ) -> OBBject[List]: """ @@ -204,7 +204,7 @@ class CLASS_fixedincome(Container): Start date of the data, in YYYY-MM-DD format. end_date : Union[datetime.date, NoneType, str] End date of the data, in YYYY-MM-DD format. - provider : Union[Literal['fred'], NoneType] + provider : Optional[Literal['fred']] The provider to use for the query, by default None. If None, the provider specified in defaults is selected or 'fred' if there is no default. @@ -216,7 +216,7 @@ class CLASS_fixedincome(Container): OBBject results : List[FEDFUNDS] Serializable results. - provider : Union[Literal['fred'], NoneType] + provider : Optional[Literal['fred']] Provider name. warnings : Optional[List[Warning_]] List of warnings. @@ -251,19 +251,19 @@ class CLASS_fixedincome(Container): @validate_arguments def iorb( self, - start_date: typing_extensions.Annotated[ + start_date: Annotated[ Union[datetime.date, None, str], OpenBBCustomParameter( description="Start date of the data, in YYYY-MM-DD format." ), ] = None, - end_date: typing_extensions.Annotated[ + end_date: Annotated[ Union[datetime.date, None, str], OpenBBCustomParameter( description="End date of the data, in YYYY-MM-DD format." ), ] = None, - provider: Union[Literal["fred"], None] = None, + provider: Optional[Literal["fred"]] = None, **kwargs ) -> OBBject[List]: """ @@ -278,7 +278,7 @@ class CLASS_fixedincome(Container): Start date of the data, in YYYY-MM-DD format. end_date : Union[datetime.date, NoneType, str] End date of the data, in YYYY-MM-DD format. - provider : Union[Literal['fred'], NoneType] + provider : Optional[Literal['fred']] The provider to use for the query, by default None. If None, the provider specified in defaults is selected or 'fred' if there is no default. @@ -288,7 +288,7 @@ class CLASS_fixedincome(Container): OBBject results : List[IORB] Serializable results. - provider : Union[Literal['fred'], NoneType] + provider : Optional[Literal['fred']] Provider name. warnings : Optional[List[Warning_]] List of warnings. @@ -322,7 +322,7 @@ class CLASS_fixedincome(Container): @validate_arguments def projections( - self, provider: Union[Literal["fred"], None] = None, **kwargs + self, provider: Optional[Literal["fred"]] = None, **kwargs ) -> OBBject[List]: """ Get Effective Federal Funds Rate data. A bank rate is the interest rate a nation's central bank charges to its @@ -332,7 +332,7 @@ class CLASS_fixedincome(Container): Parameters ---------- - provider : Union[Literal['fred'], NoneType] + provider : Optional[Literal['fred']] The provider to use for the query, by default None. If None, the provider specified in defaults is selected or 'fred' if there is no default. @@ -344,7 +344,7 @@ class CLASS_fixedincome(Container): OBBject results : List[PROJECTIONS] Serializable results. - provider : Union[Literal['fred'], NoneType] + provider : Optional[Literal['fred']] Provider name. warnings : Optional[List[Warning_]] List of warnings. @@ -388,19 +388,19 @@ class CLASS_fixedincome(Container): @validate_arguments def sofr( self, - start_date: typing_extensions.Annotated[ + start_date: Annotated[ Union[datetime.date, None, str], OpenBBCustomParameter( description="Start date of the data, in YYYY-MM-DD format." ), ] = None, - end_date: typing_extensions.Annotated[ + end_date: Annotated[ Union[datetime.date, None, str], OpenBBCustomParameter( description="End date of the data, in YYYY-MM-DD format." ), ] = None, - provider: Union[Literal["fred"], None] = None, + provider: Optional[Literal["fred"]] = None, **kwargs ) -> OBBject[List]: """Get United States yield curve. @@ -411,7 +411,7 @@ class CLASS_fixedincome(Container): Start date of the data, in YYYY-MM-DD format. end_date : Union[datetime.date, NoneType, str] End date of the data, in YYYY-MM-DD format. - provider : Union[Literal['fred'], NoneType] + provider : Optional[Literal['fred']] The provider to use for the query, by default None. If None, the provider specified in defaults is selected or 'fred' if there is no default. @@ -423,7 +423,7 @@ class CLASS_fixedincome(Container): OBBject results : List[SOFR] Serializable results. - provider : Union[Literal['fred'], NoneType] + provider : Optional[Literal['fred']] Provider name. warnings : Optional[List[Warning_]] List of warnings. @@ -458,19 +458,19 @@ class CLASS_fixedincome(Container): @validate_arguments def sonia( self, - start_date: typing_extensions.Annotated[ + start_date: Annotated[ Union[datetime.date, None, str], OpenBBCustomParameter( description="Start date of the data, in YYYY-MM-DD format." ), ] = None, - end_date: typing_extensions.Annotated[ + end_date: Annotated[ Union[datetime.date, None, str], OpenBBCustomParameter( description="End date of the data, in YYYY-MM-DD format." ), ] = None, - provider: Union[Literal["fred"], None] = None, + provider: Optional[Literal["fred"]] = None, **kwargs ) -> OBBject[List]: """ @@ -484,7 +484,7 @@ class CLASS_fixedincome(Container): Start date of the data, in YYYY-MM-DD format. end_date : Union[datetime.date, NoneType, str] End date of the data, in YYYY-MM-DD format. - provider : Union[Literal['fred'], NoneType] + provider : Optional[Literal['fred']] The provider to use for the query, by default None. If None, the provider specified in defaults is selected or 'fred' if there is no default. @@ -496,7 +496,7 @@ class CLASS_fixedincome(Container): OBBject results : List[SONIA] Serializable results. - provider : Union[Literal['fred'], NoneType] + provider : Optional[Literal['fred']] Provider name. warnings : Optional[List[Warning_]] List of warnings. @@ -531,19 +531,19 @@ class CLASS_fixedincome(Container): @validate_arguments def treasury( self, - start_date: typing_extensions.Annotated[ + start_date: Annotated[ Union[datetime.date, None, str], OpenBBCustomParameter( description="Start date of the data, in YYYY-MM-DD format." ), ] = None, - end_date: typing_extensions.Annotated[ + end_date: Annotated[ Union[datetime.date, None, str], OpenBBCustomParameter( description="End date of the data, in YYYY-MM-DD format." ), ] = None, - provider: Union[Literal["fmp"], None] = None, + provider: Optional[Literal["fmp"]] = None, **kwargs ) -> OBBject[List]: """Get treasury rates. @@ -554,7 +554,7 @@ class CLASS_fixedincome(Container): Start date of the data, in YYYY-MM-DD format. end_date : Union[datetime.date, NoneType, str] End date of the data, in YYYY-MM-DD format. - provider : Union[Literal['fmp'], NoneType] + provider : Optional[Literal['fmp']] The provider to use for the query, by default None. If None, the provider specified in defaults is selected or 'fmp' if there is no default. @@ -564,7 +564,7 @@ class CLASS_fixedincome(Container): OBBject results : List[TreasuryRates] Serializable results. - provider : Union[Literal['fmp'], NoneType] + provider : Optional[Literal['fmp']] Provider name. warnings : Optional[List[Warning_]] List of warnings. @@ -621,28 +621,28 @@ class CLASS_fixedincome(Container): @validate_arguments def ycrv( self, - date: typing_extensions.Annotated[ - Union[datetime.date, None], + date: Annotated[ + Optional[datetime.date], OpenBBCustomParameter( description="Date to get Yield Curve data. Defaults to the most recent FRED entry." ), ] = None, - inflation_adjusted: typing_extensions.Annotated[ - Union[bool, None], + inflation_adjusted: Annotated[ + Optional[bool], OpenBBCustomParameter(description="Get inflation adjusted rates."), ] = False, - provider: Union[Literal["fred"], None] = None, + provider: Optional[Literal["fred"]] = None, **kwargs ) -> OBBject[List]: """Get United States yield curve. Parameters ---------- - date : Union[datetime.date, NoneType] + date : Optional[datetime.date] Date to get Yield Curve data. Defaults to the most recent FRED entry. - inflation_adjusted : Union[bool, NoneType] + inflation_adjusted : Optional[bool] Get inflation adjusted rates. - provider : Union[Literal['fred'], NoneType] + provider : Optional[Literal['fred']] The provider to use for the query, by default None. If None, the provider specified in defaults is selected or 'fred' if there is no default. @@ -652,7 +652,7 @@ class CLASS_fixedincome(Container): OBBject results : List[USYieldCurve] Serializable results. - provider : Union[Literal['fred'], NoneType] + provider : Optional[Literal['fred']] Provider name. warnings : Optional[List[Warning_]] List of warnings. diff --git a/openbb_sdk/openbb/package/forex.py b/openbb_sdk/openbb/package/forex.py index aaf80df5186..06050e6f06d 100644 --- a/openbb_sdk/openbb/package/forex.py +++ b/openbb_sdk/openbb/package/forex.py @@ -1,14 +1,14 @@ ### THIS FILE IS AUTO-GENERATED. DO NOT EDIT. ### import datetime -from typing import List, Literal, Union +from typing import List, Literal, Optional, Union -import typing_extensions from openbb_core.app.model.custom_parameter import OpenBBCustomParameter from openbb_core.app.model.obbject import OBBject from openbb_core.app.static.container import Container from openbb_core.app.static.filters import filter_inputs from pydantic import validate_arguments +from typing_extensions import Annotated class CLASS_forex(Container): @@ -23,26 +23,26 @@ class CLASS_forex(Container): @validate_arguments def load( self, - symbol: typing_extensions.Annotated[ + symbol: Annotated[ Union[str, List[str]], OpenBBCustomParameter(description="Symbol to get data for."), ], - start_date: typing_extensions.Annotated[ + start_date: Annotated[ Union[datetime.date, None, str], OpenBBCustomParameter( description="Start date of the data, in YYYY-MM-DD format." ), ] = None, - end_date: typing_extensions.Annotated[ + end_date: Annotated[ Union[datetime.date, None, str], OpenBBCustomParameter( description="End date of the data, in YYYY-MM-DD format." ), ] = None, - provider: Union[Literal["fmp", "polygon", "yfinance"], None] = None, + provider: Optional[Literal["fmp", "polygon", "yfinance"]] = None, **kwargs ) -> OBBject[List]: - """Forex Intraday Price. + r"""Forex Intraday Price. Parameters ---------- @@ -52,7 +52,7 @@ class CLASS_forex(Container): Start date of the data, in YYYY-MM-DD format. end_date : Union[datetime.date, NoneType, str] End date of the data, in YYYY-MM-DD format. - provider : Union[Literal['fmp', 'polygon', 'yfinance'], NoneType] + provider : Optional[Literal['fmp', 'polygon', 'yfinance']] The provider to use for the query, by default None. If None, the provider specified in defaults is selected or 'fmp' if there is no default. @@ -66,9 +66,9 @@ class CLASS_forex(Container): Whether the data is adjusted. (provider: polygon) multiplier : PositiveInt Multiplier of the timespan. (provider: polygon) - interval : Union[Literal['1m', '2m', '5m', '15m', '30m', '60m', '90m', '1h', '1d', '5d', '1wk', '1mo', '3mo'], NoneType] + interval : Optional[Literal['1m', '2m', '5m', '15m', '30m', '60m', '90m', '1h', '1d', '5d', '1wk', '1mo', '3mo']] Data granularity. (provider: yfinance) - period : Union[Literal['1d', '5d', '1mo', '3mo', '6mo', '1y', '2y', '5y', '10y', 'ytd', 'max'], NoneType] + period : Optional[Literal['1d', '5d', '1mo', '3mo', '6mo', '1y', '2y', '5y', '10y', 'ytd', 'max']] Period of the data to return. (provider: yfinance) prepost : bool Include Pre and Post market data. (provider: yfinance) @@ -82,7 +82,7 @@ class CLASS_forex(Container): OBBject results : List[ForexHistorical] Serializable results. - provider : Union[Literal['fmp', 'polygon', 'yfinance'], NoneType] + provider : Optional[Literal['fmp', 'polygon', 'yfinance']] Provider name. warnings : Optional[List[Warning_]] List of warnings. @@ -114,11 +114,11 @@ class CLASS_forex(Container): change : Optional[float] Change in the price of the symbol from the previous day. (provider: fmp) change_percent : Optional[float] - Change \\% in the price of the symbol. (provider: fmp) + Change \% in the price of the symbol. (provider: fmp) label : Optional[str] Human readable format of the date. (provider: fmp) change_over_time : Optional[float] - Change \\% in the price of the symbol over a period of time. (provider: fmp) + Change \% in the price of the symbol over a period of time. (provider: fmp) n : Optional[PositiveInt] Number of transactions for the symbol in the time period. (provider: polygon) """ # noqa: E501 @@ -142,31 +142,29 @@ class CLASS_forex(Container): @validate_arguments def pairs( - self, - provider: Union[Literal["fmp", "intrinio", "polygon"], None] = None, - **kwargs + self, provider: Optional[Literal["fmp", "polygon"]] = None, **kwargs ) -> OBBject[List]: """Forex Available Pairs. Parameters ---------- - provider : Union[Literal['fmp', 'intrinio', 'polygon'], NoneType] + provider : Optional[Literal['fmp', 'polygon']] The provider to use for the query, by default None. If None, the provider specified in defaults is selected or 'fmp' if there is no default. - symbol : Union[str, NoneType] + symbol : Optional[str] Symbol of the pair to search. (provider: polygon) - date : Union[datetime.date, NoneType] + date : Optional[datetime.date] A specific date to get data for. (provider: polygon) - search : Union[str, NoneType] + search : Optional[str] Search for terms within the ticker and/or company name. (provider: polygon) - active : Union[Literal[True, False], NoneType] + active : Optional[Literal[True, False]] Specify if the tickers returned should be actively traded on the queried date. (provider: polygon) - order : Union[Literal['asc', 'desc'], NoneType] + order : Optional[Literal['asc', 'desc']] Order data by ascending or descending. (provider: polygon) - sort : Union[Literal['ticker', 'name', 'market', 'locale', 'currency_symbol', 'currency_name', 'base_currency_symbol', 'base_currency_name', 'last_updated_utc', 'delisted_utc'], NoneType] + sort : Optional[Literal['ticker', 'name', 'market', 'locale', 'currency_symbol', 'currency_name', 'base_currency_symbol', 'base_currency_name', 'last_updated_utc', 'delisted_utc']] Sort field used for ordering. (provider: polygon) - limit : Union[pydantic.types.PositiveInt, NoneType] + limit : Optional[pydantic.types.PositiveInt] The number of data entries to return. (provider: polygon) Returns @@ -174,7 +172,7 @@ class CLASS_forex(Container): OBBject results : List[ForexPairs] Serializable results. - provider : Union[Literal['fmp', 'intrinio', 'polygon'], NoneType] + provider : Optional[Literal['fmp', 'polygon']] Provider name. warnings : Optional[List[Warning_]] List of warnings. @@ -195,12 +193,6 @@ class CLASS_forex(Container): Stock exchange of the currency pair. (provider: fmp) exchange_short_name : Optional[str] Short name of the stock exchange of the currency pair. (provider: fmp) - code : Optional[str] - Code of the currency pair. (provider: intrinio) - base_currency : Optional[str] - ISO 4217 currency code of the base currency. (provider: intrinio) - quote_currency : Optional[str] - ISO 4217 currency code of the quote currency. (provider: intrinio) market : Optional[str] The name of the trading market. Always 'fx'. (provider: polygon) locale : Optional[str] diff --git a/openbb_sdk/openbb/package/futures.py b/openbb_sdk/openbb/package/futures.py index 3993a774d40..b5ffdb711e7 100644 --- a/openbb_sdk/openbb/package/futures.py +++ b/openbb_sdk/openbb/package/futures.py @@ -1,14 +1,14 @@ ### THIS FILE IS AUTO-GENERATED. DO NOT EDIT. ### import datetime -from typing import List, Literal, Union +from typing import List, Literal, Optional, Union -import typing_extensions from openbb_core.app.model.custom_parameter import OpenBBCustomParameter from openbb_core.app.model.obbject import OBBject from openbb_core.app.static.container import Container from openbb_core.app.static.filters import filter_inputs from pydantic import validate_arguments +from typing_extensions import Annotated class CLASS_futures(Container): @@ -23,15 +23,15 @@ class CLASS_futures(Container): @validate_arguments def curve( self, - symbol: typing_extensions.Annotated[ + symbol: Annotated[ Union[str, List[str]], OpenBBCustomParameter(description="Symbol to get data for."), ], - date: typing_extensions.Annotated[ - Union[datetime.date, None], + date: Annotated[ + Optional[datetime.date], OpenBBCustomParameter(description="Historical date to search curve for."), ] = None, - provider: Union[Literal["cboe", "yfinance"], None] = None, + provider: Optional[Literal["cboe", "yfinance"]] = None, **kwargs ) -> OBBject[List]: """Futures Historical Price. @@ -40,9 +40,9 @@ class CLASS_futures(Container): ---------- symbol : Union[str, List[str]] Symbol to get data for. - date : Union[datetime.date, NoneType] + date : Optional[datetime.date] Historical date to search curve for. - provider : Union[Literal['cboe', 'yfinance'], NoneType] + provider : Optional[Literal['cboe', 'yfinance']] The provider to use for the query, by default None. If None, the provider specified in defaults is selected or 'cboe' if there is no default. @@ -52,7 +52,7 @@ class CLASS_futures(Container): OBBject results : List[FuturesCurve] Serializable results. - provider : Union[Literal['cboe', 'yfinance'], NoneType] + provider : Optional[Literal['cboe', 'yfinance']] Provider name. warnings : Optional[List[Warning_]] List of warnings. @@ -89,27 +89,27 @@ class CLASS_futures(Container): @validate_arguments def load( self, - symbol: typing_extensions.Annotated[ + symbol: Annotated[ Union[str, List[str]], OpenBBCustomParameter(description="Symbol to get data for."), ], - start_date: typing_extensions.Annotated[ + start_date: Annotated[ Union[datetime.date, None, str], OpenBBCustomParameter( description="Start date of the data, in YYYY-MM-DD format." ), ] = None, - end_date: typing_extensions.Annotated[ + end_date: Annotated[ Union[datetime.date, None, str], OpenBBCustomParameter( description="End date of the data, in YYYY-MM-DD format." ), ] = None, - expiration: typing_extensions.Annotated[ - Union[str, None], + expiration: Annotated[ + Optional[str], OpenBBCustomParameter(description="Future expiry date with format YYYY-MM"), ] = None, - provider: Union[Literal["yfinance"], None] = None, + provider: Optional[Literal["yfinance"]] = None, **kwargs ) -> OBBject[List]: """Futures Historical Price. @@ -122,15 +122,15 @@ class CLASS_futures(Container): Start date of the data, in YYYY-MM-DD format. end_date : Union[datetime.date, NoneType, str] End date of the data, in YYYY-MM-DD format. - expiration : Union[str, NoneType] + expiration : Optional[str] Future expiry date with format YYYY-MM - provider : Union[Literal['yfinance'], NoneType] + provider : Optional[Literal['yfinance']] The provider to use for the query, by default None. If None, the provider specified in defaults is selected or 'yfinance' if there is no default. - interval : Union[Literal['1m', '2m', '5m', '15m', '30m', '60m', '90m', '1h', '1d', '5d', '1wk', '1mo', '3mo'], NoneType] + interval : Optional[Literal['1m', '2m', '5m', '15m', '30m', '60m', '90m', '1h', '1d', '5d', '1wk', '1mo', '3mo']] Data granularity. (provider: yfinance) - period : Union[Literal['1d', '5d', '1mo', '3mo', '6mo', '1y', '2y', '5y', '10y', 'ytd', 'max'], NoneType] + period : Optional[Literal['1d', '5d', '1mo', '3mo', '6mo', '1y', '2y', '5y', '10y', 'ytd', 'max']] Period of the data to return. (provider: yfinance) prepost : bool Include Pre and Post market data. (provider: yfinance) @@ -144,7 +144,7 @@ class CLASS_futures(Container): OBBject results : List[FuturesHistorical] Serializable results. - provider : Union[Literal['yfinance'], NoneType] + provider : Optional[Literal['yfinance']] Provider name. warnings : Optional[List[Warning_]] List of warnings. diff --git a/openbb_sdk/openbb/package/module_map.json b/openbb_sdk/openbb/package/module_map.json index c407a2f8167..a75cc7694c9 100644 --- a/openbb_sdk/openbb/package/module_map.json +++ b/openbb_sdk/openbb/package/module_map.json @@ -2,21 +2,6 @@ "__extensions__": "", "crypto": "/crypto", "crypto_load": "/crypto/load", - "econometrics": "/econometrics", - "econometrics_bgot": "/econometrics/bgot", - "econometrics_coint": "/econometrics/coint", - "econometrics_corr": "/econometrics/corr", - "econometrics_dwat": "/econometrics/dwat", - "econometrics_granger": "/econometrics/granger", - "econometrics_ols": "/econometrics/ols", - "econometrics_ols_summary": "/econometrics/ols_summary", - "econometrics_panelbols": "/econometrics/panelbols", - "econometrics_panelfd": "/econometrics/panelfd", - "econometrics_panelfmac": "/econometrics/panelfmac", - "econometrics_panelols": "/econometrics/panelols", - "econometrics_panelpols": "/econometrics/panelpols", - "econometrics_panelre": "/econometrics/panelre", - "econometrics_unitroot": "/econometrics/unitroot", "economy": "/economy", "economy_available_indices": "/economy/available_indices", "economy_const": "/economy/const", diff --git a/openbb_sdk/openbb/package/news.py b/openbb_sdk/openbb/package/news.py index ca86b4f4bae..9567a3d6a2f 100644 --- a/openbb_sdk/openbb/package/news.py +++ b/openbb_sdk/openbb/package/news.py @@ -1,14 +1,14 @@ ### THIS FILE IS AUTO-GENERATED. DO NOT EDIT. ### -from typing import List, Literal, Union +from typing import List, Literal, Optional import pydantic -import typing_extensions from openbb_core.app.model.custom_parameter import OpenBBCustomParameter from openbb_core.app.model.obbject import OBBject from openbb_core.app.static.container import Container from openbb_core.app.static.filters import filter_inputs from pydantic import validate_arguments +from typing_extensions import Annotated class CLASS_news(Container): @@ -22,11 +22,11 @@ class CLASS_news(Container): @validate_arguments def globalnews( self, - page: typing_extensions.Annotated[ + page: Annotated[ pydantic.types.NonNegativeInt, OpenBBCustomParameter(description="Page of the global news."), ] = 0, - provider: Union[Literal["benzinga", "fmp", "intrinio"], None] = None, + provider: Optional[Literal["benzinga", "fmp"]] = None, **kwargs ) -> OBBject[List]: """Global News. @@ -35,7 +35,7 @@ class CLASS_news(Container): ---------- page : NonNegativeInt Page of the global news. - provider : Union[Literal['benzinga', 'fmp', 'intrinio'], NoneType] + provider : Optional[Literal['benzinga', 'fmp']] The provider to use for the query, by default None. If None, the provider specified in defaults is selected or 'benzinga' if there is no default. @@ -43,45 +43,39 @@ class CLASS_news(Container): Number of results to return per page. (provider: benzinga) display_output : Literal['headline', 'summary', 'full', 'all'] Type of data to return. (provider: benzinga) - date : Union[datetime.datetime, NoneType] + date : Optional[datetime.datetime] Date of the news to retrieve. (provider: benzinga) - date_from : Union[datetime.datetime, NoneType] + date_from : Optional[datetime.datetime] Start date of the news to retrieve. (provider: benzinga) - date_to : Union[datetime.datetime, NoneType] + date_to : Optional[datetime.datetime] End date of the news to retrieve. (provider: benzinga) - updated_since : Union[int, NoneType] + updated_since : Optional[int] Number of seconds since the news was updated. (provider: benzinga) - published_since : Union[int, NoneType] + published_since : Optional[int] Number of seconds since the news was published. (provider: benzinga) - sort : Union[Literal['published_at', 'updated_at', 'title', 'author', 'channel', 'ticker', 'topic', 'content_type'], NoneType] + sort : Optional[Literal['published_at', 'updated_at', 'title', 'author', 'channel', 'ticker', 'topic', 'content_type']] Order in which to sort the news. (provider: benzinga) - isin : Union[str, NoneType] + isin : Optional[str] The ISIN of the news to retrieve. (provider: benzinga) - cusip : Union[str, NoneType] + cusip : Optional[str] The CUSIP of the news to retrieve. (provider: benzinga) - tickers : Union[str, NoneType] + tickers : Optional[str] Tickers of the news to retrieve. (provider: benzinga) - channels : Union[str, NoneType] + channels : Optional[str] Channels of the news to retrieve. (provider: benzinga) - topics : Union[str, NoneType] + topics : Optional[str] Topics of the news to retrieve. (provider: benzinga) - authors : Union[str, NoneType] + authors : Optional[str] Authors of the news to retrieve. (provider: benzinga) - content_types : Union[str, NoneType] + content_types : Optional[str] Content types of the news to retrieve. (provider: benzinga) - next_page : str - Token to get the next page of data from a previous API call. (provider: intrinio) - limit : Union[int, NoneType] - The number of data entries to return. (provider: intrinio) - all_pages : Union[bool, NoneType] - Returns all pages of data from the API call at once. (provider: intrinio) Returns ------- OBBject results : List[GlobalNews] Serializable results. - provider : Union[Literal['benzinga', 'fmp', 'intrinio'], NoneType] + provider : Optional[Literal['benzinga', 'fmp']] Provider name. warnings : Optional[List[Warning_]] List of warnings. @@ -111,11 +105,7 @@ class CLASS_news(Container): teaser : Optional[str] Teaser of the news. (provider: benzinga) site : Optional[str] - Site of the news. (provider: fmp) - id : Optional[str] - Article ID. (provider: intrinio) - company : Optional[Mapping[str, Any]] - Company details related to the news article. (provider: intrinio)""" # noqa: E501 + Site of the news. (provider: fmp)""" # noqa: E501 inputs = filter_inputs( provider_choices={ diff --git a/openbb_sdk/openbb/package/qa.py b/openbb_sdk/openbb/package/qa.py index 108f406bfe5..93b458a101a 100644 --- a/openbb_sdk/openbb/package/qa.py +++ b/openbb_sdk/openbb/package/qa.py @@ -337,7 +337,7 @@ class CLASS_qa(Container): self, data: Union[List[openbb_provider.abstract.data.Data], pandas.DataFrame], target: str, - fuller_reg: Literal["c", "ct", "ctt", "nc", "c"] = "c", + fuller_reg: Literal["c", "ct", "ctt", "nc"] = "c", kpss_reg: Literal["c", "ct"] = "c", ) -> OBBject[openbb_qa.qa_models.UnitRootModel]: """Unit Root Test. diff --git a/openbb_sdk/openbb/package/stocks.py b/openbb_sdk/openbb/package/stocks.py index 49e3d986071..bca1afff86c 100644 --- a/openbb_sdk/openbb/package/stocks.py +++ b/openbb_sdk/openbb/package/stocks.py @@ -1,16 +1,15 @@ ### THIS FILE IS AUTO-GENERATED. DO NOT EDIT. ### import datetime -from typing import List, Literal, Union +from typing import List, Literal, Optional, Union import pydantic -import pydantic.main -import typing_extensions from openbb_core.app.model.custom_parameter import OpenBBCustomParameter from openbb_core.app.model.obbject import OBBject from openbb_core.app.static.container import Container from openbb_core.app.static.filters import filter_inputs -from pydantic import BaseModel, validate_arguments +from pydantic import validate_arguments +from typing_extensions import Annotated class CLASS_stocks(Container): @@ -51,11 +50,11 @@ class CLASS_stocks(Container): @validate_arguments def info( self, - symbol: typing_extensions.Annotated[ + symbol: Annotated[ Union[str, List[str]], OpenBBCustomParameter(description="Symbol to get data for."), ], - provider: Union[Literal["cboe"], None] = None, + provider: Optional[Literal["cboe"]] = None, **kwargs ) -> OBBject[List]: """Get general price and performance metrics of a stock. @@ -64,7 +63,7 @@ class CLASS_stocks(Container): ---------- symbol : Union[str, List[str]] Symbol to get data for. - provider : Union[Literal['cboe'], NoneType] + provider : Optional[Literal['cboe']] The provider to use for the query, by default None. If None, the provider specified in defaults is selected or 'cboe' if there is no default. @@ -74,7 +73,7 @@ class CLASS_stocks(Container): OBBject results : List[StockInfo] Serializable results. - provider : Union[Literal['cboe'], NoneType] + provider : Optional[Literal['cboe']] Provider name. warnings : Optional[List[Warning_]] List of warnings. @@ -166,30 +165,27 @@ class CLASS_stocks(Container): @validate_arguments def load( self, - symbol: typing_extensions.Annotated[ + symbol: Annotated[ Union[str, List[str]], OpenBBCustomParameter(description="Symbol to get data for."), ], - start_date: typing_extensions.Annotated[ + start_date: Annotated[ Union[datetime.date, None, str], OpenBBCustomParameter( description="Start date of the data, in YYYY-MM-DD format." ), ] = None, - end_date: typing_extensions.Annotated[ + 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: Union[ - Literal["alpha_vantage", "cboe", "fmp", "intrinio", "polygon", "yfinance"], - None, - ] = None, + provider: Optional[Literal["cboe", "fmp", "polygon", "yfinance"]] = None, **kwargs ) -> OBBject[List]: - """Load stock data for a specific ticker. + r"""Load stock data for a specific ticker. Parameters ---------- @@ -201,46 +197,26 @@ class CLASS_stocks(Container): End date of the data, in YYYY-MM-DD format. chart : bool Whether to create a chart or not, by default False. - provider : Union[Literal['alpha_vantage', 'cboe', 'fmp', 'intrinio', 'polygon', 'yfinance'], NoneType] + provider : Optional[Literal['cboe', 'fmp', 'polygon', 'yfinance']] The provider to use for the query, by default None. - If None, the provider specified in defaults is selected or 'alpha_vantage' if there is + If None, the provider specified in defaults is selected or 'cboe' if there is no default. - period : Union[Literal['intraday', 'daily', 'weekly', 'monthly'], Literal['1d', '5d', '1mo', '3mo', '6mo', '1y', '2y', '5y', '10y', 'ytd', 'max'], NoneType] - Period of the data to return. (provider: alpha_vantage, yfinance) - interval : Union[Literal['1min', '5min', '15min', '30min', '60min'], NoneType, Literal['1d', '1m'], Literal['1min', '5min', '15min', '30min', '1hour', '4hour', '1day'], Literal['1m', '2m', '5m', '15m', '30m', '60m', '90m', '1h', '1d', '5d', '1wk', '1mo', '3mo']] - Data granularity. (provider: alpha_vantage, cboe, fmp, yfinance) - adjusted : Union[bool, NoneType] - Output time series is adjusted by historical split and dividend events. (provider: alpha_vantage, polygon) - extended_hours : Union[bool, NoneType] - Extended trading hours during pre-market and after-hours. (provider: alpha_vantage) - month : Union[str, NoneType] - Query a specific month in history (in YYYY-MM format). (provider: alpha_vantage) - outputsize : Union[Literal['compact', 'full'], NoneType] - Compact returns only the latest 100 data points in the intraday time series; full returns trailing 30 days of the most recent intraday data if the month parameter (see above) is not specified, or the full intraday data for a specific month in history if the month parameter is specified. (provider: alpha_vantage) - timeseries : Union[pydantic.types.NonNegativeInt, NoneType] + interval : Union[Literal['1d', '1m'], NoneType, Literal['1min', '5min', '15min', '30min', '1hour', '4hour', '1day'], Literal['1m', '2m', '5m', '15m', '30m', '60m', '90m', '1h', '1d', '5d', '1wk', '1mo', '3mo']] + Data granularity. (provider: cboe, fmp, yfinance) + timeseries : Optional[pydantic.types.NonNegativeInt] Number of days to look back. (provider: fmp) - timezone : Union[Literal['Africa/Algiers', 'Africa/Cairo', 'Africa/Casablanca', 'Africa/Harare', 'Africa/Johannesburg', 'Africa/Monrovia', 'Africa/Nairobi', 'America/Argentina/Buenos_Aires', 'America/Bogota', 'America/Caracas', 'America/Chicago', 'America/Chihuahua', 'America/Denver', 'America/Godthab', 'America/Guatemala', 'America/Guyana', 'America/Halifax', 'America/Indiana/Indianapolis', 'America/Juneau', 'America/La_Paz', 'America/Lima', 'America/Lima', 'America/Los_Angeles', 'America/Mazatlan', 'America/Mexico_City', 'America/Mexico_City', 'America/Monterrey', 'America/Montevideo', 'America/New_York', 'America/Phoenix', 'America/Regina', 'America/Santiago', 'America/Sao_Paulo', 'America/St_Johns', 'America/Tijuana', 'Asia/Almaty', 'Asia/Baghdad', 'Asia/Baku', 'Asia/Bangkok', 'Asia/Bangkok', 'Asia/Chongqing', 'Asia/Colombo', 'Asia/Dhaka', 'Asia/Dhaka', 'Asia/Hong_Kong', 'Asia/Irkutsk', 'Asia/Jakarta', 'Asia/Jerusalem', 'Asia/Kabul', 'Asia/Kamchatka', 'Asia/Karachi', 'Asia/Karachi', 'Asia/Kathmandu', 'Asia/Kolkata', 'Asia/Kolkata', 'Asia/Kolkata', 'Asia/Kolkata', 'Asia/Krasnoyarsk', 'Asia/Kuala_Lumpur', 'Asia/Kuwait', 'Asia/Magadan', 'Asia/Muscat', 'Asia/Muscat', 'Asia/Novosibirsk', 'Asia/Rangoon', 'Asia/Riyadh', 'Asia/Seoul', 'Asia/Shanghai', 'Asia/Singapore', 'Asia/Srednekolymsk', 'Asia/Taipei', 'Asia/Tashkent', 'Asia/Tbilisi', 'Asia/Tehran', 'Asia/Tokyo', 'Asia/Tokyo', 'Asia/Tokyo', 'Asia/Ulaanbaatar', 'Asia/Urumqi', 'Asia/Vladivostok', 'Asia/Yakutsk', 'Asia/Yekaterinburg', 'Asia/Yerevan', 'Atlantic/Azores', 'Atlantic/Cape_Verde', 'Atlantic/South_Georgia', 'Australia/Adelaide', 'Australia/Brisbane', 'Australia/Darwin', 'Australia/Hobart', 'Australia/Melbourne', 'Australia/Melbourne', 'Australia/Perth', 'Australia/Sydney', 'Etc/UTC', 'UTC', 'Europe/Amsterdam', 'Europe/Athens', 'Europe/Belgrade', 'Europe/Berlin', 'Europe/Berlin', 'Europe/Bratislava', 'Europe/Brussels', 'Europe/Bucharest', 'Europe/Budapest', 'Europe/Copenhagen', 'Europe/Dublin', 'Europe/Helsinki', 'Europe/Istanbul', 'Europe/Kaliningrad', 'Europe/Kiev', 'Europe/Lisbon', 'Europe/Ljubljana', 'Europe/London', 'Europe/London', 'Europe/Madrid', 'Europe/Minsk', 'Europe/Moscow', 'Europe/Moscow', 'Europe/Paris', 'Europe/Prague', 'Europe/Riga', 'Europe/Rome', 'Europe/Samara', 'Europe/Sarajevo', 'Europe/Skopje', 'Europe/Sofia', 'Europe/Stockholm', 'Europe/Tallinn', 'Europe/Vienna', 'Europe/Vilnius', 'Europe/Volgograd', 'Europe/Warsaw', 'Europe/Zagreb', 'Pacific/Apia', 'Pacific/Auckland', 'Pacific/Auckland', 'Pacific/Chatham', 'Pacific/Fakaofo', 'Pacific/Fiji', 'Pacific/Guadalcanal', 'Pacific/Guam', 'Pacific/Honolulu', 'Pacific/Majuro', 'Pacific/Midway', 'Pacific/Midway', 'Pacific/Noumea', 'Pacific/Pago_Pago', 'Pacific/Port_Moresby', 'Pacific/Tongatapu'], NoneType] - Returns trading times in this timezone. (provider: intrinio) - source : Union[Literal['realtime', 'delayed', 'nasdaq_basic'], NoneType] - The source of the data. (provider: intrinio) - start_time : Union[datetime.time, NoneType] - Return intervals starting at the specified time on the `start_date` formatted as 'hh:mm:ss'. (provider: intrinio) - end_time : Union[datetime.time, NoneType] - Return intervals stopping at the specified time on the `end_date` formatted as 'hh:mm:ss'. (provider: intrinio) - interval_size : Union[Literal['1m', '5m', '10m', '15m', '30m', '60m', '1h'], NoneType] - The data time frequency. (provider: intrinio) - limit : Union[pydantic.types.NonNegativeInt, NoneType, pydantic.types.PositiveInt] - The number of data entries to return. (provider: intrinio, polygon) - next_page : Union[str, NoneType] - Token to get the next page of data from a previous API call. (provider: intrinio) - all_pages : Union[bool, NoneType] - Returns all pages of data from the API call at once. (provider: intrinio) timespan : Literal['minute', 'hour', 'day', 'week', 'month', 'quarter', 'year'] Timespan of the data. (provider: polygon) sort : Literal['asc', 'desc'] Sort order of the data. (provider: polygon) + limit : PositiveInt + The number of data entries to return. (provider: polygon) + adjusted : bool + Output time series is adjusted by historical split and dividend events. (provider: polygon) multiplier : PositiveInt Multiplier of the timespan. (provider: polygon) + period : Optional[Literal['1d', '5d', '1mo', '3mo', '6mo', '1y', '2y', '5y', '10y', 'ytd', 'max']] + Period of the data to return. (provider: yfinance) prepost : bool Include Pre and Post market data. (provider: yfinance) adjust : bool @@ -253,7 +229,7 @@ class CLASS_stocks(Container): OBBject results : List[StockHistorical] Serializable results. - provider : Union[Literal['alpha_vantage', 'cboe', 'fmp', 'intrinio', 'polygon', 'yfinance'], NoneType] + provider : Optional[Literal['cboe', 'fmp', 'polygon', 'yfinance']] Provider name. warnings : Optional[List[Warning_]] List of warnings. @@ -278,12 +254,6 @@ class CLASS_stocks(Container): The volume of the symbol. vwap : Optional[PositiveFloat] Volume Weighted Average Price of the symbol. - adjusted_close : Optional[PositiveFloat] - The adjusted close price of the symbol. (provider: alpha_vantage) - dividend_amount : Optional[NonNegativeFloat] - Dividend amount paid for the corresponding date. (provider: alpha_vantage) - split_coefficient : Optional[NonNegativeFloat] - Split coefficient for the corresponding date. (provider: alpha_vantage) calls_volume : Optional[float] Number of calls traded during the most recent trading period. Only valid if interval is 1m. (provider: cboe) puts_volume : Optional[float] @@ -295,19 +265,13 @@ class CLASS_stocks(Container): unadjusted_volume : Optional[float] Unadjusted volume of the symbol. (provider: fmp) change : Optional[float] - Change in the price of the symbol from the previous day. (provider: fmp, intrinio) + Change in the price of the symbol from the previous day. (provider: fmp) change_percent : Optional[float] - Change \\% in the price of the symbol. (provider: fmp) + Change \% in the price of the symbol. (provider: fmp) label : Optional[str] Human readable format of the date. (provider: fmp) change_over_time : Optional[float] - Change \\% in the price of the symbol over a period of time. (provider: fmp) - close_time : Optional[datetime] - The timestamp that represents the end of the interval span. (provider: intrinio) - interval : Optional[str] - The data time frequency. (provider: intrinio) - average : Optional[float] - Average trade price of an individual stock during the interval. (provider: intrinio) + Change \% in the price of the symbol over a period of time. (provider: fmp) transactions : Optional[PositiveInt] Number of transactions for the symbol in the time period. (provider: polygon) """ # noqa: E501 @@ -333,16 +297,16 @@ class CLASS_stocks(Container): @validate_arguments def multiples( self, - symbol: typing_extensions.Annotated[ + symbol: Annotated[ Union[str, List[str]], OpenBBCustomParameter(description="Symbol to get data for."), ], - limit: typing_extensions.Annotated[ - Union[int, None], + limit: Annotated[ + Optional[int], OpenBBCustomParameter(description="The number of data entries to return."), ] = 100, chart: bool = False, - provider: Union[Literal["fmp"], None] = None, + provider: Optional[Literal["fmp"]] = None, **kwargs ) -> OBBject[List]: """Get valuation multiples for a stock ticker. @@ -351,11 +315,11 @@ class CLASS_stocks(Container): ---------- symbol : Union[str, List[str]] Symbol to get data for. - limit : Union[int, NoneType] + limit : Optional[int] The number of data entries to return. chart : bool Whether to create a chart or not, by default False. - provider : Union[Literal['fmp'], NoneType] + provider : Optional[Literal['fmp']] The provider to use for the query, by default None. If None, the provider specified in defaults is selected or 'fmp' if there is no default. @@ -365,7 +329,7 @@ class CLASS_stocks(Container): OBBject results : List[StockMultiples] Serializable results. - provider : Union[Literal['fmp'], NoneType] + provider : Optional[Literal['fmp']] Provider name. warnings : Optional[List[Warning_]] List of warnings. @@ -517,23 +481,21 @@ class CLASS_stocks(Container): @validate_arguments def news( self, - symbols: typing_extensions.Annotated[ + symbols: Annotated[ str, OpenBBCustomParameter(description="Symbol to get data for.") ], - page: typing_extensions.Annotated[ + page: Annotated[ int, OpenBBCustomParameter( description="Page of the stock news to be retrieved." ), ] = 0, - limit: typing_extensions.Annotated[ - Union[pydantic.types.NonNegativeInt, None], + limit: Annotated[ + Optional[pydantic.types.NonNegativeInt], OpenBBCustomParameter(description="Number of results to return per page."), ] = 15, chart: bool = False, - provider: Union[ - Literal["benzinga", "fmp", "intrinio", "polygon", "yfinance"], None - ] = None, + provider: Optional[Literal["benzinga", "fmp", "polygon", "yfinance"]] = None, **kwargs ) -> OBBject[List]: """Get news for one or more stock tickers. @@ -544,63 +506,59 @@ class CLASS_stocks(Container): Symbol to get data for. page : int Page of the stock news to be retrieved. - limit : Union[pydantic.types.NonNegativeInt, NoneType] + limit : Optional[pydantic.types.NonNegativeInt] Number of results to return per page. chart : bool Whether to create a chart or not, by default False. - provider : Union[Literal['benzinga', 'fmp', 'intrinio', 'polygon', 'yfinance'], NoneType] + provider : Optional[Literal['benzinga', 'fmp', 'polygon', 'yfinance']] The provider to use for the query, by default None. If None, the provider specified in defaults is selected or 'benzinga' if there is no default. display_output : Literal['headline', 'summary', 'full', 'all'] Type of data to return. (provider: benzinga) - date : Union[datetime.datetime, NoneType] + date : Optional[datetime.datetime] Date of the news to retrieve. (provider: benzinga) - date_from : Union[datetime.datetime, NoneType] + date_from : Optional[datetime.datetime] Start date of the news to retrieve. (provider: benzinga) - date_to : Union[datetime.datetime, NoneType] + date_to : Optional[datetime.datetime] End date of the news to retrieve. (provider: benzinga) - updated_since : Union[int, NoneType] + updated_since : Optional[int] Number of seconds since the news was updated. (provider: benzinga) - published_since : Union[int, NoneType] + published_since : Optional[int] Number of seconds since the news was published. (provider: benzinga) sort : Union[Literal['published_at', 'updated_at', 'title', 'author', 'channel', 'ticker', 'topic', 'content_type'], NoneType, str] Order in which to sort the news. (provider: benzinga, polygon) - isin : Union[str, NoneType] + isin : Optional[str] The ISIN of the news to retrieve. (provider: benzinga) - cusip : Union[str, NoneType] + cusip : Optional[str] The CUSIP of the news to retrieve. (provider: benzinga) - channels : Union[str, NoneType] + channels : Optional[str] Channels of the news to retrieve. (provider: benzinga) - topics : Union[str, NoneType] + topics : Optional[str] Topics of the news to retrieve. (provider: benzinga) - authors : Union[str, NoneType] + authors : Optional[str] Authors of the news to retrieve. (provider: benzinga) - content_types : Union[str, NoneType] + content_types : Optional[str] Content types of the news to retrieve. (provider: benzinga) - next_page : Union[str, NoneType] - Token to get the next page of data from a previous API call. (provider: intrinio) - all_pages : Union[bool, NoneType] - Returns all pages of data from the API call at once. (provider: intrinio) - ticker_lt : Union[str, NoneType] + ticker_lt : Optional[str] Less than. (provider: polygon) - ticker_lte : Union[str, NoneType] + ticker_lte : Optional[str] Less than or equal. (provider: polygon) - ticker_gt : Union[str, NoneType] + ticker_gt : Optional[str] Greater than. (provider: polygon) - ticker_gte : Union[str, NoneType] + ticker_gte : Optional[str] Greater than or equal. (provider: polygon) - published_utc : Union[str, NoneType] + published_utc : Optional[str] Published date of the query. (provider: polygon) - published_utc_lt : Union[str, NoneType] + published_utc_lt : Optional[str] Less than. (provider: polygon) - published_utc_lte : Union[str, NoneType] + published_utc_lte : Optional[str] Less than or equal. (provider: polygon) - published_utc_gt : Union[str, NoneType] + published_utc_gt : Optional[str] Greater than. (provider: polygon) - published_utc_gte : Union[str, NoneType] + published_utc_gte : Optional[str] Greater than or equal. (provider: polygon) - order : Union[Literal['asc', 'desc'], NoneType] + order : Optional[Literal['asc', 'desc']] Sort order of the query. (provider: polygon) Returns @@ -608,7 +566,7 @@ class CLASS_stocks(Container): OBBject results : List[StockNews] Serializable results. - provider : Union[Literal['benzinga', 'fmp', 'intrinio', 'polygon', 'yfinance'], NoneType] + provider : Optional[Literal['benzinga', 'fmp', 'polygon', 'yfinance']] Provider name. warnings : Optional[List[Warning_]] List of warnings. @@ -643,12 +601,12 @@ class CLASS_stocks(Container): URL to the image of the news source. (provider: fmp) site : Optional[str] Name of the news source. (provider: fmp) - id : Optional[str] - Article ID. (provider: intrinio, polygon) amp_url : Optional[str] AMP URL. (provider: polygon) author : Optional[str] Author of the article. (provider: polygon) + id : Optional[str] + Article ID. (provider: polygon) image_url : Optional[str] Image URL. (provider: polygon) keywords : Optional[List[str]] @@ -693,32 +651,30 @@ class CLASS_stocks(Container): @validate_arguments def quote( self, - symbol: typing_extensions.Annotated[ + symbol: Annotated[ Union[str, List[str]], OpenBBCustomParameter(description="Symbol to get data for."), ], - provider: Union[Literal["fmp", "intrinio"], None] = None, + provider: Optional[Literal["fmp"]] = None, **kwargs - ) -> OBBject[BaseModel]: + ) -> OBBject[List]: """Load stock data for a specific ticker. Parameters ---------- symbol : Union[str, List[str]] Symbol to get data for. - provider : Union[Literal['fmp', 'intrinio'], NoneType] + provider : Optional[Literal['fmp']] The provider to use for the query, by default None. If None, the provider specified in defaults is selected or 'fmp' if there is no default. - source : Literal['iex', 'bats', 'bats_delayed', 'utp_delayed', 'cta_a_delayed', 'cta_b_delayed', 'intrinio_mx', 'intrinio_mx_plus', 'delayed_sip'] - Source of the data. (provider: intrinio) Returns ------- OBBject results : List[StockQuote] Serializable results. - provider : Union[Literal['fmp', 'intrinio'], NoneType] + provider : Optional[Literal['fmp']] Provider name. warnings : Optional[List[Warning_]] List of warnings. @@ -772,47 +728,7 @@ class CLASS_stocks(Container): earnings_announcement : Optional[str] Earnings announcement date of the stock. (provider: fmp) shares_outstanding : Optional[int] - Number of shares outstanding of the stock. (provider: fmp) - last_price : Optional[float] - Price of the last trade. (provider: intrinio) - last_time : Optional[datetime] - Date and Time when the last trade occurred. (provider: intrinio) - last_size : Optional[int] - Size of the last trade. (provider: intrinio) - bid_price : Optional[float] - Price of the top bid order. (provider: intrinio) - bid_size : Optional[int] - Size of the top bid order. (provider: intrinio) - ask_price : Optional[float] - Price of the top ask order. (provider: intrinio) - ask_size : Optional[int] - Size of the top ask order. (provider: intrinio) - open_price : Optional[float] - Open price for the trading day. (provider: intrinio) - close_price : Optional[float] - Closing price for the trading day (IEX source only). (provider: intrinio) - high_price : Optional[float] - High Price for the trading day. (provider: intrinio) - low_price : Optional[float] - Low Price for the trading day. (provider: intrinio) - exchange_volume : Optional[int] - Number of shares exchanged during the trading day on the exchange. (provider: intrinio) - market_volume : Optional[int] - Number of shares exchanged during the trading day for the whole market. (provider: intrinio) - updated_on : Optional[datetime] - Date and Time when the data was last updated. (provider: intrinio) - source : Optional[str] - Source of the data. (provider: intrinio) - listing_venue : Optional[str] - Listing venue where the trade took place (SIP source only). (provider: intrinio) - sales_conditions : Optional[str] - Indicates any sales condition modifiers associated with the trade. (provider: intrinio) - quote_conditions : Optional[str] - Indicates any quote condition modifiers associated with the trade. (provider: intrinio) - market_center_code : Optional[str] - Market center character code. (provider: intrinio) - is_darkpool : Optional[bool] - Whether or not the current trade is from a darkpool. (provider: intrinio)""" # noqa: E501 + Number of shares outstanding of the stock. (provider: fmp)""" # noqa: E501 inputs = filter_inputs( provider_choices={ @@ -832,14 +748,12 @@ class CLASS_stocks(Container): @validate_arguments def search( self, - query: typing_extensions.Annotated[ - str, OpenBBCustomParameter(description="Search query.") - ] = "", - ticker: typing_extensions.Annotated[ + query: Annotated[str, OpenBBCustomParameter(description="Search query.")] = "", + ticker: Annotated[ bool, OpenBBCustomParameter(description="Whether to search by ticker symbol."), ] = False, - provider: Union[Literal["cboe"], None] = None, + provider: Optional[Literal["cboe"]] = None, **kwargs ) -> OBBject[List]: """Search for a company or stock ticker. @@ -850,7 +764,7 @@ class CLASS_stocks(Container): Search query. ticker : bool Whether to search by ticker symbol. - provider : Union[Literal['cboe'], NoneType] + provider : Optional[Literal['cboe']] The provider to use for the query, by default None. If None, the provider specified in defaults is selected or 'cboe' if there is no default. @@ -860,7 +774,7 @@ class CLASS_stocks(Container): OBBject results : List[StockSearch] Serializable results. - provider : Union[Literal['cboe'], NoneType] + provider : Optional[Literal['cboe']] Provider name. warnings : Optional[List[Warning_]] List of warnings. diff --git a/openbb_sdk/openbb/package/stocks_ca.py b/openbb_sdk/openbb/package/stocks_ca.py index ba6d82e77ad..8c8d05c9d06 100644 --- a/openbb_sdk/openbb/package/stocks_ca.py +++ b/openbb_sdk/openbb/package/stocks_ca.py @@ -1,13 +1,13 @@ ### THIS FILE IS AUTO-GENERATED. DO NOT EDIT. ### -from typing import List, Literal, Union +from typing import List, Literal, Optional, Union -import typing_extensions from openbb_core.app.model.custom_parameter import OpenBBCustomParameter from openbb_core.app.model.obbject import OBBject from openbb_core.app.static.container import Container from openbb_core.app.static.filters import filter_inputs from pydantic import BaseModel, validate_arguments +from typing_extensions import Annotated class CLASS_stocks_ca(Container): @@ -21,11 +21,11 @@ class CLASS_stocks_ca(Container): @validate_arguments def peers( self, - symbol: typing_extensions.Annotated[ + symbol: Annotated[ Union[str, List[str]], OpenBBCustomParameter(description="Symbol to get data for."), ], - provider: Union[Literal["fmp"], None] = None, + provider: Optional[Literal["fmp"]] = None, **kwargs ) -> OBBject[BaseModel]: """Company peers. @@ -34,7 +34,7 @@ class CLASS_stocks_ca(Container): ---------- symbol : Union[str, List[str]] Symbol to get data for. - provider : Union[Literal['fmp'], NoneType] + provider : Optional[Literal['fmp']] The provider to use for the query, by default None. If None, the provider specified in defaults is selected or 'fmp' if there is no default. @@ -44,7 +44,7 @@ class CLASS_stocks_ca(Container): OBBject results : List[StockPeers] Serializable results. - provider : Union[Literal['fmp'], NoneType] + provider : Optional[Literal['fmp']] Provider name. warnings : Optional[List[Warning_]] List of warnings. diff --git a/openbb_sdk/openbb/package/stocks_dd.py b/openbb_sdk/openbb/package/stocks_dd.py index 08d0e5aee52..2656ec811bf 100644 --- a/openbb_sdk/openbb/package/stocks_dd.py +++ b/openbb_sdk/openbb/package/stocks_dd.py @@ -1,13 +1,13 @@ ### THIS FILE IS AUTO-GENERATED. DO NOT EDIT. ### -from typing import List, Literal, Union +from typing import List, Literal, Optional, Union -import typing_extensions from openbb_core.app.model.custom_parameter import OpenBBCustomParameter from openbb_core.app.model.obbject import OBBject from openbb_core.app.static.container import Container from openbb_core.app.static.filters import filter_inputs from pydantic import validate_arguments +from typing_extensions import Annotated class CLASS_stocks_dd(Container): @@ -21,11 +21,11 @@ class CLASS_stocks_dd(Container): @validate_arguments def sec( self, - symbol: typing_extensions.Annotated[ + symbol: Annotated[ Union[str, List[str]], OpenBBCustomParameter(description="Symbol to get data for."), ], - type: typing_extensions.Annotated[ + type: Annotated[ Literal[ "1", "1-A", @@ -130,15 +130,15 @@ class CLASS_stocks_dd(Container): ], OpenBBCustomParameter(description="Type of the SEC filing form."), ] = "10-K", - page: typing_extensions.Annotated[ - Union[int, None], + page: Annotated[ + Optional[int], OpenBBCustomParameter(description="Page number of the results."), ] = 0, - limit: typing_extensions.Annotated[ - Union[int, None], + limit: Annotated[ + Optional[int], OpenBBCustomParameter(description="The number of data entries to return."), ] = 100, - provider: Union[Literal["fmp"], None] = None, + provider: Optional[Literal["fmp"]] = None, **kwargs ) -> OBBject[List]: """SEC Filings. @@ -149,11 +149,11 @@ class CLASS_stocks_dd(Container): Symbol to get data for. 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'] Type of the SEC filing form. - page : Union[int, NoneType] + page : Optional[int] Page number of the results. - limit : Union[int, NoneType] + limit : Optional[int] The number of data entries to return. - provider : Union[Literal['fmp'], NoneType] + provider : Optional[Literal['fmp']] The provider to use for the query, by default None. If None, the provider specified in defaults is selected or 'fmp' if there is no default. @@ -163,7 +163,7 @@ class CLASS_stocks_dd(Container): OBBject results : List[SECFilings] Serializable results. - provider : Union[Literal['fmp'], NoneType] + provider : Optional[Literal['fmp']] Provider name. warnings : Optional[List[Warning_]] List of warnings. diff --git a/openbb_sdk/openbb/package/stocks_fa.py b/openbb_sdk/openbb/package/stocks_fa.py index ccbf8cdc115..1f6f8a404f9 100644 --- a/openbb_sdk/openbb/package/stocks_fa.py +++ b/openbb_sdk/openbb/package/stocks_fa.py @@ -1,16 +1,16 @@ ### THIS FILE IS AUTO-GENERATED. DO NOT EDIT. ### import datetime -from typing import List, Literal, Union +from typing import List, Literal, Optional, Union import pydantic import pydantic.main -import typing_extensions from openbb_core.app.model.custom_parameter import OpenBBCustomParameter from openbb_core.app.model.obbject import OBBject from openbb_core.app.static.container import Container from openbb_core.app.static.filters import filter_inputs from pydantic import BaseModel, validate_arguments +from typing_extensions import Annotated class CLASS_stocks_fa(Container): @@ -50,19 +50,19 @@ class CLASS_stocks_fa(Container): @validate_arguments def balance( self, - symbol: typing_extensions.Annotated[ + symbol: Annotated[ Union[str, List[str]], OpenBBCustomParameter(description="Symbol to get data for."), ], - period: typing_extensions.Annotated[ + period: Annotated[ Literal["annual", "quarter"], OpenBBCustomParameter(description="Period of the data to return."), ] = "annual", - limit: typing_extensions.Annotated[ - Union[pydantic.types.NonNegativeInt, None], + limit: Annotated[ + Optional[pydantic.types.NonNegativeInt], OpenBBCustomParameter(description="The number of data entries to return."), ] = 12, - provider: Union[Literal["fmp", "intrinio", "polygon", "yfinance"], None] = None, + provider: Optional[Literal["fmp", "polygon", "yfinance"]] = None, **kwargs ) -> OBBject[List]: """Balance Sheet. @@ -73,47 +73,43 @@ class CLASS_stocks_fa(Container): Symbol to get data for. period : Literal['annual', 'quarter'] Period of the data to return. - limit : Union[pydantic.types.NonNegativeInt, NoneType] + limit : Optional[pydantic.types.NonNegativeInt] The number of data entries to return. - provider : Union[Literal['fmp', 'intrinio', 'polygon', 'yfinance'], NoneType] + provider : Optional[Literal['fmp', 'polygon', 'yfinance']] The provider to use for the query, by default None. If None, the provider specified in defaults is selected or 'fmp' if there is no default. - type : Literal['reported', 'standardized'] - Type of the statement to be fetched. (provider: intrinio) - year : Union[int, NoneType] - Year of the statement to be fetched. (provider: intrinio) - company_name : Union[str, NoneType] + company_name : Optional[str] Name of the company. (provider: polygon) - company_name_search : Union[str, NoneType] + company_name_search : Optional[str] Name of the company to search. (provider: polygon) - sic : Union[str, NoneType] + sic : Optional[str] The Standard Industrial Classification (SIC) of the company. (provider: polygon) - filing_date : Union[datetime.date, NoneType] + filing_date : Optional[datetime.date] Filing date of the financial statement. (provider: polygon) - filing_date_lt : Union[datetime.date, NoneType] + filing_date_lt : Optional[datetime.date] Filing date less than the given date. (provider: polygon) - filing_date_lte : Union[datetime.date, NoneType] + filing_date_lte : Optional[datetime.date] Filing date less than or equal to the given date. (provider: polygon) - filing_date_gt : Union[datetime.date, NoneType] + filing_date_gt : Optional[datetime.date] Filing date greater than the given date. (provider: polygon) - filing_date_gte : Union[datetime.date, NoneType] + filing_date_gte : Optional[datetime.date] Filing date greater than or equal to the given date. (provider: polygon) - period_of_report_date : Union[datetime.date, NoneType] + period_of_report_date : Optional[datetime.date] Period of report date of the financial statement. (provider: polygon) - period_of_report_date_lt : Union[datetime.date, NoneType] + period_of_report_date_lt : Optional[datetime.date] Period of report date less than the given date. (provider: polygon) - period_of_report_date_lte : Union[datetime.date, NoneType] + period_of_report_date_lte : Optional[datetime.date] Period of report date less than or equal to the given date. (provider: polygon) - period_of_report_date_gt : Union[datetime.date, NoneType] + period_of_report_date_gt : Optional[datetime.date] Period of report date greater than the given date. (provider: polygon) - period_of_report_date_gte : Union[datetime.date, NoneType] + period_of_report_date_gte : Optional[datetime.date] Period of report date greater than or equal to the given date. (provider: polygon) - include_sources : Union[bool, NoneType] + include_sources : Optional[bool] Whether to include the sources of the financial statement. (provider: polygon) - order : Union[Literal['asc', 'desc'], NoneType] + order : Optional[Literal['asc', 'desc']] Order of the financial statement. (provider: polygon) - sort : Union[Literal['filing_date', 'period_of_report_date'], NoneType] + sort : Optional[Literal['filing_date', 'period_of_report_date']] Sort of the financial statement. (provider: polygon) Returns @@ -121,7 +117,7 @@ class CLASS_stocks_fa(Container): OBBject results : List[BalanceSheet] Serializable results. - provider : Union[Literal['fmp', 'intrinio', 'polygon', 'yfinance'], NoneType] + provider : Optional[Literal['fmp', 'polygon', 'yfinance']] Provider name. warnings : Optional[List[Warning_]] List of warnings. @@ -261,15 +257,15 @@ class CLASS_stocks_fa(Container): @validate_arguments def balance_growth( self, - symbol: typing_extensions.Annotated[ + symbol: Annotated[ Union[str, List[str]], OpenBBCustomParameter(description="Symbol to get data for."), ], - limit: typing_extensions.Annotated[ + limit: Annotated[ int, OpenBBCustomParameter(description="The number of data entries to return."), ] = 10, - provider: Union[Literal["fmp"], None] = None, + provider: Optional[Literal["fmp"]] = None, **kwargs ) -> OBBject[List]: """Balance Sheet Statement Growth. @@ -280,7 +276,7 @@ class CLASS_stocks_fa(Container): Symbol to get data for. limit : int The number of data entries to return. - provider : Union[Literal['fmp'], NoneType] + provider : Optional[Literal['fmp']] The provider to use for the query, by default None. If None, the provider specified in defaults is selected or 'fmp' if there is no default. @@ -290,7 +286,7 @@ class CLASS_stocks_fa(Container): OBBject results : List[BalanceSheetGrowth] Serializable results. - provider : Union[Literal['fmp'], NoneType] + provider : Optional[Literal['fmp']] Provider name. warnings : Optional[List[Warning_]] List of warnings. @@ -405,19 +401,19 @@ class CLASS_stocks_fa(Container): @validate_arguments def cal( self, - start_date: typing_extensions.Annotated[ + start_date: Annotated[ Union[datetime.date, None, str], OpenBBCustomParameter( description="Start date of the data, in YYYY-MM-DD format." ), ] = None, - end_date: typing_extensions.Annotated[ + end_date: Annotated[ Union[datetime.date, None, str], OpenBBCustomParameter( description="End date of the data, in YYYY-MM-DD format." ), ] = None, - provider: Union[Literal["fmp"], None] = None, + provider: Optional[Literal["fmp"]] = None, **kwargs ) -> OBBject[List]: """Show Dividend Calendar for a given start and end dates. @@ -428,7 +424,7 @@ class CLASS_stocks_fa(Container): Start date of the data, in YYYY-MM-DD format. end_date : Union[datetime.date, NoneType, str] End date of the data, in YYYY-MM-DD format. - provider : Union[Literal['fmp'], NoneType] + provider : Optional[Literal['fmp']] The provider to use for the query, by default None. If None, the provider specified in defaults is selected or 'fmp' if there is no default. @@ -438,7 +434,7 @@ class CLASS_stocks_fa(Container): OBBject results : List[DividendCalendar] Serializable results. - provider : Union[Literal['fmp'], NoneType] + provider : Optional[Literal['fmp']] Provider name. warnings : Optional[List[Warning_]] List of warnings. @@ -485,19 +481,19 @@ class CLASS_stocks_fa(Container): @validate_arguments def cash( self, - symbol: typing_extensions.Annotated[ + symbol: Annotated[ Union[str, List[str]], OpenBBCustomParameter(description="Symbol to get data for."), ], - period: typing_extensions.Annotated[ + period: Annotated[ Literal["annual", "quarter"], OpenBBCustomParameter(description="Period of the data to return."), ] = "annual", - limit: typing_extensions.Annotated[ - Union[pydantic.types.NonNegativeInt, None], + limit: Annotated[ + Optional[pydantic.types.NonNegativeInt], OpenBBCustomParameter(description="The number of data entries to return."), ] = 12, - provider: Union[Literal["fmp", "intrinio", "polygon", "yfinance"], None] = None, + provider: Optional[Literal["fmp", "polygon", "yfinance"]] = None, **kwargs ) -> OBBject[List]: """Cash Flow Statement. @@ -508,47 +504,43 @@ class CLASS_stocks_fa(Container): Symbol to get data for. period : Literal['annual', 'quarter'] Period of the data to return. - limit : Union[pydantic.types.NonNegativeInt, NoneType] + limit : Optional[pydantic.types.NonNegativeInt] The number of data entries to return. - provider : Union[Literal['fmp', 'intrinio', 'polygon', 'yfinance'], NoneType] + provider : Optional[Literal['fmp', 'polygon', 'yfinance']] The provider to use for the query, by default None. If None, the provider specified in defaults is selected or 'fmp' if there is no default. - type : Literal['reported', 'standardized'] - Type of the statement to be fetched. (provider: intrinio) - year : Union[int, NoneType] - Year of the statement to be fetched. (provider: intrinio) - company_name : Union[str, NoneType] + company_name : Optional[str] Name of the company. (provider: polygon) - company_name_search : Union[str, NoneType] + company_name_search : Optional[str] Name of the company to search. (provider: polygon) - sic : Union[str, NoneType] + sic : Optional[str] The Standard Industrial Classification (SIC) of the company. (provider: polygon) - filing_date : Union[datetime.date, NoneType] + filing_date : Optional[datetime.date] Filing date of the financial statement. (provider: polygon) - filing_date_lt : Union[datetime.date, NoneType] + filing_date_lt : Optional[datetime.date] Filing date less than the given date. (provider: polygon) - filing_date_lte : Union[datetime.date, NoneType] + filing_date_lte : Optional[datetime.date] Filing date less than or equal to the given date. (provider: polygon) - filing_date_gt : Union[datetime.date, NoneType] + filing_date_gt : Optional[datetime.date] Filing date greater than the given date. (provider: polygon) - filing_date_gte : Union[datetime.date, NoneType] + filing_date_gte : Optional[datetime.date] Filing date greater than or equal to the given date. (provider: polygon) - period_of_report_date : Union[datetime.date, NoneType] + period_of_report_date : Optional[datetime.date] Period of report date of the financial statement. (provider: polygon) - period_of_report_date_lt : Union[datetime.date, NoneType] + period_of_report_date_lt : Optional[datetime.date] Period of report date less than the given date. (provider: polygon) - period_of_report_date_lte : Union[datetime.date, NoneType] + period_of_report_date_lte : Optional[datetime.date] Period of report date less than or equal to the given date. (provider: polygon) - period_of_report_date_gt : Union[datetime.date, NoneType] + period_of_report_date_gt : Optional[datetime.date] Period of report date greater than the given date. (provider: polygon) - period_of_report_date_gte : Union[datetime.date, NoneType] + period_of_report_date_gte : Optional[datetime.date] Period of report date greater than or equal to the given date. (provider: polygon) - include_sources : Union[bool, NoneType] + include_sources : Optional[bool] Whether to include the sources of the financial statement. (provider: polygon) - order : Union[Literal['asc', 'desc'], NoneType] + order : Optional[Literal['asc', 'desc']] Order of the financial statement. (provider: polygon) - sort : Union[Literal['filing_date', 'period_of_report_date'], NoneType] + sort : Optional[Literal['filing_date', 'period_of_report_date']] Sort of the financial statement. (provider: polygon) Returns @@ -556,7 +548,7 @@ class CLASS_stocks_fa(Container): OBBject results : List[CashFlowStatement] Serializable results. - provider : Union[Literal['fmp', 'intrinio', 'polygon', 'yfinance'], NoneType] + provider : Optional[Literal['fmp', 'polygon', 'yfinance']] Provider name. warnings : Optional[List[Warning_]] List of warnings. @@ -682,15 +674,15 @@ class CLASS_stocks_fa(Container): @validate_arguments def cash_growth( self, - symbol: typing_extensions.Annotated[ + symbol: Annotated[ Union[str, List[str]], OpenBBCustomParameter(description="Symbol to get data for."), ], - limit: typing_extensions.Annotated[ + limit: Annotated[ int, OpenBBCustomParameter(description="The number of data entries to return."), ] = 10, - provider: Union[Literal["fmp"], None] = None, + provider: Optional[Literal["fmp"]] = None, **kwargs ) -> OBBject[List]: """Cash Flow Statement Growth. @@ -701,7 +693,7 @@ class CLASS_stocks_fa(Container): Symbol to get data for. limit : int The number of data entries to return. - provider : Union[Literal['fmp'], NoneType] + provider : Optional[Literal['fmp']] The provider to use for the query, by default None. If None, the provider specified in defaults is selected or 'fmp' if there is no default. @@ -711,7 +703,7 @@ class CLASS_stocks_fa(Container): OBBject results : List[CashFlowStatementGrowth] Serializable results. - provider : Union[Literal['fmp'], NoneType] + provider : Optional[Literal['fmp']] Provider name. warnings : Optional[List[Warning_]] List of warnings. @@ -808,11 +800,11 @@ class CLASS_stocks_fa(Container): @validate_arguments def comp( self, - symbol: typing_extensions.Annotated[ + symbol: Annotated[ Union[str, List[str]], OpenBBCustomParameter(description="Symbol to get data for."), ], - provider: Union[Literal["fmp"], None] = None, + provider: Optional[Literal["fmp"]] = None, **kwargs ) -> OBBject[List]: """Executive Compensation. @@ -821,7 +813,7 @@ class CLASS_stocks_fa(Container): ---------- symbol : Union[str, List[str]] Symbol to get data for. - provider : Union[Literal['fmp'], NoneType] + provider : Optional[Literal['fmp']] The provider to use for the query, by default None. If None, the provider specified in defaults is selected or 'fmp' if there is no default. @@ -831,7 +823,7 @@ class CLASS_stocks_fa(Container): OBBject results : List[ExecutiveCompensation] Serializable results. - provider : Union[Literal['fmp'], NoneType] + provider : Optional[Literal['fmp']] Provider name. warnings : Optional[List[Warning_]] List of warnings. @@ -887,19 +879,19 @@ class CLASS_stocks_fa(Container): @validate_arguments def comsplit( self, - start_date: typing_extensions.Annotated[ + start_date: Annotated[ Union[datetime.date, None, str], OpenBBCustomParameter( description="Start date of the data, in YYYY-MM-DD format." ), ] = None, - end_date: typing_extensions.Annotated[ + end_date: Annotated[ Union[datetime.date, None, str], OpenBBCustomParameter( description="End date of the data, in YYYY-MM-DD format." ), ] = None, - provider: Union[Literal["fmp"], None] = None, + provider: Optional[Literal["fmp"]] = None, **kwargs ) -> OBBject[List]: """Stock Split Calendar. @@ -910,7 +902,7 @@ class CLASS_stocks_fa(Container): Start date of the data, in YYYY-MM-DD format. end_date : Union[datetime.date, NoneType, str] End date of the data, in YYYY-MM-DD format. - provider : Union[Literal['fmp'], NoneType] + provider : Optional[Literal['fmp']] The provider to use for the query, by default None. If None, the provider specified in defaults is selected or 'fmp' if there is no default. @@ -920,7 +912,7 @@ class CLASS_stocks_fa(Container): OBBject results : List[StockSplitCalendar] Serializable results. - provider : Union[Literal['fmp'], NoneType] + provider : Optional[Literal['fmp']] Provider name. warnings : Optional[List[Warning_]] List of warnings. @@ -961,11 +953,11 @@ class CLASS_stocks_fa(Container): @validate_arguments def divs( self, - symbol: typing_extensions.Annotated[ + symbol: Annotated[ Union[str, List[str]], OpenBBCustomParameter(description="Symbol to get data for."), ], - provider: Union[Literal["fmp"], None] = None, + provider: Optional[Literal["fmp"]] = None, **kwargs ) -> OBBject[List]: """Historical Dividends. @@ -974,7 +966,7 @@ class CLASS_stocks_fa(Container): ---------- symbol : Union[str, List[str]] Symbol to get data for. - provider : Union[Literal['fmp'], NoneType] + provider : Optional[Literal['fmp']] The provider to use for the query, by default None. If None, the provider specified in defaults is selected or 'fmp' if there is no default. @@ -984,7 +976,7 @@ class CLASS_stocks_fa(Container): OBBject results : List[HistoricalDividends] Serializable results. - provider : Union[Literal['fmp'], NoneType] + provider : Optional[Literal['fmp']] Provider name. warnings : Optional[List[Warning_]] List of warnings. @@ -1028,15 +1020,15 @@ class CLASS_stocks_fa(Container): @validate_arguments def earning( self, - symbol: typing_extensions.Annotated[ + symbol: Annotated[ Union[str, List[str]], OpenBBCustomParameter(description="Symbol to get data for."), ], - limit: typing_extensions.Annotated[ - Union[int, None], + limit: Annotated[ + Optional[int], OpenBBCustomParameter(description="The number of data entries to return."), ] = 50, - provider: Union[Literal["fmp"], None] = None, + provider: Optional[Literal["fmp"]] = None, **kwargs ) -> OBBject[List]: """Earnings Calendar. @@ -1045,9 +1037,9 @@ class CLASS_stocks_fa(Container): ---------- symbol : Union[str, List[str]] Symbol to get data for. - limit : Union[int, NoneType] + limit : Optional[int] The number of data entries to return. - provider : Union[Literal['fmp'], NoneType] + provider : Optional[Literal['fmp']] The provider to use for the query, by default None. If None, the provider specified in defaults is selected or 'fmp' if there is no default. @@ -1057,7 +1049,7 @@ class CLASS_stocks_fa(Container): OBBject results : List[EarningsCalendar] Serializable results. - provider : Union[Literal['fmp'], NoneType] + provider : Optional[Literal['fmp']] Provider name. warnings : Optional[List[Warning_]] List of warnings. @@ -1106,11 +1098,11 @@ class CLASS_stocks_fa(Container): @validate_arguments def emp( self, - symbol: typing_extensions.Annotated[ + symbol: Annotated[ Union[str, List[str]], OpenBBCustomParameter(description="Symbol to get data for."), ], - provider: Union[Literal["fmp"], None] = None, + provider: Optional[Literal["fmp"]] = None, **kwargs ) -> OBBject[List]: """Number of Employees. @@ -1119,7 +1111,7 @@ class CLASS_stocks_fa(Container): ---------- symbol : Union[str, List[str]] Symbol to get data for. - provider : Union[Literal['fmp'], NoneType] + provider : Optional[Literal['fmp']] The provider to use for the query, by default None. If None, the provider specified in defaults is selected or 'fmp' if there is no default. @@ -1129,7 +1121,7 @@ class CLASS_stocks_fa(Container): OBBject results : List[HistoricalEmployees] Serializable results. - provider : Union[Literal['fmp'], NoneType] + provider : Optional[Literal['fmp']] Provider name. warnings : Optional[List[Warning_]] List of warnings. @@ -1177,19 +1169,19 @@ class CLASS_stocks_fa(Container): @validate_arguments def est( self, - symbol: typing_extensions.Annotated[ + symbol: Annotated[ Union[str, List[str]], OpenBBCustomParameter(description="Symbol to get data for."), ], - period: typing_extensions.Annotated[ - Literal["quarter", "annual"], + period: Annotated[ + Literal["annual", "quarter"], OpenBBCustomParameter(description="Period of the data to return."), ] = "annual", - limit: typing_extensions.Annotated[ + limit: Annotated[ int, OpenBBCustomParameter(description="The number of data entries to return."), ] = 30, - provider: Union[Literal["fmp"], None] = None, + provider: Optional[Literal["fmp"]] = None, **kwargs ) -> OBBject[List]: """Analyst Estimates. @@ -1198,11 +1190,11 @@ class CLASS_stocks_fa(Container): ---------- symbol : Union[str, List[str]] Symbol to get data for. - period : Literal['quarter', 'annual'] + period : Literal['annual', 'quarter'] Period of the data to return. limit : int The number of data entries to return. - provider : Union[Literal['fmp'], NoneType] + provider : Optional[Literal['fmp']] The provider to use for the query, by default None. If None, the provider specified in defaults is selected or 'fmp' if there is no default. @@ -1212,7 +1204,7 @@ class CLASS_stocks_fa(Container): OBBject results : List[AnalystEstimates] Serializable results. - provider : Union[Literal['fmp'], NoneType] + provider : Optional[Literal['fmp']] Provider name. warnings : Optional[List[Warning_]] List of warnings. @@ -1288,19 +1280,19 @@ class CLASS_stocks_fa(Container): @validate_arguments def income( self, - symbol: typing_extensions.Annotated[ + symbol: Annotated[ Union[str, List[str]], OpenBBCustomParameter(description="Symbol to get data for."), ], - period: typing_extensions.Annotated[ + period: Annotated[ Literal["annual", "quarter"], OpenBBCustomParameter(description="Period of the data to return."), ] = "annual", - limit: typing_extensions.Annotated[ - Union[pydantic.types.NonNegativeInt, None], + limit: Annotated[ + Optional[pydantic.types.NonNegativeInt], OpenBBCustomParameter(description="The number of data entries to return."), ] = 12, - provider: Union[Literal["fmp", "intrinio", "polygon", "yfinance"], None] = None, + provider: Optional[Literal["fmp", "polygon", "yfinance"]] = None, **kwargs ) -> OBBject[List]: """Income Statement. @@ -1311,47 +1303,43 @@ class CLASS_stocks_fa(Container): Symbol to get data for. period : Literal['annual', 'quarter'] Period of the data to return. - limit : Union[pydantic.types.NonNegativeInt, NoneType] + limit : Optional[pydantic.types.NonNegativeInt] The number of data entries to return. - provider : Union[Literal['fmp', 'intrinio', 'polygon', 'yfinance'], NoneType] + provider : Optional[Literal['fmp', 'polygon', 'yfinance']] The provider to use for the query, by default None. If None, the provider specified in defaults is selected or 'fmp' if there is no default. - type : Literal['reported', 'standardized'] - Type of the statement to be fetched. (provider: intrinio) - year : Union[int, NoneType] - Year of the statement to be fetched. (provider: intrinio) - company_name : Union[str, NoneType] + company_name : Optional[str] Name of the company. (provider: polygon) - company_name_search : Union[str, NoneType] + company_name_search : Optional[str] Name of the company to search. (provider: polygon) - sic : Union[str, NoneType] + sic : Optional[str] The Standard Industrial Classification (SIC) of the company. (provider: polygon) - filing_date : Union[datetime.date, NoneType] + filing_date : Optional[datetime.date] Filing date of the financial statement. (provider: polygon) - filing_date_lt : Union[datetime.date, NoneType] + filing_date_lt : Optional[datetime.date] Filing date less than the given date. (provider: polygon) - filing_date_lte : Union[datetime.date, NoneType] + filing_date_lte : Optional[datetime.date] Filing date less than or equal to the given date. (provider: polygon) - filing_date_gt : Union[datetime.date, NoneType] + filing_date_gt : Optional[datetime.date] Filing date greater than the given date. (provider: polygon) - filing_date_gte : Union[datetime.date, NoneType] + filing_date_gte : Optional[datetime.date] Filing date greater than or equal to the given date. (provider: polygon) - period_of_report_date : Union[datetime.date, NoneType] + period_of_report_date : Optional[datetime.date] Period of report date of the financial statement. (provider: polygon) - period_of_report_date_lt : Union[datetime.date, NoneType] + period_of_report_date_lt : Optional[datetime.date] Period of report date less than the given date. (provider: polygon) - period_of_report_date_lte : Union[datetime.date, NoneType] + period_of_report_date_lte : Optional[datetime.date] Period of report date less than or equal to the given date. (provider: polygon) - period_of_report_date_gt : Union[datetime.date, NoneType] + period_of_report_date_gt : Optional[datetime.date] Period of report date greater than the given date. (provider: polygon) - period_of_report_date_gte : Union[datetime.date, NoneType] + period_of_report_date_gte : Optional[datetime.date] Period of report date greater than or equal to the given date. (provider: polygon) - include_sources : Union[bool, NoneType] + include_sources : Optional[bool] Whether to include the sources of the financial statement. (provider: polygon) - order : Union[Literal['asc', 'desc'], NoneType] + order : Optional[Literal['asc', 'desc']] Order of the financial statement. (provider: polygon) - sort : Union[Literal['filing_date', 'period_of_report_date'], NoneType] + sort : Optional[Literal['filing_date', 'period_of_report_date']] Sort of the financial statement. (provider: polygon) Returns @@ -1359,7 +1347,7 @@ class CLASS_stocks_fa(Container): OBBject results : List[IncomeStatement] Serializable results. - provider : Union[Literal['fmp', 'intrinio', 'polygon', 'yfinance'], NoneType] + provider : Optional[Literal['fmp', 'polygon', 'yfinance']] Provider name. warnings : Optional[List[Warning_]] List of warnings. @@ -1475,19 +1463,19 @@ class CLASS_stocks_fa(Container): @validate_arguments def income_growth( self, - symbol: typing_extensions.Annotated[ + symbol: Annotated[ Union[str, List[str]], OpenBBCustomParameter(description="Symbol to get data for."), ], - limit: typing_extensions.Annotated[ + limit: Annotated[ int, OpenBBCustomParameter(description="The number of data entries to return."), ] = 10, - period: typing_extensions.Annotated[ + period: Annotated[ Literal["annual", "quarter"], OpenBBCustomParameter(description="Period of the data to return."), ] = "annual", - provider: Union[Literal["fmp"], None] = None, + provider: Optional[Literal["fmp"]] = None, **kwargs ) -> OBBject[List]: """Income Statement Growth. @@ -1500,7 +1488,7 @@ class CLASS_stocks_fa(Container): The number of data entries to return. period : Literal['annual', 'quarter'] Period of the data to return. - provider : Union[Literal['fmp'], NoneType] + provider : Optional[Literal['fmp']] The provider to use for the query, by default None. If None, the provider specified in defaults is selected or 'fmp' if there is no default. @@ -1510,7 +1498,7 @@ class CLASS_stocks_fa(Container): OBBject results : List[IncomeStatementGrowth] Serializable results. - provider : Union[Literal['fmp'], NoneType] + provider : Optional[Literal['fmp']] Provider name. warnings : Optional[List[Warning_]] List of warnings. @@ -1600,12 +1588,12 @@ class CLASS_stocks_fa(Container): @validate_arguments def ins( self, - symbol: typing_extensions.Annotated[ + symbol: Annotated[ Union[str, List[str]], OpenBBCustomParameter(description="Symbol to get data for."), ], - transactionType: typing_extensions.Annotated[ - Union[ + transactionType: Annotated[ + Optional[ List[ Literal[ "A-Award", @@ -1627,24 +1615,23 @@ class CLASS_stocks_fa(Container): "X-InTheMoney", "Z-Trust", ] - ], - None, + ] ], OpenBBCustomParameter(description="Type of the transaction."), ] = ["P-Purchase"], - reportingCik: typing_extensions.Annotated[ - Union[int, None], + reportingCik: Annotated[ + Optional[int], OpenBBCustomParameter(description="CIK of the reporting owner."), ] = None, - companyCik: typing_extensions.Annotated[ - Union[int, None], + companyCik: Annotated[ + Optional[int], OpenBBCustomParameter(description="CIK of the company owner."), ] = None, - page: typing_extensions.Annotated[ - Union[int, None], + page: Annotated[ + Optional[int], OpenBBCustomParameter(description="Page number of the data to fetch."), ] = 0, - provider: Union[Literal["fmp"], None] = None, + provider: Optional[Literal["fmp"]] = None, **kwargs ) -> OBBject[List]: """Stock Insider Trading. @@ -1653,15 +1640,15 @@ class CLASS_stocks_fa(Container): ---------- symbol : Union[str, List[str]] Symbol to get data for. - transactionType : Union[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']], NoneType] + 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']]] Type of the transaction. - reportingCik : Union[int, NoneType] + reportingCik : Optional[int] CIK of the reporting owner. - companyCik : Union[int, NoneType] + companyCik : Optional[int] CIK of the company owner. - page : Union[int, NoneType] + page : Optional[int] Page number of the data to fetch. - provider : Union[Literal['fmp'], NoneType] + provider : Optional[Literal['fmp']] The provider to use for the query, by default None. If None, the provider specified in defaults is selected or 'fmp' if there is no default. @@ -1671,7 +1658,7 @@ class CLASS_stocks_fa(Container): OBBject results : List[StockInsiderTrading] Serializable results. - provider : Union[Literal['fmp'], NoneType] + provider : Optional[Literal['fmp']] Provider name. warnings : Optional[List[Warning_]] List of warnings. @@ -1735,18 +1722,18 @@ class CLASS_stocks_fa(Container): @validate_arguments def ins_own( self, - symbol: typing_extensions.Annotated[ + symbol: Annotated[ Union[str, List[str]], OpenBBCustomParameter(description="Symbol to get data for."), ], - include_current_quarter: typing_extensions.Annotated[ + include_current_quarter: Annotated[ bool, OpenBBCustomParameter(description="Include current quarter data.") ] = False, - date: typing_extensions.Annotated[ - Union[datetime.date, None], + date: Annotated[ + Optional[datetime.date], OpenBBCustomParameter(description="A specific date to get data for."), ] = None, - provider: Union[Literal["fmp"], None] = None, + provider: Optional[Literal["fmp"]] = None, **kwargs ) -> OBBject[List]: """Institutional Ownership. @@ -1757,9 +1744,9 @@ class CLASS_stocks_fa(Container): Symbol to get data for. include_current_quarter : bool Include current quarter data. - date : Union[datetime.date, NoneType] + date : Optional[datetime.date] A specific date to get data for. - provider : Union[Literal['fmp'], NoneType] + provider : Optional[Literal['fmp']] The provider to use for the query, by default None. If None, the provider specified in defaults is selected or 'fmp' if there is no default. @@ -1769,7 +1756,7 @@ class CLASS_stocks_fa(Container): OBBject results : List[InstitutionalOwnership] Serializable results. - provider : Union[Literal['fmp'], NoneType] + provider : Optional[Literal['fmp']] Provider name. warnings : Optional[List[Warning_]] List of warnings. @@ -1874,19 +1861,19 @@ class CLASS_stocks_fa(Container): @validate_arguments def metrics( self, - symbol: typing_extensions.Annotated[ + symbol: Annotated[ Union[str, List[str]], OpenBBCustomParameter(description="Symbol to get data for."), ], - period: typing_extensions.Annotated[ + period: Annotated[ Literal["annual", "quarter"], OpenBBCustomParameter(description="Period of the data to return."), ] = "annual", - limit: typing_extensions.Annotated[ - Union[int, None], + limit: Annotated[ + Optional[int], OpenBBCustomParameter(description="The number of data entries to return."), ] = 100, - provider: Union[Literal["fmp"], None] = None, + provider: Optional[Literal["fmp"]] = None, **kwargs ) -> OBBject[List]: """Key Metrics. @@ -1897,9 +1884,9 @@ class CLASS_stocks_fa(Container): Symbol to get data for. period : Literal['annual', 'quarter'] Period of the data to return. - limit : Union[int, NoneType] + limit : Optional[int] The number of data entries to return. - provider : Union[Literal['fmp'], NoneType] + provider : Optional[Literal['fmp']] The provider to use for the query, by default None. If None, the provider specified in defaults is selected or 'fmp' if there is no default. @@ -1909,7 +1896,7 @@ class CLASS_stocks_fa(Container): OBBject results : List[KeyMetrics] Serializable results. - provider : Union[Literal['fmp'], NoneType] + provider : Optional[Literal['fmp']] Provider name. warnings : Optional[List[Warning_]] List of warnings. @@ -2061,11 +2048,11 @@ class CLASS_stocks_fa(Container): @validate_arguments def mgmt( self, - symbol: typing_extensions.Annotated[ + symbol: Annotated[ Union[str, List[str]], OpenBBCustomParameter(description="Symbol to get data for."), ], - provider: Union[Literal["fmp"], None] = None, + provider: Optional[Literal["fmp"]] = None, **kwargs ) -> OBBject[List]: """Key Executives. @@ -2074,7 +2061,7 @@ class CLASS_stocks_fa(Container): ---------- symbol : Union[str, List[str]] Symbol to get data for. - provider : Union[Literal['fmp'], NoneType] + provider : Optional[Literal['fmp']] The provider to use for the query, by default None. If None, the provider specified in defaults is selected or 'fmp' if there is no default. @@ -2084,7 +2071,7 @@ class CLASS_stocks_fa(Container): OBBject results : List[KeyExecutives] Serializable results. - provider : Union[Literal['fmp'], NoneType] + provider : Optional[Literal['fmp']] Provider name. warnings : Optional[List[Warning_]] List of warnings. @@ -2128,11 +2115,11 @@ class CLASS_stocks_fa(Container): @validate_arguments def overview( self, - symbol: typing_extensions.Annotated[ + symbol: Annotated[ Union[str, List[str]], OpenBBCustomParameter(description="Symbol to get data for."), ], - provider: Union[Literal["fmp"], None] = None, + provider: Optional[Literal["fmp"]] = None, **kwargs ) -> OBBject[BaseModel]: """Company Overview. @@ -2141,7 +2128,7 @@ class CLASS_stocks_fa(Container): ---------- symbol : Union[str, List[str]] Symbol to get data for. - provider : Union[Literal['fmp'], NoneType] + provider : Optional[Literal['fmp']] The provider to use for the query, by default None. If None, the provider specified in defaults is selected or 'fmp' if there is no default. @@ -2151,7 +2138,7 @@ class CLASS_stocks_fa(Container): OBBject results : List[CompanyOverview] Serializable results. - provider : Union[Literal['fmp'], NoneType] + provider : Optional[Literal['fmp']] Provider name. warnings : Optional[List[Warning_]] List of warnings. @@ -2253,19 +2240,19 @@ class CLASS_stocks_fa(Container): @validate_arguments def own( self, - symbol: typing_extensions.Annotated[ + symbol: Annotated[ Union[str, List[str]], OpenBBCustomParameter(description="Symbol to get data for."), ], - date: typing_extensions.Annotated[ - Union[datetime.date, None], + date: Annotated[ + Optional[datetime.date], OpenBBCustomParameter(description="A specific date to get data for."), ] = None, - page: typing_extensions.Annotated[ - Union[int, None], + page: Annotated[ + Optional[int], OpenBBCustomParameter(description="Page number of the data to fetch."), ] = 0, - provider: Union[Literal["fmp"], None] = None, + provider: Optional[Literal["fmp"]] = None, **kwargs ) -> OBBject[List]: """Stock Ownership. @@ -2274,11 +2261,11 @@ class CLASS_stocks_fa(Container): ---------- symbol : Union[str, List[str]] Symbol to get data for. - date : Union[datetime.date, NoneType] + date : Optional[datetime.date] A specific date to get data for. - page : Union[int, NoneType] + page : Optional[int] Page number of the data to fetch. - provider : Union[Literal['fmp'], NoneType] + provider : Optional[Literal['fmp']] The provider to use for the query, by default None. If None, the provider specified in defaults is selected or 'fmp' if there is no default. @@ -2288,7 +2275,7 @@ class CLASS_stocks_fa(Container): OBBject results : List[StockOwnership] Serializable results. - provider : Union[Literal['fmp'], NoneType] + provider : Optional[Literal['fmp']] Provider name. warnings : Optional[List[Warning_]] List of warnings. @@ -2398,11 +2385,11 @@ class CLASS_stocks_fa(Container): @validate_arguments def pt( self, - symbol: typing_extensions.Annotated[ + symbol: Annotated[ Union[str, List[str]], OpenBBCustomParameter(description="Symbol to get data for."), ], - provider: Union[Literal["fmp"], None] = None, + provider: Optional[Literal["fmp"]] = None, **kwargs ) -> OBBject[BaseModel]: """Price Target Consensus. @@ -2411,7 +2398,7 @@ class CLASS_stocks_fa(Container): ---------- symbol : Union[str, List[str]] Symbol to get data for. - provider : Union[Literal['fmp'], NoneType] + provider : Optional[Literal['fmp']] The provider to use for the query, by default None. If None, the provider specified in defaults is selected or 'fmp' if there is no default. @@ -2421,7 +2408,7 @@ class CLASS_stocks_fa(Container): OBBject results : List[PriceTargetConsensus] Serializable results. - provider : Union[Literal['fmp'], NoneType] + provider : Optional[Literal['fmp']] Provider name. warnings : Optional[List[Warning_]] List of warnings. @@ -2461,11 +2448,11 @@ class CLASS_stocks_fa(Container): @validate_arguments def pta( self, - symbol: typing_extensions.Annotated[ + symbol: Annotated[ Union[str, List[str]], OpenBBCustomParameter(description="Symbol to get data for."), ], - provider: Union[Literal["fmp"], None] = None, + provider: Optional[Literal["fmp"]] = None, **kwargs ) -> OBBject[List]: """Price Target. @@ -2474,7 +2461,7 @@ class CLASS_stocks_fa(Container): ---------- symbol : Union[str, List[str]] Symbol to get data for. - provider : Union[Literal['fmp'], NoneType] + provider : Optional[Literal['fmp']] The provider to use for the query, by default None. If None, the provider specified in defaults is selected or 'fmp' if there is no default. @@ -2486,7 +2473,7 @@ class CLASS_stocks_fa(Container): OBBject results : List[PriceTarget] Serializable results. - provider : Union[Literal['fmp'], NoneType] + provider : Optional[Literal['fmp']] Provider name. warnings : Optional[List[Warning_]] List of warnings. @@ -2544,19 +2531,19 @@ class CLASS_stocks_fa(Container): @validate_arguments def ratios( self, - symbol: typing_extensions.Annotated[ + symbol: Annotated[ Union[str, List[str]], OpenBBCustomParameter(description="Symbol to get data for."), ], - period: typing_extensions.Annotated[ + period: Annotated[ Literal["annual", "quarter"], OpenBBCustomParameter(description="Period of the data to return."), ] = "annual", - limit: typing_extensions.Annotated[ - Union[pydantic.types.NonNegativeInt, None], + limit: Annotated[ + Optional[pydantic.types.NonNegativeInt], OpenBBCustomParameter(description="The number of data entries to return."), ] = 12, - provider: Union[Literal["fmp"], None] = None, + provider: Optional[Literal["fmp"]] = None, **kwargs ) -> OBBject[List]: """Extensive set of ratios over time. @@ -2567,9 +2554,9 @@ class CLASS_stocks_fa(Container): Symbol to get data for. period : Literal['annual', 'quarter'] Period of the data to return. - limit : Union[pydantic.types.NonNegativeInt, NoneType] + limit : Optional[pydantic.types.NonNegativeInt] The number of data entries to return. - provider : Union[Literal['fmp'], NoneType] + provider : Optional[Literal['fmp']] The provider to use for the query, by default None. If None, the provider specified in defaults is selected or 'fmp' if there is no default. @@ -2579,7 +2566,7 @@ class CLASS_stocks_fa(Container): OBBject results : List[FinancialRatios] Serializable results. - provider : Union[Literal['fmp'], NoneType] + provider : Optional[Literal['fmp']] Provider name. warnings : Optional[List[Warning_]] List of warnings. @@ -2725,19 +2712,19 @@ class CLASS_stocks_fa(Container): @validate_arguments def revgeo( self, - symbol: typing_extensions.Annotated[ + symbol: Annotated[ Union[str, List[str]], OpenBBCustomParameter(description="Symbol to get data for."), ], - period: typing_extensions.Annotated[ - Literal["quarter", "annual"], + period: Annotated[ + Literal["annual", "quarter"], OpenBBCustomParameter(description="Period of the data to return."), ] = "annual", - structure: typing_extensions.Annotated[ + structure: Annotated[ Literal["hierarchical", "flat"], OpenBBCustomParameter(description="Structure of the returned data."), ] = "flat", - provider: Union[Literal["fmp"], None] = None, + provider: Optional[Literal["fmp"]] = None, **kwargs ) -> OBBject[List]: """Revenue Geographic. @@ -2746,11 +2733,11 @@ class CLASS_stocks_fa(Container): ---------- symbol : Union[str, List[str]] Symbol to get data for. - period : Literal['quarter', 'annual'] + period : Literal['annual', 'quarter'] Period of the data to return. structure : Literal['hierarchical', 'flat'] Structure of the returned data. - provider : Union[Literal['fmp'], NoneType] + provider : Optional[Literal['fmp']] The provider to use for the query, by default None. If None, the provider specified in defaults is selected or 'fmp' if there is no default. @@ -2760,7 +2747,7 @@ class CLASS_stocks_fa(Container): OBBject results : List[RevenueGeographic] Serializable results. - provider : Union[Literal['fmp'], NoneType] + provider : Optional[Literal['fmp']] Provider name. warnings : Optional[List[Warning_]] List of warnings. @@ -2806,19 +2793,19 @@ class CLASS_stocks_fa(Container): @validate_arguments def revseg( self, - symbol: typing_extensions.Annotated[ + symbol: Annotated[ Union[str, List[str]], OpenBBCustomParameter(description="Symbol to get data for."), ], - period: typing_extensions.Annotated[ - Literal["quarter", "annual"], + period: Annotated[ + Literal["annual", "quarter"], OpenBBCustomParameter(description="Period of the data to return."), ] = "annual", - structure: typing_extensions.Annotated[ + structure: Annotated[ Literal["hierarchical", "flat"], OpenBBCustomParameter(description="Structure of the returned data."), ] = "flat", - provider: Union[Literal["fmp"], None] = None, + provider: Optional[Literal["fmp"]] = None, **kwargs ) -> OBBject[List]: """Revenue Business Line. @@ -2827,11 +2814,11 @@ class CLASS_stocks_fa(Container): ---------- symbol : Union[str, List[str]] Symbol to get data for. - period : Literal['quarter', 'annual'] + period : Literal['annual', 'quarter'] Period of the data to return. structure : Literal['hierarchical', 'flat'] Structure of the returned data. - provider : Union[Literal['fmp'], NoneType] + provider : Optional[Literal['fmp']] The provider to use for the query, by default None. If None, the provider specified in defaults is selected or 'fmp' if there is no default. @@ -2841,7 +2828,7 @@ class CLASS_stocks_fa(Container): OBBject results : List[RevenueBusinessLine] Serializable results. - provider : Union[Literal['fmp'], NoneType] + provider : Optional[Literal['fmp']] Provider name. warnings : Optional[List[Warning_]] List of warnings. @@ -2877,11 +2864,11 @@ class CLASS_stocks_fa(Container): @validate_arguments def shrs( self, - symbol: typing_extensions.Annotated[ + symbol: Annotated[ Union[str, List[str]], OpenBBCustomParameter(description="Symbol to get data for."), ], - provider: Union[Literal["fmp"], None] = None, + provider: Optional[Literal["fmp"]] = None, **kwargs ) -> OBBject[List]: """Share Statistics. @@ -2890,7 +2877,7 @@ class CLASS_stocks_fa(Container): ---------- symbol : Union[str, List[str]] Symbol to get data for. - provider : Union[Literal['fmp'], NoneType] + provider : Optional[Literal['fmp']] The provider to use for the query, by default None. If None, the provider specified in defaults is selected or 'fmp' if there is no default. @@ -2900,7 +2887,7 @@ class CLASS_stocks_fa(Container): OBBject results : List[ShareStatistics] Serializable results. - provider : Union[Literal['fmp'], NoneType] + provider : Optional[Literal['fmp']] Provider name. warnings : Optional[List[Warning_]] List of warnings. @@ -2942,11 +2929,11 @@ class CLASS_stocks_fa(Container): @validate_arguments def split( self, - symbol: typing_extensions.Annotated[ + symbol: Annotated[ Union[str, List[str]], OpenBBCustomParameter(description="Symbol to get data for."), ], - provider: Union[Literal["fmp"], None] = None, + provider: Optional[Literal["fmp"]] = None, **kwargs ) -> OBBject[List]: """Historical Stock Splits. @@ -2955,7 +2942,7 @@ class CLASS_stocks_fa(Container): ---------- symbol : Union[str, List[str]] Symbol to get data for. - provider : Union[Literal['fmp'], NoneType] + provider : Optional[Literal['fmp']] The provider to use for the query, by default None. If None, the provider specified in defaults is selected or 'fmp' if there is no default. @@ -2965,7 +2952,7 @@ class CLASS_stocks_fa(Container): OBBject results : List[HistoricalStockSplits] Serializable results. - provider : Union[Literal['fmp'], NoneType] + provider : Optional[Literal['fmp']] Provider name. warnings : Optional[List[Warning_]] List of warnings. @@ -3003,21 +2990,21 @@ class CLASS_stocks_fa(Container): @validate_arguments def transcript( self, - symbol: typing_extensions.Annotated[ + symbol: Annotated[ Union[str, List[str]], OpenBBCustomParameter(description="Symbol to get data for."), ], - year: typing_extensions.Annotated[ + year: Annotated[ int, OpenBBCustomParameter(description="Year of the earnings call transcript."), ], - quarter: typing_extensions.Annotated[ + quarter: Annotated[ Literal[1, 2, 3, 4], OpenBBCustomParameter( description="Quarter of the earnings call transcript." ), ] = 1, - provider: Union[Literal["fmp"], None] = None, + provider: Optional[Literal["fmp"]] = None, **kwargs ) -> OBBject[List]: """Earnings Call Transcript. @@ -3030,7 +3017,7 @@ class CLASS_stocks_fa(Container): Year of the earnings call transcript. quarter : Literal[1, 2, 3, 4] Quarter of the earnings call transcript. - provider : Union[Literal['fmp'], NoneType] + provider : Optional[Literal['fmp']] The provider to use for the query, by default None. If None, the provider specified in defaults is selected or 'fmp' if there is no default. @@ -3040,7 +3027,7 @@ class CLASS_stocks_fa(Container): OBBject results : List[EarningsCallTranscript] Serializable results. - provider : Union[Literal['fmp'], NoneType] + provider : Optional[Literal['fmp']] Provider name. warnings : Optional[List[Warning_]] List of warnings. diff --git a/openbb_sdk/openbb/package/stocks_options.py b/openbb_sdk/openbb/package/stocks_options.py index 9363e2ddc7b..8b5fc5dc315 100644 --- a/openbb_sdk/openbb/package/stocks_options.py +++ b/openbb_sdk/openbb/package/stocks_options.py @@ -1,13 +1,13 @@ ### THIS FILE IS AUTO-GENERATED. DO NOT EDIT. ### -from typing import List, Literal, Union +from typing import List, Literal, Optional, Union -import typing_extensions from openbb_core.app.model.custom_parameter import OpenBBCustomParameter from openbb_core.app.model.obbject import OBBject from openbb_core.app.static.container import Container from openbb_core.app.static.filters import filter_inputs from pydantic import validate_arguments +from typing_extensions import Annotated class CLASS_stocks_options(Container): @@ -21,11 +21,11 @@ class CLASS_stocks_options(Container): @validate_arguments def chains( self, - symbol: typing_extensions.Annotated[ + symbol: Annotated[ Union[str, List[str]], OpenBBCustomParameter(description="Symbol to get data for."), ], - provider: Union[Literal["cboe", "intrinio"], None] = None, + provider: Optional[Literal["cboe"]] = None, **kwargs ) -> OBBject[List]: """Get the complete options chain for a ticker. @@ -34,19 +34,17 @@ class CLASS_stocks_options(Container): ---------- symbol : Union[str, List[str]] Symbol to get data for. - provider : Union[Literal['cboe', 'intrinio'], NoneType] + provider : Optional[Literal['cboe']] The provider to use for the query, by default None. If None, the provider specified in defaults is selected or 'cboe' if there is no default. - date : Union[datetime.date, str, NoneType] - Date for which the options chains are returned. (provider: intrinio) Returns ------- OBBject results : List[OptionsChains] Serializable results. - provider : Union[Literal['cboe', 'intrinio'], NoneType] + provider : Optional[Literal['cboe']] Provider name. warnings : Optional[List[Warning_]] List of warnings. @@ -80,11 +78,11 @@ class CLASS_stocks_options(Container): theoretical : Optional[float] Theoretical value of the option. (provider: cboe) open : Optional[float] - Opening price of the option. (provider: cboe, intrinio) + Opening price of the option. (provider: cboe) high : Optional[float] - High price of the option. (provider: cboe, intrinio) + High price of the option. (provider: cboe) low : Optional[float] - Low price of the option. (provider: cboe, intrinio) + Low price of the option. (provider: cboe) last_trade_price : Optional[float] Last trade price of the option. (provider: cboe) tick : Optional[str] @@ -96,40 +94,21 @@ class CLASS_stocks_options(Container): change_percent : Optional[float] Change, in percent, of the option. (provider: cboe) implied_volatility : Optional[float] - Implied volatility of the option. (provider: cboe, intrinio) + Implied volatility of the option. (provider: cboe) delta : Optional[float] - Delta of the option. (provider: cboe, intrinio) + Delta of the option. (provider: cboe) gamma : Optional[float] - Gamma of the option. (provider: cboe, intrinio) + Gamma of the option. (provider: cboe) vega : Optional[float] - Vega of the option. (provider: cboe, intrinio) + Vega of the option. (provider: cboe) theta : Optional[float] - Theta of the option. (provider: cboe, intrinio) + Theta of the option. (provider: cboe) rho : Optional[float] Rho of the option. (provider: cboe) last_trade_timestamp : Optional[datetime] Last trade timestamp of the option. (provider: cboe) dte : Optional[int] - Days to expiration for the option. (provider: cboe, intrinio) - mark : Optional[float] - The mid-price between the latest bid-ask spread. (provider: intrinio) - open_bid : Optional[float] - The lowest bid price for the option that day. (provider: intrinio) - open_ask : Optional[float] - The lowest ask price for the option that day. (provider: intrinio) - bid_low : Optional[float] - The lowest bid price for the option that day. (provider: intrinio) - ask_low : Optional[float] - The lowest ask price for the option that day. (provider: intrinio) - bid_high : Optional[float] - The highest bid price for the option that day. (provider: intrinio) - ask_high : Optional[float] - The highest ask price for the option that day. (provider: intrinio) - close : Optional[float] - Close price for the option that day. (provider: intrinio) - eod_date : Optional[date] - Historical date for which the options chains data is from. (provider: intrinio) - """ # noqa: E501 + Days to expiration for the option. (provider: cboe)""" # noqa: E501 inputs = filter_inputs( provider_choices={ diff --git a/openbb_sdk/openbb/package/ta.py b/openbb_sdk/openbb/package/ta.py index be11bdd7747..3cfc2d7a1e8 100644 --- a/openbb_sdk/openbb/package/ta.py +++ b/openbb_sdk/openbb/package/ta.py @@ -1,6 +1,6 @@ ### THIS FILE IS AUTO-GENERATED. DO NOT EDIT. ### -from typing import List, Literal, Union +from typing import List, Literal, Optional, Union import openbb_provider import pandas @@ -783,8 +783,8 @@ class CLASS_ta(Container): index: str = "date", close_column: Literal["close", "adj_close"] = "close", period: pydantic.types.PositiveInt = 120, - start_date: Union[str, None] = None, - end_date: Union[str, None] = None, + start_date: Optional[str] = None, + end_date: Optional[str] = None, ) -> OBBject[List]: """Create Fibonacci Retracement Levels. diff --git a/openbb_sdk/sdk/core/openbb_core/app/model/obbject.py b/openbb_sdk/sdk/core/openbb_core/app/model/obbject.py index 405fec1eec4..c4e6d4dc77b 100644 --- a/openbb_sdk/sdk/core/openbb_core/app/model/obbject.py +++ b/openbb_sdk/sdk/core/openbb_core/app/model/obbject.py @@ -3,9 +3,6 @@ from typing import Any, Dict, Generic, List, Literal, Optional, TypeVar import pandas as pd from numpy import ndarray -from pydantic import BaseModel, Field -from pydantic.generics import GenericModel - from openbb_core.app.charting_service import ChartingService from openbb_core.app.model.abstract.error import OpenBBError from openbb_core.app.model.abstract.tagged import Tagged @@ -14,6 +11,8 @@ from openbb_core.app.model.charts.chart import Chart from openbb_core.app.model.metadata import Metadata from openbb_core.app.provider_interface import ProviderInterface from openbb_core.app.utils import basemodel_to_df +from pydantic import BaseModel, Field +from pydantic.generics import GenericModel try: from polars import DataFrame as PolarsDataFrame @@ -97,6 +96,7 @@ class OBBject(GenericModel, Generic[T], Tagged): res = self.results df = None + sort_columns = True if isinstance(res, list) and len(res) == 1 and isinstance(res[0], dict): for r in res: dict_of_df = {} @@ -105,21 +105,26 @@ class OBBject(GenericModel, Generic[T], Tagged): isinstance(nv, BaseModel) for nv in v ): dict_of_df[k] = basemodel_to_df(v, "date") + sort_columns = False else: dict_of_df[k] = pd.DataFrame(v) - df = pd.concat(dict_of_df, axis=1) + # Pass keys (column names) in the order we want them + df = pd.concat(dict_of_df, axis=1) # , keys=dict_of_df.keys()) + elif isinstance(res, list) and all( isinstance(item, BaseModel) for item in res ): df = basemodel_to_df(res, "date") + sort_columns = False else: df = pd.DataFrame(res) if df is None: raise OpenBBError("Unsupported data format.") - # Improve output so that all columns that are None are not returned - df.sort_index(axis=1, inplace=True) + # Drop columns that are all NaN, but don't rearrange columns + if sort_columns: + df.sort_index(axis=1, inplace=True) df = df.dropna(axis=1, how="all") except Exception as e: diff --git a/openbb_sdk/sdk/core/openbb_core/app/utils.py b/openbb_sdk/sdk/core/openbb_core/app/utils.py index 960e63b9028..c252fda7577 100644 --- a/openbb_sdk/sdk/core/openbb_core/app/utils.py +++ b/openbb_sdk/sdk/core/openbb_core/app/utils.py @@ -10,14 +10,20 @@ def basemodel_to_df( index: Optional[Union[str, Iterable]] = None, ) -> pd.DataFrame: """Convert list of BaseModel to a Pandas DataFrame.""" + # Get consistent column order from the first data instance + columns_order = ( + list(data[0].dict().keys()) + if isinstance(data, list) and data + else list(data.dict().keys()) # type: ignore + ) if isinstance(data, list): - df = pd.DataFrame([d.dict() for d in data]) + df = pd.DataFrame([d.dict() for d in data], columns=columns_order) else: try: - df = pd.DataFrame(data.dict()) + df = pd.DataFrame(data.dict(), columns=columns_order) except ValueError: - df = pd.DataFrame(data.dict(), index=["values"]) + df = pd.DataFrame(data.dict(), index=["values"], columns=columns_order) if "is_multiindex" in df.columns: col_names = ast.literal_eval(df.multiindex_names.unique()[0]) @@ -30,6 +36,7 @@ def basemodel_to_df( if df.index.name == "date": df.index = pd.to_datetime(df.index) df.sort_index(axis=0, inplace=True) + return df From 4213885a7bc60b0bda7945e01e6b84721b0339d9 Mon Sep 17 00:00:00 2001 From: Igor Radovanovic <74266147+IgorWounds@users.noreply.github.com> Date: Mon, 11 Sep 2023 13:37:08 +0200 Subject: [PATCH 2/9] Semi-passing tests --- .../sdk/core/openbb_core/app/model/obbject.py | 11 ++++++++--- openbb_sdk/sdk/core/openbb_core/app/utils.py | 3 +++ .../sdk/core/tests/app/model/test_obbject.py | 17 ++++++----------- 3 files changed, 17 insertions(+), 14 deletions(-) diff --git a/openbb_sdk/sdk/core/openbb_core/app/model/obbject.py b/openbb_sdk/sdk/core/openbb_core/app/model/obbject.py index c4e6d4dc77b..fe3c684a7b1 100644 --- a/openbb_sdk/sdk/core/openbb_core/app/model/obbject.py +++ b/openbb_sdk/sdk/core/openbb_core/app/model/obbject.py @@ -3,6 +3,9 @@ from typing import Any, Dict, Generic, List, Literal, Optional, TypeVar import pandas as pd from numpy import ndarray +from pydantic import BaseModel, Field +from pydantic.generics import GenericModel + from openbb_core.app.charting_service import ChartingService from openbb_core.app.model.abstract.error import OpenBBError from openbb_core.app.model.abstract.tagged import Tagged @@ -11,8 +14,6 @@ from openbb_core.app.model.charts.chart import Chart from openbb_core.app.model.metadata import Metadata from openbb_core.app.provider_interface import ProviderInterface from openbb_core.app.utils import basemodel_to_df -from pydantic import BaseModel, Field -from pydantic.generics import GenericModel try: from polars import DataFrame as PolarsDataFrame @@ -96,6 +97,7 @@ class OBBject(GenericModel, Generic[T], Tagged): res = self.results df = None + sort_columns = True if isinstance(res, list) and len(res) == 1 and isinstance(res[0], dict): for r in res: @@ -108,7 +110,6 @@ class OBBject(GenericModel, Generic[T], Tagged): sort_columns = False else: dict_of_df[k] = pd.DataFrame(v) - # Pass keys (column names) in the order we want them df = pd.concat(dict_of_df, axis=1) # , keys=dict_of_df.keys()) elif isinstance(res, list) and all( @@ -130,6 +131,10 @@ class OBBject(GenericModel, Generic[T], Tagged): except Exception as e: raise OpenBBError("Failed to convert results to DataFrame.") from e + if isinstance(df.index, pd.MultiIndex): + df.sort_index(axis=0, level=0, inplace=True) + df.sort_index(axis=0, level=1, inplace=True) + return df def to_polars(self) -> PolarsDataFrame: diff --git a/openbb_sdk/sdk/core/openbb_core/app/utils.py b/openbb_sdk/sdk/core/openbb_core/app/utils.py index c252fda7577..b679f0b8c9f 100644 --- a/openbb_sdk/sdk/core/openbb_core/app/utils.py +++ b/openbb_sdk/sdk/core/openbb_core/app/utils.py @@ -37,6 +37,9 @@ def basemodel_to_df( df.index = pd.to_datetime(df.index) df.sort_index(axis=0, inplace=True) + if isinstance(df.index, pd.MultiIndex): + df = df.sort_index(axis=0, level=0, inplace=True) + df = df.sort_index(axis=0, level=1, inplace=True) return df diff --git a/openbb_sdk/sdk/core/tests/app/model/test_obbject.py b/openbb_sdk/sdk/core/tests/app/model/test_obbject.py index 8a0e9ee9f9d..04405ded32e 100644 --- a/openbb_sdk/sdk/core/tests/app/model/test_obbject.py +++ b/openbb_sdk/sdk/core/tests/app/model/test_obbject.py @@ -5,6 +5,7 @@ import pandas as pd import pytest from openbb_core.app.model.obbject import Chart, OBBject, OpenBBError from openbb_provider.abstract.data import Data +from pandas.testing import assert_frame_equal def test_OBBject(): @@ -141,11 +142,7 @@ def test_to_dataframe_no_results(): pd.to_datetime("1956-02-01"), pd.to_datetime("1956-03-01"), ], - "another_date": [ - "2023-09-01", - "2023-09-01", - "2023-09-01", - ], + "another_date": ["2023-09-01", "2023-09-01", "2023-09-01"], "value": [0.0, 0.0, 0.0], } ).set_index("date"), @@ -156,16 +153,13 @@ def test_to_dataframe_no_results(): pd.to_datetime("1955-04-01"), pd.to_datetime("1955-05-01"), ], - "another_date": [ - "2023-09-01", - "2023-09-01", - "2023-09-01", - ], + "another_date": ["2023-09-01", "2023-09-01", "2023-09-01"], "value": [0.0, 0.0, 0.0], } ).set_index("date"), }, axis=1, + sort=True, ), ), # Test case 10: Empty results @@ -182,7 +176,8 @@ def test_to_dataframe(results, expected_df): # Act and Assert if isinstance(expected_df, pd.DataFrame): result = co.to_dataframe() - assert result.equals(expected_df) + # assert result.equals(expected_df) + assert_frame_equal(result, expected_df) else: with pytest.raises(expected_df.__class__) as exc_info: co.to_dataframe() From 6ee5092bf9607f300a792e6d905eda33a8770f69 Mon Sep 17 00:00:00 2001 From: Igor Radovanovic <74266147+IgorWounds@users.noreply.github.com> Date: Mon, 11 Sep 2023 16:59:45 +0200 Subject: [PATCH 3/9] Passing tests --- .../sdk/core/tests/app/model/test_obbject.py | 78 ++++++++++++++----- 1 file changed, 58 insertions(+), 20 deletions(-) diff --git a/openbb_sdk/sdk/core/tests/app/model/test_obbject.py b/openbb_sdk/sdk/core/tests/app/model/test_obbject.py index 04405ded32e..d0e00be2019 100644 --- a/openbb_sdk/sdk/core/tests/app/model/test_obbject.py +++ b/openbb_sdk/sdk/core/tests/app/model/test_obbject.py @@ -31,6 +31,21 @@ def test_to_dataframe_no_results(): co.to_dataframe() +class MockData(Data): + """Test helper.""" + + x: int + y: int + + +class MockMultiData(Data): + """Test helper.""" + + date: str + another_date: str + value: float + + @pytest.mark.parametrize( "results, expected_df", [ @@ -52,24 +67,28 @@ def test_to_dataframe_no_results(): # Test case 3: List of Data ( [ - Data(x=0, y=2), - Data(x=1, y=3), - Data(x=2, y=0), - Data(x=3, y=1), - Data(x=4, y=6), + MockData(x=0, y=2), + MockData(x=1, y=3), + MockData(x=2, y=0), + MockData(x=3, y=1), + MockData(x=4, y=6), ], - pd.DataFrame({"x": [0, 1, 2, 3, 4], "y": [2, 3, 0, 1, 6]}), + pd.DataFrame( + {"x": [0, 1, 2, 3, 4], "y": [2, 3, 0, 1, 6]}, columns=["x", "y"] + ), ), # Test case 4: List of dict ( [ - {"x": 1, "y": 2}, - {"x": 1, "y": 3}, - {"x": 2, "y": 0}, - {"x": 3, "y": 1}, - {"x": 4, "y": 6}, + {"a": 1, "y": 2}, + {"a": 1, "y": 3}, + {"a": 2, "y": 0}, + {"a": 3, "y": 1}, + {"a": 4, "y": 6}, ], - pd.DataFrame({"x": [1, 1, 2, 3, 4], "y": [2, 3, 0, 1, 6]}), + pd.DataFrame( + {"a": [1, 1, 2, 3, 4], "y": [2, 3, 0, 1, 6]}, columns=["a", "y"] + ), ), # Test case 5: List of Lists ( @@ -122,14 +141,26 @@ def test_to_dataframe_no_results(): [ { "df1": [ - Data(date="1956-01-01", another_date="2023-09-01", value=0.0), - Data(date="1956-02-01", another_date="2023-09-01", value=0.0), - Data(date="1956-03-01", another_date="2023-09-01", value=0.0), + MockMultiData( + date="1956-01-01", another_date="2023-09-01", value=0.0 + ), + MockMultiData( + date="1956-02-01", another_date="2023-09-01", value=0.0 + ), + MockMultiData( + date="1956-03-01", another_date="2023-09-01", value=0.0 + ), ], "df2": [ - Data(date="1955-03-01", another_date="2023-09-01", value=0.0), - Data(date="1955-04-01", another_date="2023-09-01", value=0.0), - Data(date="1955-05-01", another_date="2023-09-01", value=0.0), + MockMultiData( + date="1955-03-01", another_date="2023-09-01", value=0.0 + ), + MockMultiData( + date="1955-04-01", another_date="2023-09-01", value=0.0 + ), + MockMultiData( + date="1955-05-01", another_date="2023-09-01", value=0.0 + ), ], } ], @@ -144,7 +175,8 @@ def test_to_dataframe_no_results(): ], "another_date": ["2023-09-01", "2023-09-01", "2023-09-01"], "value": [0.0, 0.0, 0.0], - } + }, + columns=["date", "another_date", "value"], ).set_index("date"), "df2": pd.DataFrame( { @@ -155,7 +187,8 @@ def test_to_dataframe_no_results(): ], "another_date": ["2023-09-01", "2023-09-01", "2023-09-01"], "value": [0.0, 0.0, 0.0], - } + }, + columns=["date", "another_date", "value"], ).set_index("date"), }, axis=1, @@ -177,7 +210,12 @@ def test_to_dataframe(results, expected_df): if isinstance(expected_df, pd.DataFrame): result = co.to_dataframe() # assert result.equals(expected_df) + # try: assert_frame_equal(result, expected_df) + # except AssertionError: + # assert set(expected_df.columns) == set(result.columns) + # for col in result.columns: + # assert expected_df[col].equals(result[col]) else: with pytest.raises(expected_df.__class__) as exc_info: co.to_dataframe() From bd19a99b7ae5cc2c69c44818936d0a94c9412921 Mon Sep 17 00:00:00 2001 From: Igor Radovanovic <74266147+IgorWounds@users.noreply.github.com> Date: Mon, 11 Sep 2023 17:43:19 +0200 Subject: [PATCH 4/9] to_dataframe --- openbb_sdk/sdk/core/openbb_core/app/model/obbject.py | 6 +----- openbb_sdk/sdk/core/openbb_core/app/utils.py | 3 --- 2 files changed, 1 insertion(+), 8 deletions(-) diff --git a/openbb_sdk/sdk/core/openbb_core/app/model/obbject.py b/openbb_sdk/sdk/core/openbb_core/app/model/obbject.py index fe3c684a7b1..8d9b0f847fe 100644 --- a/openbb_sdk/sdk/core/openbb_core/app/model/obbject.py +++ b/openbb_sdk/sdk/core/openbb_core/app/model/obbject.py @@ -110,7 +110,7 @@ class OBBject(GenericModel, Generic[T], Tagged): sort_columns = False else: dict_of_df[k] = pd.DataFrame(v) - df = pd.concat(dict_of_df, axis=1) # , keys=dict_of_df.keys()) + df = pd.concat(dict_of_df, axis=1) elif isinstance(res, list) and all( isinstance(item, BaseModel) for item in res @@ -131,10 +131,6 @@ class OBBject(GenericModel, Generic[T], Tagged): except Exception as e: raise OpenBBError("Failed to convert results to DataFrame.") from e - if isinstance(df.index, pd.MultiIndex): - df.sort_index(axis=0, level=0, inplace=True) - df.sort_index(axis=0, level=1, inplace=True) - return df def to_polars(self) -> PolarsDataFrame: diff --git a/openbb_sdk/sdk/core/openbb_core/app/utils.py b/openbb_sdk/sdk/core/openbb_core/app/utils.py index b679f0b8c9f..c252fda7577 100644 --- a/openbb_sdk/sdk/core/openbb_core/app/utils.py +++ b/openbb_sdk/sdk/core/openbb_core/app/utils.py @@ -37,9 +37,6 @@ def basemodel_to_df( df.index = pd.to_datetime(df.index) df.sort_index(axis=0, inplace=True) - if isinstance(df.index, pd.MultiIndex): - df = df.sort_index(axis=0, level=0, inplace=True) - df = df.sort_index(axis=0, level=1, inplace=True) return df From b7d1272a845357a474ffe4386d7f680809051c78 Mon Sep 17 00:00:00 2001 From: Igor Radovanovic <74266147+IgorWounds@users.noreply.github.com> Date: Mon, 11 Sep 2023 22:12:18 +0200 Subject: [PATCH 5/9] to_dict --- .../sdk/core/openbb_core/app/model/obbject.py | 3 + .../sdk/core/tests/app/model/test_obbject.py | 79 ++++++++++++------- 2 files changed, 54 insertions(+), 28 deletions(-) diff --git a/openbb_sdk/sdk/core/openbb_core/app/model/obbject.py b/openbb_sdk/sdk/core/openbb_core/app/model/obbject.py index 8d9b0f847fe..94d2f68b026 100644 --- a/openbb_sdk/sdk/core/openbb_core/app/model/obbject.py +++ b/openbb_sdk/sdk/core/openbb_core/app/model/obbject.py @@ -161,6 +161,9 @@ class OBBject(GenericModel, Generic[T], Tagged): for field in df.columns: results[field] = df[field].tolist() + # remove index from results + if "index" in results: + del results["index"] return results def to_chart(self, **kwargs): diff --git a/openbb_sdk/sdk/core/tests/app/model/test_obbject.py b/openbb_sdk/sdk/core/tests/app/model/test_obbject.py index d0e00be2019..1eca6bf0444 100644 --- a/openbb_sdk/sdk/core/tests/app/model/test_obbject.py +++ b/openbb_sdk/sdk/core/tests/app/model/test_obbject.py @@ -209,13 +209,7 @@ def test_to_dataframe(results, expected_df): # Act and Assert if isinstance(expected_df, pd.DataFrame): result = co.to_dataframe() - # assert result.equals(expected_df) - # try: assert_frame_equal(result, expected_df) - # except AssertionError: - # assert set(expected_df.columns) == set(result.columns) - # for col in result.columns: - # assert expected_df[col].equals(result[col]) else: with pytest.raises(expected_df.__class__) as exc_info: co.to_dataframe() @@ -224,45 +218,74 @@ def test_to_dataframe(results, expected_df): @pytest.mark.parametrize( - "results, expected", - [ - # Test case 1: Normal results with "date" column + "results, expected_dict", + [ # Case 1: Normal results with "date" column ( [{"date": "2023-07-30", "value": 10}, {"date": "2023-07-31", "value": 20}], - { - "date": [pd.to_datetime("2023-07-30"), pd.to_datetime("2023-07-31")], - "value": [10, 20], - }, + {"date": ["2023-07-30", "2023-07-31"], "value": [10, 20]}, ), - # Test case 2: Normal results without "date" column + # Case 2: Normal results without "date" column ( [{"value": 10}, {"value": 20}], + {"value": [10, 20]}, + ), + # Test case 3: Dict of lists + ( + {"0": [0, 2], "1": [1, 3], "2": [2, 0], "3": [3, 1], "4": [4, 6]}, + {"0": [0, 2], "1": [1, 3], "2": [2, 0], "3": [3, 1], "4": [4, 6]}, + ), + # Test case 4: No results + ([], OpenBBError("Results not found.")), + # Test case 5: Results as None, should raise OpenBBError + (None, OpenBBError("Results not found.")), + # Test case 6: List of tuples + ( + [(3, 2), (1, 3), (2, 0), (3, 1), (4, 6)], + {0: [3, 1, 2, 3, 4], 1: [2, 3, 0, 1, 6]}, + ), + # Test case 7: List of Strings + ( + ["YOLO2", "YOLO3", "YOLO0", "YOLO1", "YOLO6"], + {0: ["YOLO2", "YOLO3", "YOLO0", "YOLO1", "YOLO6"]}, + ), + # Test case 8: List of Numbers + ( + [1, 0.42, 12321, 1293, 0.00123], + {0: [1, 0.42, 12321, 1293, 0.00123]}, + ), + # Test case 9: Dict of Dicts + ( { - "value": [10, 20], + "0": {"x": 0, "y": 2}, + "1": {"x": 1, "y": 3}, + "2": {"x": 2, "y": 0}, + "3": {"x": 3, "y": 1}, + "4": {"x": 4, "y": 6}, + }, + { + "0": [0, 2], + "1": [1, 3], + "2": [2, 0], + "3": [3, 1], + "4": [4, 6], }, ), - # Test case 3: Empty results - ([], OpenBBError("Results not found.")), ], ) -def test_to_dict(results, expected): +def test_to_dict(results, expected_dict): """Test helper.""" # Arrange - if results: - results = [Data(**d) for d in results] co = OBBject(results=results) # Act and Assert - if isinstance(expected, Exception): - with pytest.raises(expected.__class__) as exc_info: + if isinstance(expected_dict, (list, dict)): + result = co.to_dict() + assert result == expected_dict + else: + with pytest.raises(expected_dict.__class__) as exc_info: co.to_dict() - assert str(exc_info.value) == str(expected) - else: - result = co.to_dict() - result.pop("index", None) - - assert result == expected + assert str(exc_info.value) == str(expected_dict) @patch("openbb_core.app.model.obbject.OBBject.to_dataframe") From 969b0262bd9f5d67efe65530d6f55c65655c65b5 Mon Sep 17 00:00:00 2001 From: Igor Radovanovic <74266147+IgorWounds@users.noreply.github.com> Date: Mon, 11 Sep 2023 22:24:46 +0200 Subject: [PATCH 6/9] Handle dict of dicts --- openbb_sdk/sdk/core/openbb_core/app/model/obbject.py | 6 ++++++ openbb_sdk/sdk/core/tests/app/model/test_obbject.py | 10 +++++----- 2 files changed, 11 insertions(+), 5 deletions(-) diff --git a/openbb_sdk/sdk/core/openbb_core/app/model/obbject.py b/openbb_sdk/sdk/core/openbb_core/app/model/obbject.py index 94d2f68b026..fc36cdf51c8 100644 --- a/openbb_sdk/sdk/core/openbb_core/app/model/obbject.py +++ b/openbb_sdk/sdk/core/openbb_core/app/model/obbject.py @@ -156,6 +156,11 @@ class OBBject(GenericModel, Generic[T], Tagged): Dict[str, List] Dictionary of lists. """ + if isinstance(self.results, dict) and all( + isinstance(v, dict) for v in self.results.values() + ): + return self.results + df = self.to_dataframe().reset_index() # type: ignore results = {} for field in df.columns: @@ -164,6 +169,7 @@ class OBBject(GenericModel, Generic[T], Tagged): # remove index from results if "index" in results: del results["index"] + return results def to_chart(self, **kwargs): diff --git a/openbb_sdk/sdk/core/tests/app/model/test_obbject.py b/openbb_sdk/sdk/core/tests/app/model/test_obbject.py index 1eca6bf0444..315f4a75fc3 100644 --- a/openbb_sdk/sdk/core/tests/app/model/test_obbject.py +++ b/openbb_sdk/sdk/core/tests/app/model/test_obbject.py @@ -263,11 +263,11 @@ def test_to_dataframe(results, expected_df): "4": {"x": 4, "y": 6}, }, { - "0": [0, 2], - "1": [1, 3], - "2": [2, 0], - "3": [3, 1], - "4": [4, 6], + "0": {"x": 0, "y": 2}, + "1": {"x": 1, "y": 3}, + "2": {"x": 2, "y": 0}, + "3": {"x": 3, "y": 1}, + "4": {"x": 4, "y": 6}, }, ), ], From 1b21696dc94f1927e41ff3ea396fa1550a46b77c Mon Sep 17 00:00:00 2001 From: Igor Radovanovic <74266147+IgorWounds@users.noreply.github.com> Date: Tue, 12 Sep 2023 14:29:45 +0200 Subject: [PATCH 7/9] Improve to_dict --- .../sdk/core/openbb_core/app/model/obbject.py | 15 ++++++++++++++- .../sdk/core/tests/app/model/test_obbject.py | 8 +------- 2 files changed, 15 insertions(+), 8 deletions(-) diff --git a/openbb_sdk/sdk/core/openbb_core/app/model/obbject.py b/openbb_sdk/sdk/core/openbb_core/app/model/obbject.py index fc36cdf51c8..38311533751 100644 --- a/openbb_sdk/sdk/core/openbb_core/app/model/obbject.py +++ b/openbb_sdk/sdk/core/openbb_core/app/model/obbject.py @@ -159,7 +159,14 @@ class OBBject(GenericModel, Generic[T], Tagged): if isinstance(self.results, dict) and all( isinstance(v, dict) for v in self.results.values() ): - return self.results + results: Dict[str, List] = {} + for _, v in self.results.items(): + for kk, vv in v.items(): + if kk not in results: + results[kk] = [] + results[kk].append(vv) + + return results df = self.to_dataframe().reset_index() # type: ignore results = {} @@ -172,6 +179,12 @@ class OBBject(GenericModel, Generic[T], Tagged): return results + # def to_dict(self, list_fields: bool = False) -> Dict[str, Any]: + # if list_fields: + # df = self.to_dataframe().reset_index() + # return {field: df[field].tolist() for field in df.columns} + # return self.dict()["results"] + def to_chart(self, **kwargs): """ Create or update the `Chart`. diff --git a/openbb_sdk/sdk/core/tests/app/model/test_obbject.py b/openbb_sdk/sdk/core/tests/app/model/test_obbject.py index 315f4a75fc3..a6b8c745b9d 100644 --- a/openbb_sdk/sdk/core/tests/app/model/test_obbject.py +++ b/openbb_sdk/sdk/core/tests/app/model/test_obbject.py @@ -262,13 +262,7 @@ def test_to_dataframe(results, expected_df): "3": {"x": 3, "y": 1}, "4": {"x": 4, "y": 6}, }, - { - "0": {"x": 0, "y": 2}, - "1": {"x": 1, "y": 3}, - "2": {"x": 2, "y": 0}, - "3": {"x": 3, "y": 1}, - "4": {"x": 4, "y": 6}, - }, + {"x": [0, 1, 2, 3, 4], "y": [2, 3, 0, 1, 6]}, ), ], ) From f0b190783c2d66a99c9f99fca9b9175f6dfb70e9 Mon Sep 17 00:00:00 2001 From: Igor Radovanovic <74266147+IgorWounds@users.noreply.github.com> Date: Tue, 12 Sep 2023 15:02:44 +0200 Subject: [PATCH 8/9] Rebuild static assets --- openbb_sdk/openbb/package/__extensions__.py | 7 + openbb_sdk/openbb/package/crypto.py | 28 +- openbb_sdk/openbb/package/economy.py | 86 ++-- openbb_sdk/openbb/package/extension_map.json | 36 +- openbb_sdk/openbb/package/fixedincome.py | 98 ++-- openbb_sdk/openbb/package/forex.py | 54 ++- openbb_sdk/openbb/package/futures.py | 40 +- openbb_sdk/openbb/package/module_map.json | 15 + openbb_sdk/openbb/package/news.py | 50 +- openbb_sdk/openbb/package/qa.py | 2 +- openbb_sdk/openbb/package/stocks.py | 238 +++++++--- openbb_sdk/openbb/package/stocks_ca.py | 12 +- openbb_sdk/openbb/package/stocks_dd.py | 26 +- openbb_sdk/openbb/package/stocks_fa.py | 461 ++++++++++--------- openbb_sdk/openbb/package/stocks_options.py | 51 +- openbb_sdk/openbb/package/ta.py | 6 +- 16 files changed, 687 insertions(+), 523 deletions(-) diff --git a/openbb_sdk/openbb/package/__extensions__.py b/openbb_sdk/openbb/package/__extensions__.py index b72edde1849..445cb6fa972 100644 --- a/openbb_sdk/openbb/package/__extensions__.py +++ b/openbb_sdk/openbb/package/__extensions__.py @@ -7,6 +7,7 @@ from openbb_core.app.static.container import Container class Extensions(Container): """ /crypto + /econometrics /economy /fixedincome /forex @@ -26,6 +27,12 @@ class Extensions(Container): return crypto.CLASS_crypto(command_runner=self._command_runner) + @property + def econometrics(self): # route = "/econometrics" + from . import econometrics + + return econometrics.CLASS_econometrics(command_runner=self._command_runner) + @property def economy(self): # route = "/economy" from . import economy diff --git a/openbb_sdk/openbb/package/crypto.py b/openbb_sdk/openbb/package/crypto.py index 3937c437fac..b6d602bd724 100644 --- a/openbb_sdk/openbb/package/crypto.py +++ b/openbb_sdk/openbb/package/crypto.py @@ -1,14 +1,14 @@ ### THIS FILE IS AUTO-GENERATED. DO NOT EDIT. ### import datetime -from typing import List, Literal, Optional, Union +from typing import List, Literal, Union +import typing_extensions from openbb_core.app.model.custom_parameter import OpenBBCustomParameter from openbb_core.app.model.obbject import OBBject from openbb_core.app.static.container import Container from openbb_core.app.static.filters import filter_inputs from pydantic import validate_arguments -from typing_extensions import Annotated class CLASS_crypto(Container): @@ -22,26 +22,26 @@ class CLASS_crypto(Container): @validate_arguments def load( self, - symbol: Annotated[ + symbol: typing_extensions.Annotated[ Union[str, List[str]], OpenBBCustomParameter(description="Symbol to get data for."), ], - start_date: Annotated[ + start_date: typing_extensions.Annotated[ Union[datetime.date, None, str], OpenBBCustomParameter( description="Start date of the data, in YYYY-MM-DD format." ), ] = None, - end_date: Annotated[ + end_date: typing_extensions.Annotated[ Union[datetime.date, None, str], OpenBBCustomParameter( description="End date of the data, in YYYY-MM-DD format." ), ] = None, - provider: Optional[Literal["fmp", "polygon", "yfinance"]] = None, + provider: Union[Literal["fmp", "polygon", "yfinance"], None] = None, **kwargs ) -> OBBject[List]: - r"""Crypto Historical Price. + """Crypto Historical Price. Parameters ---------- @@ -51,11 +51,11 @@ class CLASS_crypto(Container): Start date of the data, in YYYY-MM-DD format. end_date : Union[datetime.date, NoneType, str] End date of the data, in YYYY-MM-DD format. - provider : Optional[Literal['fmp', 'polygon', 'yfinance']] + provider : Union[Literal['fmp', 'polygon', 'yfinance'], NoneType] The provider to use for the query, by default None. If None, the provider specified in defaults is selected or 'fmp' if there is no default. - timeseries : Optional[pydantic.types.NonNegativeInt] + timeseries : Union[pydantic.types.NonNegativeInt, NoneType] Number of days to look back. (provider: fmp) timespan : Literal['minute', 'hour', 'day', 'week', 'month', 'quarter', 'year'] Timespan of the data. (provider: polygon) @@ -67,9 +67,9 @@ class CLASS_crypto(Container): Whether the data is adjusted. (provider: polygon) multiplier : PositiveInt Multiplier of the timespan. (provider: polygon) - interval : Optional[Literal['1m', '2m', '5m', '15m', '30m', '60m', '90m', '1h', '1d', '5d', '1wk', '1mo', '3mo']] + interval : Union[Literal['1m', '2m', '5m', '15m', '30m', '60m', '90m', '1h', '1d', '5d', '1wk', '1mo', '3mo'], NoneType] Data granularity. (provider: yfinance) - period : Optional[Literal['1d', '5d', '1mo', '3mo', '6mo', '1y', '2y', '5y', '10y', 'ytd', 'max']] + period : Union[Literal['1d', '5d', '1mo', '3mo', '6mo', '1y', '2y', '5y', '10y', 'ytd', 'max'], NoneType] Period of the data to return. (provider: yfinance) prepost : bool Include Pre and Post market data. (provider: yfinance) @@ -83,7 +83,7 @@ class CLASS_crypto(Container): OBBject results : List[CryptoHistorical] Serializable results. - provider : Optional[Literal['fmp', 'polygon', 'yfinance']] + provider : Union[Literal['fmp', 'polygon', 'yfinance'], NoneType] Provider name. warnings : Optional[List[Warning_]] List of warnings. @@ -115,11 +115,11 @@ class CLASS_crypto(Container): change : Optional[float] Change in the price of the symbol from the previous day. (provider: fmp) change_percent : Optional[float] - Change \% in the price of the symbol. (provider: fmp) + Change \\% in the price of the symbol. (provider: fmp) label : Optional[str] Human readable format of the date. (provider: fmp) change_over_time : Optional[float] - Change \% in the price of the symbol over a period of time. (provider: fmp) + Change \\% in the price of the symbol over a period of time. (provider: fmp) n : Optional[PositiveInt] Number of transactions for the symbol in the time period. (provider: polygon) """ # noqa: E501 diff --git a/openbb_sdk/openbb/package/economy.py b/openbb_sdk/openbb/package/economy.py index a25ad79064b..12b5d5c5e98 100644 --- a/openbb_sdk/openbb/package/economy.py +++ b/openbb_sdk/openbb/package/economy.py @@ -1,14 +1,14 @@ ### THIS FILE IS AUTO-GENERATED. DO NOT EDIT. ### import datetime -from typing import List, Literal, Optional, Union +from typing import List, Literal, Union +import typing_extensions from openbb_core.app.model.custom_parameter import OpenBBCustomParameter from openbb_core.app.model.obbject import OBBject from openbb_core.app.static.container import Container from openbb_core.app.static.filters import filter_inputs from pydantic import validate_arguments -from typing_extensions import Annotated class CLASS_economy(Container): @@ -27,13 +27,13 @@ class CLASS_economy(Container): @validate_arguments def available_indices( - self, provider: Optional[Literal["cboe", "fmp", "yfinance"]] = None, **kwargs + self, provider: Union[Literal["cboe", "fmp", "yfinance"], None] = None, **kwargs ) -> OBBject[List]: """Lists of available indices from a provider. Parameters ---------- - provider : Optional[Literal['cboe', 'fmp', 'yfinance']] + provider : Union[Literal['cboe', 'fmp', 'yfinance'], NoneType] The provider to use for the query, by default None. If None, the provider specified in defaults is selected or 'cboe' if there is no default. @@ -45,7 +45,7 @@ class CLASS_economy(Container): OBBject results : List[AvailableIndices] Serializable results. - provider : Optional[Literal['cboe', 'fmp', 'yfinance']] + provider : Union[Literal['cboe', 'fmp', 'yfinance'], NoneType] Provider name. warnings : Optional[List[Warning_]] List of warnings. @@ -105,13 +105,13 @@ class CLASS_economy(Container): @validate_arguments def const( self, - index: Annotated[ + index: typing_extensions.Annotated[ Literal["nasdaq", "sp500", "dowjones"], OpenBBCustomParameter( description="Index for which we want to fetch the constituents." ), ] = "dowjones", - provider: Optional[Literal["fmp"]] = None, + provider: Union[Literal["fmp"], None] = None, **kwargs ) -> OBBject[List]: """Get the constituents of an index. @@ -120,7 +120,7 @@ class CLASS_economy(Container): ---------- index : Literal['nasdaq', 'sp500', 'dowjones'] Index for which we want to fetch the constituents. - provider : Optional[Literal['fmp']] + provider : Union[Literal['fmp'], NoneType] The provider to use for the query, by default None. If None, the provider specified in defaults is selected or 'fmp' if there is no default. @@ -130,7 +130,7 @@ class CLASS_economy(Container): OBBject results : List[MajorIndicesConstituents] Serializable results. - provider : Optional[Literal['fmp']] + provider : Union[Literal['fmp'], NoneType] Provider name. warnings : Optional[List[Warning_]] List of warnings. @@ -176,7 +176,7 @@ class CLASS_economy(Container): @validate_arguments def cpi( self, - countries: Annotated[ + countries: typing_extensions.Annotated[ List[ Literal[ "australia", @@ -232,33 +232,33 @@ class CLASS_economy(Container): ], OpenBBCustomParameter(description="The country or countries to get data."), ], - units: Annotated[ + units: typing_extensions.Annotated[ Literal["growth_previous", "growth_same", "index_2015"], OpenBBCustomParameter(description="The data units."), ] = "growth_same", - frequency: Annotated[ + frequency: typing_extensions.Annotated[ Literal["monthly", "quarter", "annual"], OpenBBCustomParameter(description="The data time frequency."), ] = "monthly", - harmonized: Annotated[ + harmonized: typing_extensions.Annotated[ bool, OpenBBCustomParameter( description="Whether you wish to obtain harmonized data." ), ] = False, - start_date: Annotated[ + start_date: typing_extensions.Annotated[ Union[datetime.date, None, str], OpenBBCustomParameter( description="Start date of the data, in YYYY-MM-DD format." ), ] = None, - end_date: Annotated[ + end_date: typing_extensions.Annotated[ Union[datetime.date, None, str], OpenBBCustomParameter( description="End date of the data, in YYYY-MM-DD format." ), ] = None, - provider: Optional[Literal["fred"]] = None, + provider: Union[Literal["fred"], None] = None, **kwargs ) -> OBBject[List]: """CPI. @@ -277,7 +277,7 @@ class CLASS_economy(Container): Start date of the data, in YYYY-MM-DD format. end_date : Union[datetime.date, NoneType, str] End date of the data, in YYYY-MM-DD format. - provider : Optional[Literal['fred']] + provider : Union[Literal['fred'], NoneType] The provider to use for the query, by default None. If None, the provider specified in defaults is selected or 'fred' if there is no default. @@ -287,7 +287,7 @@ class CLASS_economy(Container): OBBject results : List[CPI] Serializable results. - provider : Optional[Literal['fred']] + provider : Union[Literal['fred'], NoneType] Provider name. warnings : Optional[List[Warning_]] List of warnings. @@ -330,23 +330,23 @@ class CLASS_economy(Container): @validate_arguments def european_index( self, - symbol: Annotated[ + symbol: typing_extensions.Annotated[ Union[str, List[str]], OpenBBCustomParameter(description="Symbol to get data for."), ], - start_date: Annotated[ + start_date: typing_extensions.Annotated[ Union[datetime.date, None, str], OpenBBCustomParameter( description="Start date of the data, in YYYY-MM-DD format." ), ] = None, - end_date: Annotated[ + end_date: typing_extensions.Annotated[ Union[datetime.date, None, str], OpenBBCustomParameter( description="End date of the data, in YYYY-MM-DD format." ), ] = None, - provider: Optional[Literal["cboe"]] = None, + provider: Union[Literal["cboe"], None] = None, **kwargs ) -> OBBject[List]: """Get historical close values for select European indices. @@ -359,11 +359,11 @@ class CLASS_economy(Container): Start date of the data, in YYYY-MM-DD format. end_date : Union[datetime.date, NoneType, str] End date of the data, in YYYY-MM-DD format. - provider : Optional[Literal['cboe']] + provider : Union[Literal['cboe'], NoneType] The provider to use for the query, by default None. If None, the provider specified in defaults is selected or 'cboe' if there is no default. - interval : Optional[Literal['1d', '1m']] + interval : Union[Literal['1d', '1m'], NoneType] Data granularity. (provider: cboe) Returns @@ -371,7 +371,7 @@ class CLASS_economy(Container): OBBject results : List[EuropeanIndexHistorical] Serializable results. - provider : Optional[Literal['cboe']] + provider : Union[Literal['cboe'], NoneType] Provider name. warnings : Optional[List[Warning_]] List of warnings. @@ -415,11 +415,11 @@ class CLASS_economy(Container): @validate_arguments def european_index_constituents( self, - symbol: Annotated[ + symbol: typing_extensions.Annotated[ Union[str, List[str]], OpenBBCustomParameter(description="Symbol to get data for."), ], - provider: Optional[Literal["cboe"]] = None, + provider: Union[Literal["cboe"], None] = None, **kwargs ) -> OBBject[List]: """Get current levels for constituents of select European indices. @@ -428,7 +428,7 @@ class CLASS_economy(Container): ---------- symbol : Union[str, List[str]] Symbol to get data for. - provider : Optional[Literal['cboe']] + provider : Union[Literal['cboe'], NoneType] The provider to use for the query, by default None. If None, the provider specified in defaults is selected or 'cboe' if there is no default. @@ -438,7 +438,7 @@ class CLASS_economy(Container): OBBject results : List[EuropeanIndexConstituents] Serializable results. - provider : Optional[Literal['cboe']] + provider : Union[Literal['cboe'], NoneType] Provider name. warnings : Optional[List[Warning_]] List of warnings. @@ -498,26 +498,26 @@ class CLASS_economy(Container): @validate_arguments def index( self, - symbol: Annotated[ + symbol: typing_extensions.Annotated[ Union[str, List[str]], OpenBBCustomParameter(description="Symbol to get data for."), ], - start_date: Annotated[ + start_date: typing_extensions.Annotated[ Union[datetime.date, None, str], OpenBBCustomParameter( description="Start date of the data, in YYYY-MM-DD format." ), ] = None, - end_date: Annotated[ + end_date: typing_extensions.Annotated[ Union[datetime.date, None, str], OpenBBCustomParameter( description="End date of the data, in YYYY-MM-DD format." ), ] = None, - provider: Optional[Literal["cboe", "fmp", "polygon", "yfinance"]] = None, + provider: Union[Literal["cboe", "fmp", "polygon", "yfinance"], None] = None, **kwargs ) -> OBBject[List]: - r"""Get historical levels for an index. + """Get historical levels for an index. Parameters ---------- @@ -527,13 +527,13 @@ class CLASS_economy(Container): Start date of the data, in YYYY-MM-DD format. end_date : Union[datetime.date, NoneType, str] End date of the data, in YYYY-MM-DD format. - provider : Optional[Literal['cboe', 'fmp', 'polygon', 'yfinance']] + provider : Union[Literal['cboe', 'fmp', 'polygon', 'yfinance'], NoneType] The provider to use for the query, by default None. If None, the provider specified in defaults is selected or 'cboe' if there is no default. interval : Union[Literal['1d', '1m'], NoneType, Literal['1min', '5min', '15min', '30min', '1hour', '4hour', '1day'], Literal['1m', '2m', '5m', '15m', '30m', '60m', '90m', '1h', '1d', '5d', '1wk', '1mo', '3mo']] Data granularity. (provider: cboe, fmp, yfinance) - timeseries : Optional[pydantic.types.NonNegativeInt] + timeseries : Union[pydantic.types.NonNegativeInt, NoneType] Number of days to look back. (provider: fmp) timespan : Literal['minute', 'hour', 'day', 'week', 'month', 'quarter', 'year'] Timespan of the data. (provider: polygon) @@ -545,7 +545,7 @@ class CLASS_economy(Container): Whether the data is adjusted. (provider: polygon) multiplier : PositiveInt Multiplier of the timespan. (provider: polygon) - period : Optional[Literal['1d', '5d', '1mo', '3mo', '6mo', '1y', '2y', '5y', '10y', 'ytd', 'max']] + period : Union[Literal['1d', '5d', '1mo', '3mo', '6mo', '1y', '2y', '5y', '10y', 'ytd', 'max'], NoneType] Period of the data to return. (provider: yfinance) prepost : bool Include Pre and Post market data. (provider: yfinance) @@ -559,7 +559,7 @@ class CLASS_economy(Container): OBBject results : List[MajorIndicesHistorical] Serializable results. - provider : Optional[Literal['cboe', 'fmp', 'polygon', 'yfinance']] + provider : Union[Literal['cboe', 'fmp', 'polygon', 'yfinance'], NoneType] Provider name. warnings : Optional[List[Warning_]] List of warnings. @@ -595,11 +595,11 @@ class CLASS_economy(Container): change : Optional[float] Change in the price of the symbol from the previous day. (provider: fmp) change_percent : Optional[float] - Change \% in the price of the symbol. (provider: fmp) + Change \\% in the price of the symbol. (provider: fmp) label : Optional[str] Human readable format of the date. (provider: fmp) change_over_time : Optional[float] - Change \% in the price of the symbol over a period of time. (provider: fmp) + Change \\% in the price of the symbol over a period of time. (provider: fmp) """ # noqa: E501 inputs = filter_inputs( @@ -621,13 +621,13 @@ class CLASS_economy(Container): @validate_arguments def risk( - self, provider: Optional[Literal["fmp"]] = None, **kwargs + self, provider: Union[Literal["fmp"], None] = None, **kwargs ) -> OBBject[List]: """Market Risk Premium. Parameters ---------- - provider : Optional[Literal['fmp']] + provider : Union[Literal['fmp'], NoneType] The provider to use for the query, by default None. If None, the provider specified in defaults is selected or 'fmp' if there is no default. @@ -637,7 +637,7 @@ class CLASS_economy(Container): OBBject results : List[RiskPremium] Serializable results. - provider : Optional[Literal['fmp']] + provider : Union[Literal['fmp'], NoneType] Provider name. warnings : Optional[List[Warning_]] List of warnings. diff --git a/openbb_sdk/openbb/package/extension_map.json b/openbb_sdk/openbb/package/extension_map.json index cf5a80bf118..b11b4e0560d 100644 --- a/openbb_sdk/openbb/package/extension_map.json +++ b/openbb_sdk/openbb/package/extension_map.json @@ -1,22 +1,26 @@ { "openbb_core_extension": [ - "crypto@0.1.1", - "economy@0.1.1", - "fixedincome@0.1.1", - "forex@0.1.1", - "futures@0.1.1", - "news@0.1.1", - "openbb_charting@0.1.0", - "qa@0.1.0", - "stocks@0.1.0", - "ta@0.1.0" + "crypto@0.1.0a0", + "econometrics@0.1.0a0", + "economy@0.1.0a0", + "fixedincome@0.1.0a0", + "forex@0.1.0a0", + "futures@0.1.0a0", + "news@0.1.0a0", + "openbb_charting@0.1.0a1", + "qa@0.1.0a0", + "stocks@0.1.0a0", + "ta@0.1.0a0" ], "openbb_provider_extension": [ - "benzinga@0.1.1", - "cboe@0.1.1", - "fmp@0.1.1", - "fred@0.1.1", - "polygon@0.1.1", - "yfinance@0.1.1" + "alpha_vantage@0.1.0a0", + "benzinga@0.1.0a0", + "cboe@0.1.0a0", + "fmp@0.1.0a0", + "fred@0.1.0a0", + "intrinio@0.1.0a0", + "polygon@0.1.0a0", + "quandl@0.1.0a0", + "yfinance@0.1.0a0" ] } \ No newline at end of file diff --git a/openbb_sdk/openbb/package/fixedincome.py b/openbb_sdk/openbb/package/fixedincome.py index c1854d40f13..50bf2542345 100644 --- a/openbb_sdk/openbb/package/fixedincome.py +++ b/openbb_sdk/openbb/package/fixedincome.py @@ -1,14 +1,14 @@ ### THIS FILE IS AUTO-GENERATED. DO NOT EDIT. ### import datetime -from typing import List, Literal, Optional, Union +from typing import List, Literal, Union +import typing_extensions from openbb_core.app.model.custom_parameter import OpenBBCustomParameter from openbb_core.app.model.obbject import OBBject from openbb_core.app.static.container import Container from openbb_core.app.static.filters import filter_inputs from pydantic import validate_arguments -from typing_extensions import Annotated class CLASS_fixedincome(Container): @@ -30,19 +30,19 @@ class CLASS_fixedincome(Container): @validate_arguments def ameribor( self, - start_date: Annotated[ + start_date: typing_extensions.Annotated[ Union[datetime.date, None, str], OpenBBCustomParameter( description="Start date of the data, in YYYY-MM-DD format." ), ] = None, - end_date: Annotated[ + end_date: typing_extensions.Annotated[ Union[datetime.date, None, str], OpenBBCustomParameter( description="End date of the data, in YYYY-MM-DD format." ), ] = None, - provider: Optional[Literal["fred"]] = None, + provider: Union[Literal["fred"], None] = None, **kwargs ) -> OBBject[List]: """ @@ -56,7 +56,7 @@ class CLASS_fixedincome(Container): Start date of the data, in YYYY-MM-DD format. end_date : Union[datetime.date, NoneType, str] End date of the data, in YYYY-MM-DD format. - provider : Optional[Literal['fred']] + provider : Union[Literal['fred'], NoneType] The provider to use for the query, by default None. If None, the provider specified in defaults is selected or 'fred' if there is no default. @@ -68,7 +68,7 @@ class CLASS_fixedincome(Container): OBBject results : List[AMERIBOR] Serializable results. - provider : Optional[Literal['fred']] + provider : Union[Literal['fred'], NoneType] Provider name. warnings : Optional[List[Warning_]] List of warnings. @@ -103,19 +103,19 @@ class CLASS_fixedincome(Container): @validate_arguments def estr( self, - start_date: Annotated[ + start_date: typing_extensions.Annotated[ Union[datetime.date, None, str], OpenBBCustomParameter( description="Start date of the data, in YYYY-MM-DD format." ), ] = None, - end_date: Annotated[ + end_date: typing_extensions.Annotated[ Union[datetime.date, None, str], OpenBBCustomParameter( description="End date of the data, in YYYY-MM-DD format." ), ] = None, - provider: Optional[Literal["fred"]] = None, + provider: Union[Literal["fred"], None] = None, **kwargs ) -> OBBject[List]: """ @@ -130,7 +130,7 @@ class CLASS_fixedincome(Container): Start date of the data, in YYYY-MM-DD format. end_date : Union[datetime.date, NoneType, str] End date of the data, in YYYY-MM-DD format. - provider : Optional[Literal['fred']] + provider : Union[Literal['fred'], NoneType] The provider to use for the query, by default None. If None, the provider specified in defaults is selected or 'fred' if there is no default. @@ -142,7 +142,7 @@ class CLASS_fixedincome(Container): OBBject results : List[ESTR] Serializable results. - provider : Optional[Literal['fred']] + provider : Union[Literal['fred'], NoneType] Provider name. warnings : Optional[List[Warning_]] List of warnings. @@ -177,19 +177,19 @@ class CLASS_fixedincome(Container): @validate_arguments def fed( self, - start_date: Annotated[ + start_date: typing_extensions.Annotated[ Union[datetime.date, None, str], OpenBBCustomParameter( description="Start date of the data, in YYYY-MM-DD format." ), ] = None, - end_date: Annotated[ + end_date: typing_extensions.Annotated[ Union[datetime.date, None, str], OpenBBCustomParameter( description="End date of the data, in YYYY-MM-DD format." ), ] = None, - provider: Optional[Literal["fred"]] = None, + provider: Union[Literal["fred"], None] = None, **kwargs ) -> OBBject[List]: """ @@ -204,7 +204,7 @@ class CLASS_fixedincome(Container): Start date of the data, in YYYY-MM-DD format. end_date : Union[datetime.date, NoneType, str] End date of the data, in YYYY-MM-DD format. - provider : Optional[Literal['fred']] + provider : Union[Literal['fred'], NoneType] The provider to use for the query, by default None. If None, the provider specified in defaults is selected or 'fred' if there is no default. @@ -216,7 +216,7 @@ class CLASS_fixedincome(Container): OBBject results : List[FEDFUNDS] Serializable results. - provider : Optional[Literal['fred']] + provider : Union[Literal['fred'], NoneType] Provider name. warnings : Optional[List[Warning_]] List of warnings. @@ -251,19 +251,19 @@ class CLASS_fixedincome(Container): @validate_arguments def iorb( self, - start_date: Annotated[ + start_date: typing_extensions.Annotated[ Union[datetime.date, None, str], OpenBBCustomParameter( description="Start date of the data, in YYYY-MM-DD format." ), ] = None, - end_date: Annotated[ + end_date: typing_extensions.Annotated[ Union[datetime.date, None, str], OpenBBCustomParameter( description="End date of the data, in YYYY-MM-DD format." ), ] = None, - provider: Optional[Literal["fred"]] = None, + provider: Union[Literal["fred"], None] = None, **kwargs ) -> OBBject[List]: """ @@ -278,7 +278,7 @@ class CLASS_fixedincome(Container): Start date of the data, in YYYY-MM-DD format. end_date : Union[datetime.date, NoneType, str] End date of the data, in YYYY-MM-DD format. - provider : Optional[Literal['fred']] + provider : Union[Literal['fred'], NoneType] The provider to use for the query, by default None. If None, the provider specified in defaults is selected or 'fred' if there is no default. @@ -288,7 +288,7 @@ class CLASS_fixedincome(Container): OBBject results : List[IORB] Serializable results. - provider : Optional[Literal['fred']] + provider : Union[Literal['fred'], NoneType] Provider name. warnings : Optional[List[Warning_]] List of warnings. @@ -322,7 +322,7 @@ class CLASS_fixedincome(Container): @validate_arguments def projections( - self, provider: Optional[Literal["fred"]] = None, **kwargs + self, provider: Union[Literal["fred"], None] = None, **kwargs ) -> OBBject[List]: """ Get Effective Federal Funds Rate data. A bank rate is the interest rate a nation's central bank charges to its @@ -332,7 +332,7 @@ class CLASS_fixedincome(Container): Parameters ---------- - provider : Optional[Literal['fred']] + provider : Union[Literal['fred'], NoneType] The provider to use for the query, by default None. If None, the provider specified in defaults is selected or 'fred' if there is no default. @@ -344,7 +344,7 @@ class CLASS_fixedincome(Container): OBBject results : List[PROJECTIONS] Serializable results. - provider : Optional[Literal['fred']] + provider : Union[Literal['fred'], NoneType] Provider name. warnings : Optional[List[Warning_]] List of warnings. @@ -388,19 +388,19 @@ class CLASS_fixedincome(Container): @validate_arguments def sofr( self, - start_date: Annotated[ + start_date: typing_extensions.Annotated[ Union[datetime.date, None, str], OpenBBCustomParameter( description="Start date of the data, in YYYY-MM-DD format." ), ] = None, - end_date: Annotated[ + end_date: typing_extensions.Annotated[ Union[datetime.date, None, str], OpenBBCustomParameter( description="End date of the data, in YYYY-MM-DD format." ), ] = None, - provider: Optional[Literal["fred"]] = None, + provider: Union[Literal["fred"], None] = None, **kwargs ) -> OBBject[List]: """Get United States yield curve. @@ -411,7 +411,7 @@ class CLASS_fixedincome(Container): Start date of the data, in YYYY-MM-DD format. end_date : Union[datetime.date, NoneType, str] End date of the data, in YYYY-MM-DD format. - provider : Optional[Literal['fred']] + provider : Union[Literal['fred'], NoneType] The provider to use for the query, by default None. If None, the provider specified in defaults is selected or 'fred' if there is no default. @@ -423,7 +423,7 @@ class CLASS_fixedincome(Container): OBBject results : List[SOFR] Serializable results. - provider : Optional[Literal['fred']] + provider : Union[Literal['fred'], NoneType] Provider name. warnings : Optional[List[Warning_]] List of warnings. @@ -458,19 +458,19 @@ class CLASS_fixedincome(Container): @validate_arguments def sonia( self, - start_date: Annotated[ + start_date: typing_extensions.Annotated[ Union[datetime.date, None, str], OpenBBCustomParameter( description="Start date of the data, in YYYY-MM-DD format." ), ] = None, - end_date: Annotated[ + end_date: typing_extensions.Annotated[ Union[datetime.date, None, str], OpenBBCustomParameter( description="End date of the data, in YYYY-MM-DD format." ), ] = None, - provider: Optional[Literal["fred"]] = None, + provider: Union[Literal["fred"], None] = None, **kwargs ) -> OBBject[List]: """ @@ -484,7 +484,7 @@ class CLASS_fixedincome(Container): Start date of the data, in YYYY-MM-DD format. end_date : Union[datetime.date, NoneType, str] End date of the data, in YYYY-MM-DD format. - provider : Optional[Literal['fred']] + provider : Union[Literal['fred'], NoneType] The provider to use for the query, by default None. If None, the provider specified in defaults is selected or 'fred' if there is no default. @@ -496,7 +496,7 @@ class CLASS_fixedincome(Container): OBBject results : List[SONIA] Serializable results. - provider : Optional[Literal['fred']] + provider : Union[Literal['fred'], NoneType] Provider name. warnings : Optional[List[Warning_]] List of warnings. @@ -531,19 +531,19 @@ class CLASS_fixedincome(Container): @validate_arguments def treasury( self, - start_date: Annotated[ + start_date: typing_extensions.Annotated[ Union[datetime.date, None, str], OpenBBCustomParameter( description="Start date of the data, in YYYY-MM-DD format." ), ] = None, - end_date: Annotated[ + end_date: typing_extensions.Annotated[ Union[datetime.date, None, str], OpenBBCustomParameter( description="End date of the data, in YYYY-MM-DD format." ), ] = None, - provider: Optional[Literal["fmp"]] = None, + provider: Union[Literal["fmp"], None] = None, **kwargs ) -> OBBject[List]: """Get treasury rates. @@ -554,7 +554,7 @@ class CLASS_fixedincome(Container): Start date of the data, in YYYY-MM-DD format. end_date : Union[datetime.date, NoneType, str] End date of the data, in YYYY-MM-DD format. - provider : Optional[Literal['fmp']] + provider : Union[Literal['fmp'], NoneType] The provider to use for the query, by default None. If None, the provider specified in defaults is selected or 'fmp' if there is no default. @@ -564,7 +564,7 @@ class CLASS_fixedincome(Container): OBBject results : List[TreasuryRates] Serializable results. - provider : Optional[Literal['fmp']] + provider : Union[Literal['fmp'], NoneType] Provider name. warnings : Optional[List[Warning_]] List of warnings. @@ -621,28 +621,28 @@ class CLASS_fixedincome(Container): @validate_arguments def ycrv( self, - date: Annotated[ - Optional[datetime.date], + date: typing_extensions.Annotated[ + Union[datetime.date, None], OpenBBCustomParameter( description="Date to get Yield Curve data. Defaults to the most recent FRED entry." ), ] = None, - inflation_adjusted: Annotated[ - Optional[bool], + inflation_adjusted: typing_extensions.Annotated[ + Union[bool, None], OpenBBCustomParameter(description="Get inflation adjusted rates."), ] = False, - provider: Optional[Literal["fred"]] = None, + provider: Union[Literal["fred"], None] = None, **kwargs ) -> OBBject[List]: """Get United States yield curve. Parameters ---------- - date : Optional[datetime.date] + date : Union[datetime.date, NoneType] Date to get Yield Curve data. Defaults to the most recent FRED entry. - inflation_adjusted : Optional[bool] + inflation_adjusted : Union[bool, NoneType] Get inflation adjusted rates. - provider : Optional[Literal['fred']] + provider : Union[Literal['fred'], NoneType] The provider to use for the query, by default None. If None, the provider specified in defaults is selected or 'fred' if there is no default. @@ -652,7 +652,7 @@ class CLASS_fixedincome(Container): OBBject results : List[USYieldCurve] Serializable results. - provider : Optional[Literal['fred']] + provider : Union[Literal['fred'], NoneType] Provider name. warnings : Optional[List[Warning_]] List of warnings. diff --git a/openbb_sdk/openbb/package/forex.py b/openbb_sdk/openbb/package/forex.py index 06050e6f06d..aaf80df5186 100644 --- a/openbb_sdk/openbb/package/forex.py +++ b/openbb_sdk/openbb/package/forex.py @@ -1,14 +1,14 @@ ### THIS FILE IS AUTO-GENERATED. DO NOT EDIT. ### import datetime -from typing import List, Literal, Optional, Union +from typing import List, Literal, Union +import typing_extensions from openbb_core.app.model.custom_parameter import OpenBBCustomParameter from openbb_core.app.model.obbject import OBBject from openbb_core.app.static.container import Container from openbb_core.app.static.filters import filter_inputs from pydantic import validate_arguments -from typing_extensions import Annotated class CLASS_forex(Container): @@ -23,26 +23,26 @@ class CLASS_forex(Container): @validate_arguments def load( self, - symbol: Annotated[ + symbol: typing_extensions.Annotated[ Union[str, List[str]], OpenBBCustomParameter(description="Symbol to get data for."), ], - start_date: Annotated[ + start_date: typing_extensions.Annotated[ Union[datetime.date, None, str], OpenBBCustomParameter( description="Start date of the data, in YYYY-MM-DD format." ), ] = None, - end_date: Annotated[ + end_date: typing_extensions.Annotated[ Union[datetime.date, None, str], OpenBBCustomParameter( description="End date of the data, in YYYY-MM-DD format." ), ] = None, - provider: Optional[Literal["fmp", "polygon", "yfinance"]] = None, + provider: Union[Literal["fmp", "polygon", "yfinance"], None] = None, **kwargs ) -> OBBject[List]: - r"""Forex Intraday Price. + """Forex Intraday Price. Parameters ---------- @@ -52,7 +52,7 @@ class CLASS_forex(Container): Start date of the data, in YYYY-MM-DD format. end_date : Union[datetime.date, NoneType, str] End date of the data, in YYYY-MM-DD format. - provider : Optional[Literal['fmp', 'polygon', 'yfinance']] + provider : Union[Literal['fmp', 'polygon', 'yfinance'], NoneType] The provider to use for the query, by default None. If None, the provider specified in defaults is selected or 'fmp' if there is no default. @@ -66,9 +66,9 @@ class CLASS_forex(Container): Whether the data is adjusted. (provider: polygon) multiplier : PositiveInt Multiplier of the timespan. (provider: polygon) - interval : Optional[Literal['1m', '2m', '5m', '15m', '30m', '60m', '90m', '1h', '1d', '5d', '1wk', '1mo', '3mo']] + interval : Union[Literal['1m', '2m', '5m', '15m', '30m', '60m', '90m', '1h', '1d', '5d', '1wk', '1mo', '3mo'], NoneType] Data granularity. (provider: yfinance) - period : Optional[Literal['1d', '5d', '1mo', '3mo', '6mo', '1y', '2y', '5y', '10y', 'ytd', 'max']] + period : Union[Literal['1d', '5d', '1mo', '3mo', '6mo', '1y', '2y', '5y', '10y', 'ytd', 'max'], NoneType] Period of the data to return. (provider: yfinance) prepost : bool Include Pre and Post market data. (provider: yfinance) @@ -82,7 +82,7 @@ class CLASS_forex(Container): OBBject results : List[ForexHistorical] Serializable results. - provider : Optional[Literal['fmp', 'polygon', 'yfinance']] + provider : Union[Literal['fmp', 'polygon', 'yfinance'], NoneType] Provider name. warnings : Optional[List[Warning_]] List of warnings. @@ -114,11 +114,11 @@ class CLASS_forex(Container): change : Optional[float] Change in the price of the symbol from the previous day. (provider: fmp) change_percent : Optional[float] - Change \% in the price of the symbol. (provider: fmp) + Change \\% in the price of the symbol. (provider: fmp) label : Optional[str] Human readable format of the date. (provider: fmp) change_over_time : Optional[float] - Change \% in the price of the symbol over a period of time. (provider: fmp) + Change \\% in the price of the symbol over a period of time. (provider: fmp) n : Optional[PositiveInt] Number of transactions for the symbol in the time period. (provider: polygon) """ # noqa: E501 @@ -142,29 +142,31 @@ class CLASS_forex(Container): @validate_arguments def pairs( - self, provider: Optional[Literal["fmp", "polygon"]] = None, **kwargs + self, + provider: Union[Literal["fmp", "intrinio", "polygon"], None] = None, + **kwargs ) -> OBBject[List]: """Forex Available Pairs. Parameters ---------- - provider : Optional[Literal['fmp', 'polygon']] + provider : Union[Literal['fmp', 'intrinio', 'polygon'], NoneType] The provider to use for the query, by default None. If None, the provider specified in defaults is selected or 'fmp' if there is no default. - symbol : Optional[str] + symbol : Union[str, NoneType] Symbol of the pair to search. (provider: polygon) - date : Optional[datetime.date] + date : Union[datetime.date, NoneType] A specific date to get data for. (provider: polygon) - search : Optional[str] + search : Union[str, NoneType] Search for terms within the ticker and/or company name. (provider: polygon) - active : Optional[Literal[True, False]] + active : Union[Literal[True, False], NoneType] Specify if the tickers returned should be actively traded on the queried date. (provider: polygon) - order : Optional[Literal['asc', 'desc']] + order : Union[Literal['asc', 'desc'], NoneType] Order data by ascending or descending. (provider: polygon) - sort : Optional[Literal['ticker', 'name', 'market', 'locale', 'currency_symbol', 'currency_name', 'base_currency_symbol', 'base_currency_name', 'last_updated_utc', 'delisted_utc']] + sort : Union[Literal['ticker', 'name', 'market', 'locale', 'currency_symbol', 'currency_name', 'base_currency_symbol', 'base_currency_name', 'last_updated_utc', 'delisted_utc'], NoneType] Sort field used for ordering. (provider: polygon) - limit : Optional[pydantic.types.PositiveInt] + limit : Union[pydantic.types.PositiveInt, NoneType] The number of data entries to return. (provider: polygon) Returns @@ -172,7 +174,7 @@ class CLASS_forex(Container): OBBject results : List[ForexPairs] Serializable results. - provider : Optional[Literal['fmp', 'polygon']] + provider : Union[Literal['fmp', 'intrinio', 'polygon'], NoneType] Provider name. warnings : Optional[List[Warning_]] List of warnings. @@ -193,6 +195,12 @@ class CLASS_forex(Container): Stock exchange of the currency pair. (provider: fmp) exchange_short_name : Optional[str] Short name of the stock exchange of the currency pair. (provider: fmp) + code : Optional[str] + Code of the currency pair. (provider: intrinio) + base_currency : Optional[str] + ISO 4217 currency code of the base currency. (provider: intrinio) + quote_currency : Optional[str] + ISO 4217 currency code of the quote currency. (provider: intrinio) market : Optional[str] The name of the trading market. Always 'fx'. (provider: polygon) locale : Optional[str] diff --git a/openbb_sdk/openbb/package/futures.py b/openbb_sdk/openbb/package/futures.py index b5ffdb711e7..3993a774d40 100644 --- a/openbb_sdk/openbb/package/futures.py +++ b/openbb_sdk/openbb/package/futures.py @@ -1,14 +1,14 @@ ### THIS FILE IS AUTO-GENERATED. DO NOT EDIT. ### import datetime -from typing import List, Literal, Optional, Union +from typing import List, Literal, Union +import typing_extensions from openbb_core.app.model.custom_parameter import OpenBBCustomParameter from openbb_core.app.model.obbject import OBBject from openbb_core.app.static.container import Container from openbb_core.app.static.filters import filter_inputs from pydantic import validate_arguments -from typing_extensions import Annotated class CLASS_futures(Container): @@ -23,15 +23,15 @@ class CLASS_futures(Container): @validate_arguments def curve( self, - symbol: Annotated[ + symbol: typing_extensions.Annotated[ Union[str, List[str]], OpenBBCustomParameter(description="Symbol to get data for."), ], - date: Annotated[ - Optional[datetime.date], + date: typing_extensions.Annotated[ + Union[datetime.date, None], OpenBBCustomParameter(description="Historical date to search curve for."), ] = None, - provider: Optional[Literal["cboe", "yfinance"]] = None, + provider: Union[Literal["cboe", "yfinance"], None] = None, **kwargs ) -> OBBject[List]: """Futures Historical Price. @@ -40,9 +40,9 @@ class CLASS_futures(Container): ---------- symbol : Union[str, List[str]] Symbol to get data for. - date : Optional[datetime.date] + date : Union[datetime.date, NoneType] Historical date to search curve for. - provider : Optional[Literal['cboe', 'yfinance']] + provider : Union[Literal['cboe', 'yfinance'], NoneType] The provider to use for the query, by default None. If None, the provider specified in defaults is selected or 'cboe' if there is no default. @@ -52,7 +52,7 @@ class CLASS_futures(Container): OBBject results : List[FuturesCurve] Serializable results. - provider : Optional[Literal['cboe', 'yfinance']] + provider : Union[Literal['cboe', 'yfinance'], NoneType] Provider name. warnings : Optional[List[Warning_]] List of warnings. @@ -89,27 +89,27 @@ class CLASS_futures(Container): @validate_arguments def load( self, - symbol: Annotated[ + symbol: typing_extensions.Annotated[ Union[str, List[str]], OpenBBCustomParameter(description="Symbol to get data for."), ], - start_date: Annotated[ + start_date: typing_extensions.Annotated[ Union[datetime.date, None, str], OpenBBCustomParameter( description="Start date of the data, in YYYY-MM-DD format." ), ] = None, - end_date: Annotated[ + end_date: typing_extensions.Annotated[ Union[datetime.date, None, str], OpenBBCustomParameter( description="End date of the data, in YYYY-MM-DD format." ), ] = None, - expiration: Annotated[ - Optional[str], + expiration: typing_extensions.Annotated[ + Union[str, None], OpenBBCustomParameter(description="Future expiry date with format YYYY-MM"), ] = None, - provider: Optional[Literal["yfinance"]] = None, + provider: Union[Literal["yfinance"], None] = None, **kwargs ) -> OBBject[List]: """Futures Historical Price. @@ -122,15 +122,15 @@ class CLASS_futures(Container): Start date of the data, in YYYY-MM-DD format. end_date : Union[datetime.date, NoneType, str] End date of the data, in YYYY-MM-DD format. - expiration : Optional[str] + expiration : Union[str, NoneType] Future expiry date with format YYYY-MM - provider : Optional[Literal['yfinance']] + provider : Union[Literal['yfinance'], NoneType] The provider to use for the query, by default None. If None, the provider specified in defaults is selected or 'yfinance' if there is no default. - interval : Optional[Literal['1m', '2m', '5m', '15m', '30m', '60m', '90m', '1h', '1d', '5d', '1wk', '1mo', '3mo']] + interval : Union[Literal['1m', '2m', '5m', '15m', '30m', '60m', '90m', '1h', '1d', '5d', '1wk', '1mo', '3mo'], NoneType] Data granularity. (provider: yfinance) - period : Optional[Literal['1d', '5d', '1mo', '3mo', '6mo', '1y', '2y', '5y', '10y', 'ytd', 'max']] + period : Union[Literal['1d', '5d', '1mo', '3mo', '6mo', '1y', '2y', '5y', '10y', 'ytd', 'max'], NoneType] Period of the data to return. (provider: yfinance) prepost : bool Include Pre and Post market data. (provider: yfinance) @@ -144,7 +144,7 @@ class CLASS_futures(Container): OBBject results : List[FuturesHistorical] Serializable results. - provider : Optional[Literal['yfinance']] + provider : Union[Literal['yfinance'], NoneType] Provider name. warnings : Optional[List[Warning_]] List of warnings. diff --git a/openbb_sdk/openbb/package/module_map.json b/openbb_sdk/openbb/package/module_map.json index a75cc7694c9..c407a2f8167 100644 --- a/openbb_sdk/openbb/package/module_map.json +++ b/openbb_sdk/openbb/package/module_map.json @@ -2,6 +2,21 @@ "__extensions__": "", "crypto": "/crypto", "crypto_load": "/crypto/load", + "econometrics": "/econometrics", + "econometrics_bgot": "/econometrics/bgot", + "econometrics_coint": "/econometrics/coint", + "econometrics_corr": "/econometrics/corr", + "econometrics_dwat": "/econometrics/dwat", + "econometrics_granger": "/econometrics/granger", + "econometrics_ols": "/econometrics/ols", + "econometrics_ols_summary": "/econometrics/ols_summary", + "econometrics_panelbols": "/econometrics/panelbols", + "econometrics_panelfd": "/econometrics/panelfd", + "econometrics_panelfmac": "/econometrics/panelfmac", + "econometrics_panelols": "/econometrics/panelols", + "econometrics_panelpols": "/econometrics/panelpols", + "econometrics_panelre": "/econometrics/panelre", + "econometrics_unitroot": "/econometrics/unitroot", "economy": "/economy", "economy_available_indices": "/economy/available_indices", "economy_const": "/economy/const", diff --git a/openbb_sdk/openbb/package/news.py b/openbb_sdk/openbb/package/news.py index 9567a3d6a2f..ca86b4f4bae 100644 --- a/openbb_sdk/openbb/package/news.py +++ b/openbb_sdk/openbb/package/news.py @@ -1,14 +1,14 @@ ### THIS FILE IS AUTO-GENERATED. DO NOT EDIT. ### -from typing import List, Literal, Optional +from typing import List, Literal, Union import pydantic +import typing_extensions from openbb_core.app.model.custom_parameter import OpenBBCustomParameter from openbb_core.app.model.obbject import OBBject from openbb_core.app.static.container import Container from openbb_core.app.static.filters import filter_inputs from pydantic import validate_arguments -from typing_extensions import Annotated class CLASS_news(Container): @@ -22,11 +22,11 @@ class CLASS_news(Container): @validate_arguments def globalnews( self, - page: Annotated[ + page: typing_extensions.Annotated[ pydantic.types.NonNegativeInt, OpenBBCustomParameter(description="Page of the global news."), ] = 0, - provider: Optional[Literal["benzinga", "fmp"]] = None, + provider: Union[Literal["benzinga", "fmp", "intrinio"], None] = None, **kwargs ) -> OBBject[List]: """Global News. @@ -35,7 +35,7 @@ class CLASS_news(Container): ---------- page : NonNegativeInt Page of the global news. - provider : Optional[Literal['benzinga', 'fmp']] + provider : Union[Literal['benzinga', 'fmp', 'intrinio'], NoneType] The provider to use for the query, by default None. If None, the provider specified in defaults is selected or 'benzinga' if there is no default. @@ -43,39 +43,45 @@ class CLASS_news(Container): Number of results to return per page. (provider: benzinga) display_output : Literal['headline', 'summary', 'full', 'all'] Type of data to return. (provider: benzinga) - date : Optional[datetime.datetime] + date : Union[datetime.datetime, NoneType] Date of the news to retrieve. (provider: benzinga) - date_from : Optional[datetime.datetime] + date_from : Union[datetime.datetime, NoneType] Start date of the news to retrieve. (provider: benzinga) - date_to : Optional[datetime.datetime] + date_to : Union[datetime.datetime, NoneType] End date of the news to retrieve. (provider: benzinga) - updated_since : Optional[int] + updated_since : Union[int, NoneType] Number of seconds since the news was updated. (provider: benzinga) - published_since : Optional[int] + published_since : Union[int, NoneType] Number of seconds since the news was published. (provider: benzinga) - sort : Optional[Literal['published_at', 'updated_at', 'title', 'author', 'channel', 'ticker', 'topic', 'content_type']] + sort : Union[Literal['published_at', 'updated_at', 'title', 'author', 'channel', 'ticker', 'topic', 'content_type'], NoneType] Order in which to sort the news. (provider: benzinga) - isin : Optional[str] + isin : Union[str, NoneType] The ISIN of the news to retrieve. (provider: benzinga) - cusip : Optional[str] + cusip : Union[str, NoneType] The CUSIP of the news to retrieve. (provider: benzinga) - tickers : Optional[str] + tickers : Union[str, NoneType] Tickers of the news to retrieve. (provider: benzinga) - channels : Optional[str] + channels : Union[str, NoneType] Channels of the news to retrieve. (provider: benzinga) - topics : Optional[str] + topics : Union[str, NoneType] Topics of the news to retrieve. (provider: benzinga) - authors : Optional[str] + authors : Union[str, NoneType] Authors of the news to retrieve. (provider: benzinga) - content_types : Optional[str] + content_types : Union[str, NoneType] Content types of the news to retrieve. (provider: benzinga) + next_page : str + Token to get the next page of data from a previous API call. (provider: intrinio) + limit : Union[int, NoneType] + The number of data entries to return. (provider: intrinio) + all_pages : Union[bool, NoneType] + Returns all pages of data from the API call at once. (provider: intrinio) Returns ------- OBBject results : List[GlobalNews] Serializable results. - provider : Optional[Literal['benzinga', 'fmp']] + provider : Union[Literal['benzinga', 'fmp', 'intrinio'], NoneType] Provider name. warnings : Optional[List[Warning_]] List of warnings. @@ -105,7 +111,11 @@ class CLASS_news(Container): teaser : Optional[str] Teaser of the news. (provider: benzinga) site : Optional[str] - Site of the news. (provider: fmp)""" # noqa: E501 + Site of the news. (provider: fmp) + id : Optional[str] + Article ID. (provider: intrinio) + company : Optional[Mapping[str, Any]] + Company details related to the news article. (provider: intrinio)""" # noqa: E501 inputs = filter_inputs( provider_choices={ diff --git a/openbb_sdk/openbb/package/qa.py b/openbb_sdk/openbb/package/qa.py index 93b458a101a..108f406bfe5 100644 --- a/openbb_sdk/openbb/package/qa.py +++ b/openbb_sdk/openbb/package/qa.py @@ -337,7 +337,7 @@ class CLASS_qa(Container): self, data: Union[List[openbb_provider.abstract.data.Data], pandas.DataFrame], target: str, - fuller_reg: Literal["c", "ct", "ctt", "nc"] = "c", + fuller_reg: Literal["c", "ct", "ctt", "nc", "c"] = "c", kpss_reg: Literal["c", "ct"] = "c", ) -> OBBject[openbb_qa.qa_models.UnitRootModel]: """Unit Root Test. diff --git a/openbb_sdk/openbb/package/stocks.py b/openbb_sdk/openbb/package/stocks.py index bca1afff86c..49e3d986071 100644 --- a/openbb_sdk/openbb/package/stocks.py +++ b/openbb_sdk/openbb/package/stocks.py @@ -1,15 +1,16 @@ ### THIS FILE IS AUTO-GENERATED. DO NOT EDIT. ### import datetime -from typing import List, Literal, Optional, Union +from typing import List, Literal, Union import pydantic +import pydantic.main +import typing_extensions from openbb_core.app.model.custom_parameter import OpenBBCustomParameter from openbb_core.app.model.obbject import OBBject from openbb_core.app.static.container import Container from openbb_core.app.static.filters import filter_inputs -from pydantic import validate_arguments -from typing_extensions import Annotated +from pydantic import BaseModel, validate_arguments class CLASS_stocks(Container): @@ -50,11 +51,11 @@ class CLASS_stocks(Container): @validate_arguments def info( self, - symbol: Annotated[ + symbol: typing_extensions.Annotated[ Union[str, List[str]], OpenBBCustomParameter(description="Symbol to get data for."), ], - provider: Optional[Literal["cboe"]] = None, + provider: Union[Literal["cboe"], None] = None, **kwargs ) -> OBBject[List]: """Get general price and performance metrics of a stock. @@ -63,7 +64,7 @@ class CLASS_stocks(Container): ---------- symbol : Union[str, List[str]] Symbol to get data for. - provider : Optional[Literal['cboe']] + provider : Union[Literal['cboe'], NoneType] The provider to use for the query, by default None. If None, the provider specified in defaults is selected or 'cboe' if there is no default. @@ -73,7 +74,7 @@ class CLASS_stocks(Container): OBBject results : List[StockInfo] Serializable results. - provider : Optional[Literal['cboe']] + provider : Union[Literal['cboe'], NoneType] Provider name. warnings : Optional[List[Warning_]] List of warnings. @@ -165,27 +166,30 @@ class CLASS_stocks(Container): @validate_arguments def load( self, - symbol: Annotated[ + symbol: typing_extensions.Annotated[ Union[str, List[str]], OpenBBCustomParameter(description="Symbol to get data for."), ], - start_date: Annotated[ + start_date: typing_extensions.Annotated[ Union[datetime.date, None, str], OpenBBCustomParameter( description="Start date of the data, in YYYY-MM-DD format." ), ] = None, - end_date: Annotated[ + end_date: typing_extensions.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["cboe", "fmp", "polygon", "yfinance"]] = None, + provider: Union[ + Literal["alpha_vantage", "cboe", "fmp", "intrinio", "polygon", "yfinance"], + None, + ] = None, **kwargs ) -> OBBject[List]: - r"""Load stock data for a specific ticker. + """Load stock data for a specific ticker. Parameters ---------- @@ -197,26 +201,46 @@ class CLASS_stocks(Container): End date of the data, in YYYY-MM-DD format. chart : bool Whether to create a chart or not, by default False. - provider : Optional[Literal['cboe', 'fmp', 'polygon', 'yfinance']] + provider : Union[Literal['alpha_vantage', 'cboe', 'fmp', 'intrinio', 'polygon', 'yfinance'], NoneType] The provider to use for the query, by default None. - If None, the provider specified in defaults is selected or 'cboe' if there is + If None, the provider specified in defaults is selected or 'alpha_vantage' if there is no default. - interval : Union[Literal['1d', '1m'], NoneType, Literal['1min', '5min', '15min', '30min', '1hour', '4hour', '1day'], Literal['1m', '2m', '5m', '15m', '30m', '60m', '90m', '1h', '1d', '5d', '1wk', '1mo', '3mo']] - Data granularity. (provider: cboe, fmp, yfinance) - timeseries : Optional[pydantic.types.NonNegativeInt] + period : Union[Literal['intraday', 'daily', 'weekly', 'monthly'], Literal['1d', '5d', '1mo', '3mo', '6mo', '1y', '2y', '5y', '10y', 'ytd', 'max'], NoneType] + Period of the data to return. (provider: alpha_vantage, yfinance) + interval : Union[Literal['1min', '5min', '15min', '30min', '60min'], NoneType, Literal['1d', '1m'], Literal['1min', '5min', '15min', '30min', '1hour', '4hour', '1day'], Literal['1m', '2m', '5m', '15m', '30m', '60m', '90m', '1h', '1d', '5d', '1wk', '1mo', '3mo']] + Data granularity. (provider: alpha_vantage, cboe, fmp, yfinance) + adjusted : Union[bool, NoneType] + Output time series is adjusted by historical split and dividend events. (provider: alpha_vantage, polygon) + extended_hours : Union[bool, NoneType] + Extended trading hours during pre-market and after-hours. (provider: alpha_vantage) + month : Union[str, NoneType] + Query a specific month in history (in YYYY-MM format). (provider: alpha_vantage) + outputsize : Union[Literal['compact', 'full'], NoneType] + Compact returns only the latest 100 data points in the intraday time series; full returns trailing 30 days of the most recent intraday data if the month parameter (see above) is not specified, or the full intraday data for a specific month in history if the month parameter is specified. (provider: alpha_vantage) + timeseries : Union[pydantic.types.NonNegativeInt, NoneType] Number of days to look back. (provider: fmp) + timezone : Union[Literal['Africa/Algiers', 'Africa/Cairo', 'Africa/Casablanca', 'Africa/Harare', 'Africa/Johannesburg', 'Africa/Monrovia', 'Africa/Nairobi', 'America/Argentina/Buenos_Aires', 'America/Bogota', 'America/Caracas', 'America/Chicago', 'America/Chihuahua', 'America/Denver', 'America/Godthab', 'America/Guatemala', 'America/Guyana', 'America/Halifax', 'America/Indiana/Indianapolis', 'America/Juneau', 'America/La_Paz', 'America/Lima', 'America/Lima', 'America/Los_Angeles', 'America/Mazatlan', 'America/Mexico_City', 'America/Mexico_City', 'America/Monterrey', 'America/Montevideo', 'America/New_York', 'America/Phoenix', 'America/Regina', 'America/Santiago', 'America/Sao_Paulo', 'America/St_Johns', 'America/Tijuana', 'Asia/Almaty', 'Asia/Baghdad', 'Asia/Baku', 'Asia/Bangkok', 'Asia/Bangkok', 'Asia/Chongqing', 'Asia/Colombo', 'Asia/Dhaka', 'Asia/Dhaka', 'Asia/Hong_Kong', 'Asia/Irkutsk', 'Asia/Jakarta', 'Asia/Jerusalem', 'Asia/Kabul', 'Asia/Kamchatka', 'Asia/Karachi', 'Asia/Karachi', 'Asia/Kathmandu', 'Asia/Kolkata', 'Asia/Kolkata', 'Asia/Kolkata', 'Asia/Kolkata', 'Asia/Krasnoyarsk', 'Asia/Kuala_Lumpur', 'Asia/Kuwait', 'Asia/Magadan', 'Asia/Muscat', 'Asia/Muscat', 'Asia/Novosibirsk', 'Asia/Rangoon', 'Asia/Riyadh', 'Asia/Seoul', 'Asia/Shanghai', 'Asia/Singapore', 'Asia/Srednekolymsk', 'Asia/Taipei', 'Asia/Tashkent', 'Asia/Tbilisi', 'Asia/Tehran', 'Asia/Tokyo', 'Asia/Tokyo', 'Asia/Tokyo', 'Asia/Ulaanbaatar', 'Asia/Urumqi', 'Asia/Vladivostok', 'Asia/Yakutsk', 'Asia/Yekaterinburg', 'Asia/Yerevan', 'Atlantic/Azores', 'Atlantic/Cape_Verde', 'Atlantic/South_Georgia', 'Australia/Adelaide', 'Australia/Brisbane', 'Australia/Darwin', 'Australia/Hobart', 'Australia/Melbourne', 'Australia/Melbourne', 'Australia/Perth', 'Australia/Sydney', 'Etc/UTC', 'UTC', 'Europe/Amsterdam', 'Europe/Athens', 'Europe/Belgrade', 'Europe/Berlin', 'Europe/Berlin', 'Europe/Bratislava', 'Europe/Brussels', 'Europe/Bucharest', 'Europe/Budapest', 'Europe/Copenhagen', 'Europe/Dublin', 'Europe/Helsinki', 'Europe/Istanbul', 'Europe/Kaliningrad', 'Europe/Kiev', 'Europe/Lisbon', 'Europe/Ljubljana', 'Europe/London', 'Europe/London', 'Europe/Madrid', 'Europe/Minsk', 'Europe/Moscow', 'Europe/Moscow', 'Europe/Paris', 'Europe/Prague', 'Europe/Riga', 'Europe/Rome', 'Europe/Samara', 'Europe/Sarajevo', 'Europe/Skopje', 'Europe/Sofia', 'Europe/Stockholm', 'Europe/Tallinn', 'Europe/Vienna', 'Europe/Vilnius', 'Europe/Volgograd', 'Europe/Warsaw', 'Europe/Zagreb', 'Pacific/Apia', 'Pacific/Auckland', 'Pacific/Auckland', 'Pacific/Chatham', 'Pacific/Fakaofo', 'Pacific/Fiji', 'Pacific/Guadalcanal', 'Pacific/Guam', 'Pacific/Honolulu', 'Pacific/Majuro', 'Pacific/Midway', 'Pacific/Midway', 'Pacific/Noumea', 'Pacific/Pago_Pago', 'Pacific/Port_Moresby', 'Pacific/Tongatapu'], NoneType] + Returns trading times in this timezone. (provider: intrinio) + source : Union[Literal['realtime', 'delayed', 'nasdaq_basic'], NoneType] + The source of the data. (provider: intrinio) + start_time : Union[datetime.time, NoneType] + Return intervals starting at the specified time on the `start_date` formatted as 'hh:mm:ss'. (provider: intrinio) + end_time : Union[datetime.time, NoneType] + Return intervals stopping at the specified time on the `end_date` formatted as 'hh:mm:ss'. (provider: intrinio) + interval_size : Union[Literal['1m', '5m', '10m', '15m', '30m', '60m', '1h'], NoneType] + The data time frequency. (provider: intrinio) + limit : Union[pydantic.types.NonNegativeInt, NoneType, pydantic.types.PositiveInt] + The number of data entries to return. (provider: intrinio, polygon) + next_page : Union[str, NoneType] + Token to get the next page of data from a previous API call. (provider: intrinio) + all_pages : Union[bool, NoneType] + Returns all pages of data from the API call at once. (provider: intrinio) timespan : Literal['minute', 'hour', 'day', 'week', 'month', 'quarter', 'year'] Timespan of the data. (provider: polygon) sort : Literal['asc', 'desc'] Sort order of the data. (provider: polygon) - limit : PositiveInt - The number of data entries to return. (provider: polygon) - adjusted : bool - Output time series is adjusted by historical split and dividend events. (provider: polygon) multiplier : PositiveInt Multiplier of the timespan. (provider: polygon) - period : Optional[Literal['1d', '5d', '1mo', '3mo', '6mo', '1y', '2y', '5y', '10y', 'ytd', 'max']] - Period of the data to return. (provider: yfinance) prepost : bool Include Pre and Post market data. (provider: yfinance) adjust : bool @@ -229,7 +253,7 @@ class CLASS_stocks(Container): OBBject results : List[StockHistorical] Serializable results. - provider : Optional[Literal['cboe', 'fmp', 'polygon', 'yfinance']] + provider : Union[Literal['alpha_vantage', 'cboe', 'fmp', 'intrinio', 'polygon', 'yfinance'], NoneType] Provider name. warnings : Optional[List[Warning_]] List of warnings. @@ -254,6 +278,12 @@ class CLASS_stocks(Container): The volume of the symbol. vwap : Optional[PositiveFloat] Volume Weighted Average Price of the symbol. + adjusted_close : Optional[PositiveFloat] + The adjusted close price of the symbol. (provider: alpha_vantage) + dividend_amount : Optional[NonNegativeFloat] + Dividend amount paid for the corresponding date. (provider: alpha_vantage) + split_coefficient : Optional[NonNegativeFloat] + Split coefficient for the corresponding date. (provider: alpha_vantage) calls_volume : Optional[float] Number of calls traded during the most recent trading period. Only valid if interval is 1m. (provider: cboe) puts_volume : Optional[float] @@ -265,13 +295,19 @@ class CLASS_stocks(Container): unadjusted_volume : Optional[float] Unadjusted volume of the symbol. (provider: fmp) change : Optional[float] - Change in the price of the symbol from the previous day. (provider: fmp) + Change in the price of the symbol from the previous day. (provider: fmp, intrinio) change_percent : Optional[float] - Change \% in the price of the symbol. (provider: fmp) + Change \\% in the price of the symbol. (provider: fmp) label : Optional[str] Human readable format of the date. (provider: fmp) change_over_time : Optional[float] - Change \% in the price of the symbol over a period of time. (provider: fmp) + Change \\% in the price of the symbol over a period of time. (provider: fmp) + close_time : Optional[datetime] + The timestamp that represents the end of the interval span. (provider: intrinio) + interval : Optional[str] + The data time frequency. (provider: intrinio) + average : Optional[float] + Average trade price of an individual stock during the interval. (provider: intrinio) transactions : Optional[PositiveInt] Number of transactions for the symbol in the time period. (provider: polygon) """ # noqa: E501 @@ -297,16 +333,16 @@ class CLASS_stocks(Container): @validate_arguments def multiples( self, - symbol: Annotated[ + symbol: typing_extensions.Annotated[ Union[str, List[str]], OpenBBCustomParameter(description="Symbol to get data for."), ], - limit: Annotated[ - Optional[int], + limit: typing_extensions.Annotated[ + Union[int, None], OpenBBCustomParameter(description="The number of data entries to return."), ] = 100, chart: bool = False, - provider: Optional[Literal["fmp"]] = None, + provider: Union[Literal["fmp"], None] = None, **kwargs ) -> OBBject[List]: """Get valuation multiples for a stock ticker. @@ -315,11 +351,11 @@ class CLASS_stocks(Container): ---------- symbol : Union[str, List[str]] Symbol to get data for. - limit : Optional[int] + limit : Union[int, NoneType] The number of data entries to return. chart : bool Whether to create a chart or not, by default False. - provider : Optional[Literal['fmp']] + provider : Union[Literal['fmp'], NoneType] The provider to use for the query, by default None. If None, the provider specified in defaults is selected or 'fmp' if there is no default. @@ -329,7 +365,7 @@ class CLASS_stocks(Container): OBBject results : List[StockMultiples] Serializable results. - provider : Optional[Literal['fmp']] + provider : Union[Literal['fmp'], NoneType] Provider name. warnings : Optional[List[Warning_]] List of warnings. @@ -481,21 +517,23 @@ class CLASS_stocks(Container): @validate_arguments def news( self, - symbols: Annotated[ + symbols: typing_extensions.Annotated[ str, OpenBBCustomParameter(description="Symbol to get data for.") ], - page: Annotated[ + page: typing_extensions.Annotated[ int, OpenBBCustomParameter( description="Page of the stock news to be retrieved." ), ] = 0, - limit: Annotated[ - Optional[pydantic.types.NonNegativeInt], + limit: typing_extensions.Annotated[ + Union[pydantic.types.NonNegativeInt, None], OpenBBCustomParameter(description="Number of results to return per page."), ] = 15, chart: bool = False, - provider: Optional[Literal["benzinga", "fmp", "polygon", "yfinance"]] = None, + provider: Union[ + Literal["benzinga", "fmp", "intrinio", "polygon", "yfinance"], None + ] = None, **kwargs ) -> OBBject[List]: """Get news for one or more stock tickers. @@ -506,59 +544,63 @@ class CLASS_stocks(Container): Symbol to get data for. page : int Page of the stock news to be retrieved. - limit : Optional[pydantic.types.NonNegativeInt] + limit : Union[pydantic.types.NonNegativeInt, NoneType] Number of results to return per page. chart : bool Whether to create a chart or not, by default False. - provider : Optional[Literal['benzinga', 'fmp', 'polygon', 'yfinance']] + provider : Union[Literal['benzinga', 'fmp', 'intrinio', 'polygon', 'yfinance'], NoneType] The provider to use for the query, by default None. If None, the provider specified in defaults is selected or 'benzinga' if there is no default. display_output : Literal['headline', 'summary', 'full', 'all'] Type of data to return. (provider: benzinga) - date : Optional[datetime.datetime] + date : Union[datetime.datetime, NoneType] Date of the news to retrieve. (provider: benzinga) - date_from : Optional[datetime.datetime] + date_from : Union[datetime.datetime, NoneType] Start date of the news to retrieve. (provider: benzinga) - date_to : Optional[datetime.datetime] + date_to : Union[datetime.datetime, NoneType] End date of the news to retrieve. (provider: benzinga) - updated_since : Optional[int] + updated_since : Union[int, NoneType] Number of seconds since the news was updated. (provider: benzinga) - published_since : Optional[int] + published_since : Union[int, NoneType] Number of seconds since the news was published. (provider: benzinga) sort : Union[Literal['published_at', 'updated_at', 'title', 'author', 'channel', 'ticker', 'topic', 'content_type'], NoneType, str] Order in which to sort the news. (provider: benzinga, polygon) - isin : Optional[str] + isin : Union[str, NoneType] The ISIN of the news to retrieve. (provider: benzinga) - cusip : Optional[str] + cusip : Union[str, NoneType] The CUSIP of the news to retrieve. (provider: benzinga) - channels : Optional[str] + channels : Union[str, NoneType] Channels of the news to retrieve. (provider: benzinga) - topics : Optional[str] + topics : Union[str, NoneType] Topics of the news to retrieve. (provider: benzinga) - authors : Optional[str] + authors : Union[str, NoneType] Authors of the news to retrieve. (provider: benzinga) - content_types : Optional[str] + content_types : Union[str, NoneType] Content types of the news to retrieve. (provider: benzinga) - ticker_lt : Optional[str] + next_page : Union[str, NoneType] + Token to get the next page of data from a previous API call. (provider: intrinio) + all_pages : Union[bool, NoneType] + Returns all pages of data from the API call at once. (provider: intrinio) + ticker_lt : Union[str, NoneType] Less than. (provider: polygon) - ticker_lte : Optional[str] + ticker_lte : Union[str, NoneType] Less than or equal. (provider: polygon) - ticker_gt : Optional[str] + ticker_gt : Union[str, NoneType] Greater than. (provider: polygon) - ticker_gte : Optional[str] + ticker_gte : Union[str, NoneType] Greater than or equal. (provider: polygon) - published_utc : Optional[str] + published_utc : Union[str, NoneType] Published date of the query. (provider: polygon) - published_utc_lt : Optional[str] + published_utc_lt : Union[str, NoneType] Less than. (provider: polygon) - published_utc_lte : Optional[str] + published_utc_lte : Union[str, NoneType] Less than or equal. (provider: polygon) - published_utc_gt : Optional[str] + published_utc_gt : Union[str, NoneType] Greater than. (provider: polygon) - published_utc_gte : Optional[str] + published_utc_gte : Union[str, NoneType] Greater than or equal. (provider: polygon) - order : Optional[Literal['asc', 'desc']] + order : Union[Literal['asc', 'desc'], NoneType] Sort order of the query. (provider: polygon) Returns @@ -566,7 +608,7 @@ class CLASS_stocks(Container): OBBject results : List[StockNews] Serializable results. - provider : Optional[Literal['benzinga', 'fmp', 'polygon', 'yfinance']] + provider : Union[Literal['benzinga', 'fmp', 'intrinio', 'polygon', 'yfinance'], NoneType] Provider name. warnings : Optional[List[Warning_]] List of warnings. @@ -601,12 +643,12 @@ class CLASS_stocks(Container): URL to the image of the news source. (provider: fmp) site : Optional[str] Name of the news source. (provider: fmp) + id : Optional[str] + Article ID. (provider: intrinio, polygon) amp_url : Optional[str] AMP URL. (provider: polygon) author : Optional[str] Author of the article. (provider: polygon) - id : Optional[str] - Article ID. (provider: polygon) image_url : Optional[str] Image URL. (provider: polygon) keywords : Optional[List[str]] @@ -651,30 +693,32 @@ class CLASS_stocks(Container): @validate_arguments def quote( self, - symbol: Annotated[ + symbol: typing_extensions.Annotated[ Union[str, List[str]], OpenBBCustomParameter(description="Symbol to get data for."), ], - provider: Optional[Literal["fmp"]] = None, + provider: Union[Literal["fmp", "intrinio"], None] = None, **kwargs - ) -> OBBject[List]: + ) -> OBBject[BaseModel]: """Load stock data for a specific ticker. Parameters ---------- symbol : Union[str, List[str]] Symbol to get data for. - provider : Optional[Literal['fmp']] + provider : Union[Literal['fmp', 'intrinio'], NoneType] The provider to use for the query, by default None. If None, the provider specified in defaults is selected or 'fmp' if there is no default. + source : Literal['iex', 'bats', 'bats_delayed', 'utp_delayed', 'cta_a_delayed', 'cta_b_delayed', 'intrinio_mx', 'intrinio_mx_plus', 'delayed_sip'] + Source of the data. (provider: intrinio) Returns ------- OBBject results : List[StockQuote] Serializable results. - provider : Optional[Literal['fmp']] + provider : Union[Literal['fmp', 'intrinio'], NoneType] Provider name. warnings : Optional[List[Warning_]] List of warnings. @@ -728,7 +772,47 @@ class CLASS_stocks(Container): earnings_announcement : Optional[str] Earnings announcement date of the stock. (provider: fmp) shares_outstanding : Optional[int] - Number of shares outstanding of the stock. (provider: fmp)""" # noqa: E501 + Number of shares outstanding of the stock. (provider: fmp) + last_price : Optional[float] + Price of the last trade. (provider: intrinio) + last_time : Optional[datetime] + Date and Time when the last trade occurred. (provider: intrinio) + last_size : Optional[int] + Size of the last trade. (provider: intrinio) + bid_price : Optional[float] + Price of the top bid order. (provider: intrinio) + bid_size : Optional[int] + Size of the top bid order. (provider: intrinio) + ask_price : Optional[float] + Price of the top ask order. (provider: intrinio) + ask_size : Optional[int] + Size of the top ask order. (provider: intrinio) + open_price : Optional[float] + Open price for the trading day. (provider: intrinio) + close_price : Optional[float] + Closing price for the trading day (IEX source only). (provider: intrinio) + high_price : Optional[float] + High Price for the trading day. (provider: intrinio) + low_price : Optional[float] + Low Price for the trading day. (provider: intrinio) + exchange_volume : Optional[int] + Number of shares exchanged during the trading day on the exchange. (provider: intrinio) + market_volume : Optional[int] + Number of shares exchanged during the trading day for the whole market. (provider: intrinio) + updated_on : Optional[datetime] + Date and Time when the data was last updated. (provider: intrinio) + source : Optional[str] + Source of the data. (provider: intrinio) + listing_venue : Optional[str] + Listing venue where the trade took place (SIP source only). (provider: intrinio) + sales_conditions : Optional[str] + Indicates any sales condition modifiers associated with the trade. (provider: intrinio) + quote_conditions : Optional[str] + Indicates any quote condition modifiers associated with the trade. (provider: intrinio) + market_center_code : Optional[str] + Market center character code. (provider: intrinio) + is_darkpool : Optional[bool] + Whether or not the current trade is from a darkpool. (provider: intrinio)""" # noqa: E501 inputs = filter_inputs( provider_choices={ @@ -748,12 +832,14 @@ class CLASS_stocks(Container): @validate_arguments def search( self, - query: Annotated[str, OpenBBCustomParameter(description="Search query.")] = "", - ticker: Annotated[ + query: typing_extensions.Annotated[ + str, OpenBBCustomParameter(description="Search query.") + ] = "", + ticker: typing_extensions.Annotated[ bool, OpenBBCustomParameter(description="Whether to search by ticker symbol."), ] = False, - provider: Optional[Literal["cboe"]] = None, + provider: Union[Literal["cboe"], None] = None, **kwargs ) -> OBBject[List]: """Search for a company or stock ticker. @@ -764,7 +850,7 @@ class CLASS_stocks(Container): Search query. ticker : bool Whether to search by ticker symbol. - provider : Optional[Literal['cboe']] + provider : Union[Literal['cboe'], NoneType] The provider to use for the query, by default None. If None, the provider specified in defaults is selected or 'cboe' if there is no default. @@ -774,7 +860,7 @@ class CLASS_stocks(Container): OBBject results : List[StockSearch] Serializable results. - provider : Optional[Literal['cboe']] + provider : Union[Literal['cboe'], NoneType] Provider name. warnings : Optional[List[Warning_]] List of warnings. diff --git a/openbb_sdk/openbb/package/stocks_ca.py b/openbb_sdk/openbb/package/stocks_ca.py index 8c8d05c9d06..ba6d82e77ad 100644 --- a/openbb_sdk/openbb/package/stocks_ca.py +++ b/openbb_sdk/openbb/package/stocks_ca.py @@ -1,13 +1,13 @@ ### THIS FILE IS AUTO-GENERATED. DO NOT EDIT. ### -from typing import List, Literal, Optional, Union +from typing import List, Literal, Union +import typing_extensions from openbb_core.app.model.custom_parameter import OpenBBCustomParameter from openbb_core.app.model.obbject import OBBject from openbb_core.app.static.container import Container from openbb_core.app.static.filters import filter_inputs from pydantic import BaseModel, validate_arguments -from typing_extensions import Annotated class CLASS_stocks_ca(Container): @@ -21,11 +21,11 @@ class CLASS_stocks_ca(Container): @validate_arguments def peers( self, - symbol: Annotated[ + symbol: typing_extensions.Annotated[ Union[str, List[str]], OpenBBCustomParameter(description="Symbol to get data for."), ], - provider: Optional[Literal["fmp"]] = None, + provider: Union[Literal["fmp"], None] = None, **kwargs ) -> OBBject[BaseModel]: """Company peers. @@ -34,7 +34,7 @@ class CLASS_stocks_ca(Container): ---------- symbol : Union[str, List[str]] Symbol to get data for. - provider : Optional[Literal['fmp']] + provider : Union[Literal['fmp'], NoneType] The provider to use for the query, by default None. If None, the provider specified in defaults is selected or 'fmp' if there is no default. @@ -44,7 +44,7 @@ class CLASS_stocks_ca(Container): OBBject results : List[StockPeers] Serializable results. - provider : Optional[Literal['fmp']] + provider : Union[Literal['fmp'], NoneType] Provider name. warnings : Optional[List[Warning_]] List of warnings. diff --git a/openbb_sdk/openbb/package/stocks_dd.py b/openbb_sdk/openbb/package/stocks_dd.py index 2656ec811bf..08d0e5aee52 100644 --- a/openbb_sdk/openbb/package/stocks_dd.py +++ b/openbb_sdk/openbb/package/stocks_dd.py @@ -1,13 +1,13 @@ ### THIS FILE IS AUTO-GENERATED. DO NOT EDIT. ### -from typing import List, Literal, Optional, Union +from typing import List, Literal, Union +import typing_extensions from openbb_core.app.model.custom_parameter import OpenBBCustomParameter from openbb_core.app.model.obbject import OBBject from openbb_core.app.static.container import Container from openbb_core.app.static.filters import filter_inputs from pydantic import validate_arguments -from typing_extensions import Annotated class CLASS_stocks_dd(Container): @@ -21,11 +21,11 @@ class CLASS_stocks_dd(Container): @validate_arguments def sec( self, - symbol: Annotated[ + symbol: typing_extensions.Annotated[ Union[str, List[str]], OpenBBCustomParameter(description="Symbol to get data for."), ], - type: Annotated[ + type: typing_extensions.Annotated[ Literal[ "1", "1-A", @@ -130,15 +130,15 @@ class CLASS_stocks_dd(Container): ], OpenBBCustomParameter(description="Type of the SEC filing form."), ] = "10-K", - page: Annotated[ - Optional[int], + page: typing_extensions.Annotated[ + Union[int, None], OpenBBCustomParameter(description="Page number of the results."), ] = 0, - limit: Annotated[ - Optional[int], + limit: typing_extensions.Annotated[ + Union[int, None], OpenBBCustomParameter(description="The number of data entries to return."), ] = 100, - provider: Optional[Literal["fmp"]] = None, + provider: Union[Literal["fmp"], None] = None, **kwargs ) -> OBBject[List]: """SEC Filings. @@ -149,11 +149,11 @@ class CLASS_stocks_dd(Container): Symbol to get data for. 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'] Type of the SEC filing form. - page : Optional[int] + page : Union[int, NoneType] Page number of the results. - limit : Optional[int] + limit : Union[int, NoneType] The number of data entries to return. - provider : Optional[Literal['fmp']] + provider : Union[Literal['fmp'], NoneType] The provider to use for the query, by default None. If None, the provider specified in defaults is selected or 'fmp' if there is no default. @@ -163,7 +163,7 @@ class CLASS_stocks_dd(Container): OBBject results : List[SECFilings] Serializable results. - provider : Optional[Literal['fmp']] + provider : Union[Literal['fmp'], NoneType] Provider name. warnings : Optional[List[Warning_]] List of warnings. diff --git a/openbb_sdk/openbb/package/stocks_fa.py b/openbb_sdk/openbb/package/stocks_fa.py index 1f6f8a404f9..ccbf8cdc115 100644 --- a/openbb_sdk/openbb/package/stocks_fa.py +++ b/openbb_sdk/openbb/package/stocks_fa.py @@ -1,16 +1,16 @@ ### THIS FILE IS AUTO-GENERATED. DO NOT EDIT. ### import datetime -from typing import List, Literal, Optional, Union +from typing import List, Literal, Union import pydantic import pydantic.main +import typing_extensions from openbb_core.app.model.custom_parameter import OpenBBCustomParameter from openbb_core.app.model.obbject import OBBject from openbb_core.app.static.container import Container from openbb_core.app.static.filters import filter_inputs from pydantic import BaseModel, validate_arguments -from typing_extensions import Annotated class CLASS_stocks_fa(Container): @@ -50,19 +50,19 @@ class CLASS_stocks_fa(Container): @validate_arguments def balance( self, - symbol: Annotated[ + symbol: typing_extensions.Annotated[ Union[str, List[str]], OpenBBCustomParameter(description="Symbol to get data for."), ], - period: Annotated[ + period: typing_extensions.Annotated[ Literal["annual", "quarter"], OpenBBCustomParameter(description="Period of the data to return."), ] = "annual", - limit: Annotated[ - Optional[pydantic.types.NonNegativeInt], + limit: typing_extensions.Annotated[ + Union[pydantic.types.NonNegativeInt, None], OpenBBCustomParameter(description="The number of data entries to return."), ] = 12, - provider: Optional[Literal["fmp", "polygon", "yfinance"]] = None, + provider: Union[Literal["fmp", "intrinio", "polygon", "yfinance"], None] = None, **kwargs ) -> OBBject[List]: """Balance Sheet. @@ -73,43 +73,47 @@ class CLASS_stocks_fa(Container): Symbol to get data for. period : Literal['annual', 'quarter'] Period of the data to return. - limit : Optional[pydantic.types.NonNegativeInt] + limit : Union[pydantic.types.NonNegativeInt, NoneType] The number of data entries to return. - provider : Optional[Literal['fmp', 'polygon', 'yfinance']] + provider : Union[Literal['fmp', 'intrinio', 'polygon', 'yfinance'], NoneType] The provider to use for the query, by default None. If None, the provider specified in defaults is selected or 'fmp' if there is no default. - company_name : Optional[str] + type : Literal['reported', 'standardized'] + Type of the statement to be fetched. (provider: intrinio) + year : Union[int, NoneType] + Year of the statement to be fetched. (provider: intrinio) + company_name : Union[str, NoneType] Name of the company. (provider: polygon) - company_name_search : Optional[str] + company_name_search : Union[str, NoneType] Name of the company to search. (provider: polygon) - sic : Optional[str] + sic : Union[str, NoneType] The Standard Industrial Classification (SIC) of the company. (provider: polygon) - filing_date : Optional[datetime.date] + filing_date : Union[datetime.date, NoneType] Filing date of the financial statement. (provider: polygon) - filing_date_lt : Optional[datetime.date] + filing_date_lt : Union[datetime.date, NoneType] Filing date less than the given date. (provider: polygon) - filing_date_lte : Optional[datetime.date] + filing_date_lte : Union[datetime.date, NoneType] Filing date less than or equal to the given date. (provider: polygon) - filing_date_gt : Optional[datetime.date] + filing_date_gt : Union[datetime.date, NoneType] Filing date greater than the given date. (provider: polygon) - filing_date_gte : Optional[datetime.date] + filing_date_gte : Union[datetime.date, NoneType] Filing date greater than or equal to the given date. (provider: polygon) - period_of_report_date : Optional[datetime.date] + period_of_report_date : Union[datetime.date, NoneType] Period of report date of the financial statement. (provider: polygon) - period_of_report_date_lt : Optional[datetime.date] + period_of_report_date_lt : Union[datetime.date, NoneType] Period of report date less than the given date. (provider: polygon) - period_of_report_date_lte : Optional[datetime.date] + period_of_report_date_lte : Union[datetime.date, NoneType] Period of report date less than or equal to the given date. (provider: polygon) - period_of_report_date_gt : Optional[datetime.date] + period_of_report_date_gt : Union[datetime.date, NoneType] Period of report date greater than the given date. (provider: polygon) - period_of_report_date_gte : Optional[datetime.date] + period_of_report_date_gte : Union[datetime.date, NoneType] Period of report date greater than or equal to the given date. (provider: polygon) - include_sources : Optional[bool] + include_sources : Union[bool, NoneType] Whether to include the sources of the financial statement. (provider: polygon) - order : Optional[Literal['asc', 'desc']] + order : Union[Literal['asc', 'desc'], NoneType] Order of the financial statement. (provider: polygon) - sort : Optional[Literal['filing_date', 'period_of_report_date']] + sort : Union[Literal['filing_date', 'period_of_report_date'], NoneType] Sort of the financial statement. (provider: polygon) Returns @@ -117,7 +121,7 @@ class CLASS_stocks_fa(Container): OBBject results : List[BalanceSheet] Serializable results. - provider : Optional[Literal['fmp', 'polygon', 'yfinance']] + provider : Union[Literal['fmp', 'intrinio', 'polygon', 'yfinance'], NoneType] Provider name. warnings : Optional[List[Warning_]] List of warnings. @@ -257,15 +261,15 @@ class CLASS_stocks_fa(Container): @validate_arguments def balance_growth( self, - symbol: Annotated[ + symbol: typing_extensions.Annotated[ Union[str, List[str]], OpenBBCustomParameter(description="Symbol to get data for."), ], - limit: Annotated[ + limit: typing_extensions.Annotated[ int, OpenBBCustomParameter(description="The number of data entries to return."), ] = 10, - provider: Optional[Literal["fmp"]] = None, + provider: Union[Literal["fmp"], None] = None, **kwargs ) -> OBBject[List]: """Balance Sheet Statement Growth. @@ -276,7 +280,7 @@ class CLASS_stocks_fa(Container): Symbol to get data for. limit : int The number of data entries to return. - provider : Optional[Literal['fmp']] + provider : Union[Literal['fmp'], NoneType] The provider to use for the query, by default None. If None, the provider specified in defaults is selected or 'fmp' if there is no default. @@ -286,7 +290,7 @@ class CLASS_stocks_fa(Container): OBBject results : List[BalanceSheetGrowth] Serializable results. - provider : Optional[Literal['fmp']] + provider : Union[Literal['fmp'], NoneType] Provider name. warnings : Optional[List[Warning_]] List of warnings. @@ -401,19 +405,19 @@ class CLASS_stocks_fa(Container): @validate_arguments def cal( self, - start_date: Annotated[ + start_date: typing_extensions.Annotated[ Union[datetime.date, None, str], OpenBBCustomParameter( description="Start date of the data, in YYYY-MM-DD format." ), ] = None, - end_date: Annotated[ + end_date: typing_extensions.Annotated[ Union[datetime.date, None, str], OpenBBCustomParameter( description="End date of the data, in YYYY-MM-DD format." ), ] = None, - provider: Optional[Literal["fmp"]] = None, + provider: Union[Literal["fmp"], None] = None, **kwargs ) -> OBBject[List]: """Show Dividend Calendar for a given start and end dates. @@ -424,7 +428,7 @@ class CLASS_stocks_fa(Container): Start date of the data, in YYYY-MM-DD format. end_date : Union[datetime.date, NoneType, str] End date of the data, in YYYY-MM-DD format. - provider : Optional[Literal['fmp']] + provider : Union[Literal['fmp'], NoneType] The provider to use for the query, by default None. If None, the provider specified in defaults is selected or 'fmp' if there is no default. @@ -434,7 +438,7 @@ class CLASS_stocks_fa(Container): OBBject results : List[DividendCalendar] Serializable results. - provider : Optional[Literal['fmp']] + provider : Union[Literal['fmp'], NoneType] Provider name. warnings : Optional[List[Warning_]] List of warnings. @@ -481,19 +485,19 @@ class CLASS_stocks_fa(Container): @validate_arguments def cash( self, - symbol: Annotated[ + symbol: typing_extensions.Annotated[ Union[str, List[str]], OpenBBCustomParameter(description="Symbol to get data for."), ], - period: Annotated[ + period: typing_extensions.Annotated[ Literal["annual", "quarter"], OpenBBCustomParameter(description="Period of the data to return."), ] = "annual", - limit: Annotated[ - Optional[pydantic.types.NonNegativeInt], + limit: typing_extensions.Annotated[ + Union[pydantic.types.NonNegativeInt, None], OpenBBCustomParameter(description="The number of data entries to return."), ] = 12, - provider: Optional[Literal["fmp", "polygon", "yfinance"]] = None, + provider: Union[Literal["fmp", "intrinio", "polygon", "yfinance"], None] = None, **kwargs ) -> OBBject[List]: """Cash Flow Statement. @@ -504,43 +508,47 @@ class CLASS_stocks_fa(Container): Symbol to get data for. period : Literal['annual', 'quarter'] Period of the data to return. - limit : Optional[pydantic.types.NonNegativeInt] + limit : Union[pydantic.types.NonNegativeInt, NoneType] The number of data entries to return. - provider : Optional[Literal['fmp', 'polygon', 'yfinance']] + provider : Union[Literal['fmp', 'intrinio', 'polygon', 'yfinance'], NoneType] The provider to use for the query, by default None. If None, the provider specified in defaults is selected or 'fmp' if there is no default. - company_name : Optional[str] + type : Literal['reported', 'standardized'] + Type of the statement to be fetched. (provider: intrinio) + year : Union[int, NoneType] + Year of the statement to be fetched. (provider: intrinio) + company_name : Union[str, NoneType] Name of the company. (provider: polygon) - company_name_search : Optional[str] + company_name_search : Union[str, NoneType] Name of the company to search. (provider: polygon) - sic : Optional[str] + sic : Union[str, NoneType] The Standard Industrial Classification (SIC) of the company. (provider: polygon) - filing_date : Optional[datetime.date] + filing_date : Union[datetime.date, NoneType] Filing date of the financial statement. (provider: polygon) - filing_date_lt : Optional[datetime.date] + filing_date_lt : Union[datetime.date, NoneType] Filing date less than the given date. (provider: polygon) - filing_date_lte : Optional[datetime.date] + filing_date_lte : Union[datetime.date, NoneType] Filing date less than or equal to the given date. (provider: polygon) - filing_date_gt : Optional[datetime.date] + filing_date_gt : Union[datetime.date, NoneType] Filing date greater than the given date. (provider: polygon) - filing_date_gte : Optional[datetime.date] + filing_date_gte : Union[datetime.date, NoneType] Filing date greater than or equal to the given date. (provider: polygon) - period_of_report_date : Optional[datetime.date] + period_of_report_date : Union[datetime.date, NoneType] Period of report date of the financial statement. (provider: polygon) - period_of_report_date_lt : Optional[datetime.date] + period_of_report_date_lt : Union[datetime.date, NoneType] Period of report date less than the given date. (provider: polygon) - period_of_report_date_lte : Optional[datetime.date] + period_of_report_date_lte : Union[datetime.date, NoneType] Period of report date less than or equal to the given date. (provider: polygon) - period_of_report_date_gt : Optional[datetime.date] + period_of_report_date_gt : Union[datetime.date, NoneType] Period of report date greater than the given date. (provider: polygon) - period_of_report_date_gte : Optional[datetime.date] + period_of_report_date_gte : Union[datetime.date, NoneType] Period of report date greater than or equal to the given date. (provider: polygon) - include_sources : Optional[bool] + include_sources : Union[bool, NoneType] Whether to include the sources of the financial statement. (provider: polygon) - order : Optional[Literal['asc', 'desc']] + order : Union[Literal['asc', 'desc'], NoneType] Order of the financial statement. (provider: polygon) - sort : Optional[Literal['filing_date', 'period_of_report_date']] + sort : Union[Literal['filing_date', 'period_of_report_date'], NoneType] Sort of the financial statement. (provider: polygon) Returns @@ -548,7 +556,7 @@ class CLASS_stocks_fa(Container): OBBject results : List[CashFlowStatement] Serializable results. - provider : Optional[Literal['fmp', 'polygon', 'yfinance']] + provider : Union[Literal['fmp', 'intrinio', 'polygon', 'yfinance'], NoneType] Provider name. warnings : Optional[List[Warning_]] List of warnings. @@ -674,15 +682,15 @@ class CLASS_stocks_fa(Container): @validate_arguments def cash_growth( self, - symbol: Annotated[ + symbol: typing_extensions.Annotated[ Union[str, List[str]], OpenBBCustomParameter(description="Symbol to get data for."), ], - limit: Annotated[ + limit: typing_extensions.Annotated[ int, OpenBBCustomParameter(description="The number of data entries to return."), ] = 10, - provider: Optional[Literal["fmp"]] = None, + provider: Union[Literal["fmp"], None] = None, **kwargs ) -> OBBject[List]: """Cash Flow Statement Growth. @@ -693,7 +701,7 @@ class CLASS_stocks_fa(Container): Symbol to get data for. limit : int The number of data entries to return. - provider : Optional[Literal['fmp']] + provider : Union[Literal['fmp'], NoneType] The provider to use for the query, by default None. If None, the provider specified in defaults is selected or 'fmp' if there is no default. @@ -703,7 +711,7 @@ class CLASS_stocks_fa(Container): OBBject results : List[CashFlowStatementGrowth] Serializable results. - provider : Optional[Literal['fmp']] + provider : Union[Literal['fmp'], NoneType] Provider name. warnings : Optional[List[Warning_]] List of warnings. @@ -800,11 +808,11 @@ class CLASS_stocks_fa(Container): @validate_arguments def comp( self, - symbol: Annotated[ + symbol: typing_extensions.Annotated[ Union[str, List[str]], OpenBBCustomParameter(description="Symbol to get data for."), ], - provider: Optional[Literal["fmp"]] = None, + provider: Union[Literal["fmp"], None] = None, **kwargs ) -> OBBject[List]: """Executive Compensation. @@ -813,7 +821,7 @@ class CLASS_stocks_fa(Container): ---------- symbol : Union[str, List[str]] Symbol to get data for. - provider : Optional[Literal['fmp']] + provider : Union[Literal['fmp'], NoneType] The provider to use for the query, by default None. If None, the provider specified in defaults is selected or 'fmp' if there is no default. @@ -823,7 +831,7 @@ class CLASS_stocks_fa(Container): OBBject results : List[ExecutiveCompensation] Serializable results. - provider : Optional[Literal['fmp']] + provider : Union[Literal['fmp'], NoneType] Provider name. warnings : Optional[List[Warning_]] List of warnings. @@ -879,19 +887,19 @@ class CLASS_stocks_fa(Container): @validate_arguments def comsplit( self, - start_date: Annotated[ + start_date: typing_extensions.Annotated[ Union[datetime.date, None, str], OpenBBCustomParameter( description="Start date of the data, in YYYY-MM-DD format." ), ] = None, - end_date: Annotated[ + end_date: typing_extensions.Annotated[ Union[datetime.date, None, str], OpenBBCustomParameter( description="End date of the data, in YYYY-MM-DD format." ), ] = None, - provider: Optional[Literal["fmp"]] = None, + provider: Union[Literal["fmp"], None] = None, **kwargs ) -> OBBject[List]: """Stock Split Calendar. @@ -902,7 +910,7 @@ class CLASS_stocks_fa(Container): Start date of the data, in YYYY-MM-DD format. end_date : Union[datetime.date, NoneType, str] End date of the data, in YYYY-MM-DD format. - provider : Optional[Literal['fmp']] + provider : Union[Literal['fmp'], NoneType] The provider to use for the query, by default None. If None, the provider specified in defaults is selected or 'fmp' if there is no default. @@ -912,7 +920,7 @@ class CLASS_stocks_fa(Container): OBBject results : List[StockSplitCalendar] Serializable results. - provider : Optional[Literal['fmp']] + provider : Union[Literal['fmp'], NoneType] Provider name. warnings : Optional[List[Warning_]] List of warnings. @@ -953,11 +961,11 @@ class CLASS_stocks_fa(Container): @validate_arguments def divs( self, - symbol: Annotated[ + symbol: typing_extensions.Annotated[ Union[str, List[str]], OpenBBCustomParameter(description="Symbol to get data for."), ], - provider: Optional[Literal["fmp"]] = None, + provider: Union[Literal["fmp"], None] = None, **kwargs ) -> OBBject[List]: """Historical Dividends. @@ -966,7 +974,7 @@ class CLASS_stocks_fa(Container): ---------- symbol : Union[str, List[str]] Symbol to get data for. - provider : Optional[Literal['fmp']] + provider : Union[Literal['fmp'], NoneType] The provider to use for the query, by default None. If None, the provider specified in defaults is selected or 'fmp' if there is no default. @@ -976,7 +984,7 @@ class CLASS_stocks_fa(Container): OBBject results : List[HistoricalDividends] Serializable results. - provider : Optional[Literal['fmp']] + provider : Union[Literal['fmp'], NoneType] Provider name. warnings : Optional[List[Warning_]] List of warnings. @@ -1020,15 +1028,15 @@ class CLASS_stocks_fa(Container): @validate_arguments def earning( self, - symbol: Annotated[ + symbol: typing_extensions.Annotated[ Union[str, List[str]], OpenBBCustomParameter(description="Symbol to get data for."), ], - limit: Annotated[ - Optional[int], + limit: typing_extensions.Annotated[ + Union[int, None], OpenBBCustomParameter(description="The number of data entries to return."), ] = 50, - provider: Optional[Literal["fmp"]] = None, + provider: Union[Literal["fmp"], None] = None, **kwargs ) -> OBBject[List]: """Earnings Calendar. @@ -1037,9 +1045,9 @@ class CLASS_stocks_fa(Container): ---------- symbol : Union[str, List[str]] Symbol to get data for. - limit : Optional[int] + limit : Union[int, NoneType] The number of data entries to return. - provider : Optional[Literal['fmp']] + provider : Union[Literal['fmp'], NoneType] The provider to use for the query, by default None. If None, the provider specified in defaults is selected or 'fmp' if there is no default. @@ -1049,7 +1057,7 @@ class CLASS_stocks_fa(Container): OBBject results : List[EarningsCalendar] Serializable results. - provider : Optional[Literal['fmp']] + provider : Union[Literal['fmp'], NoneType] Provider name. warnings : Optional[List[Warning_]] List of warnings. @@ -1098,11 +1106,11 @@ class CLASS_stocks_fa(Container): @validate_arguments def emp( self, - symbol: Annotated[ + symbol: typing_extensions.Annotated[ Union[str, List[str]], OpenBBCustomParameter(description="Symbol to get data for."), ], - provider: Optional[Literal["fmp"]] = None, + provider: Union[Literal["fmp"], None] = None, **kwargs ) -> OBBject[List]: """Number of Employees. @@ -1111,7 +1119,7 @@ class CLASS_stocks_fa(Container): ---------- symbol : Union[str, List[str]] Symbol to get data for. - provider : Optional[Literal['fmp']] + provider : Union[Literal['fmp'], NoneType] The provider to use for the query, by default None. If None, the provider specified in defaults is selected or 'fmp' if there is no default. @@ -1121,7 +1129,7 @@ class CLASS_stocks_fa(Container): OBBject results : List[HistoricalEmployees] Serializable results. - provider : Optional[Literal['fmp']] + provider : Union[Literal['fmp'], NoneType] Provider name. warnings : Optional[List[Warning_]] List of warnings. @@ -1169,19 +1177,19 @@ class CLASS_stocks_fa(Container): @validate_arguments def est( self, - symbol: Annotated[ + symbol: typing_extensions.Annotated[ Union[str, List[str]], OpenBBCustomParameter(description="Symbol to get data for."), ], - period: Annotated[ - Literal["annual", "quarter"], + period: typing_extensions.Annotated[ + Literal["quarter", "annual"], OpenBBCustomParameter(description="Period of the data to return."), ] = "annual", - limit: Annotated[ + limit: typing_extensions.Annotated[ int, OpenBBCustomParameter(description="The number of data entries to return."), ] = 30, - provider: Optional[Literal["fmp"]] = None, + provider: Union[Literal["fmp"], None] = None, **kwargs ) -> OBBject[List]: """Analyst Estimates. @@ -1190,11 +1198,11 @@ class CLASS_stocks_fa(Container): ---------- symbol : Union[str, List[str]] Symbol to get data for. - period : Literal['annual', 'quarter'] + period : Literal['quarter', 'annual'] Period of the data to return. limit : int The number of data entries to return. - provider : Optional[Literal['fmp']] + provider : Union[Literal['fmp'], NoneType] The provider to use for the query, by default None. If None, the provider specified in defaults is selected or 'fmp' if there is no default. @@ -1204,7 +1212,7 @@ class CLASS_stocks_fa(Container): OBBject results : List[AnalystEstimates] Serializable results. - provider : Optional[Literal['fmp']] + provider : Union[Literal['fmp'], NoneType] Provider name. warnings : Optional[List[Warning_]] List of warnings. @@ -1280,19 +1288,19 @@ class CLASS_stocks_fa(Container): @validate_arguments def income( self, - symbol: Annotated[ + symbol: typing_extensions.Annotated[ Union[str, List[str]], OpenBBCustomParameter(description="Symbol to get data for."), ], - period: Annotated[ + period: typing_extensions.Annotated[ Literal["annual", "quarter"], OpenBBCustomParameter(description="Period of the data to return."), ] = "annual", - limit: Annotated[ - Optional[pydantic.types.NonNegativeInt], + limit: typing_extensions.Annotated[ + Union[pydantic.types.NonNegativeInt, None], OpenBBCustomParameter(description="The number of data entries to return."), ] = 12, - provider: Optional[Literal["fmp", "polygon", "yfinance"]] = None, + provider: Union[Literal["fmp", "intrinio", "polygon", "yfinance"], None] = None, **kwargs ) -> OBBject[List]: """Income Statement. @@ -1303,43 +1311,47 @@ class CLASS_stocks_fa(Container): Symbol to get data for. period : Literal['annual', 'quarter'] Period of the data to return. - limit : Optional[pydantic.types.NonNegativeInt] + limit : Union[pydantic.types.NonNegativeInt, NoneType] The number of data entries to return. - provider : Optional[Literal['fmp', 'polygon', 'yfinance']] + provider : Union[Literal['fmp', 'intrinio', 'polygon', 'yfinance'], NoneType] The provider to use for the query, by default None. If None, the provider specified in defaults is selected or 'fmp' if there is no default. - company_name : Optional[str] + type : Literal['reported', 'standardized'] + Type of the statement to be fetched. (provider: intrinio) + year : Union[int, NoneType] + Year of the statement to be fetched. (provider: intrinio) + company_name : Union[str, NoneType] Name of the company. (provider: polygon) - company_name_search : Optional[str] + company_name_search : Union[str, NoneType] Name of the company to search. (provider: polygon) - sic : Optional[str] + sic : Union[str, NoneType] The Standard Industrial Classification (SIC) of the company. (provider: polygon) - filing_date : Optional[datetime.date] + filing_date : Union[datetime.date, NoneType] Filing date of the financial statement. (provider: polygon) - filing_date_lt : Optional[datetime.date] + filing_date_lt : Union[datetime.date, NoneType] Filing date less than the given date. (provider: polygon) - filing_date_lte : Optional[datetime.date] + filing_date_lte : Union[datetime.date, NoneType] Filing date less than or equal to the given date. (provider: polygon) - filing_date_gt : Optional[datetime.date] + filing_date_gt : Union[datetime.date, NoneType] Filing date greater than the given date. (provider: polygon) - filing_date_gte : Optional[datetime.date] + filing_date_gte : Union[datetime.date, NoneType] Filing date greater than or equal to the given date. (provider: polygon) - period_of_report_date : Optional[datetime.date] + period_of_report_date : Union[datetime.date, NoneType] Period of report date of the financial statement. (provider: polygon) - period_of_report_date_lt : Optional[datetime.date] + period_of_report_date_lt : Union[datetime.date, NoneType] Period of report date less than the given date. (provider: polygon) - period_of_report_date_lte : Optional[datetime.date] + period_of_report_date_lte : Union[datetime.date, NoneType] Period of report date less than or equal to the given date. (provider: polygon) - period_of_report_date_gt : Optional[datetime.date] + period_of_report_date_gt : Union[datetime.date, NoneType] Period of report date greater than the given date. (provider: polygon) - period_of_report_date_gte : Optional[datetime.date] + period_of_report_date_gte : Union[datetime.date, NoneType] Period of report date greater than or equal to the given date. (provider: polygon) - include_sources : Optional[bool] + include_sources : Union[bool, NoneType] Whether to include the sources of the financial statement. (provider: polygon) - order : Optional[Literal['asc', 'desc']] + order : Union[Literal['asc', 'desc'], NoneType] Order of the financial statement. (provider: polygon) - sort : Optional[Literal['filing_date', 'period_of_report_date']] + sort : Union[Literal['filing_date', 'period_of_report_date'], NoneType] Sort of the financial statement. (provider: polygon) Returns @@ -1347,7 +1359,7 @@ class CLASS_stocks_fa(Container): OBBject results : List[IncomeStatement] Serializable results. - provider : Optional[Literal['fmp', 'polygon', 'yfinance']] + provider : Union[Literal['fmp', 'intrinio', 'polygon', 'yfinance'], NoneType] Provider name. warnings : Optional[List[Warning_]] List of warnings. @@ -1463,19 +1475,19 @@ class CLASS_stocks_fa(Container): @validate_arguments def income_growth( self, - symbol: Annotated[ + symbol: typing_extensions.Annotated[ Union[str, List[str]], OpenBBCustomParameter(description="Symbol to get data for."), ], - limit: Annotated[ + limit: typing_extensions.Annotated[ int, OpenBBCustomParameter(description="The number of data entries to return."), ] = 10, - period: Annotated[ + period: typing_extensions.Annotated[ Literal["annual", "quarter"], OpenBBCustomParameter(description="Period of the data to return."), ] = "annual", - provider: Optional[Literal["fmp"]] = None, + provider: Union[Literal["fmp"], None] = None, **kwargs ) -> OBBject[List]: """Income Statement Growth. @@ -1488,7 +1500,7 @@ class CLASS_stocks_fa(Container): The number of data entries to return. period : Literal['annual', 'quarter'] Period of the data to return. - provider : Optional[Literal['fmp']] + provider : Union[Literal['fmp'], NoneType] The provider to use for the query, by default None. If None, the provider specified in defaults is selected or 'fmp' if there is no default. @@ -1498,7 +1510,7 @@ class CLASS_stocks_fa(Container): OBBject results : List[IncomeStatementGrowth] Serializable results. - provider : Optional[Literal['fmp']] + provider : Union[Literal['fmp'], NoneType] Provider name. warnings : Optional[List[Warning_]] List of warnings. @@ -1588,12 +1600,12 @@ class CLASS_stocks_fa(Container): @validate_arguments def ins( self, - symbol: Annotated[ + symbol: typing_extensions.Annotated[ Union[str, List[str]], OpenBBCustomParameter(description="Symbol to get data for."), ], - transactionType: Annotated[ - Optional[ + transactionType: typing_extensions.Annotated[ + Union[ List[ Literal[ "A-Award", @@ -1615,23 +1627,24 @@ class CLASS_stocks_fa(Container): "X-InTheMoney", "Z-Trust", ] - ] + ], + None, ], OpenBBCustomParameter(description="Type of the transaction."), ] = ["P-Purchase"], - reportingCik: Annotated[ - Optional[int], + reportingCik: typing_extensions.Annotated[ + Union[int, None], OpenBBCustomParameter(description="CIK of the reporting owner."), ] = None, - companyCik: Annotated[ - Optional[int], + companyCik: typing_extensions.Annotated[ + Union[int, None], OpenBBCustomParameter(description="CIK of the company owner."), ] = None, - page: Annotated[ - Optional[int], + page: typing_extensions.Annotated[ + Union[int, None], OpenBBCustomParameter(description="Page number of the data to fetch."), ] = 0, - provider: Optional[Literal["fmp"]] = None, + provider: Union[Literal["fmp"], None] = None, **kwargs ) -> OBBject[List]: """Stock Insider Trading. @@ -1640,15 +1653,15 @@ class CLASS_stocks_fa(Container): ---------- symbol : Union[str, List[str]] Symbol to get data for. - transactionType : Optional[List[Literal['A-Award', 'C-Conversion', 'D-Return', 'E-ExpireShort', 'F-InKind', 'G-Gift', 'H-ExpireLong', 'I-Discretionary', 'J-Other', 'L-Small', 'M-Exempt', 'O-OutOfTheMoney', 'P-Purchase', 'S-Sale', 'U-Tender', 'W-Will', 'X-InTheMoney', 'Z-Trust']]] + transactionType : Union[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']], NoneType] Type of the transaction. - reportingCik : Optional[int] + reportingCik : Union[int, NoneType] CIK of the reporting owner. - companyCik : Optional[int] + companyCik : Union[int, NoneType] CIK of the company owner. - page : Optional[int] + page : Union[int, NoneType] Page number of the data to fetch. - provider : Optional[Literal['fmp']] + provider : Union[Literal['fmp'], NoneType] The provider to use for the query, by default None. If None, the provider specified in defaults is selected or 'fmp' if there is no default. @@ -1658,7 +1671,7 @@ class CLASS_stocks_fa(Container): OBBject results : List[StockInsiderTrading] Serializable results. - provider : Optional[Literal['fmp']] + provider : Union[Literal['fmp'], NoneType] Provider name. warnings : Optional[List[Warning_]] List of warnings. @@ -1722,18 +1735,18 @@ class CLASS_stocks_fa(Container): @validate_arguments def ins_own( self, - symbol: Annotated[ + symbol: typing_extensions.Annotated[ Union[str, List[str]], OpenBBCustomParameter(description="Symbol to get data for."), ], - include_current_quarter: Annotated[ + include_current_quarter: typing_extensions.Annotated[ bool, OpenBBCustomParameter(description="Include current quarter data.") ] = False, - date: Annotated[ - Optional[datetime.date], + date: typing_extensions.Annotated[ + Union[datetime.date, None], OpenBBCustomParameter(description="A specific date to get data for."), ] = None, - provider: Optional[Literal["fmp"]] = None, + provider: Union[Literal["fmp"], None] = None, **kwargs ) -> OBBject[List]: """Institutional Ownership. @@ -1744,9 +1757,9 @@ class CLASS_stocks_fa(Container): Symbol to get data for. include_current_quarter : bool Include current quarter data. - date : Optional[datetime.date] + date : Union[datetime.date, NoneType] A specific date to get data for. - provider : Optional[Literal['fmp']] + provider : Union[Literal['fmp'], NoneType] The provider to use for the query, by default None. If None, the provider specified in defaults is selected or 'fmp' if there is no default. @@ -1756,7 +1769,7 @@ class CLASS_stocks_fa(Container): OBBject results : List[InstitutionalOwnership] Serializable results. - provider : Optional[Literal['fmp']] + provider : Union[Literal['fmp'], NoneType] Provider name. warnings : Optional[List[Warning_]] List of warnings. @@ -1861,19 +1874,19 @@ class CLASS_stocks_fa(Container): @validate_arguments def metrics( self, - symbol: Annotated[ + symbol: typing_extensions.Annotated[ Union[str, List[str]], OpenBBCustomParameter(description="Symbol to get data for."), ], - period: Annotated[ + period: typing_extensions.Annotated[ Literal["annual", "quarter"], OpenBBCustomParameter(description="Period of the data to return."), ] = "annual", - limit: Annotated[ - Optional[int], + limit: typing_extensions.Annotated[ + Union[int, None], OpenBBCustomParameter(description="The number of data entries to return."), ] = 100, - provider: Optional[Literal["fmp"]] = None, + provider: Union[Literal["fmp"], None] = None, **kwargs ) -> OBBject[List]: """Key Metrics. @@ -1884,9 +1897,9 @@ class CLASS_stocks_fa(Container): Symbol to get data for. period : Literal['annual', 'quarter'] Period of the data to return. - limit : Optional[int] + limit : Union[int, NoneType] The number of data entries to return. - provider : Optional[Literal['fmp']] + provider : Union[Literal['fmp'], NoneType] The provider to use for the query, by default None. If None, the provider specified in defaults is selected or 'fmp' if there is no default. @@ -1896,7 +1909,7 @@ class CLASS_stocks_fa(Container): OBBject results : List[KeyMetrics] Serializable results. - provider : Optional[Literal['fmp']] + provider : Union[Literal['fmp'], NoneType] Provider name. warnings : Optional[List[Warning_]] List of warnings. @@ -2048,11 +2061,11 @@ class CLASS_stocks_fa(Container): @validate_arguments def mgmt( self, - symbol: Annotated[ + symbol: typing_extensions.Annotated[ Union[str, List[str]], OpenBBCustomParameter(description="Symbol to get data for."), ], - provider: Optional[Literal["fmp"]] = None, + provider: Union[Literal["fmp"], None] = None, **kwargs ) -> OBBject[List]: """Key Executives. @@ -2061,7 +2074,7 @@ class CLASS_stocks_fa(Container): ---------- symbol : Union[str, List[str]] Symbol to get data for. - provider : Optional[Literal['fmp']] + provider : Union[Literal['fmp'], NoneType] The provider to use for the query, by default None. If None, the provider specified in defaults is selected or 'fmp' if there is no default. @@ -2071,7 +2084,7 @@ class CLASS_stocks_fa(Container): OBBject results : List[KeyExecutives] Serializable results. - provider : Optional[Literal['fmp']] + provider : Union[Literal['fmp'], NoneType] Provider name. warnings : Optional[List[Warning_]] List of warnings. @@ -2115,11 +2128,11 @@ class CLASS_stocks_fa(Container): @validate_arguments def overview( self, - symbol: Annotated[ + symbol: typing_extensions.Annotated[ Union[str, List[str]], OpenBBCustomParameter(description="Symbol to get data for."), ], - provider: Optional[Literal["fmp"]] = None, + provider: Union[Literal["fmp"], None] = None, **kwargs ) -> OBBject[BaseModel]: """Company Overview. @@ -2128,7 +2141,7 @@ class CLASS_stocks_fa(Container): ---------- symbol : Union[str, List[str]] Symbol to get data for. - provider : Optional[Literal['fmp']] + provider : Union[Literal['fmp'], NoneType] The provider to use for the query, by default None. If None, the provider specified in defaults is selected or 'fmp' if there is no default. @@ -2138,7 +2151,7 @@ class CLASS_stocks_fa(Container): OBBject results : List[CompanyOverview] Serializable results. - provider : Optional[Literal['fmp']] + provider : Union[Literal['fmp'], NoneType] Provider name. warnings : Optional[List[Warning_]] List of warnings. @@ -2240,19 +2253,19 @@ class CLASS_stocks_fa(Container): @validate_arguments def own( self, - symbol: Annotated[ + symbol: typing_extensions.Annotated[ Union[str, List[str]], OpenBBCustomParameter(description="Symbol to get data for."), ], - date: Annotated[ - Optional[datetime.date], + date: typing_extensions.Annotated[ + Union[datetime.date, None], OpenBBCustomParameter(description="A specific date to get data for."), ] = None, - page: Annotated[ - Optional[int], + page: typing_extensions.Annotated[ + Union[int, None], OpenBBCustomParameter(description="Page number of the data to fetch."), ] = 0, - provider: Optional[Literal["fmp"]] = None, + provider: Union[Literal["fmp"], None] = None, **kwargs ) -> OBBject[List]: """Stock Ownership. @@ -2261,11 +2274,11 @@ class CLASS_stocks_fa(Container): ---------- symbol : Union[str, List[str]] Symbol to get data for. - date : Optional[datetime.date] + date : Union[datetime.date, NoneType] A specific date to get data for. - page : Optional[int] + page : Union[int, NoneType] Page number of the data to fetch. - provider : Optional[Literal['fmp']] + provider : Union[Literal['fmp'], NoneType] The provider to use for the query, by default None. If None, the provider specified in defaults is selected or 'fmp' if there is no default. @@ -2275,7 +2288,7 @@ class CLASS_stocks_fa(Container): OBBject results : List[StockOwnership] Serializable results. - provider : Optional[Literal['fmp']] + provider : Union[Literal['fmp'], NoneType] Provider name. warnings : Optional[List[Warning_]] List of warnings. @@ -2385,11 +2398,11 @@ class CLASS_stocks_fa(Container): @validate_arguments def pt( self, - symbol: Annotated[ + symbol: typing_extensions.Annotated[ Union[str, List[str]], OpenBBCustomParameter(description="Symbol to get data for."), ], - provider: Optional[Literal["fmp"]] = None, + provider: Union[Literal["fmp"], None] = None, **kwargs ) -> OBBject[BaseModel]: """Price Target Consensus. @@ -2398,7 +2411,7 @@ class CLASS_stocks_fa(Container): ---------- symbol : Union[str, List[str]] Symbol to get data for. - provider : Optional[Literal['fmp']] + provider : Union[Literal['fmp'], NoneType] The provider to use for the query, by default None. If None, the provider specified in defaults is selected or 'fmp' if there is no default. @@ -2408,7 +2421,7 @@ class CLASS_stocks_fa(Container): OBBject results : List[PriceTargetConsensus] Serializable results. - provider : Optional[Literal['fmp']] + provider : Union[Literal['fmp'], NoneType] Provider name. warnings : Optional[List[Warning_]] List of warnings. @@ -2448,11 +2461,11 @@ class CLASS_stocks_fa(Container): @validate_arguments def pta( self, - symbol: Annotated[ + symbol: typing_extensions.Annotated[ Union[str, List[str]], OpenBBCustomParameter(description="Symbol to get data for."), ], - provider: Optional[Literal["fmp"]] = None, + provider: Union[Literal["fmp"], None] = None, **kwargs ) -> OBBject[List]: """Price Target. @@ -2461,7 +2474,7 @@ class CLASS_stocks_fa(Container): ---------- symbol : Union[str, List[str]] Symbol to get data for. - provider : Optional[Literal['fmp']] + provider : Union[Literal['fmp'], NoneType] The provider to use for the query, by default None. If None, the provider specified in defaults is selected or 'fmp' if there is no default. @@ -2473,7 +2486,7 @@ class CLASS_stocks_fa(Container): OBBject results : List[PriceTarget] Serializable results. - provider : Optional[Literal['fmp']] + provider : Union[Literal['fmp'], NoneType] Provider name. warnings : Optional[List[Warning_]] List of warnings. @@ -2531,19 +2544,19 @@ class CLASS_stocks_fa(Container): @validate_arguments def ratios( self, - symbol: Annotated[ + symbol: typing_extensions.Annotated[ Union[str, List[str]], OpenBBCustomParameter(description="Symbol to get data for."), ], - period: Annotated[ + period: typing_extensions.Annotated[ Literal["annual", "quarter"], OpenBBCustomParameter(description="Period of the data to return."), ] = "annual", - limit: Annotated[ - Optional[pydantic.types.NonNegativeInt], + limit: typing_extensions.Annotated[ + Union[pydantic.types.NonNegativeInt, None], OpenBBCustomParameter(description="The number of data entries to return."), ] = 12, - provider: Optional[Literal["fmp"]] = None, + provider: Union[Literal["fmp"], None] = None, **kwargs ) -> OBBject[List]: """Extensive set of ratios over time. @@ -2554,9 +2567,9 @@ class CLASS_stocks_fa(Container): Symbol to get data for. period : Literal['annual', 'quarter'] Period of the data to return. - limit : Optional[pydantic.types.NonNegativeInt] + limit : Union[pydantic.types.NonNegativeInt, NoneType] The number of data entries to return. - provider : Optional[Literal['fmp']] + provider : Union[Literal['fmp'], NoneType] The provider to use for the query, by default None. If None, the provider specified in defaults is selected or 'fmp' if there is no default. @@ -2566,7 +2579,7 @@ class CLASS_stocks_fa(Container): OBBject results : List[FinancialRatios] Serializable results. - provider : Optional[Literal['fmp']] + provider : Union[Literal['fmp'], NoneType] Provider name. warnings : Optional[List[Warning_]] List of warnings. @@ -2712,19 +2725,19 @@ class CLASS_stocks_fa(Container): @validate_arguments def revgeo( self, - symbol: Annotated[ + symbol: typing_extensions.Annotated[ Union[str, List[str]], OpenBBCustomParameter(description="Symbol to get data for."), ], - period: Annotated[ - Literal["annual", "quarter"], + period: typing_extensions.Annotated[ + Literal["quarter", "annual"], OpenBBCustomParameter(description="Period of the data to return."), ] = "annual", - structure: Annotated[ + structure: typing_extensions.Annotated[ Literal["hierarchical", "flat"], OpenBBCustomParameter(description="Structure of the returned data."), ] = "flat", - provider: Optional[Literal["fmp"]] = None, + provider: Union[Literal["fmp"], None] = None, **kwargs ) -> OBBject[List]: """Revenue Geographic. @@ -2733,11 +2746,11 @@ class CLASS_stocks_fa(Container): ---------- symbol : Union[str, List[str]] Symbol to get data for. - period : Literal['annual', 'quarter'] + period : Literal['quarter', 'annual'] Period of the data to return. structure : Literal['hierarchical', 'flat'] Structure of the returned data. - provider : Optional[Literal['fmp']] + provider : Union[Literal['fmp'], NoneType] The provider to use for the query, by default None. If None, the provider specified in defaults is selected or 'fmp' if there is no default. @@ -2747,7 +2760,7 @@ class CLASS_stocks_fa(Container): OBBject results : List[RevenueGeographic] Serializable results. - provider : Optional[Literal['fmp']] + provider : Union[Literal['fmp'], NoneType] Provider name. warnings : Optional[List[Warning_]] List of warnings. @@ -2793,19 +2806,19 @@ class CLASS_stocks_fa(Container): @validate_arguments def revseg( self, - symbol: Annotated[ + symbol: typing_extensions.Annotated[ Union[str, List[str]], OpenBBCustomParameter(description="Symbol to get data for."), ], - period: Annotated[ - Literal["annual", "quarter"], + period: typing_extensions.Annotated[ + Literal["quarter", "annual"], OpenBBCustomParameter(description="Period of the data to return."), ] = "annual", - structure: Annotated[ + structure: typing_extensions.Annotated[ Literal["hierarchical", "flat"], OpenBBCustomParameter(description="Structure of the returned data."), ] = "flat", - provider: Optional[Literal["fmp"]] = None, + provider: Union[Literal["fmp"], None] = None, **kwargs ) -> OBBject[List]: """Revenue Business Line. @@ -2814,11 +2827,11 @@ class CLASS_stocks_fa(Container): ---------- symbol : Union[str, List[str]] Symbol to get data for. - period : Literal['annual', 'quarter'] + period : Literal['quarter', 'annual'] Period of the data to return. structure : Literal['hierarchical', 'flat'] Structure of the returned data. - provider : Optional[Literal['fmp']] + provider : Union[Literal['fmp'], NoneType] The provider to use for the query, by default None. If None, the provider specified in defaults is selected or 'fmp' if there is no default. @@ -2828,7 +2841,7 @@ class CLASS_stocks_fa(Container): OBBject results : List[RevenueBusinessLine] Serializable results. - provider : Optional[Literal['fmp']] + provider : Union[Literal['fmp'], NoneType] Provider name. warnings : Optional[List[Warning_]] List of warnings. @@ -2864,11 +2877,11 @@ class CLASS_stocks_fa(Container): @validate_arguments def shrs( self, - symbol: Annotated[ + symbol: typing_extensions.Annotated[ Union[str, List[str]], OpenBBCustomParameter(description="Symbol to get data for."), ], - provider: Optional[Literal["fmp"]] = None, + provider: Union[Literal["fmp"], None] = None, **kwargs ) -> OBBject[List]: """Share Statistics. @@ -2877,7 +2890,7 @@ class CLASS_stocks_fa(Container): ---------- symbol : Union[str, List[str]] Symbol to get data for. - provider : Optional[Literal['fmp']] + provider : Union[Literal['fmp'], NoneType] The provider to use for the query, by default None. If None, the provider specified in defaults is selected or 'fmp' if there is no default. @@ -2887,7 +2900,7 @@ class CLASS_stocks_fa(Container): OBBject results : List[ShareStatistics] Serializable results. - provider : Optional[Literal['fmp']] + provider : Union[Literal['fmp'], NoneType] Provider name. warnings : Optional[List[Warning_]] List of warnings. @@ -2929,11 +2942,11 @@ class CLASS_stocks_fa(Container): @validate_arguments def split( self, - symbol: Annotated[ + symbol: typing_extensions.Annotated[ Union[str, List[str]], OpenBBCustomParameter(description="Symbol to get data for."), ], - provider: Optional[Literal["fmp"]] = None, + provider: Union[Literal["fmp"], None] = None, **kwargs ) -> OBBject[List]: """Historical Stock Splits. @@ -2942,7 +2955,7 @@ class CLASS_stocks_fa(Container): ---------- symbol : Union[str, List[str]] Symbol to get data for. - provider : Optional[Literal['fmp']] + provider : Union[Literal['fmp'], NoneType] The provider to use for the query, by default None. If None, the provider specified in defaults is selected or 'fmp' if there is no default. @@ -2952,7 +2965,7 @@ class CLASS_stocks_fa(Container): OBBject results : List[HistoricalStockSplits] Serializable results. - provider : Optional[Literal['fmp']] + provider : Union[Literal['fmp'], NoneType] Provider name. warnings : Optional[List[Warning_]] List of warnings. @@ -2990,21 +3003,21 @@ class CLASS_stocks_fa(Container): @validate_arguments def transcript( self, - symbol: Annotated[ + symbol: typing_extensions.Annotated[ Union[str, List[str]], OpenBBCustomParameter(description="Symbol to get data for."), ], - year: Annotated[ + year: typing_extensions.Annotated[ int, OpenBBCustomParameter(description="Year of the earnings call transcript."), ], - quarter: Annotated[ + quarter: typing_extensions.Annotated[ Literal[1, 2, 3, 4], OpenBBCustomParameter( description="Quarter of the earnings call transcript." ), ] = 1, - provider: Optional[Literal["fmp"]] = None, + provider: Union[Literal["fmp"], None] = None, **kwargs ) -> OBBject[List]: """Earnings Call Transcript. @@ -3017,7 +3030,7 @@ class CLASS_stocks_fa(Container): Year of the earnings call transcript. quarter : Literal[1, 2, 3, 4] Quarter of the earnings call transcript. - provider : Optional[Literal['fmp']] + provider : Union[Literal['fmp'], NoneType] The provider to use for the query, by default None. If None, the provider specified in defaults is selected or 'fmp' if there is no default. @@ -3027,7 +3040,7 @@ class CLASS_stocks_fa(Container): OBBject results : List[EarningsCallTranscript] Serializable results. - provider : Optional[Literal['fmp']] + provider : Union[Literal['fmp'], NoneType] Provider name. warnings : Optional[List[Warning_]] List of warnings. diff --git a/openbb_sdk/openbb/package/stocks_options.py b/openbb_sdk/openbb/package/stocks_options.py index 8b5fc5dc315..9363e2ddc7b 100644 --- a/openbb_sdk/openbb/package/stocks_options.py +++ b/openbb_sdk/openbb/package/stocks_options.py @@ -1,13 +1,13 @@ ### THIS FILE IS AUTO-GENERATED. DO NOT EDIT. ### -from typing import List, Literal, Optional, Union +from typing import List, Literal, Union +import typing_extensions from openbb_core.app.model.custom_parameter import OpenBBCustomParameter from openbb_core.app.model.obbject import OBBject from openbb_core.app.static.container import Container from openbb_core.app.static.filters import filter_inputs from pydantic import validate_arguments -from typing_extensions import Annotated class CLASS_stocks_options(Container): @@ -21,11 +21,11 @@ class CLASS_stocks_options(Container): @validate_arguments def chains( self, - symbol: Annotated[ + symbol: typing_extensions.Annotated[ Union[str, List[str]], OpenBBCustomParameter(description="Symbol to get data for."), ], - provider: Optional[Literal["cboe"]] = None, + provider: Union[Literal["cboe", "intrinio"], None] = None, **kwargs ) -> OBBject[List]: """Get the complete options chain for a ticker. @@ -34,17 +34,19 @@ class CLASS_stocks_options(Container): ---------- symbol : Union[str, List[str]] Symbol to get data for. - provider : Optional[Literal['cboe']] + provider : Union[Literal['cboe', 'intrinio'], NoneType] The provider to use for the query, by default None. If None, the provider specified in defaults is selected or 'cboe' if there is no default. + date : Union[datetime.date, str, NoneType] + Date for which the options chains are returned. (provider: intrinio) Returns ------- OBBject results : List[OptionsChains] Serializable results. - provider : Optional[Literal['cboe']] + provider : Union[Literal['cboe', 'intrinio'], NoneType] Provider name. warnings : Optional[List[Warning_]] List of warnings. @@ -78,11 +80,11 @@ class CLASS_stocks_options(Container): theoretical : Optional[float] Theoretical value of the option. (provider: cboe) open : Optional[float] - Opening price of the option. (provider: cboe) + Opening price of the option. (provider: cboe, intrinio) high : Optional[float] - High price of the option. (provider: cboe) + High price of the option. (provider: cboe, intrinio) low : Optional[float] - Low price of the option. (provider: cboe) + Low price of the option. (provider: cboe, intrinio) last_trade_price : Optional[float] Last trade price of the option. (provider: cboe) tick : Optional[str] @@ -94,21 +96,40 @@ class CLASS_stocks_options(Container): change_percent : Optional[float] Change, in percent, of the option. (provider: cboe) implied_volatility : Optional[float] - Implied volatility of the option. (provider: cboe) + Implied volatility of the option. (provider: cboe, intrinio) delta : Optional[float] - Delta of the option. (provider: cboe) + Delta of the option. (provider: cboe, intrinio) gamma : Optional[float] - Gamma of the option. (provider: cboe) + Gamma of the option. (provider: cboe, intrinio) vega : Optional[float] - Vega of the option. (provider: cboe) + Vega of the option. (provider: cboe, intrinio) theta : Optional[float] - Theta of the option. (provider: cboe) + Theta of the option. (provider: cboe, intrinio) rho : Optional[float] Rho of the option. (provider: cboe) last_trade_timestamp : Optional[datetime] Last trade timestamp of the option. (provider: cboe) dte : Optional[int] - Days to expiration for the option. (provider: cboe)""" # noqa: E501 + Days to expiration for the option. (provider: cboe, intrinio) + mark : Optional[float] + The mid-price between the latest bid-ask spread. (provider: intrinio) + open_bid : Optional[float] + The lowest bid price for the option that day. (provider: intrinio) + open_ask : Optional[float] + The lowest ask price for the option that day. (provider: intrinio) + bid_low : Optional[float] + The lowest bid price for the option that day. (provider: intrinio) + ask_low : Optional[float] + The lowest ask price for the option that day. (provider: intrinio) + bid_high : Optional[float] + The highest bid price for the option that day. (provider: intrinio) + ask_high : Optional[float] + The highest ask price for the option that day. (provider: intrinio) + close : Optional[float] + Close price for the option that day. (provider: intrinio) + eod_date : Optional[date] + Historical date for which the options chains data is from. (provider: intrinio) + """ # noqa: E501 inputs = filter_inputs( provider_choices={ diff --git a/openbb_sdk/openbb/package/ta.py b/openbb_sdk/openbb/package/ta.py index 3cfc2d7a1e8..be11bdd7747 100644 --- a/openbb_sdk/openbb/package/ta.py +++ b/openbb_sdk/openbb/package/ta.py @@ -1,6 +1,6 @@ ### THIS FILE IS AUTO-GENERATED. DO NOT EDIT. ### -from typing import List, Literal, Optional, Union +from typing import List, Literal, Union import openbb_provider import pandas @@ -783,8 +783,8 @@ class CLASS_ta(Container): index: str = "date", close_column: Literal["close", "adj_close"] = "close", period: pydantic.types.PositiveInt = 120, - start_date: Optional[str] = None, - end_date: Optional[str] = None, + start_date: Union[str, None] = None, + end_date: Union[str, None] = None, ) -> OBBject[List]: """Create Fibonacci Retracement Levels. From d5ad4652c6abcc149037eb3b720e5323de4faebc Mon Sep 17 00:00:00 2001 From: Igor Radovanovic <74266147+IgorWounds@users.noreply.github.com> Date: Tue, 12 Sep 2023 15:06:29 +0200 Subject: [PATCH 9/9] Cleanup --- .../sdk/core/openbb_core/app/model/obbject.py | 6 ------ openbb_sdk/sdk/core/openbb_core/app/utils.py | 13 +++---------- 2 files changed, 3 insertions(+), 16 deletions(-) diff --git a/openbb_sdk/sdk/core/openbb_core/app/model/obbject.py b/openbb_sdk/sdk/core/openbb_core/app/model/obbject.py index 38311533751..9bb84def10a 100644 --- a/openbb_sdk/sdk/core/openbb_core/app/model/obbject.py +++ b/openbb_sdk/sdk/core/openbb_core/app/model/obbject.py @@ -179,12 +179,6 @@ class OBBject(GenericModel, Generic[T], Tagged): return results - # def to_dict(self, list_fields: bool = False) -> Dict[str, Any]: - # if list_fields: - # df = self.to_dataframe().reset_index() - # return {field: df[field].tolist() for field in df.columns} - # return self.dict()["results"] - def to_chart(self, **kwargs): """ Create or update the `Chart`. diff --git a/openbb_sdk/sdk/core/openbb_core/app/utils.py b/openbb_sdk/sdk/core/openbb_core/app/utils.py index c252fda7577..5e1874fcdd3 100644 --- a/openbb_sdk/sdk/core/openbb_core/app/utils.py +++ b/openbb_sdk/sdk/core/openbb_core/app/utils.py @@ -10,20 +10,13 @@ def basemodel_to_df( index: Optional[Union[str, Iterable]] = None, ) -> pd.DataFrame: """Convert list of BaseModel to a Pandas DataFrame.""" - # Get consistent column order from the first data instance - columns_order = ( - list(data[0].dict().keys()) - if isinstance(data, list) and data - else list(data.dict().keys()) # type: ignore - ) - if isinstance(data, list): - df = pd.DataFrame([d.dict() for d in data], columns=columns_order) + df = pd.DataFrame([d.dict() for d in data]) else: try: - df = pd.DataFrame(data.dict(), columns=columns_order) + df = pd.DataFrame(data.dict()) except ValueError: - df = pd.DataFrame(data.dict(), index=["values"], columns=columns_order) + df = pd.DataFrame(data.dict(), index=["values"]) if "is_multiindex" in df.columns: col_names = ast.literal_eval(df.multiindex_names.unique()[0])