From 2f4abee46c12d0144b5a3b877541527ca6e51e8a Mon Sep 17 00:00:00 2001 From: Pratyush Shukla Date: Thu, 18 Jan 2024 11:04:11 +0530 Subject: [PATCH] [DEPRECATION] `index.market` renamed to `index.price.historical` (#5962) * deprecate index.market and add index.price.historical * add index.historical standard model * add index.historical provider models * index extension tests * provider tests * linting --- .../standard_models/index_historical.py | 63 +++ .../index/integration/test_index_api.py | 115 ++++++ .../index/integration/test_index_python.py | 110 ++++++ .../index/openbb_index/index_router.py | 9 +- .../index/openbb_index/price/__init__.py | 1 + .../index/openbb_index/price/price_router.py | 27 ++ .../providers/cboe/openbb_cboe/__init__.py | 14 +- .../openbb_cboe/models/index_historical.py | 212 ++++++++++ .../test_cboe_index_historical_fetcher.yaml | 346 ++++++++++++++++ .../cboe/tests/test_cboe_fetchers.py | 12 + .../providers/fmp/openbb_fmp/__init__.py | 2 + .../fmp/openbb_fmp/models/index_historical.py | 112 ++++++ .../test_fmp_index_historical_fetcher.yaml | 57 +++ .../providers/fmp/tests/test_fmp_fetchers.py | 14 + .../intrinio/openbb_intrinio/__init__.py | 2 + .../models/index_historical.py | 91 +++++ ...est_intrinio_index_historical_fetcher.yaml | 52 +++ .../intrinio/tests/test_intrinio_fetchers.py | 15 + .../polygon/openbb_polygon/__init__.py | 4 + .../openbb_polygon/models/index_historical.py | 110 ++++++ ...test_polygon_index_historical_fetcher.yaml | 79 ++++ .../polygon/tests/test_polygon_fetchers.py | 16 + .../yfinance/openbb_yfinance/__init__.py | 4 + .../models/index_historical.py | 135 +++++++ ...aml => test_y_finance_active_fetcher.yaml} | 0 ...inance_aggressive_small_caps_fetcher.yaml} | 0 ...ml => test_y_finance_gainers_fetcher.yaml} | 0 ...finance_growth_tech_equities_fetcher.yaml} | 0 ...st_y_finance_index_historical_fetcher.yaml | 373 ++++++++++++++++++ ...aml => test_y_finance_losers_fetcher.yaml} | 0 ..._undervalued_growth_equities_fetcher.yaml} | 0 ...nance_undervalued_large_caps_fetcher.yaml} | 0 .../yfinance/tests/test_yfinance_fetchers.py | 30 +- 33 files changed, 1992 insertions(+), 13 deletions(-) create mode 100644 openbb_platform/core/openbb_core/provider/standard_models/index_historical.py create mode 100644 openbb_platform/extensions/index/openbb_index/price/__init__.py create mode 100644 openbb_platform/extensions/index/openbb_index/price/price_router.py create mode 100644 openbb_platform/providers/cboe/openbb_cboe/models/index_historical.py create mode 100644 openbb_platform/providers/cboe/tests/record/http/test_cboe_fetchers/test_cboe_index_historical_fetcher.yaml create mode 100644 openbb_platform/providers/fmp/openbb_fmp/models/index_historical.py create mode 100644 openbb_platform/providers/fmp/tests/record/http/test_fmp_fetchers/test_fmp_index_historical_fetcher.yaml create mode 100644 openbb_platform/providers/intrinio/openbb_intrinio/models/index_historical.py create mode 100644 openbb_platform/providers/intrinio/tests/record/http/test_intrinio_fetchers/test_intrinio_index_historical_fetcher.yaml create mode 100644 openbb_platform/providers/polygon/openbb_polygon/models/index_historical.py create mode 100644 openbb_platform/providers/polygon/tests/record/http/test_polygon_fetchers/test_polygon_index_historical_fetcher.yaml create mode 100644 openbb_platform/providers/yfinance/openbb_yfinance/models/index_historical.py rename openbb_platform/providers/yfinance/tests/record/http/test_yfinance_fetchers/{test_yf_active_fetcher.yaml => test_y_finance_active_fetcher.yaml} (100%) rename openbb_platform/providers/yfinance/tests/record/http/test_yfinance_fetchers/{test_yf_aggressive_small_caps_fetcher.yaml => test_y_finance_aggressive_small_caps_fetcher.yaml} (100%) rename openbb_platform/providers/yfinance/tests/record/http/test_yfinance_fetchers/{test_yf_gainers_fetcher.yaml => test_y_finance_gainers_fetcher.yaml} (100%) rename openbb_platform/providers/yfinance/tests/record/http/test_yfinance_fetchers/{test_yf_growth_tech_equities_fetcher.yaml => test_y_finance_growth_tech_equities_fetcher.yaml} (100%) create mode 100644 openbb_platform/providers/yfinance/tests/record/http/test_yfinance_fetchers/test_y_finance_index_historical_fetcher.yaml rename openbb_platform/providers/yfinance/tests/record/http/test_yfinance_fetchers/{test_yf_losers_fetcher.yaml => test_y_finance_losers_fetcher.yaml} (100%) rename openbb_platform/providers/yfinance/tests/record/http/test_yfinance_fetchers/{test_yf_undervalued_growth_equities_fetcher.yaml => test_y_finance_undervalued_growth_equities_fetcher.yaml} (100%) rename openbb_platform/providers/yfinance/tests/record/http/test_yfinance_fetchers/{test_yf_undervalued_large_caps_fetcher.yaml => test_y_finance_undervalued_large_caps_fetcher.yaml} (100%) diff --git a/openbb_platform/core/openbb_core/provider/standard_models/index_historical.py b/openbb_platform/core/openbb_core/provider/standard_models/index_historical.py new file mode 100644 index 00000000000..2e19d327260 --- /dev/null +++ b/openbb_platform/core/openbb_core/provider/standard_models/index_historical.py @@ -0,0 +1,63 @@ +"""Index Historical Standard Model.""" + +from datetime import ( + date as dateType, + datetime, +) +from typing import List, Optional, Set, Union + +from dateutil import parser +from pydantic import Field, StrictFloat, field_validator + +from openbb_core.provider.abstract.data import Data, ForceInt +from openbb_core.provider.abstract.query_params import QueryParams +from openbb_core.provider.utils.descriptions import ( + DATA_DESCRIPTIONS, + QUERY_DESCRIPTIONS, +) + + +class IndexHistoricalQueryParams(QueryParams): + """Index Historical Query.""" + + symbol: str = Field(description=QUERY_DESCRIPTIONS.get("symbol", "")) + start_date: Optional[dateType] = Field( + description=QUERY_DESCRIPTIONS.get("start_date", ""), default=None + ) + end_date: Optional[dateType] = Field( + description=QUERY_DESCRIPTIONS.get("end_date", ""), default=None + ) + + @field_validator("symbol", mode="before", check_fields=False) + @classmethod + def upper_symbol(cls, v: Union[str, List[str], Set[str]]): + """Convert symbol to uppercase.""" + if isinstance(v, str): + return v.upper() + return ",".join([symbol.upper() for symbol in list(v)]) + + +class IndexHistoricalData(Data): + """Index Historical Data.""" + + date: datetime = Field(description=DATA_DESCRIPTIONS.get("date", "")) + open: Optional[StrictFloat] = Field( + default=None, description=DATA_DESCRIPTIONS.get("open", "") + ) + high: Optional[StrictFloat] = Field( + default=None, description=DATA_DESCRIPTIONS.get("high", "") + ) + low: Optional[StrictFloat] = Field( + default=None, description=DATA_DESCRIPTIONS.get("low", "") + ) + close: Optional[StrictFloat] = Field( + default=None, description=DATA_DESCRIPTIONS.get("close", "") + ) + volume: Optional[ForceInt] = Field( + default=None, description=DATA_DESCRIPTIONS.get("volume", "") + ) + + @field_validator("date", mode="before", check_fields=False) + def date_validate(cls, v): # pylint: disable=E0213 + """Return formatted datetime.""" + return parser.isoparse(str(v)) diff --git a/openbb_platform/extensions/index/integration/test_index_api.py b/openbb_platform/extensions/index/integration/test_index_api.py index 29250f8955a..8bf77655bbc 100644 --- a/openbb_platform/extensions/index/integration/test_index_api.py +++ b/openbb_platform/extensions/index/integration/test_index_api.py @@ -149,6 +149,121 @@ def test_index_market(params, headers): assert result.status_code == 200 +@parametrize( + "params", + [ + ( + { + "symbol": "^DJI", + "start_date": "2023-01-01", + "end_date": "2023-06-06", + "provider": "fmp", + "sort": "desc", + } + ), + ( + { + "interval": "1m", + "provider": "cboe", + "symbol": "AAVE100", + "start_date": "2023-01-01", + "end_date": "2023-06-06", + } + ), + ( + { + "interval": "1d", + "provider": "cboe", + "symbol": "AAVE100", + "start_date": "2023-01-01", + "end_date": "2023-06-06", + } + ), + ( + { + "interval": "1min", + "provider": "fmp", + "symbol": "^DJI", + "start_date": "2023-01-01", + "end_date": "2023-06-06", + "timeseries": 1, + "sort": "desc", + } + ), + ( + { + "interval": "1day", + "provider": "fmp", + "symbol": "^DJI", + "start_date": "2023-01-01", + "end_date": "2023-06-06", + "timeseries": 1, + "sort": "desc", + } + ), + ( + { + "timespan": "minute", + "sort": "desc", + "limit": 49999, + "adjusted": True, + "multiplier": 1, + "provider": "polygon", + "symbol": "NDX", + "start_date": "2023-01-01", + "end_date": "2023-06-06", + } + ), + ( + { + "timespan": "day", + "sort": "desc", + "limit": 49999, + "adjusted": True, + "multiplier": 1, + "provider": "polygon", + "symbol": "NDX", + "start_date": "2023-01-01", + "end_date": "2023-06-06", + } + ), + ( + { + "interval": "1d", + "period": "max", + "prepost": True, + "rounding": True, + "provider": "yfinance", + "symbol": "DJI", + "start_date": "2023-01-01", + "end_date": "2023-06-06", + } + ), + ( + { + "provider": "intrinio", + "start_date": "2023-01-01", + "end_date": "2023-06-06", + "symbol": "$DJI", + "tag": "level", + "sort": "desc", + "limit": 100, + "type": None, + } + ), + ], +) +@pytest.mark.integration +def test_index_price_historical(params, headers): + params = {p: v for p, v in params.items() if v} + + query_str = get_querystring(params, []) + url = f"http://0.0.0.0:8000/api/v1/index/price/historical?{query_str}" + result = requests.get(url, headers=headers, timeout=20) + assert isinstance(result, requests.Response) + assert result.status_code == 200 + + @parametrize( "params", [ diff --git a/openbb_platform/extensions/index/integration/test_index_python.py b/openbb_platform/extensions/index/integration/test_index_python.py index 8a84157d4d5..d5365cb23f1 100644 --- a/openbb_platform/extensions/index/integration/test_index_python.py +++ b/openbb_platform/extensions/index/integration/test_index_python.py @@ -142,6 +142,116 @@ def test_index_market(params, obb): assert len(result.results) > 0 +@parametrize( + "params", + [ + ( + { + "symbol": "AAVE100", + "start_date": "2023-01-01", + "end_date": "2023-06-06", + } + ), + ( + { + "interval": "1m", + "provider": "cboe", + "symbol": "AAVE100", + "start_date": "2023-01-01", + "end_date": "2023-06-06", + } + ), + ( + { + "interval": "1d", + "provider": "cboe", + "symbol": "AAVE100", + "start_date": "2023-01-01", + "end_date": "2023-06-06", + } + ), + ( + { + "interval": "1min", + "provider": "fmp", + "symbol": "^DJI", + "start_date": "2023-01-01", + "end_date": "2023-06-06", + "timeseries": 1, + "sort": "desc", + } + ), + ( + { + "interval": "1day", + "provider": "fmp", + "symbol": "^DJI", + "start_date": "2023-01-01", + "end_date": "2023-06-06", + "timeseries": 1, + "sort": "desc", + } + ), + ( + { + "timespan": "minute", + "sort": "desc", + "limit": 49999, + "adjusted": True, + "multiplier": 1, + "provider": "polygon", + "symbol": "NDX", + "start_date": "2023-01-01", + "end_date": "2023-06-06", + } + ), + ( + { + "timespan": "day", + "sort": "desc", + "limit": 49999, + "adjusted": True, + "multiplier": 1, + "provider": "polygon", + "symbol": "NDX", + "start_date": "2023-01-01", + "end_date": "2023-06-06", + } + ), + ( + { + "interval": "1d", + "period": "max", + "prepost": True, + "rounding": True, + "provider": "yfinance", + "symbol": "DJI", + "start_date": "2023-01-01", + "end_date": "2023-06-06", + } + ), + ( + { + "provider": "intrinio", + "start_date": "2023-01-01", + "end_date": "2023-06-06", + "symbol": "$DJI", + "tag": "level", + "sort": "desc", + "limit": 100, + "type": None, + } + ), + ], +) +@pytest.mark.integration +def test_index_price_historical(params, obb): + result = obb.index.price.historical(**params) + assert result + assert isinstance(result, OBBject) + assert len(result.results) > 0 + + @parametrize( "params", [ diff --git a/openbb_platform/extensions/index/openbb_index/index_router.py b/openbb_platform/extensions/index/openbb_index/index_router.py index 9f4d8df994a..6fc329d310d 100644 --- a/openbb_platform/extensions/index/openbb_index/index_router.py +++ b/openbb_platform/extensions/index/openbb_index/index_router.py @@ -10,12 +10,19 @@ from openbb_core.app.query import Query from openbb_core.app.router import Router from pydantic import BaseModel +from openbb_index.price.price_router import router as price_router + router = Router(prefix="") +router.include_router(price_router) # pylint: disable=unused-argument -@router.command(model="MarketIndices") +@router.command( + model="MarketIndices", + deprecated=True, + deprecation_message="This endpoint will be deprecated in the future releases. Use '/index/price/historical' instead.", +) async def market( cc: CommandContext, provider_choices: ProviderChoices, diff --git a/openbb_platform/extensions/index/openbb_index/price/__init__.py b/openbb_platform/extensions/index/openbb_index/price/__init__.py new file mode 100644 index 00000000000..8246f259eea --- /dev/null +++ b/openbb_platform/extensions/index/openbb_index/price/__init__.py @@ -0,0 +1 @@ +"""Index Price.""" diff --git a/openbb_platform/extensions/index/openbb_index/price/price_router.py b/openbb_platform/extensions/index/openbb_index/price/price_router.py new file mode 100644 index 00000000000..dc44332a687 --- /dev/null +++ b/openbb_platform/extensions/index/openbb_index/price/price_router.py @@ -0,0 +1,27 @@ +"""Price Router.""" + +from openbb_core.app.model.command_context import CommandContext +from openbb_core.app.model.obbject import OBBject +from openbb_core.app.provider_interface import ( + ExtraParams, + ProviderChoices, + StandardParams, +) +from openbb_core.app.query import Query +from openbb_core.app.router import Router +from pydantic import BaseModel + +router = Router(prefix="/price") + +# pylint: disable=unused-argument + + +@router.command(model="IndexHistorical") +async def historical( + cc: CommandContext, + provider_choices: ProviderChoices, + standard_params: StandardParams, + extra_params: ExtraParams, +) -> OBBject[BaseModel]: + """Index Historical Price. Load stock data for a specific index.""" + return await OBBject.from_query(Query(**locals())) diff --git a/openbb_platform/providers/cboe/openbb_cboe/__init__.py b/openbb_platform/providers/cboe/openbb_cboe/__init__.py index 3d72a61c32f..a9b59b1abee 100644 --- a/openbb_platform/providers/cboe/openbb_cboe/__init__.py +++ b/openbb_platform/providers/cboe/openbb_cboe/__init__.py @@ -12,6 +12,9 @@ from openbb_cboe.models.european_indices import ( CboeEuropeanIndicesFetcher, ) from openbb_cboe.models.futures_curve import CboeFuturesCurveFetcher +from openbb_cboe.models.index_historical import ( + CboeIndexHistoricalFetcher, +) from openbb_cboe.models.index_search import CboeIndexSearchFetcher from openbb_cboe.models.index_snapshots import CboeIndexSnapshotsFetcher from openbb_cboe.models.market_indices import ( @@ -28,16 +31,17 @@ cboe_provider = Provider( around the world.""", credentials=None, fetcher_dict={ - "EquitySearch": CboeEquitySearchFetcher, - "OptionsChains": CboeOptionsChainsFetcher, + "AvailableIndices": CboeAvailableIndicesFetcher, "EquityHistorical": CboeEquityHistoricalFetcher, "EquityInfo": CboeEquityInfoFetcher, - "FuturesCurve": CboeFuturesCurveFetcher, - "AvailableIndices": CboeAvailableIndicesFetcher, + "EquitySearch": CboeEquitySearchFetcher, "EuropeanIndexConstituents": CboeEuropeanIndexConstituentsFetcher, "EuropeanIndices": CboeEuropeanIndicesFetcher, - "MarketIndices": CboeMarketIndicesFetcher, + "FuturesCurve": CboeFuturesCurveFetcher, + "IndexHistorical": CboeIndexHistoricalFetcher, "IndexSearch": CboeIndexSearchFetcher, "IndexSnapshots": CboeIndexSnapshotsFetcher, + "MarketIndices": CboeMarketIndicesFetcher, + "OptionsChains": CboeOptionsChainsFetcher, }, ) diff --git a/openbb_platform/providers/cboe/openbb_cboe/models/index_historical.py b/openbb_platform/providers/cboe/openbb_cboe/models/index_historical.py new file mode 100644 index 00000000000..d68b413fa43 --- /dev/null +++ b/openbb_platform/providers/cboe/openbb_cboe/models/index_historical.py @@ -0,0 +1,212 @@ +"""CBOE Index Historical Model.""" + +from datetime import datetime, timedelta +from typing import Any, Dict, List, Literal, Optional + +import pandas as pd +from openbb_cboe.utils.helpers import ( + TICKER_EXCEPTIONS, + get_cboe_index_directory, + get_ticker_info, +) +from openbb_core.provider.abstract.fetcher import Fetcher +from openbb_core.provider.standard_models.index_historical import ( + IndexHistoricalData, + IndexHistoricalQueryParams, +) +from openbb_core.provider.utils.helpers import make_request +from pydantic import Field + + +class CboeIndexHistoricalQueryParams(IndexHistoricalQueryParams): + """CBOE Index Historical Query. + + Source: https://www.cboe.com/ + """ + + interval: Literal["1d", "1m"] = Field( + description="Use interval, 1m, for intraday prices during the most recent trading period.", + default="1d", + ) + + +class CboeIndexHistoricalData(IndexHistoricalData): + """CBOE Index Historical Data.""" + + calls_volume: Optional[float] = Field( + default=None, + description="Number of calls traded during the most recent trading period. Only valid if interval is 1m.", + ) + puts_volume: Optional[float] = Field( + default=None, + description="Number of puts traded during the most recent trading period. Only valid if interval is 1m.", + ) + total_options_volume: Optional[float] = Field( + default=None, + description="Total number of options traded during the most recent trading period. Only valid if interval is 1m.", + ) + + +class CboeIndexHistoricalFetcher( + Fetcher[ + CboeIndexHistoricalQueryParams, + List[CboeIndexHistoricalData], + ] +): + """Transform the query, extract and transform the data from the CBOE endpoints.""" + + @staticmethod + def transform_query(params: Dict[str, Any]) -> CboeIndexHistoricalQueryParams: + """Transform the query. Setting the start and end dates for a 1 year period.""" + return CboeIndexHistoricalQueryParams(**params) + + @staticmethod + def extract_data( + query: CboeIndexHistoricalQueryParams, # pylint: disable=unused-argument + credentials: Optional[Dict[str, str]], + **kwargs: Any, + ) -> List[Dict]: + """Return the raw data from the CBOE endpoint.""" + # Symbol directories are cached for seven days and are used for error handling and URL generation. + INDEXES = get_cboe_index_directory().index.to_list() + query.symbol = query.symbol.upper() + data = pd.DataFrame() + if "^" in query.symbol: + query.symbol = query.symbol.replace("^", "") + query.interval = ( + "1m" if query.symbol == "NDX" and query.interval == "1d" else query.interval + ) + + now = datetime.now() + query.start_date = ( + query.start_date if query.start_date else now - timedelta(days=50000) + ) + query.end_date = query.end_date if query.end_date else now + + if query.symbol not in INDEXES and query.symbol not in TICKER_EXCEPTIONS: + raise RuntimeError( + f"The symbol, {query.symbol}, was not found in the CBOE index directory. " + "Use `index_search()` to find supported indices. If the index is European, try `european_index()`." + ) + + def __generate_historical_prices_url( + symbol, + data_type: Optional[Literal["intraday", "historical"]] = "historical", + ) -> str: + """Generate the final URL for historical prices data.""" + url: str = ( + f"https://cdn.cboe.com/api/global/delayed_quotes/charts/{data_type}" + ) + url = ( + url + f"/_{symbol}.json" + if symbol in TICKER_EXCEPTIONS or symbol in INDEXES + else url + f"/{symbol}.json" + ) + return url + + url = ( + __generate_historical_prices_url(query.symbol, "intraday") + if query.interval == "1m" + else __generate_historical_prices_url(query.symbol) + ) + r = make_request(url) + + if r.status_code != 200: + raise RuntimeError(r.status_code) + + if query.interval == "1d": + data = ( + pd.DataFrame(r.json()["data"])[ + ["date", "open", "high", "low", "close", "volume"] + ] + ).set_index("date") + + # Fill in missing data from current or most recent trading session. + + today = pd.to_datetime(datetime.now().date()) + if today.weekday() > 4: + day_minus = today.weekday() - 4 + today = pd.to_datetime(today - timedelta(days=day_minus)) + if today != data.index[-1]: + _today = pd.Series(get_ticker_info(query.symbol)) + today_df = pd.Series(dtype="object") + today_df["open"] = round(_today["open"], 2) + today_df["high"] = round(_today["high"], 2) + today_df["low"] = round(_today["low"], 2) + today_df["close"] = round(_today["close"], 2) + if ( + query.symbol not in INDEXES + and query.symbol not in TICKER_EXCEPTIONS + ): + data = data[data["volume"] > 0] + today_df["volume"] = _today["volume"] + today_df["date"] = today.date() + today_df = pd.DataFrame(today_df).transpose().set_index("date") + + data = pd.concat([data, today_df], axis=0) + + # If ticker is an index there is no volume data and the types must be set. + + if query.symbol in INDEXES or query.symbol in TICKER_EXCEPTIONS: + data = data[["open", "high", "low", "close", "volume"]] + data["open"] = round(data.open.astype(float), 2) + data["high"] = round(data.high.astype(float), 2) + data["low"] = round(data.low.astype(float), 2) + data["close"] = round(data.close.astype(float), 2) + data["volume"] = 0 + + data.index = pd.to_datetime(data.index) + data = data[data["open"] > 0] + + data = data[ + (data.index >= pd.to_datetime(query.start_date)) + & (data.index <= pd.to_datetime(query.end_date)) + ] + + if query.interval == "1m": + data_list = r.json()["data"] + date: List[datetime] = [] + open_: List[float] = [] + high: List[float] = [] + low: List[float] = [] + close: List[float] = [] + volume: List[float] = [] + calls_volume: List[float] = [] + puts_volume: List[float] = [] + total_options_volume: List[float] = [] + + for data in data_list: + date.append(data["datetime"]) + price = data["price"] + volume_data = data["volume"] + open_.append(price["open"]) + high.append(price["high"]) + low.append(price["low"]) + close.append(price["close"]) + volume.append(volume_data["stock_volume"]) + calls_volume.append(volume_data["calls_volume"]) + puts_volume.append(volume_data["puts_volume"]) + total_options_volume.append(volume_data["total_options_volume"]) + + data = pd.DataFrame() + data["date"] = pd.to_datetime(date) + data["open"] = open_ + data["high"] = high + data["low"] = low + data["close"] = close + data["volume"] = volume + data["calls_volume"] = calls_volume + data["puts_volume"] = puts_volume + data["total_options_volume"] = total_options_volume + data = data.set_index("date").sort_index() + data.index = data.index.astype(str) + data = data[data["open"] > 0] + + return data.reset_index().to_dict("records") + + @staticmethod + def transform_data( + query: CboeIndexHistoricalQueryParams, data: List[Dict], **kwargs: Any + ) -> List[CboeIndexHistoricalData]: + """Transform the data to the standard format.""" + return [CboeIndexHistoricalData.model_validate(d) for d in data] diff --git a/openbb_platform/providers/cboe/tests/record/http/test_cboe_fetchers/test_cboe_index_historical_fetcher.yaml b/openbb_platform/providers/cboe/tests/record/http/test_cboe_fetchers/test_cboe_index_historical_fetcher.yaml new file mode 100644 index 00000000000..e6b878b3f49 --- /dev/null +++ b/openbb_platform/providers/cboe/tests/record/http/test_cboe_fetchers/test_cboe_index_historical_fetcher.yaml @@ -0,0 +1,346 @@ +interactions: +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + method: GET + uri: https://cdn.cboe.com/api/global/delayed_quotes/charts/historical/_AAVE10RP.json + response: + body: + string: !!binary | + H4sIAAAAAAAAA4Rb264k1Q39ldE8M5bvF34lTyhBAQkCEiR5QPn3yNXQ071d++w3VLQ167h8WV52 + /fH59x9//v6337/7+dfP3376zMjyBesL+yeqbxG/Zf38zafP//ju9+8+f/vpb3/0f33/5w/pC9EX + pv7///nlp3//fD1HwH7wy6/f/+v6WTBoEeH19Icf//nDX09d4s+nP/3y3+uhORg5Ph7+/adffnv8 + Q45Q5o74+X/ffLoBwB8DcAIMkRUAQlTmAiCAmXIAKDBj3QKQA4ACI9MVQIATLh5wAomiAUDaW7EF + oAcAbY6xAHCFcK/FAwTixisAE6DH43sA9jGAr+YLAI5cAQigqA4ACUxJWwB+ANDmvsaAFZAKvgNg + AxeOFYAYJMceQH4MQByU0xYASuBXxL8CEAEOlgEgASX3WVAHAE/zNw8kVKgNAGI6Y4CAdZ+GgodX + QMBWucaAg5cvHlCFUBqvwBkyLO8B8Bc8FKLL3Nc09AJCkgUAAaeNNFSH4A6YDYBDIbrMcQ1CDUgJ + XV5BgSOPSqgMaa5bAIdC9DAfABzYgt8BUIKmjErICIWxfwUf1wEqAvI1CKkU1CXeAFAiGOdaB14e + 3wP4uA5c5oJLM6IM0Kj3GCBPUP0rMl8AKFDssoC/YBwAKFD6CqACxIuGB0IrBgABS+ctgDwAaHPC + JQZQoBjf6wBFQfjIAioDZaotgDrEgIGSyeoBg5KlHVMomNnwQARE8RYAfVyIKBJYFNcYMAgJHzFg + mMMDYd3OaAtAjkFITLEC6NyQJQYswFHXNCRHIK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cnf0ZwTLpJivpwGc0srashxXOkYDol+r8rlTp1ko68NiUM89nyQaVhg+5 + 8wdfjSzdz2s6MDU4t58rNkg9LNkln58srxUd+Ip+JldhYOR2Bg+ek6GcaXlbSQc+o/EprA2sLulA + xK/7KM685aXgAZkhawt9GtrRaGw0B15md99++/GHL//8+9cff//pP/z+9euvPzX65ecv3/4DAAD/ + /wMAJA5R+PcsAQA= + headers: + CF-Cache-Status: + - DYNAMIC + CF-RAY: + - 80cdc91f2ac4b3d9-MIA + Cache-Control: + - max-age=300, s-maxage=600 + Connection: + - keep-alive + Content-Encoding: + - gzip + Content-Type: + - application/json + Date: + - Tue, 26 Sep 2023 19:06:42 GMT + ETag: + - W/"f1f5926b27faf3b7ebde482a00d68cd2" + Last-Modified: + - Tue, 26 Sep 2023 19:00:57 GMT + Server: + - cloudflare + Transfer-Encoding: + - chunked + Via: + - 1.1 cad07acdf97efe1eced66076ba0912e0.cloudfront.net (CloudFront) + X-Amz-Cf-Id: + - d4Az8DcogayqQQzYUVsZNuV62dKHzgKnU7x32a3joTyb1JyS8ipRgw== + X-Amz-Cf-Pop: + - MIA3-P4 + X-Cache: + - Miss from cloudfront + x-amz-server-side-encryption: + - AES256 + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + method: GET + uri: https://cdn.cboe.com/api/global/delayed_quotes/quotes/_AAVE10RP.json + response: + body: + string: !!binary | + H4sIAAAAAAAAA2SRwW6DMBBEf8XaM7FsEwz4lkPvVVX1WMsBK7EChmKThEb592qhTdP05p15Gu16 + LhBda0M0bQ+KgGAiXbFyJSThpWJSpRISArWJBhS5QJjabdcg+b7ZvD1x9vKMfrDVOLg46Tj1Fl3n + a3tGx56rvfE7q10NimQJgWocBuuj7gdXISsZLTgXCYFZ0QsPiqw4FawoHgzd26GyPi5AuS4TAts5 + XDKaS4azCYfvYMmzxdfBfWIoX+z7seutR5zTLE8R37vdHgVBWYFA052WOJkz3LNquvC4uT3q2kz6 + Zgk6o8euGVsUWELAHVOGT/oz/N76T7s7049NM//xh+9wZcnKNRN5nuGpjQlRx8HUVmORfzt85WuV + cZVm2ER0Ff4K1N3JwxUDb13qW5fXLwAAAP//AwAg/lNsEAIAAA== + headers: + CF-Cache-Status: + - DYNAMIC + CF-RAY: + - 80cdc925eaad21e2-MIA + Cache-Control: + - max-age=0, s-maxage=5 + Connection: + - keep-alive + Content-Encoding: + - gzip + Content-Type: + - application/json + Date: + - Tue, 26 Sep 2023 19:06:43 GMT + ETag: + - W/"7af2709a5adaf8b0cb0b79307ca3d901" + Last-Modified: + - Tue, 26 Sep 2023 19:06:38 GMT + Server: + - cloudflare + Transfer-Encoding: + - chunked + Via: + - 1.1 b162b8fd297daf9a97b750bf2aa03d36.cloudfront.net (CloudFront) + X-Amz-Cf-Id: + - HXQzs1UhOevV2Ajk3OtSsAcQ8ZmtV2FUo0mshUkimm2c2_YGVeHNkQ== + X-Amz-Cf-Pop: + - MIA3-P4 + X-Cache: + - Miss from cloudfront + x-amz-server-side-encryption: + - AES256 + status: + code: 200 + message: OK +version: 1 diff --git a/openbb_platform/providers/cboe/tests/test_cboe_fetchers.py b/openbb_platform/providers/cboe/tests/test_cboe_fetchers.py index 5571e14ae34..0fb8bc7d46a 100644 --- a/openbb_platform/providers/cboe/tests/test_cboe_fetchers.py +++ b/openbb_platform/providers/cboe/tests/test_cboe_fetchers.py @@ -22,6 +22,9 @@ from openbb_cboe.models.european_indices import ( CboeEuropeanIndicesFetcher, ) from openbb_cboe.models.futures_curve import CboeFuturesCurveFetcher +from openbb_cboe.models.index_historical import ( + CboeIndexHistoricalFetcher, +) from openbb_cboe.models.index_search import CboeIndexSearchFetcher from openbb_cboe.models.index_snapshots import CboeIndexSnapshotsFetcher from openbb_cboe.models.market_indices import ( @@ -144,6 +147,15 @@ def test_cboe_market_indices_fetcher(credentials=test_credentials): assert result is None +@pytest.mark.record_http +def test_cboe_index_historical_fetcher(credentials=test_credentials): + params = {"symbol": "AAVE10RP"} + + fetcher = CboeIndexHistoricalFetcher() + result = fetcher.test(params, credentials) + assert result is None + + @pytest.mark.record_http def test_cboe_index_snapshots_fetcher(credentials=test_credentials): params = {} diff --git a/openbb_platform/providers/fmp/openbb_fmp/__init__.py b/openbb_platform/providers/fmp/openbb_fmp/__init__.py index ef387297a15..f4ce652e86d 100644 --- a/openbb_platform/providers/fmp/openbb_fmp/__init__.py +++ b/openbb_platform/providers/fmp/openbb_fmp/__init__.py @@ -44,6 +44,7 @@ from openbb_fmp.models.historical_splits import FMPHistoricalSplitsFetcher from openbb_fmp.models.income_statement import FMPIncomeStatementFetcher from openbb_fmp.models.income_statement_growth import FMPIncomeStatementGrowthFetcher from openbb_fmp.models.index_constituents import FMPIndexConstituentsFetcher +from openbb_fmp.models.index_historical import FMPIndexHistoricalFetcher from openbb_fmp.models.insider_trading import FMPInsiderTradingFetcher from openbb_fmp.models.institutional_ownership import FMPInstitutionalOwnershipFetcher from openbb_fmp.models.key_executives import FMPKeyExecutivesFetcher @@ -108,6 +109,7 @@ fmp_provider = Provider( "IncomeStatement": FMPIncomeStatementFetcher, "IncomeStatementGrowth": FMPIncomeStatementGrowthFetcher, "IndexConstituents": FMPIndexConstituentsFetcher, + "IndexHistorical": FMPIndexHistoricalFetcher, "InsiderTrading": FMPInsiderTradingFetcher, "InstitutionalOwnership": FMPInstitutionalOwnershipFetcher, "KeyExecutives": FMPKeyExecutivesFetcher, diff --git a/openbb_platform/providers/fmp/openbb_fmp/models/index_historical.py b/openbb_platform/providers/fmp/openbb_fmp/models/index_historical.py new file mode 100644 index 00000000000..d3e067a5645 --- /dev/null +++ b/openbb_platform/providers/fmp/openbb_fmp/models/index_historical.py @@ -0,0 +1,112 @@ +"""FMP Index Historical Model.""" + +from datetime import datetime +from typing import Any, Dict, List, Literal, Optional + +from dateutil.relativedelta import relativedelta +from openbb_core.provider.abstract.fetcher import Fetcher +from openbb_core.provider.standard_models.index_historical import ( + IndexHistoricalData, + IndexHistoricalQueryParams, +) +from openbb_core.provider.utils.descriptions import DATA_DESCRIPTIONS +from openbb_core.provider.utils.helpers import get_querystring +from openbb_fmp.utils.helpers import get_data_many +from pydantic import Field, NonNegativeInt + + +class FMPIndexHistoricalQueryParams(IndexHistoricalQueryParams): + """FMP Index Historical Query. + + Source: https://site.financialmodelingprep.com/developer/docs/historical-index-price-api/ + """ + + __alias_dict__ = {"start_date": "from", "end_date": "to"} + + timeseries: Optional[NonNegativeInt] = Field( + default=None, description="Number of days to look back." + ) + interval: Literal[ + "1min", "5min", "15min", "30min", "1hour", "4hour", "1day" + ] = Field(default="1day", description="Data granularity.") + sort: Literal["asc", "desc"] = Field( + default="desc", description="Sort the data in ascending or descending order." + ) + + +class FMPIndexHistoricalData(IndexHistoricalData): + """FMP Index Historical Data.""" + + adj_close: Optional[float] = Field( + description=DATA_DESCRIPTIONS.get("adj_close", ""), + default=None, + ) + unadjusted_volume: Optional[float] = Field( + description="Unadjusted volume of the symbol.", + default=None, + ) + change: Optional[float] = Field( + description="Change in the price of the symbol from the previous day.", + default=None, + ) + change_percent: Optional[float] = Field( + description="Change % in the price of the symbol.", + default=None, + ) + label: Optional[str] = Field( + description="Human readable format of the date.", default=None + ) + change_over_time: Optional[float] = Field( + description="Change % in the price of the symbol over a period of time.", + default=None, + ) + + +class FMPIndexHistoricalFetcher( + Fetcher[ + FMPIndexHistoricalQueryParams, + List[FMPIndexHistoricalData], + ] +): + """Transform the query, extract and transform the data from the FMP endpoints.""" + + @staticmethod + def transform_query(params: Dict[str, Any]) -> FMPIndexHistoricalQueryParams: + """Transform the query params.""" + transformed_params = params + + now = datetime.now().date() + if params.get("start_date") is None: + transformed_params["start_date"] = now - relativedelta(years=1) + + if params.get("end_date") is None: + transformed_params["end_date"] = now + + return FMPIndexHistoricalQueryParams.model_validate(transformed_params) + + @staticmethod + async def aextract_data( + query: FMPIndexHistoricalQueryParams, + credentials: Optional[Dict[str, str]], + **kwargs: Any, + ) -> List[Dict]: + """Return the raw data from the FMP endpoint.""" + api_key = credentials.get("fmp_api_key") if credentials else "" + + base_url = "https://financialmodelingprep.com/api/v3" + query_str = get_querystring(query.model_dump(), ["symbol", "interval", "sort"]) + + url_params = f"{query.symbol}?{query_str}&apikey={api_key}" + url = f"{base_url}/historical-chart/{query.interval}/{url_params}" + + return await get_data_many(url, "historical", **kwargs) + + @staticmethod + def transform_data( + query: FMPIndexHistoricalQueryParams, data: List[Dict], **kwargs: Any + ) -> List[FMPIndexHistoricalData]: + """Return the transformed data.""" + if query.sort == "asc": + data = sorted(data, key=lambda x: x["date"], reverse=True) + + return [FMPIndexHistoricalData.model_validate(d) for d in data] diff --git a/openbb_platform/providers/fmp/tests/record/http/test_fmp_fetchers/test_fmp_index_historical_fetcher.yaml b/openbb_platform/providers/fmp/tests/record/http/test_fmp_fetchers/test_fmp_index_historical_fetcher.yaml new file mode 100644 index 00000000000..a69a35e3d59 --- /dev/null +++ b/openbb_platform/providers/fmp/tests/record/http/test_fmp_fetchers/test_fmp_index_historical_fetcher.yaml @@ -0,0 +1,57 @@ +interactions: +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + method: GET + uri: https://financialmodelingprep.com/api/v3/historical-chart/1day/%5EDJI?apikey=MOCK_API_KEY&from=2023-01-01&to=2023-01-10 + response: + body: + string: !!binary | + H4sIAAAAAAAAA43SS07DMBAG4H1PEWXdjubhGXt6FcQCQUSRCkHitUDcHTcNcesopVGShX9b/jye + m1XTfOevadqHu/eu3TYtI8sGaUPYEG8R89uuj1P61+4lTxFRMgjs5mOw77+G8cAECTGmcXz39Lgb + gsgGKo42Bvf7/q07JhiAkPQv+ez3H8+HiC2xYX7y+M962Ym+7DQLcNiVa2eKYIZktdNFs8YlzZxK + eUlIIdRO4ZjCNU5bdqIqyEndRie7xzN/qSfh2QGK0yQnJycoTsN4lVOXneQEkVLUypmIYfjXznrB + 5GTPznzgaUlxSnS+xhkuOC1fY5jfO4pASBhi7QzoZ11Y6snmEM1VZs7oQzn/dcoFZ0iQvDTVVE9F + 0IhCtVNy4yoVTXGSGBzawmdO1Vzr0bm6/QU7Pyuq8gMAAA== + headers: + Access-Control-Allow-Credentials: + - 'true' + Access-Control-Allow-Headers: + - X-Requested-With, content-type, auth-token, Authorization, stripe-signature, + APPS + Access-Control-Allow-Methods: + - GET, POST, OPTIONS + Access-Control-Allow-Origin: + - '*' + Access-Control-Max-Age: + - '3600' + Connection: + - keep-alive + Content-Encoding: + - gzip + Content-Type: + - application/json; charset=utf-8 + Date: + - Fri, 01 Dec 2023 21:25:06 GMT + Etag: + - W/"3f2-y9+VxwqtePCRYovMzrv9Y2mmzrc" + Server: + - nginx/1.18.0 (Ubuntu) + Transfer-Encoding: + - chunked + Vary: + - Accept-Encoding + X-Frame-Options: + - SAMEORIGIN + X-Powered-By: + - Express + status: + code: 200 + message: OK +version: 1 diff --git a/openbb_platform/providers/fmp/tests/test_fmp_fetchers.py b/openbb_platform/providers/fmp/tests/test_fmp_fetchers.py index af81b5f73c5..407c2b5d1dc 100644 --- a/openbb_platform/providers/fmp/tests/test_fmp_fetchers.py +++ b/openbb_platform/providers/fmp/tests/test_fmp_fetchers.py @@ -50,6 +50,7 @@ from openbb_fmp.models.income_statement_growth import FMPIncomeStatementGrowthFe from openbb_fmp.models.index_constituents import ( FMPIndexConstituentsFetcher, ) +from openbb_fmp.models.index_historical import FMPIndexHistoricalFetcher from openbb_fmp.models.insider_trading import FMPInsiderTradingFetcher from openbb_fmp.models.institutional_ownership import FMPInstitutionalOwnershipFetcher from openbb_fmp.models.key_executives import FMPKeyExecutivesFetcher @@ -139,6 +140,19 @@ def test_fmp_market_indices_fetcher(credentials=test_credentials): assert result is None +@pytest.mark.record_http +def test_fmp_index_historical_fetcher(credentials=test_credentials): + params = { + "symbol": "^DJI", + "start_date": date(2023, 1, 1), + "end_date": date(2023, 1, 10), + } + + fetcher = FMPIndexHistoricalFetcher() + result = fetcher.test(params, credentials) + assert result is None + + @pytest.mark.record_http def test_fmp_equity_historical_fetcher(credentials=test_credentials): params = { diff --git a/openbb_platform/providers/intrinio/openbb_intrinio/__init__.py b/openbb_platform/providers/intrinio/openbb_intrinio/__init__.py index 4dc357efc2d..8b84013bb19 100644 --- a/openbb_platform/providers/intrinio/openbb_intrinio/__init__.py +++ b/openbb_platform/providers/intrinio/openbb_intrinio/__init__.py @@ -20,6 +20,7 @@ from openbb_intrinio.models.historical_dividends import ( IntrinioHistoricalDividendsFetcher, ) from openbb_intrinio.models.income_statement import IntrinioIncomeStatementFetcher +from openbb_intrinio.models.index_historical import IntrinioIndexHistoricalFetcher from openbb_intrinio.models.insider_trading import IntrinioInsiderTradingFetcher from openbb_intrinio.models.institutional_ownership import ( IntrinioInstitutionalOwnershipFetcher, @@ -58,6 +59,7 @@ intrinio_provider = Provider( "HistoricalAttributes": IntrinioHistoricalAttributesFetcher, "HistoricalDividends": IntrinioHistoricalDividendsFetcher, "IncomeStatement": IntrinioIncomeStatementFetcher, + "IndexHistorical": IntrinioIndexHistoricalFetcher, "InsiderTrading": IntrinioInsiderTradingFetcher, "InstitutionalOwnership": IntrinioInstitutionalOwnershipFetcher, "KeyMetrics": IntrinioKeyMetricsFetcher, diff --git a/openbb_platform/providers/intrinio/openbb_intrinio/models/index_historical.py b/openbb_platform/providers/intrinio/openbb_intrinio/models/index_historical.py new file mode 100644 index 00000000000..9acd91c68a1 --- /dev/null +++ b/openbb_platform/providers/intrinio/openbb_intrinio/models/index_historical.py @@ -0,0 +1,91 @@ +"""Intrinio Index Historical Model.""" + +from datetime import datetime +from typing import Any, Dict, List, Literal, Optional + +from dateutil.relativedelta import relativedelta +from openbb_core.provider.abstract.fetcher import Fetcher +from openbb_core.provider.standard_models.index_historical import ( + IndexHistoricalData, + IndexHistoricalQueryParams, +) +from openbb_core.provider.utils.descriptions import QUERY_DESCRIPTIONS +from openbb_core.provider.utils.helpers import get_querystring +from openbb_intrinio.utils.helpers import get_data_many +from pydantic import Field, NonNegativeInt + + +class IntrinioIndexHistoricalQueryParams(IndexHistoricalQueryParams): + """Intrinio Index Historical Query. + + Source: https://docs.intrinio.com/documentation/web_api/get_stock_market_index_historical_data_v2 + """ + + tag: Optional[str] = Field(default="level", description="Index tag.") + type: Optional[str] = Field( + default=None, + description="Index type.", + ) + sort: Literal["asc", "desc"] = Field( + default="desc", + description="Sort order.", + alias="sort_order", + ) + limit: NonNegativeInt = Field( + default=1000, + description=QUERY_DESCRIPTIONS.get("limit", ""), + alias="page_size", + ) + + +class IntrinioIndexHistoricalData(IndexHistoricalData): + """Intrinio Index Historical Data.""" + + __alias_dict__ = {"close": "value"} + + +class IntrinioIndexHistoricalFetcher( + Fetcher[ + IntrinioIndexHistoricalQueryParams, + List[IntrinioIndexHistoricalData], + ] +): + """Transform the query, extract and transform the data from the Intrinio endpoints.""" + + @staticmethod + def transform_query(params: Dict[str, Any]) -> IntrinioIndexHistoricalQueryParams: + """Transform the query params.""" + transformed_params = params + + now = datetime.now().date() + if params.get("start_date") is None: + transformed_params["start_date"] = now - relativedelta(years=1) + + if params.get("end_date") is None: + transformed_params["end_date"] = now + + return IntrinioIndexHistoricalQueryParams(**transformed_params) + + @staticmethod + async def aextract_data( + query: IntrinioIndexHistoricalQueryParams, + credentials: Optional[Dict[str, str]], + **kwargs: Any, + ) -> List[Dict]: + """Return the raw data from the Intrinio endpoint.""" + api_key = credentials.get("intrinio_api_key") if credentials else "" + + base_url = "https://api-v2.intrinio.com/indices/stock_market" + query_str = get_querystring(query.model_dump(by_alias=True), ["symbol", "tag"]) + url = f"{base_url}/{query.symbol}/historical_data/{query.tag}?{query_str}&api_key={api_key}" + + return await get_data_many(url, "historical_data", **kwargs) + + @staticmethod + def transform_data( + query: IntrinioIndexHistoricalQueryParams, # pylint: disable=unused-argument + data: List[Dict], + **kwargs: Any, + ) -> List[IntrinioIndexHistoricalData]: + """Return the transformed data.""" + return [IntrinioIndexHistoricalData.model_validate(d) for d in data] diff --git a/openbb_platform/providers/intrinio/tests/record/http/test_intrinio_fetchers/test_intrinio_index_historical_fetcher.yaml b/openbb_platform/providers/intrinio/tests/record/http/test_intrinio_fetchers/test_intrinio_index_historical_fetcher.yaml new file mode 100644 index 00000000000..4327fe36106 --- /dev/null +++ b/openbb_platform/providers/intrinio/tests/record/http/test_intrinio_fetchers/test_intrinio_index_historical_fetcher.yaml @@ -0,0 +1,52 @@ +interactions: +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate, br + Connection: + - keep-alive + method: GET + uri: https://api-v2.intrinio.com/indices/stock_market/$DJI/historical_data/level?api_key=MOCK_API_KEY&end_date=2023-06-06&page_size=1000&sort_order=desc&start_date=2023-01-01 + response: + body: + string: !!binary | + H4sIAGQlZWUAA3RYTW8bRwz9K4LQoz0YkvPpm4FckkMubS8tCmFjbRoB8iqVVm4cI/+93KRFlzPP + gA6W9oEzfOQj3/pl++lwmU/nw8Nw3O2Hedje/f6y1T/G7d2WPcutT/rZ3myfhuNVfxSJWRyXbzc9 + LBpYYlcSgvEalhWWIYzWMJ/IxdzB4q2sYVx9cQxh3kQLemifQrzl+j9suh6PCGLI8FWcBARbk8E5 + BZciggUDq9VVRjAxh8boIiGYoZZLchFlSXUNC5xcEgQrpp4SXUWHUrbRvMuoAmR5I3aEeCPTRBKK + 65tDUSZR8d4lRBuRhVVMG3mbKDlBfPhq+5tcQdG8oS2RZlARzCSacnCCauXXDSLE2WVEmzcNEig4 + hjDDWyrBRZjpmrfgI7m+ouGWi0HV4qivlcJMfxTtNgxLtlbKLjzUDhnxrvQZBKsrKTm6ng5Fmf4o + OjwqvJrpj6yyAt0WGlmVmp3v+yM0sqoZqi80sqolO+r7Q2E2Ub1bQLSRmFpxRU0ZGl2loAMEoajt + ogyDWVkt0wjR5leJwpkbmgUUSnSMDrSSCkWHPDzQUKZkIOWFRlJJG5J6MsQuIB3h4RXYmgwusTrf + V13MAtJglMH4E6s8lqpqR2ca5XEQdr5PVJodxJLRUBC7g5h8fOXQdQuxV4FSrwKx0uOYPE7UsMYh + oIUmVitUdDJXCEs2mjYkysCsICpaUeA8xCqPKaIRI1Z4VKiitSdWK1R1UyUEMyuIOQZkscSuIHUV + BV7NZ9uSOjpgMCs+3Y4BRjNykepdRazZDeS9YHLNBuK07Nr+UG6EkDSFPhg3OihFtdePD250UCgh + L8aNF6MoyBZx48V8iK8casYH6WCOELbqDzgkuVkYy54FI54bH5ZqcqUXAVsRBOLiPIStOQteqQX2 + m5v1w0pG7UcMNxujpFeiWSOW1DSXXu7cGLEaKtrHbGUQKL7Cm5VBqeQ86g4rg6pVwIey4W1pItTf + jRGrjAwK2R2kVdBD+2jUvAQtywW0JDWGreaC1gY1hm2hN/SZUmPYchCkZGoMWxbBmVrxpUUuEGYy + lcX+oUytY/PLekHRrGNjlQy8W+PYyCNlkREglDI1chF1KAlRa9xaIBUfGLnU2LWqr++gJakRX/Zq + ZACqeQlaDApK0qolqQuAGRjHxlVhsNWsY2OdC+AVkxrtkSQnEMZNAf642R6m/fhle/eyPewVqd92 + /PXp/dd7RV6eHz+cjvrrT2/evdXv0/C4RHtz+nvz7jSNl83baX+9zOfDcNzcP43n4c9RUQ+naT5M + 4zQr9P3pPH/a3D+Oy79Zvj+7TvP5WZ/8Oh3mcb/5edYbXjanjyvQ9fNy7d3H8/jXdZweFvR+OByf + 9dFxuMy7H8/3/+VFi9J+8XS3fLTC3v+myNOHy3h+GubDadpd5uE8f4fTv/AGME4mWth+02THL/Pu + 85LSD6r+AQAA//8DAAVlFaAwEgAA + headers: + Connection: + - keep-alive + Content-Encoding: + - gzip + Content-Type: + - application/json + Date: + - Mon, 27 Nov 2023 23:25:24 GMT + Transfer-Encoding: + - chunked + Vary: + - Origin,Accept-Encoding + status: + code: 200 + message: OK +version: 1 diff --git a/openbb_platform/providers/intrinio/tests/test_intrinio_fetchers.py b/openbb_platform/providers/intrinio/tests/test_intrinio_fetchers.py index 227ff1ac9d6..4248669dfc0 100644 --- a/openbb_platform/providers/intrinio/tests/test_intrinio_fetchers.py +++ b/openbb_platform/providers/intrinio/tests/test_intrinio_fetchers.py @@ -22,6 +22,7 @@ from openbb_intrinio.models.historical_dividends import ( IntrinioHistoricalDividendsFetcher, ) from openbb_intrinio.models.income_statement import IntrinioIncomeStatementFetcher +from openbb_intrinio.models.index_historical import IntrinioIndexHistoricalFetcher from openbb_intrinio.models.insider_trading import IntrinioInsiderTradingFetcher from openbb_intrinio.models.institutional_ownership import ( IntrinioInstitutionalOwnershipFetcher, @@ -242,6 +243,20 @@ def test_intrinio_market_indices_fetcher(credentials=test_credentials): assert result is None +@pytest.mark.record_http +def test_intrinio_index_historical_fetcher(credentials=test_credentials): + params = { + "symbol": "$DJI", + "tag": "level", + "start_date": date(2023, 1, 1), + "end_date": date(2023, 6, 6), + } + + fetcher = IntrinioIndexHistoricalFetcher() + result = fetcher.test(params, credentials) + assert result is None + + @pytest.mark.record_http def test_intrinio_historical_dividends_fetcher(credentials=test_credentials): params = { diff --git a/openbb_platform/providers/polygon/openbb_polygon/__init__.py b/openbb_platform/providers/polygon/openbb_polygon/__init__.py index 849d9938d9d..eeae079fd6b 100644 --- a/openbb_platform/providers/polygon/openbb_polygon/__init__.py +++ b/openbb_platform/providers/polygon/openbb_polygon/__init__.py @@ -9,6 +9,9 @@ from openbb_polygon.models.currency_pairs import PolygonCurrencyPairsFetcher from openbb_polygon.models.equity_historical import PolygonEquityHistoricalFetcher from openbb_polygon.models.equity_nbbo import PolygonEquityNBBOFetcher from openbb_polygon.models.income_statement import PolygonIncomeStatementFetcher +from openbb_polygon.models.index_historical import ( + PolygonIndexHistoricalFetcher, +) from openbb_polygon.models.market_indices import ( PolygonMarketIndicesFetcher, ) @@ -31,6 +34,7 @@ polygon_provider = Provider( "EquityHistorical": PolygonEquityHistoricalFetcher, "EquityNBBO": PolygonEquityNBBOFetcher, "IncomeStatement": PolygonIncomeStatementFetcher, + "IndexHistorical": PolygonIndexHistoricalFetcher, "MarketIndices": PolygonMarketIndicesFetcher, "MarketSnapshots": PolygonMarketSnapshotsFetcher, }, diff --git a/openbb_platform/providers/polygon/openbb_polygon/models/index_historical.py b/openbb_platform/providers/polygon/openbb_polygon/models/index_historical.py new file mode 100644 index 00000000000..f666aae41a5 --- /dev/null +++ b/openbb_platform/providers/polygon/openbb_polygon/models/index_historical.py @@ -0,0 +1,110 @@ +"""Polygon Index Historical Model.""" + +from datetime import datetime +from typing import Any, Dict, List, Literal, Optional + +from dateutil.relativedelta import relativedelta +from openbb_core.provider.abstract.fetcher import Fetcher +from openbb_core.provider.standard_models.index_historical import ( + IndexHistoricalData, + IndexHistoricalQueryParams, +) +from openbb_core.provider.utils.descriptions import QUERY_DESCRIPTIONS +from openbb_polygon.utils.helpers import get_data_many +from pydantic import Field, PositiveInt + + +class PolygonIndexHistoricalQueryParams(IndexHistoricalQueryParams): + """Polygon Index Historical Query. + + Source: https://polygon.io/docs/indices/getting-started + """ + + timespan: Literal[ + "minute", "hour", "day", "week", "month", "quarter", "year" + ] = Field(default="day", description="Timespan of the data.") + sort: Literal["asc", "desc"] = Field( + default="desc", description="Sort order of the data." + ) + limit: PositiveInt = Field( + default=49999, description=QUERY_DESCRIPTIONS.get("limit", "") + ) + adjusted: bool = Field(default=True, description="Whether the data is adjusted.") + multiplier: PositiveInt = Field( + default=1, description="Multiplier of the timespan." + ) + + +class PolygonIndexHistoricalData(IndexHistoricalData): + """Polygon Index Historical Data.""" + + __alias_dict__ = { + "date": "t", + "open": "o", + "high": "h", + "low": "l", + "close": "c", + "volume": "v", + "vwap": "vw", + } + + transactions: Optional[PositiveInt] = Field( + default=None, + description="Number of transactions for the symbol in the time period.", + alias="n", + ) + + +class PolygonIndexHistoricalFetcher( + Fetcher[ + PolygonIndexHistoricalQueryParams, + List[PolygonIndexHistoricalData], + ] +): + """Transform the query, extract and transform the data from the Polygon endpoints.""" + + @staticmethod + def transform_query(params: Dict[str, Any]) -> PolygonIndexHistoricalQueryParams: + """Transform the query params.""" + now = datetime.now().date() + transformed_params = params + if params.get("start_date") is None: + transformed_params["start_date"] = now - relativedelta(years=1) + + if params.get("end_date") is None: + transformed_params["end_date"] = now + + return PolygonIndexHistoricalQueryParams(**transformed_params) + + @staticmethod + async def aextract_data( + query: PolygonIndexHistoricalQueryParams, + credentials: Optional[Dict[str, str]], + **kwargs: Any, + ) -> dict: + """Extract raw data from the Polygon endpoint.""" + api_key = credentials.get("polygon_api_key") if credentials else "" + + request_url = ( + f"https://api.polygon.io/v2/aggs/ticker/" + f"I:{query.symbol}/range/{query.multiplier}/{query.timespan}/" + f"{query.start_date}/{query.end_date}?adjusted={query.adjusted}" + f"&sort={query.sort}&limit={query.limit}&apiKey={api_key}" + ) + data = await get_data_many(request_url, "results", **kwargs) + + for d in data: + d["t"] = datetime.fromtimestamp(d["t"] / 1000) + if query.timespan not in ["minute", "hour"]: + d["t"] = d["t"].date() + + return data + + @staticmethod + def transform_data( + query: PolygonIndexHistoricalQueryParams, + data: dict, + **kwargs: Any, + ) -> List[PolygonIndexHistoricalData]: + """Transform the data.""" + return [PolygonIndexHistoricalData.model_validate(d) for d in data] diff --git a/openbb_platform/providers/polygon/tests/record/http/test_polygon_fetchers/test_polygon_index_historical_fetcher.yaml b/openbb_platform/providers/polygon/tests/record/http/test_polygon_fetchers/test_polygon_index_historical_fetcher.yaml new file mode 100644 index 00000000000..305a0ebd7e8 --- /dev/null +++ b/openbb_platform/providers/polygon/tests/record/http/test_polygon_fetchers/test_polygon_index_historical_fetcher.yaml @@ -0,0 +1,79 @@ +interactions: +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + method: GET + uri: https://api.polygon.io/v2/aggs/ticker/I:NDX/range/1/day/2023-01-01/2023-05-10?adjusted=True&apiKey=MOCK_API_KEY&limit=49999&sort=desc + response: + body: + string: !!binary | + H4sIAAAAAAAA/2RYTYsk6c38L3kuhL5D6uv7XozBvhqMMUO7l1m8eNmZnoNZ9r8bZdfzVHf2Hmun + M1JSKCKUvx+vPz//++Xb8XT86ekv//+343b89uPl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afRP7+9as99OEF6suyCOgVC3M1FfY2LLUgF + wuEQ3y0s4HK3DoFPS8noKL7LhvQczgmBy2zpHYth1OFdBTuderCGvBOseC569tpY50eNj2WxUHaE + xhzT93FJzTleglk540UNzqZUTWWziPt6CaqpotUmLfRer1rTekeNOTosJ5jlaYpvdXVQlVp0V66v + J2oTt7wtNSFxH5ecJ45PgwWGLRtlfr0mxxQ5UOyauXqoKkFmc3z68n9VA01SOcWwlmgIK416mgpD + HtPSuB6TxkbSbKwlvIK8TowWMKeFpvWuymnWYgKgr29dKsY0/7LO1P+oSvJqyvP3E2olQmwFeT2/ + NJW7u0quDzXjT1QY77d+iKE2KDJYwiaHbSyuqymLMIFDK6Owsc7vV8rIib7AZryQwmfh2vfdxR2k + LpEabrpZiNKLeZ18457NFE3VxcKaCsrKYIw746W5Rko6xePBwk9PuGPBrvfkrDyGSTqRLRcLbaJZ + jL7x1icOJ8dcpMmli4OcFKiSOWcfkoEMvkqGC8HnvlfLFdeUXUlGtkdea3VQfDK/jb5X29YMHSnj + To0K37uFpU7vpsWTrWXIgTPuvWEFCDUn6pjCxorzzJeJ0S3Y+uSUMvxu5MOS4bhYsjSa0O3qYMfW + p1GHkO7idTEoS837p6Wl527gyEAFa9U7P8Yk5au+ByXcFFy1PZIzSSE1m5eiu6gkFatUQfTWd54M + iUmQHrmh2Nd594/b8f31y+uP78fT8dc/H7fj28tvP16+v/7z538dT8dzIF5Yv/CztYgx4yfnn1y+ + 6MuXkeHjdjyvr+B//C8AAP//XVlGICgXAAA= + headers: + Connection: + - keep-alive + Content-Encoding: + - gzip + Content-Type: + - application/json + Date: + - Tue, 26 Sep 2023 19:08:14 GMT + Server: + - nginx/1.19.2 + Strict-Transport-Security: + - max-age=15724800; includeSubDomains + Transfer-Encoding: + - chunked + Vary: + - Accept-Encoding + X-Request-Id: + - c575e02a0c39113007f40f41a2ea4115 + status: + code: 200 + message: OK +version: 1 diff --git a/openbb_platform/providers/polygon/tests/test_polygon_fetchers.py b/openbb_platform/providers/polygon/tests/test_polygon_fetchers.py index 569897063a6..8b7926f0713 100644 --- a/openbb_platform/providers/polygon/tests/test_polygon_fetchers.py +++ b/openbb_platform/providers/polygon/tests/test_polygon_fetchers.py @@ -11,6 +11,9 @@ from openbb_polygon.models.currency_pairs import PolygonCurrencyPairsFetcher from openbb_polygon.models.equity_historical import PolygonEquityHistoricalFetcher from openbb_polygon.models.equity_nbbo import PolygonEquityNBBOFetcher from openbb_polygon.models.income_statement import PolygonIncomeStatementFetcher +from openbb_polygon.models.index_historical import ( + PolygonIndexHistoricalFetcher, +) from openbb_polygon.models.market_indices import ( PolygonMarketIndicesFetcher, ) @@ -58,6 +61,19 @@ def test_polygon_market_indices_fetcher(credentials=test_credentials): assert result is None +@pytest.mark.record_http +def test_polygon_index_historical_fetcher(credentials=test_credentials): + params = { + "symbol": "NDX", + "start_date": date(2023, 1, 1), + "end_date": date(2023, 5, 10), + } + + fetcher = PolygonIndexHistoricalFetcher() + result = fetcher.test(params, credentials) + assert result is None + + @pytest.mark.record_http def test_polygon_company_news_fetcher(credentials=test_credentials): params = {"symbols": "AAPL"} diff --git a/openbb_platform/providers/yfinance/openbb_yfinance/__init__.py b/openbb_platform/providers/yfinance/openbb_yfinance/__init__.py index 815540f4382..01103b97bf7 100644 --- a/openbb_platform/providers/yfinance/openbb_yfinance/__init__.py +++ b/openbb_platform/providers/yfinance/openbb_yfinance/__init__.py @@ -17,6 +17,9 @@ from openbb_yfinance.models.futures_historical import YFinanceFuturesHistoricalF from openbb_yfinance.models.gainers import YFGainersFetcher from openbb_yfinance.models.growth_tech_equities import YFGrowthTechEquitiesFetcher from openbb_yfinance.models.income_statement import YFinanceIncomeStatementFetcher +from openbb_yfinance.models.index_historical import ( + YFinanceIndexHistoricalFetcher, +) from openbb_yfinance.models.losers import YFLosersFetcher from openbb_yfinance.models.market_indices import ( YFinanceMarketIndicesFetcher, @@ -51,6 +54,7 @@ yfinance_provider = Provider( "FuturesHistorical": YFinanceFuturesHistoricalFetcher, "GrowthTechEquities": YFGrowthTechEquitiesFetcher, "IncomeStatement": YFinanceIncomeStatementFetcher, + "IndexHistorical": YFinanceIndexHistoricalFetcher, "MarketIndices": YFinanceMarketIndicesFetcher, }, ) diff --git a/openbb_platform/providers/yfinance/openbb_yfinance/models/index_historical.py b/openbb_platform/providers/yfinance/openbb_yfinance/models/index_historical.py new file mode 100644 index 00000000000..955c5ae7f74 --- /dev/null +++ b/openbb_platform/providers/yfinance/openbb_yfinance/models/index_historical.py @@ -0,0 +1,135 @@ +"""Yahoo Finance Index Historical Model.""" +# ruff: noqa: SIM105 + +from datetime import datetime, timedelta +from typing import Any, Dict, List, Optional + +import pandas as pd +from dateutil.relativedelta import relativedelta +from openbb_core.provider.abstract.fetcher import Fetcher +from openbb_core.provider.standard_models.index_historical import ( + IndexHistoricalData, + IndexHistoricalQueryParams, +) +from openbb_core.provider.utils.descriptions import QUERY_DESCRIPTIONS +from openbb_core.provider.utils.errors import EmptyDataError +from openbb_yfinance.utils.helpers import yf_download +from openbb_yfinance.utils.references import INDICES, INTERVALS, PERIODS +from pandas import to_datetime +from pydantic import Field + + +class YFinanceIndexHistoricalQueryParams(IndexHistoricalQueryParams): + """YFinance Index Historical Query. + + Source: https://finance.yahoo.com/world-indices + """ + + interval: Optional[INTERVALS] = Field(default="1d", description="Data granularity.") + period: Optional[PERIODS] = Field( + default="max", description=QUERY_DESCRIPTIONS.get("period", "") + ) + prepost: bool = Field(default=True, description="Include Pre and Post market data.") + rounding: bool = Field(default=True, description="Round prices to two decimals?") + + +class YFinanceIndexHistoricalData(IndexHistoricalData): + """YFinance Index Historical Data.""" + + +class YFinanceIndexHistoricalFetcher( + Fetcher[ + YFinanceIndexHistoricalQueryParams, + List[YFinanceIndexHistoricalData], + ] +): + """Transform the query, extract and transform the data from the Yahoo Finance endpoints.""" + + @staticmethod + def transform_query(params: Dict[str, Any]) -> YFinanceIndexHistoricalQueryParams: + """Transform the query.""" + transformed_params = params + now = datetime.now().date() + + if params.get("start_date") is None: + transformed_params["start_date"] = now - relativedelta(years=1) + + if params.get("end_date") is None: + transformed_params["end_date"] = now + + tickers = params.get("symbol").lower().split(",") + + new_tickers = [] + for ticker in tickers: + _ticker = "" + indices = pd.DataFrame(INDICES).transpose().reset_index() + indices.columns = ["code", "name", "symbol"] + + if ticker in indices["code"].values: + _ticker = indices[indices["code"] == ticker]["symbol"].values[0] + + if ticker.title() in indices["name"].values: + _ticker = indices[indices["name"] == ticker.title()]["symbol"].values[0] + + if "^" + ticker.upper() in indices["symbol"].values: + _ticker = "^" + ticker.upper() + + if ticker.upper() in indices["symbol"].values: + _ticker = ticker.upper() + + if _ticker != "": + new_tickers.append(_ticker) + + transformed_params["symbol"] = ",".join(new_tickers) + + return YFinanceIndexHistoricalQueryParams(**params) + + @staticmethod + def extract_data( + query: YFinanceIndexHistoricalQueryParams, # pylint: disable=unused-argument + credentials: Optional[Dict[str, str]], + **kwargs: Any, + ) -> List[dict]: + """Return the raw data from the Yahoo Finance endpoint.""" + data = yf_download( + symbol=query.symbol, + start_date=query.start_date, + end_date=query.end_date, + interval=query.interval, + period=query.period, + prepost=query.prepost, + rounding=query.rounding, + ) + + if data.empty: + raise EmptyDataError() + + days = ( + 1 + if query.interval in ["1m", "2m", "5m", "15m", "30m", "60m", "1h", "90m"] + else 0 + ) + + if query.start_date: + if "date" in data.columns: + data.set_index("date", inplace=True) + data.index = to_datetime(data.index) + + data = data[ + (data.index >= to_datetime(query.start_date)) + & (data.index <= to_datetime(query.end_date + timedelta(days=days))) + ] + + data.reset_index(inplace=True) + data.rename(columns={"index": "date"}, inplace=True) + + return data.to_dict("records") + + @staticmethod + def transform_data( + query: YFinanceIndexHistoricalQueryParams, + data: dict, + **kwargs: Any, + ) -> List[YFinanceIndexHistoricalData]: + """Transform the data to the standard format.""" + return [YFinanceIndexHistoricalData.model_validate(d) for d in data] diff --git a/openbb_platform/providers/yfinance/tests/record/http/test_yfinance_fetchers/test_yf_active_fetcher.yaml b/openbb_platform/providers/yfinance/tests/record/http/test_yfinance_fetchers/test_y_finance_active_fetcher.yaml similarity index 100% rename from openbb_platform/providers/yfinance/tests/record/http/test_yfinance_fetchers/test_yf_active_fetcher.yaml rename to openbb_platform/providers/yfinance/tests/record/http/test_yfinance_fetchers/test_y_finance_active_fetcher.yaml diff --git a/openbb_platform/providers/yfinance/tests/record/http/test_yfinance_fetchers/test_yf_aggressive_small_caps_fetcher.yaml b/openbb_platform/providers/yfinance/tests/record/http/test_yfinance_fetchers/test_y_finance_aggressive_small_caps_fetcher.yaml similarity index 100% rename from openbb_platform/providers/yfinance/tests/record/http/test_yfinance_fetchers/test_yf_aggressive_small_caps_fetcher.yaml rename to openbb_platform/providers/yfinance/tests/record/http/test_yfinance_fetchers/test_y_finance_aggressive_small_caps_fetcher.yaml diff --git a/openbb_platform/providers/yfinance/tests/record/http/test_yfinance_fetchers/test_yf_gainers_fetcher.yaml b/openbb_platform/providers/yfinance/tests/record/http/test_yfinance_fetchers/test_y_finance_gainers_fetcher.yaml similarity index 100% rename from openbb_platform/providers/yfinance/tests/record/http/test_yfinance_fetchers/test_yf_gainers_fetcher.yaml rename to openbb_platform/providers/yfinance/tests/record/http/test_yfinance_fetchers/test_y_finance_gainers_fetcher.yaml diff --git a/openbb_platform/providers/yfinance/tests/record/http/test_yfinance_fetchers/test_yf_growth_tech_equities_fetcher.yaml b/openbb_platform/providers/yfinance/tests/record/http/test_yfinance_fetchers/test_y_finance_growth_tech_equities_fetcher.yaml similarity index 100% rename from openbb_platform/providers/yfinance/tests/record/http/test_yfinance_fetchers/test_yf_growth_tech_equities_fetcher.yaml rename to openbb_platform/providers/yfinance/tests/record/http/test_yfinance_fetchers/test_y_finance_growth_tech_equities_fetcher.yaml diff --git a/openbb_platform/providers/yfinance/tests/record/http/test_yfinance_fetchers/test_y_finance_index_historical_fetcher.yaml b/openbb_platform/providers/yfinance/tests/record/http/test_yfinance_fetchers/test_y_finance_index_historical_fetcher.yaml new file mode 100644 index 00000000000..e7547797fef --- /dev/null +++ b/openbb_platform/providers/yfinance/tests/record/http/test_yfinance_fetchers/test_y_finance_index_historical_fetcher.yaml @@ -0,0 +1,373 @@ +interactions: +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate, br + Connection: + - keep-alive + method: GET + uri: https://fc.yahoo.com/ + response: + body: + string: "\n\n \n \n \n Yahoo\n + \ \n + \ \n \n \n + \ \n \n \n \n \n \n \n \n \n \n\n" + headers: + Cache-Control: + - no-store + Connection: + - keep-alive + Content-Language: + - en + Content-Length: + - '4350' + Content-Type: + - text/html + Date: + - Mon, 08 Jan 2024 11:43:34 GMT + Expect-CT: + - max-age=31536000, report-uri="http://csp.yahoo.com/beacon/csp?src=yahoocom-expect-ct-report-only" + Server: + - ATS + Set-Cookie: + - A3=d=AQABBNXfm2UCEACtmMeuc8nOjsLoX1hjlwQFEgEBAQExnWWlZdxW0iMA_eMAAA&S=AQAAAqMQ-PrLvICW--J8J9y-wZQ; + Expires=Tue, 7 Jan 2025 17:43:34 GMT; Max-Age=31557600; Domain=.yahoo.com; + Path=/; SameSite=None; Secure; HttpOnly + Strict-Transport-Security: + - max-age=31536000 + X-Content-Type-Options: + - nosniff + X-XSS-Protection: + - 1; mode=block + status: + code: 502 + message: Connection timed out +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate, br + Connection: + - keep-alive + Cookie: + - MOCK_COOKIE + method: GET + uri: https://query1.finance.yahoo.com/v1/test/getcrumb + response: + body: + string: ASqh.0tGvoh + headers: + Age: + - '0' + Connection: + - keep-alive + Expect-CT: + - max-age=31536000, report-uri="http://csp.yahoo.com/beacon/csp?src=yahoocom-expect-ct-report-only" + Referrer-Policy: + - no-referrer-when-downgrade + Strict-Transport-Security: + - max-age=31536000 + Transfer-Encoding: + - chunked + X-Content-Type-Options: + - nosniff + X-XSS-Protection: + - 1; mode=block + cache-control: + - private + content-type: + - text/plain;charset=utf-8 + date: + - Mon, 08 Jan 2024 11:43:35 GMT + server: + - ATS + x-envoy-decorator-operation: + - finance-yql--mtls-default-production-gq1.finance-k8s.svc.yahoo.local:4080/* + x-envoy-upstream-service-time: + - '1' + x-frame-options: + - SAMEORIGIN + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate, br + Connection: + - keep-alive + Cookie: + - MOCK_COOKIE + method: GET + uri: https://query2.finance.yahoo.com/v8/finance/chart/%5EGSPC?crumb=MOCK_CRUMB&interval=1d&range=1d + response: + body: + string: '{"chart":{"result":[{"meta":{"currency":"USD","symbol":"^GSPC","exchangeName":"SNP","instrumentType":"INDEX","firstTradeDate":-1325583000,"regularMarketTime":1704491654,"gmtoffset":-18000,"timezone":"EST","exchangeTimezoneName":"America/New_York","regularMarketPrice":4697.24,"chartPreviousClose":4688.68,"priceHint":2,"currentTradingPeriod":{"pre":{"timezone":"EST","start":1704704400,"end":1704724200,"gmtoffset":-18000},"regular":{"timezone":"EST","start":1704724200,"end":1704747600,"gmtoffset":-18000},"post":{"timezone":"EST","start":1704747600,"end":1704762000,"gmtoffset":-18000}},"dataGranularity":"1d","range":"1d","validRanges":["1d","5d","1mo","3mo","6mo","1y","2y","5y","10y","ytd","max"]},"timestamp":[1704465000],"indicators":{"quote":[{"high":[4721.490234375],"close":[4697.240234375],"open":[4690.56982421875],"volume":[3844370000],"low":[4682.10986328125]}],"adjclose":[{"adjclose":[4697.240234375]}]}}],"error":null}}' + headers: + Age: + - '1' + Connection: + - keep-alive + Expect-CT: + - max-age=31536000, report-uri="http://csp.yahoo.com/beacon/csp?src=yahoocom-expect-ct-report-only" + Referrer-Policy: + - no-referrer-when-downgrade + Strict-Transport-Security: + - max-age=31536000 + X-Content-Type-Options: + - nosniff + X-XSS-Protection: + - 1; mode=block + cache-control: + - public, max-age=10, stale-while-revalidate=20 + content-length: + - '936' + content-type: + - application/json;charset=utf-8 + date: + - Mon, 08 Jan 2024 11:43:36 GMT + server: + - ATS + vary: + - Origin,Accept-Encoding + x-envoy-decorator-operation: + - finance-chart-api--mtls-production-gq1.finance-k8s.svc.yahoo.local:4080/* + x-envoy-upstream-service-time: + - '2' + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate, br + Connection: + - keep-alive + Cookie: + - MOCK_COOKIE + method: GET + uri: https://query2.finance.yahoo.com/v8/finance/chart/%5EGSPC?crumb=MOCK_CRUMB&events=div%2Csplits%2CcapitalGains&includePrePost=True&interval=1d&period1=MOCK_PERIOD_1&period2=MOCK_PERIOD_2 + response: + body: + string: !!binary | + H4sIAAAAAAAAAO1cWY8kx3H+L/O8Lud96M2QBNkPJgiTBmwItLHmjqi19qBnZyXTxP53f5GVUR1f + tAw+GxgsMJtdnZUZGfeV/fPD9398/fT88KufH54eP31+h9Hvf354//j8Wh59//np6fHD9z89/Orh + n7/5zcOrh08/vf+Pj+/w8d9+983Xv8aDx//G+x9+ePzq9ftHPP7mq6/x8O2HT89Pn98/fnj+9qcf + 5fE/fPWb3/4LvvjD26dPz98+vX7z+JvXz/jib2JOtY4cQniF/X/4/O710z++fvrT4/O3b2W92EMp + M7ZaXj388P754x/+8OnxWV4b641nTPqfjx9kh99+862B5tv9xYbq794/Pr39/vXffvX4l3//149P + f3pwm32NbzGvtNmPhK0WSr5+evzz24+fP/363cdP+DKPPI/66uFHmfv3bz8AjPRqI2gd6e2HH77G + Nh/fCOJ+fHqU/+4A/PS8kC3nkqPJIR4/vNkPUkny4O6gXy5wf3HNvcRtzdLb/7Xmjx8/Pf/igvv9 + 24Ithb++IFZ88/r59e+eXn8QUN8+C9fEN4JrIQk+YPjn1+/evvkn+fwJjHZ+XeVPfP8Rf/P629bf + +BP+JPlT5U8M8venZ5n8/vV/P3z35aQ/gH3/I9aKradeBbpXMhwltT2caYZzmEOsZQ9TL3tCzi3q + hIIT72HNeewhVt3r5tnqflpCTftpiXnsxUpKdS9Wyig6ofagExrGe9hL3ruVkeZet4ah8NbYFd6a + WtQJGbP3EAvsd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e7K4bh8JRPjdGVtYRs9spt4AsOgl7u + lQ2cmFvNrowcvrAjpXb5T5LkrgOVq/glcQHO657VbEyHo2qYtMw6lDZXfhNNb0uZviDmm5Ske+vW + wyKfbF0iydU0yydpclowu54Z6d+ijHHO7sK43FPlK6HBdazl1l0jWXM3AuECuV7WYgt7ku82qU1p + QAvnKnyTtkdOkd4Xw9bFalMmkS4MLtdVapbL09/UA48b1gP3utbB7IplUiih7st5dz2ycLeh1M1u + qXZJjFL9Tq6H8gIuD76uT1L3LOXFpcfLtmAlf6tKGkpNSUZ+9sP3zlauZZ1VtMJui/wKnmtOc40D + 0rrKt4sbZeClTdPiujjhkh5LJq9ofCqbQR75TnWx5RBhJGZuYSm67Zhc66svi+E13qFyvRgTHdA5 + sg4pcv/xRm75HQXfQcwVsEndtmWVWkxtKvMdILmR7tuJuSO5cvdsddchpNTItUgwkC1rCAR8pTY6 + qSqBTQ0Ccip6Y74tHoXEDay+bTJJnxDVx7hKLA2xpN6TkNVAnGRD2/GaXI08pWp/+MA1AspFAitw + UiPjC6GlkvaqXPvI0empu3KZBBG2BL9+1+Om0901xZRc0wRkgDWjnIBAiCNSrUxuA5FDgh27/4EJ + 8mHERJKRlZ/tMb/18EvFsuK0iHRGmGJYpXtxeV3VtGJXs8XwzO6ugi+WSWMst5yPTlwvv2dC1xMy + NypU22IttS9rJUTDkoourvouPwhA73fWhHLvwPbl1kJNMrIeX3eoTonIjHo2NPAvF3T3Cw/3BbMw + jL8gHbF8aXaFz1dLLGwV3279hWqZlKaIMj34ltjs+rKlYEb1seZ+qaj7En+vdMG5J4oQ2+TrDG04 + zmuD9Nd3X7579fD6zX/qLdif7YeXK7EvV2JfrsS+XInd3ZUvV2K1Y/zlSuz6/HIl9uVK7MuV2Jcr + sS9XYl+uxL5cia0vV2JfrsT+v7oS++W7LxL+Pz49fXx6+NWHz+/effnyvwO1cdbeaAAA + headers: + Age: + - '0' + Connection: + - keep-alive + Expect-CT: + - max-age=31536000, report-uri="http://csp.yahoo.com/beacon/csp?src=yahoocom-expect-ct-report-only" + Referrer-Policy: + - no-referrer-when-downgrade + Strict-Transport-Security: + - max-age=31536000 + Transfer-Encoding: + - chunked + X-Content-Type-Options: + - nosniff + X-XSS-Protection: + - 1; mode=block + cache-control: + - public, max-age=10, stale-while-revalidate=20 + content-encoding: + - gzip + content-type: + - application/json;charset=utf-8 + date: + - Mon, 08 Jan 2024 11:43:37 GMT + server: + - ATS + vary: + - Origin,Accept-Encoding + x-envoy-decorator-operation: + - finance-chart-api--mtls-production-gq1.finance-k8s.svc.yahoo.local:4080/* + x-envoy-upstream-service-time: + - '5' + status: + code: 200 + message: OK +version: 1 diff --git a/openbb_platform/providers/yfinance/tests/record/http/test_yfinance_fetchers/test_yf_losers_fetcher.yaml b/openbb_platform/providers/yfinance/tests/record/http/test_yfinance_fetchers/test_y_finance_losers_fetcher.yaml similarity index 100% rename from openbb_platform/providers/yfinance/tests/record/http/test_yfinance_fetchers/test_yf_losers_fetcher.yaml rename to openbb_platform/providers/yfinance/tests/record/http/test_yfinance_fetchers/test_y_finance_losers_fetcher.yaml diff --git a/openbb_platform/providers/yfinance/tests/record/http/test_yfinance_fetchers/test_yf_undervalued_growth_equities_fetcher.yaml b/openbb_platform/providers/yfinance/tests/record/http/test_yfinance_fetchers/test_y_finance_undervalued_growth_equities_fetcher.yaml similarity index 100% rename from openbb_platform/providers/yfinance/tests/record/http/test_yfinance_fetchers/test_yf_undervalued_growth_equities_fetcher.yaml rename to openbb_platform/providers/yfinance/tests/record/http/test_yfinance_fetchers/test_y_finance_undervalued_growth_equities_fetcher.yaml diff --git a/openbb_platform/providers/yfinance/tests/record/http/test_yfinance_fetchers/test_yf_undervalued_large_caps_fetcher.yaml b/openbb_platform/providers/yfinance/tests/record/http/test_yfinance_fetchers/test_y_finance_undervalued_large_caps_fetcher.yaml similarity index 100% rename from openbb_platform/providers/yfinance/tests/record/http/test_yfinance_fetchers/test_yf_undervalued_large_caps_fetcher.yaml rename to openbb_platform/providers/yfinance/tests/record/http/test_yfinance_fetchers/test_y_finance_undervalued_large_caps_fetcher.yaml diff --git a/openbb_platform/providers/yfinance/tests/test_yfinance_fetchers.py b/openbb_platform/providers/yfinance/tests/test_yfinance_fetchers.py index 4371df3b3a5..6fba6518891 100644 --- a/openbb_platform/providers/yfinance/tests/test_yfinance_fetchers.py +++ b/openbb_platform/providers/yfinance/tests/test_yfinance_fetchers.py @@ -17,6 +17,9 @@ from openbb_yfinance.models.futures_historical import YFinanceFuturesHistoricalF from openbb_yfinance.models.gainers import YFGainersFetcher from openbb_yfinance.models.growth_tech_equities import YFGrowthTechEquitiesFetcher from openbb_yfinance.models.income_statement import YFinanceIncomeStatementFetcher +from openbb_yfinance.models.index_historical import ( + YFinanceIndexHistoricalFetcher, +) from openbb_yfinance.models.losers import YFLosersFetcher from openbb_yfinance.models.market_indices import ( YFinanceMarketIndicesFetcher, @@ -59,6 +62,19 @@ def test_y_finance_market_indices_fetcher(credentials=test_credentials): assert result is None +@pytest.mark.record_http +def test_y_finance_index_historical_fetcher(credentials=test_credentials): + params = { + "symbol": "^GSPC", + "start_date": date(2023, 1, 1), + "end_date": date(2023, 1, 10), + } + + fetcher = YFinanceIndexHistoricalFetcher() + result = fetcher.test(params, credentials) + assert result is None + + @pytest.mark.record_http def test_y_finance_crypto_historical_fetcher(credentials=test_credentials): params = { @@ -177,7 +193,7 @@ def test_y_finance_etf_historical_fetcher(credentials=test_credentials): @pytest.mark.record_http -def test_yf_active_fetcher(credentials=test_credentials): +def test_y_finance_active_fetcher(credentials=test_credentials): params = {} fetcher = YFActiveFetcher() @@ -186,7 +202,7 @@ def test_yf_active_fetcher(credentials=test_credentials): @pytest.mark.record_http -def test_yf_gainers_fetcher(credentials=test_credentials): +def test_y_finance_gainers_fetcher(credentials=test_credentials): params = {} fetcher = YFGainersFetcher() @@ -195,7 +211,7 @@ def test_yf_gainers_fetcher(credentials=test_credentials): @pytest.mark.record_http -def test_yf_losers_fetcher(credentials=test_credentials): +def test_y_finance_losers_fetcher(credentials=test_credentials): params = {} fetcher = YFLosersFetcher() @@ -204,7 +220,7 @@ def test_yf_losers_fetcher(credentials=test_credentials): @pytest.mark.record_http -def test_yf_undervalued_large_caps_fetcher(credentials=test_credentials): +def test_y_finance_undervalued_large_caps_fetcher(credentials=test_credentials): params = {} fetcher = YFUndervaluedLargeCapsFetcher() @@ -213,7 +229,7 @@ def test_yf_undervalued_large_caps_fetcher(credentials=test_credentials): @pytest.mark.record_http -def test_yf_undervalued_growth_equities_fetcher(credentials=test_credentials): +def test_y_finance_undervalued_growth_equities_fetcher(credentials=test_credentials): params = {} fetcher = YFUndervaluedGrowthEquitiesFetcher() @@ -222,7 +238,7 @@ def test_yf_undervalued_growth_equities_fetcher(credentials=test_credentials): @pytest.mark.record_http -def test_yf_aggressive_small_caps_fetcher(credentials=test_credentials): +def test_y_finance_aggressive_small_caps_fetcher(credentials=test_credentials): params = {} fetcher = YFAggressiveSmallCapsFetcher() @@ -231,7 +247,7 @@ def test_yf_aggressive_small_caps_fetcher(credentials=test_credentials): @pytest.mark.record_http -def test_yf_growth_tech_equities_fetcher(credentials=test_credentials): +def test_y_finance_growth_tech_equities_fetcher(credentials=test_credentials): params = {} fetcher = YFGrowthTechEquitiesFetcher()