diff options
author | hjoaquim <h.joaquim@campus.fct.unl.pt> | 2023-10-18 12:18:32 +0100 |
---|---|---|
committer | hjoaquim <h.joaquim@campus.fct.unl.pt> | 2023-10-18 12:18:32 +0100 |
commit | fb82ff7bd9af92ed676d8f8047c31e74daf7b8b2 (patch) | |
tree | e6bcd740e7bfd34f5c09418748faf90cc102d60b | |
parent | e09629ea0e0668d8c9860edfde0d9ca9fb38069b (diff) |
static assets built on 3.8
-rw-r--r-- | openbb_platform/openbb/package/__extensions__.py | 4 | ||||
-rw-r--r-- | openbb_platform/openbb/package/crypto.py | 44 | ||||
-rw-r--r-- | openbb_platform/openbb/package/econometrics.py | 8 | ||||
-rw-r--r-- | openbb_platform/openbb/package/economy.py | 537 | ||||
-rw-r--r-- | openbb_platform/openbb/package/fixedincome.py | 191 | ||||
-rw-r--r-- | openbb_platform/openbb/package/forex.py | 97 | ||||
-rw-r--r-- | openbb_platform/openbb/package/futures.py | 59 | ||||
-rw-r--r-- | openbb_platform/openbb/package/news.py | 69 | ||||
-rw-r--r-- | openbb_platform/openbb/package/qa.py | 18 | ||||
-rw-r--r-- | openbb_platform/openbb/package/stocks.py | 520 | ||||
-rw-r--r-- | openbb_platform/openbb/package/stocks_ca.py | 14 | ||||
-rw-r--r-- | openbb_platform/openbb/package/stocks_fa.py | 1044 | ||||
-rw-r--r-- | openbb_platform/openbb/package/stocks_options.py | 87 | ||||
-rw-r--r-- | openbb_platform/openbb/package/ta.py | 56 |
14 files changed, 1584 insertions, 1164 deletions
diff --git a/openbb_platform/openbb/package/__extensions__.py b/openbb_platform/openbb/package/__extensions__.py index 6cee226f838..3be941aedfe 100644 --- a/openbb_platform/openbb/package/__extensions__.py +++ b/openbb_platform/openbb/package/__extensions__.py @@ -12,7 +12,11 @@ from inspect import Parameter import typing from typing import List, Dict, Union, Optional, Literal from annotated_types import Ge, Le, Gt, Lt +<<<<<<< Updated upstream from typing_extensions import Annotated +======= +import typing_extensions +>>>>>>> Stashed changes from openbb_core.app.utils import df_to_basemodel from openbb_core.app.static.decorators import validate diff --git a/openbb_platform/openbb/package/crypto.py b/openbb_platform/openbb/package/crypto.py index 59977cb0fce..fbf003a9410 100644 --- a/openbb_platform/openbb/package/crypto.py +++ b/openbb_platform/openbb/package/crypto.py @@ -12,7 +12,11 @@ from inspect import Parameter import typing from typing import List, Dict, Union, Optional, Literal from annotated_types import Ge, Le, Gt, Lt +<<<<<<< Updated upstream from typing_extensions import Annotated +======= +import typing_extensions +>>>>>>> Stashed changes from openbb_core.app.utils import df_to_basemodel from openbb_core.app.static.decorators import validate @@ -35,25 +39,29 @@ class ROUTER_crypto(Container): @validate def load( self, - symbol: Annotated[ + symbol: typing_extensions.Annotated[ Union[str, List[str]], OpenBBCustomParameter( description="Symbol Pair to get data for in CURR1-CURR2 or CURR1CURR2 format." ), ], - 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, +<<<<<<< Updated upstream provider: Optional[Literal["fmp", "polygon", "yfinance"]] = None, +======= + provider: Union[Literal["fmp", "polygon", "yfinance"], None] = None, +>>>>>>> Stashed changes **kwargs ) -> OBBject[List[Data]]: """Crypto Historical Price. Cryptocurrency historical price data. @@ -62,15 +70,15 @@ class ROUTER_crypto(Container): ---------- symbol : str Symbol Pair to get data for in CURR1-CURR2 or CURR1CURR2 format. - start_date : Optional[datetime.date] + start_date : Union[datetime.date, None] Start date of the data, in YYYY-MM-DD format. - end_date : Optional[datetime.date] + end_date : Union[datetime.date, None] End date of the data, in YYYY-MM-DD format. - provider : Optional[Literal['fmp', 'polygon', 'yfinance']] + provider : Union[Literal['fmp', 'polygon', 'yfinance'], None] 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[Annotated[int, Ge(ge=0)]] + timeseries : Optional[Union[typing_extensions.Annotated[int, Ge(ge=0)]]] Number of days to look back. (provider: fmp) interval : Optional[Union[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: fmp, yfinance) @@ -84,15 +92,15 @@ class ROUTER_crypto(Container): The number of data entries to return. (provider: polygon) adjusted : bool Whether the data is adjusted. (provider: polygon) - period : Optional[Literal['1d', '5d', '1mo', '3mo', '6mo', '1y', '2y', '5y', '10y', 'ytd', 'max']] + period : Optional[Union[Literal['1d', '5d', '1mo', '3mo', '6mo', '1y', '2y', '5y', '10y', 'ytd', 'max']]] Time period of the data to return. (provider: yfinance) Returns ------- OBBject - results : List[CryptoHistorical] + results : Union[List[CryptoHistorical]] Serializable results. - provider : Optional[Literal['fmp', 'polygon', 'yfinance']] + provider : Union[Literal['fmp', 'polygon', 'yfinance'], None] Provider name. warnings : Optional[List[Warning_]] List of warnings. @@ -115,21 +123,21 @@ class ROUTER_crypto(Container): The close price of the symbol. volume : float The volume of the symbol. - vwap : Optional[Annotated[float, Gt(gt=0)]] + vwap : Optional[Union[typing_extensions.Annotated[float, Gt(gt=0)]]] Volume Weighted Average Price of the symbol. - adj_close : Optional[float] + adj_close : Optional[Union[float]] Adjusted Close Price of the symbol. (provider: fmp) - unadjusted_volume : Optional[float] + unadjusted_volume : Optional[Union[float]] Unadjusted volume of the symbol. (provider: fmp) - change : Optional[float] + change : Optional[Union[float]] Change in the price of the symbol from the previous day. (provider: fmp) - change_percent : Optional[float] + change_percent : Optional[Union[float]] Change % in the price of the symbol. (provider: fmp) - label : Optional[str] + label : Optional[Union[str]] Human readable format of the date. (provider: fmp) - change_over_time : Optional[float] + change_over_time : Optional[Union[float]] Change % in the price of the symbol over a period of time. (provider: fmp) - transactions : Optional[Annotated[int, Gt(gt=0)]] + transactions : Optional[Union[typing_extensions.Annotated[int, Gt(gt=0)]]] Number of transactions for the symbol in the time period. (provider: polygon) Example -------- diff --git a/openbb_platform/openbb/package/econometrics.py b/openbb_platform/openbb/package/econometrics.py index bfee02a94a9..d30c0ae3dd5 100644 --- a/openbb_platform/openbb/package/econometrics.py +++ b/openbb_platform/openbb/package/econometrics.py @@ -12,7 +12,11 @@ from inspect import Parameter import typing from typing import List, Dict, Union, Optional, Literal from annotated_types import Ge, Le, Gt, Lt +<<<<<<< Updated upstream from typing_extensions import Annotated +======= +import typing_extensions +>>>>>>> Stashed changes from openbb_core.app.utils import df_to_basemodel from openbb_core.app.static.decorators import validate @@ -50,7 +54,7 @@ class ROUTER_econometrics(Container): data: Union[List[Data], pandas.DataFrame], y_column: str, x_columns: List[str], - lags: Annotated[int, Gt(gt=0)] = 1, + lags: typing_extensions.Annotated[int, Gt(gt=0)] = 1, ) -> OBBject[Data]: """Perform Breusch-Godfrey Lagrange Multiplier tests for residual autocorrelation. @@ -179,7 +183,7 @@ class ROUTER_econometrics(Container): data: Union[List[Data], pandas.DataFrame], y_column: str, x_column: str, - lag: Annotated[int, Gt(gt=0)] = 3, + lag: typing_extensions.Annotated[int, Gt(gt=0)] = 3, ) -> OBBject[Data]: """Perform Granger causality test to determine if X "causes" y. diff --git a/openbb_platform/openbb/package/economy.py b/openbb_platform/openbb/package/economy.py index 5bae7b88b07..685dcf7ab33 100644 --- a/openbb_platform/openbb/package/economy.py +++ b/openbb_platform/openbb/package/economy.py @@ -12,7 +12,11 @@ from inspect import Parameter import typing from typing import List, Dict, Union, Optional, Literal from annotated_types import Ge, Le, Gt, Lt +<<<<<<< Updated upstream from typing_extensions import Annotated +======= +import typing_extensions +>>>>>>> Stashed changes from openbb_core.app.utils import df_to_basemodel from openbb_core.app.static.decorators import validate @@ -50,13 +54,13 @@ class ROUTER_economy(Container): @validate def available_indices( - self, provider: Optional[Literal["cboe", "fmp", "yfinance"]] = None, **kwargs + self, provider: Union[Literal["cboe", "fmp", "yfinance"], None] = None, **kwargs ) -> OBBject[List[Data]]: """Available Indices. Available indices for a given provider. Parameters ---------- - provider : Optional[Literal['cboe', 'fmp', 'yfinance']] + provider : Union[Literal['cboe', 'fmp', 'yfinance'], None] 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. @@ -66,9 +70,9 @@ class ROUTER_economy(Container): Returns ------- OBBject - results : List[AvailableIndices] + results : Union[List[AvailableIndices]] Serializable results. - provider : Optional[Literal['cboe', 'fmp', 'yfinance']] + provider : Union[Literal['cboe', 'fmp', 'yfinance'], None] Provider name. warnings : Optional[List[Warning_]] List of warnings. @@ -79,36 +83,37 @@ class ROUTER_economy(Container): AvailableIndices ---------------- - name : Optional[str] + name : Optional[Union[str]] Name of the index. - currency : Optional[str] + currency : Optional[Union[str]] Currency the index is traded in. - isin : Optional[str] + isin : Optional[Union[str]] ISIN code for the index. Valid only for European indices. (provider: cboe) - region : Optional[str] + region : Optional[Union[str]] Region for the index. Valid only for European indices (provider: cboe) - symbol : Optional[str] + symbol : Optional[Union[str]] Symbol for the index. (provider: cboe, yfinance) - description : Optional[str] + description : Optional[Union[str]] Description for the index. Valid only for US indices. (provider: cboe) - data_delay : Optional[int] + data_delay : Optional[Union[int]] Data delay for the index. Valid only for US indices. (provider: cboe) - open_time : Optional[datetime.time] + open_time : Optional[Union[datetime.time]] Opening time for the index. Valid only for US indices. (provider: cboe) - close_time : Optional[datetime.time] + close_time : Optional[Union[datetime.time]] Closing time for the index. Valid only for US indices. (provider: cboe) - time_zone : Optional[str] + time_zone : Optional[Union[str]] Time zone for the index. Valid only for US indices. (provider: cboe) - tick_days : Optional[str] + tick_days : Optional[Union[str]] The trading days for the index. Valid only for US indices. (provider: cboe) - tick_frequency : Optional[str] + tick_frequency : Optional[Union[str]] The frequency of the index ticks. Valid only for US indices. (provider: cboe) - tick_period : Optional[str] + tick_period : Optional[Union[str]] The period of the index ticks. Valid only for US indices. (provider: cboe) - stock_exchange : Optional[str] + stock_exchange : Optional[Union[str]] Stock exchange where the index is listed. (provider: fmp) - exchange_short_name : Optional[str] + exchange_short_name : Optional[Union[str]] Short name of the stock exchange where the index is listed. (provider: fmp) +<<<<<<< Updated upstream code : Optional[str] ID code for keying the index in the OpenBB Terminal. (provider: yfinance) Example @@ -117,6 +122,10 @@ class ROUTER_economy(Container): >>> from openbb import obb >>> obb.economy.available_indices() """ # noqa: E501 +======= + code : Optional[Union[str]] + ID code for keying the index in the OpenBB Terminal. (provider: yfinance)""" # noqa: E501 +>>>>>>> Stashed changes inputs = filter_inputs( provider_choices={ @@ -134,13 +143,13 @@ class ROUTER_economy(Container): @validate 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[Data]]: """Major Indices Constituents. Constituents of an index. @@ -149,7 +158,7 @@ class ROUTER_economy(Container): ---------- index : Literal['nasdaq', 'sp500', 'dowjones'] Index for which we want to fetch the constituents. - provider : Optional[Literal['fmp']] + provider : Union[Literal['fmp'], None] 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. @@ -157,9 +166,9 @@ class ROUTER_economy(Container): Returns ------- OBBject - results : List[MajorIndicesConstituents] + results : Union[List[MajorIndicesConstituents]] Serializable results. - provider : Optional[Literal['fmp']] + provider : Union[Literal['fmp'], None] Provider name. warnings : Optional[List[Warning_]] List of warnings. @@ -176,9 +185,9 @@ class ROUTER_economy(Container): Name of the constituent company in the index. sector : str Sector the constituent company in the index belongs to. - sub_sector : Optional[str] + sub_sector : Optional[Union[str]] Sub-sector the constituent company in the index belongs to. - headquarter : Optional[str] + headquarter : Optional[Union[str]] Location of the headquarter of the constituent company in the index. date_first_added : Optional[Union[date, str]] Date the constituent company was added to the index. @@ -210,13 +219,13 @@ class ROUTER_economy(Container): @validate def cot( - self, provider: Optional[Literal["quandl"]] = None, **kwargs + self, provider: Union[Literal["quandl"], None] = None, **kwargs ) -> OBBject[List[Data]]: """Commitment of Traders Reports. Lookup Commitment of Traders Reports by series ID. Parameters ---------- - provider : Optional[Literal['quandl']] + provider : Union[Literal['quandl'], None] The provider to use for the query, by default None. If None, the provider specified in defaults is selected or 'quandl' if there is no default. @@ -227,7 +236,7 @@ class ROUTER_economy(Container): Certain symbols, such as "ES=F", or exact names are also valid. Default report is: S&P 500 Consolidated (CME)) (provider: quandl) - data_type : Optional[Literal['F', 'FO', 'CITS']] + data_type : Optional[Union[Literal['F', 'FO', 'CITS']]] The type of data to reuturn. Default is "FO". @@ -237,9 +246,9 @@ class ROUTER_economy(Container): CITS = Commodity Index Trader Supplemental. Only valid for commodities. (provider: quandl) - legacy_format : Optional[bool] + legacy_format : Optional[Union[bool]] Returns the legacy format of report. Default is False. (provider: quandl) - report_type : Optional[Literal['ALL', 'CHG', 'OLD', 'OTR']] + report_type : Optional[Union[Literal['ALL', 'CHG', 'OLD', 'OTR']]] The type of report to return. Default is "ALL". @@ -251,7 +260,7 @@ class ROUTER_economy(Container): OTR = Other Crop Years (provider: quandl) - measure : Optional[Literal['CR', 'NT', 'OI', 'CHG']] + measure : Optional[Union[Literal['CR', 'NT', 'OI', 'CHG']]] The measure to return. Default is None. @@ -263,19 +272,19 @@ class ROUTER_economy(Container): CHG = Change in Positions. Only valid when data_type is "CITS". (provider: quandl) - start_date : Optional[datetime.date] + start_date : Optional[Union[datetime.date]] The start date of the time series. Defaults to all. (provider: quandl) - end_date : Optional[datetime.date] + end_date : Optional[Union[datetime.date]] The end date of the time series. Defaults to the most recent data. (provider: quandl) - transform : Optional[Literal['diff', 'rdiff', 'cumul', 'normalize']] + transform : Optional[Union[Literal['diff', 'rdiff', 'cumul', 'normalize']]] Transform the data as w/w difference, percent change, cumulative, or normalize. (provider: quandl) Returns ------- OBBject - results : List[COT] + results : Union[List[COT]] Serializable results. - provider : Optional[Literal['quandl']] + provider : Union[Literal['quandl'], None] Provider name. warnings : Optional[List[Warning_]] List of warnings. @@ -309,8 +318,10 @@ class ROUTER_economy(Container): @validate def cot_search( self, - query: Annotated[str, OpenBBCustomParameter(description="Search query.")] = "", - provider: Optional[Literal["quandl"]] = None, + query: typing_extensions.Annotated[ + str, OpenBBCustomParameter(description="Search query.") + ] = "", + provider: Union[Literal["quandl"], None] = None, **kwargs ) -> OBBject[List[Data]]: """ @@ -322,7 +333,7 @@ class ROUTER_economy(Container): ---------- query : str Search query. - provider : Optional[Literal['quandl']] + provider : Union[Literal['quandl'], None] The provider to use for the query, by default None. If None, the provider specified in defaults is selected or 'quandl' if there is no default. @@ -330,9 +341,9 @@ class ROUTER_economy(Container): Returns ------- OBBject - results : List[COTSearch] + results : Union[List[COTSearch]] Serializable results. - provider : Optional[Literal['quandl']] + provider : Union[Literal['quandl'], None] Provider name. warnings : Optional[List[Warning_]] List of warnings. @@ -347,12 +358,13 @@ class ROUTER_economy(Container): CFTC Code of the report. name : str Name of the underlying asset. - category : Optional[str] + category : Optional[Union[str]] Category of the underlying asset. - subcategory : Optional[str] + subcategory : Optional[Union[str]] Subcategory of the underlying asset. - units : Optional[str] + units : Optional[Union[str]] The units for one contract. +<<<<<<< Updated upstream symbol : Optional[str] Trading symbol representing the underlying asset. Example @@ -361,6 +373,10 @@ class ROUTER_economy(Container): >>> from openbb import obb >>> obb.economy.cot_search() """ # noqa: E501 +======= + symbol : Optional[Union[str]] + Trading symbol representing the underlying asset.""" # noqa: E501 +>>>>>>> Stashed changes inputs = filter_inputs( provider_choices={ @@ -380,7 +396,7 @@ class ROUTER_economy(Container): @validate def cpi( self, - countries: Annotated[ + countries: typing_extensions.Annotated[ List[ Literal[ "australia", @@ -436,33 +452,33 @@ class ROUTER_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[Data]]: """CPI. Consumer Price Index. @@ -477,11 +493,11 @@ class ROUTER_economy(Container): The data time frequency. harmonized : bool Whether you wish to obtain harmonized data. - start_date : Optional[datetime.date] + start_date : Union[datetime.date, None] Start date of the data, in YYYY-MM-DD format. - end_date : Optional[datetime.date] + end_date : Union[datetime.date, None] End date of the data, in YYYY-MM-DD format. - provider : Optional[Literal['fred']] + provider : Union[Literal['fred'], None] 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. @@ -489,9 +505,9 @@ class ROUTER_economy(Container): Returns ------- OBBject - results : List[CPI] + results : Union[List[CPI]] Serializable results. - provider : Optional[Literal['fred']] + provider : Union[Literal['fred'], None] Provider name. warnings : Optional[List[Warning_]] List of warnings. @@ -502,8 +518,9 @@ class ROUTER_economy(Container): CPI --- - date : Optional[date] + date : Optional[Union[date]] The date of the data. +<<<<<<< Updated upstream value : Optional[float] CPI value on the date. Example @@ -512,6 +529,10 @@ class ROUTER_economy(Container): >>> from openbb import obb >>> obb.economy.cpi(countries=['portugal', 'spain'], units=growth_same, frequency=monthly) """ # noqa: E501 +======= + value : Optional[Union[float]] + CPI value on the date.""" # noqa: E501 +>>>>>>> Stashed changes inputs = filter_inputs( provider_choices={ @@ -536,23 +557,23 @@ class ROUTER_economy(Container): @validate def econcal( 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, - importance: Annotated[ + importance: typing_extensions.Annotated[ Literal["Low", "Medium", "High"], OpenBBCustomParameter(description="Importance of the event."), ] = None, - group: Annotated[ + group: typing_extensions.Annotated[ Literal[ "interest rate", "inflation", @@ -570,20 +591,20 @@ class ROUTER_economy(Container): ], OpenBBCustomParameter(description="Grouping of events"), ] = None, - country: Annotated[ + country: typing_extensions.Annotated[ Union[List[str], str, None], OpenBBCustomParameter(description="Country of the event"), ] = None, - provider: Optional[Literal["tradingeconomics"]] = None, + provider: Union[Literal["tradingeconomics"], None] = None, **kwargs ) -> OBBject[List[Data]]: """GDP Data. Parameters ---------- - start_date : Optional[datetime.date] + start_date : Union[datetime.date, None] Start date of the data, in YYYY-MM-DD format. - end_date : Optional[datetime.date] + end_date : Union[datetime.date, None] End date of the data, in YYYY-MM-DD format. importance : Literal['Low', 'Medium', 'High'] Importance of the event. @@ -591,7 +612,7 @@ class ROUTER_economy(Container): Grouping of events country : Union[List[str], str, None] Country of the event - provider : Optional[Literal['tradingeconomics']] + provider : Union[Literal['tradingeconomics'], None] The provider to use for the query, by default None. If None, the provider specified in defaults is selected or 'tradingeconomics' if there is no default. @@ -599,9 +620,9 @@ class ROUTER_economy(Container): Returns ------- OBBject - results : List[EconomicCalendar] + results : Union[List[EconomicCalendar]] Serializable results. - provider : Optional[Literal['tradingeco |