From 7deb4e69f646e9212e65eceec9762d9b964516c3 Mon Sep 17 00:00:00 2001 From: montezdesousa <79287829+montezdesousa@users.noreply.github.com> Date: Thu, 15 Feb 2024 12:19:18 +0000 Subject: [PATCH] [Feature] - Comma separated string and list inputs (#6062) * feat: balancesheet * feat: income statement * fix: cash flow statement * feat: financial ratios * feat: reported financials * feat: revenue business line * feat: revenue per geography * fix: warnings * Update balance_sheet.py * fix: remove warning imports * feat: balance sheet growth * feat: calendar ipo * feat: cashflow growth * feat: __validators__ * fix: typing * fix: validator msg * feat: trailing dividend_yield * feat: short volume * feat: share statistics * feat: price target + consensus * fix: update validator * feat: historical dividends * feat: key executives * fix: getattr directly * fix: type hint validator * fix: add default to getattr * typo * feat: otc * feat: options chains * fix: remove list validators * feat: add validator dict to fetchers * lint * update standard models * lint * feat: rename validator * fix: ownership * feat: query params description * fix: balance yfinance * key execs, income statement * remove change * fix: revenue geographic * fix: disable pylint * fix: unusual + balance * unit test validator * minor fix * explicit validators * update test * feat: multiple items allowed * rebuild * move check_single_value * crypto historical * order providers * fix typing * rename extra dict * marking multiple items allowed * Revert "marking multiple items allowed" This reverts commit 7da04817e18b2c9e373ffde9134f3949d11f58dd. * error msg * fix: default provider runtime vs configuration * minor fix * docstring * revert default changes * get provider before executing cmd * fix container bug * clean filter * add comment * prevent bad defaults * update docstring * typing * fix * black * fix docstring generation * [Feature] - Mark multiple item fetchers (#6074) * feat: price target * bezinga company news * equity quote * marking multiple items allowed * more multiple items * black * rebuild * another batch * rebuild * another * cpi * move prop * rebuild --------- Co-authored-by: hjoaquim * rename var * update msg * rename func * fix test * mypy * ruff --------- Co-authored-by: hjoaquim --- .../openbb_core/app/provider_interface.py | 15 +- .../core/openbb_core/app/static/container.py | 19 +- .../openbb_core/app/static/package_builder.py | 86 ++++--- .../openbb_core/app/static/utils/filters.py | 36 ++- openbb_platform/core/openbb_core/app/utils.py | 10 + .../provider/abstract/query_params.py | 37 ++- .../core/openbb_core/provider/registry_map.py | 30 +++ .../provider/utils/descriptions.py | 2 - openbb_platform/core/tests/app/test_utils.py | 20 ++ openbb_platform/openbb/package/crypto.py | 6 +- .../openbb/package/crypto_price.py | 23 +- openbb_platform/openbb/package/currency.py | 6 +- .../openbb/package/currency_price.py | 23 +- .../openbb/package/derivatives_options.py | 12 +- openbb_platform/openbb/package/economy.py | 122 +++++++--- openbb_platform/openbb/package/economy_gdp.py | 30 ++- openbb_platform/openbb/package/equity.py | 38 ++- .../openbb/package/equity_calendar.py | 40 +++- .../openbb/package/equity_compare.py | 6 +- .../openbb/package/equity_discovery.py | 52 ++++- .../openbb/package/equity_estimates.py | 40 +++- .../openbb/package/equity_fundamental.py | 216 ++++++++++++++---- .../openbb/package/equity_ownership.py | 38 ++- .../openbb/package/equity_price.py | 62 +++-- .../openbb/package/equity_shorts.py | 6 +- openbb_platform/openbb/package/etf.py | 87 +++++-- openbb_platform/openbb/package/fixedincome.py | 10 +- .../openbb/package/fixedincome_corporate.py | 48 ++-- .../openbb/package/fixedincome_government.py | 18 +- .../openbb/package/fixedincome_rate.py | 76 ++++-- .../openbb/package/fixedincome_spreads.py | 30 ++- openbb_platform/openbb/package/index.py | 34 ++- .../openbb/package/module_map.json | 4 +- openbb_platform/openbb/package/news.py | 60 +++-- .../openbb/package/regulators_sec.py | 64 ++++-- .../models/equity_historical.py | 2 + .../openbb_benzinga/models/company_news.py | 2 + .../openbb_benzinga/models/price_target.py | 1 + .../openbb_cboe/models/equity_historical.py | 2 + .../cboe/openbb_cboe/models/equity_quote.py | 2 + .../openbb_cboe/models/index_historical.py | 2 + .../openbb_finra/models/otc_aggregate.py | 1 + .../openbb_finviz/models/equity_profile.py | 2 + .../openbb_finviz/models/key_metrics.py | 2 + .../openbb_finviz/models/price_target.py | 2 + .../openbb_fmp/models/crypto_historical.py | 1 + .../openbb_fmp/models/equity_historical.py | 1 + .../fmp/openbb_fmp/models/equity_peers.py | 2 +- .../fmp/openbb_fmp/models/equity_profile.py | 1 + .../fmp/openbb_fmp/models/equity_quote.py | 2 + .../models/equity_valuation_multiples.py | 2 + .../models/executive_compensation.py | 2 + .../fmp/openbb_fmp/models/key_metrics.py | 2 + .../providers/fred/openbb_fred/models/cpi.py | 2 + .../fred/openbb_fred/models/series.py | 2 + .../openbb_intrinio/models/company_news.py | 1 + .../openbb_intrinio/models/equity_info.py | 2 + .../openbb_intrinio/models/equity_quote.py | 2 + .../models/historical_attributes.py | 1 + .../models/index_historical.py | 1 + .../models/latest_attributes.py | 2 + .../openbb_nasdaq/models/economic_calendar.py | 2 + .../models/historical_dividends.py | 2 + .../models/crypto_historical.py | 2 + .../models/currency_historical.py | 2 + .../models/equity_historical.py | 2 + .../openbb_polygon/models/index_historical.py | 2 + .../openbb_stockgrid/models/short_volume.py | 2 + .../openbb_tiingo/models/equity_historical.py | 1 + .../models/economic_calendar.py | 2 + .../models/crypto_historical.py | 2 + .../models/currency_historical.py | 2 + .../models/equity_historical.py | 2 + .../openbb_yfinance/models/equity_profile.py | 2 + .../openbb_yfinance/models/equity_quote.py | 2 + .../openbb_yfinance/models/etf_info.py | 2 + .../models/futures_historical.py | 2 + .../models/historical_dividends.py | 14 +- .../models/index_historical.py | 2 + .../openbb_yfinance/models/key_executives.py | 14 +- .../openbb_yfinance/models/market_indices.py | 2 + .../models/price_target_consensus.py | 2 + .../models/share_statistics.py | 2 + 83 files changed, 1158 insertions(+), 359 deletions(-) diff --git a/openbb_platform/core/openbb_core/app/provider_interface.py b/openbb_platform/core/openbb_core/app/provider_interface.py index 0e37ea7fa73..9755ccdb77c 100644 --- a/openbb_platform/core/openbb_core/app/provider_interface.py +++ b/openbb_platform/core/openbb_core/app/provider_interface.py @@ -217,13 +217,24 @@ class ProviderInterface(metaclass=SingletonMeta): # field.outer_type_ don't work for Optional nested types type_ = field.annotation + additional_description = "" + if (extra := field.json_schema_extra) and ( + multiple := extra.get("multiple_items_allowed") + ): + if provider_name: + additional_description += " Multiple items allowed." + else: + additional_description += ( + " Multiple items allowed: " + ", ".join(multiple) + "." + ) + provider_field = ( f"(provider: {provider_name})" if provider_name != "openbb" else "" ) description = ( - f"{field.description} {provider_field}" + f"{field.description}{additional_description} {provider_field}" if provider_name and field.description - else f"{field.description}" + else f"{field.description}{additional_description}" ) if field.is_required(): diff --git a/openbb_platform/core/openbb_core/app/static/container.py b/openbb_platform/core/openbb_core/app/static/container.py index 0f0e483678d..333f3913712 100644 --- a/openbb_platform/core/openbb_core/app/static/container.py +++ b/openbb_platform/core/openbb_core/app/static/container.py @@ -1,8 +1,9 @@ """Container class.""" -from typing import Any +from typing import Any, Optional, Tuple from openbb_core.app.command_runner import CommandRunner +from openbb_core.app.model.abstract.error import OpenBBError from openbb_core.app.model.obbject import OBBject @@ -21,3 +22,19 @@ class Container: if output_type == "OBBject": return obbject return getattr(obbject, "to_" + output_type)() + + def _get_provider( + self, choice: Optional[str], cmd: str, available: Tuple[str] + ) -> str: + """Get the provider to use in execution.""" + if choice is None: + if config_default := self._command_runner.user_settings.defaults.routes.get( + cmd, {} + ).get("provider"): + if config_default in available: + return config_default + raise OpenBBError( + f"provider '{config_default}' is not available. Choose from: {', '.join(available)}." + ) + return available[0] + return choice diff --git a/openbb_platform/core/openbb_core/app/static/package_builder.py b/openbb_platform/core/openbb_core/app/static/package_builder.py index 4accfa70c08..ea57bfbbd98 100644 --- a/openbb_platform/core/openbb_core/app/static/package_builder.py +++ b/openbb_platform/core/openbb_core/app/static/package_builder.py @@ -5,6 +5,7 @@ import builtins import inspect import shutil import sys +from dataclasses import Field from inspect import Parameter, _empty, isclass, signature from json import dumps, load from pathlib import Path @@ -44,7 +45,7 @@ from openbb_core.env import Env from openbb_core.provider.abstract.data import Data try: - from openbb_charting import Charting + from openbb_charting import Charting # type: ignore CHARTING_INSTALLED = True except ImportError: @@ -436,6 +437,18 @@ class ClassDefinition: class MethodDefinition: """Build the method definition for the Platform.""" + # These are types we want to expand. + # For example, start_date is always a 'date', but we also accept 'str' as input. + # Be careful, if the type is not coercible by pydantic to the original type, you + # will need to add some conversion code in the input filter. + TYPE_EXPANSION = { + "data": DataProcessingSupportedTypes, + "start_date": str, + "end_date": str, + "date": str, + "provider": None, + } + @staticmethod def build_class_loader_method(path: str) -> str: """Build the class loader method.""" @@ -478,6 +491,14 @@ class MethodDefinition: return default_default + @staticmethod + def get_extra(field: FieldInfo) -> dict: + """Get json schema extra""" + field_default = getattr(field, "default", None) + if field_default: + return getattr(field_default, "json_schema_extra", {}) + return {} + @staticmethod def is_annotated_dc(annotation) -> bool: """Check if the annotation is an annotated dataclass.""" @@ -521,17 +542,6 @@ class MethodDefinition: path: str, parameter_map: Dict[str, Parameter] ) -> OrderedDict[str, Parameter]: """Format the params.""" - # These are types we want to expand. - # For example, start_date is always a 'date', but we also accept 'str' as input. - # Be careful, if the type is not coercible by pydantic to the original type, you - # will need to add some conversion code in the input filter. - TYPE_EXPANSION = { - "data": DataProcessingSupportedTypes, - "start_date": str, - "end_date": str, - "date": str, - "provider": None, - } DEFAULT_REPLACEMENT = { "provider": None, @@ -557,8 +567,8 @@ class MethodDefinition: for field_name, field in fields.items(): type_ = MethodDefinition.get_type(field) default = MethodDefinition.get_default(field) - - new_type = TYPE_EXPANSION.get(field_name, ...) + extra = MethodDefinition.get_extra(field) + new_type = MethodDefinition.get_expanded_type(field_name, extra) updated_type = type_ if new_type is ... else Union[type_, new_type] formatted[field_name] = Parameter( @@ -568,8 +578,7 @@ class MethodDefinition: default=DEFAULT_REPLACEMENT.get(field_name, default), ) else: - new_type = TYPE_EXPANSION.get(name, ...) - + new_type = MethodDefinition.get_expanded_type(name) if hasattr(new_type, "__constraints__"): types = new_type.__constraints__ + (param.annotation,) updated_type = Union[types] # type: ignore @@ -595,9 +604,9 @@ class MethodDefinition: ): """Add the field description to the param signature.""" if model_name: - available_fields: Dict[str, FieldInfo] = ProviderInterface().map[ - model_name - ]["openbb"]["QueryParams"]["fields"] + available_fields: Dict[str, Field] = ( + ProviderInterface().params[model_name]["standard"].__dataclass_fields__ + ) for param, value in od.items(): if param not in available_fields: @@ -608,7 +617,9 @@ class MethodDefinition: new_value = value.replace( annotation=Annotated[ value.annotation, - OpenBBCustomParameter(description=field.description), + OpenBBCustomParameter( + description=getattr(field.default, "description", "") + ), ], ) @@ -722,22 +733,40 @@ class MethodDefinition: code += " simplefilter('always', DeprecationWarning)\n" code += f""" warn("{deprecation_message}", category=DeprecationWarning, stacklevel=2)\n\n""" + extra_info = {} + code += " return self._run(\n" code += f""" "{path}",\n""" code += " **filter_inputs(\n" for name, param in parameter_map.items(): if name == "extra_params": code += f" {name}=kwargs,\n" + elif name == "provider_choices": + field = param.annotation.__args__[0].__dataclass_fields__["provider"] + available = field.type.__args__ + code += " provider_choices={\n" + code += ' "provider": self._get_provider(\n' + code += " provider,\n" + code += f' "{path}",\n' + code += f" {available},\n" + code += " )\n" + code += " },\n" elif MethodDefinition.is_annotated_dc(param.annotation): fields = param.annotation.__args__[0].__dataclass_fields__ value = {k: k for k in fields} code += f" {name}={{\n" for k, v in value.items(): code += f' "{k}": {v},\n' + # TODO: Extend this to extra_params + if extra := MethodDefinition.get_extra(fields[k]): + extra_info[k] = extra code += " },\n" else: code += f" {name}={name},\n" + if extra_info: + code += f" extra_info={extra_info},\n" + if MethodDefinition.is_data_processing_function(path): code += " data_processing=True,\n" @@ -746,6 +775,13 @@ class MethodDefinition: return code + @classmethod + def get_expanded_type(cls, field_name: str, extra: Optional[dict] = None) -> object: + """Expand the original field type""" + if extra and "multiple_items_allowed" in extra: + return List[str] + return cls.TYPE_EXPANSION.get(field_name, ...) + @classmethod def build_command_method( cls, @@ -839,10 +875,6 @@ class DocstringGenerator: standard_dict = params["standard"].__dataclass_fields__ extra_dict = params["extra"].__dataclass_fields__ - obb_query_fields: Dict[str, FieldInfo] = cls.provider_interface.map[model_name][ - "openbb" - ]["QueryParams"]["fields"] - if examples: example_docstring = "\n Example\n -------\n" example_docstring += " >>> from openbb import obb\n" @@ -858,9 +890,11 @@ class DocstringGenerator: for param_name, param in explicit_params.items(): if param_name in standard_dict: # pylint: disable=W0212 - p_type = obb_query_fields[param_name].annotation + p_type = param._annotation.__args__[0] type_ = p_type.__name__ if inspect.isclass(p_type) else p_type - description = getattr(obb_query_fields[param_name], "description", "") + description = getattr( + param._annotation.__metadata__[0], "description", "" + ) elif param_name == "provider": # pylint: disable=W0212 type_ = param._annotation diff --git a/openbb_platform/core/openbb_core/app/static/utils/filters.py b/openbb_platform/core/openbb_core/app/static/utils/filters.py index 267aac6878e..cccec2ada17 100644 --- a/openbb_platform/core/openbb_core/app/static/utils/filters.py +++ b/openbb_platform/core/openbb_core/app/static/utils/filters.py @@ -1,12 +1,44 @@ """OpenBB filters.""" -from openbb_core.app.utils import convert_to_basemodel +from typing import Dict, List, Optional + +from openbb_core.app.utils import check_single_item, convert_to_basemodel -def filter_inputs(data_processing: bool = False, **kwargs) -> dict: +def filter_inputs( + data_processing: bool = False, + extra_info: Optional[Dict[str, List[str]]] = None, + **kwargs, +) -> dict: """Filter command inputs.""" for key, value in kwargs.items(): if data_processing and key == "data": kwargs[key] = convert_to_basemodel(value) + if extra_info: + PROPERTY = "multiple_items_allowed" + + # Here we check if list items are passed and multiple items allowed for + # the given provider/input combination. In that case we transform the list + # into a comma-separated string + for field, props in extra_info.items(): + if PROPERTY in props and ( + provider := kwargs.get("provider_choices", {}).get("provider") + ): + for p in ("standard_params", "extra_params"): + if field in kwargs.get(p, {}): + current = kwargs[p][field] + new = ( + ",".join(current) if isinstance(current, list) else current + ) + + if provider and provider not in props[PROPERTY]: + check_single_item( + new, + f"{field} -> multiple items not allowed for '{provider}'", + ) + + kwargs[p][field] = new + break + return kwargs diff --git a/openbb_platform/core/openbb_core/app/utils.py b/openbb_platform/core/openbb_core/app/utils.py index e0c232801e7..b1a563131ac 100644 --- a/openbb_platform/core/openbb_core/app/utils.py +++ b/openbb_platform/core/openbb_core/app/utils.py @@ -8,6 +8,7 @@ import numpy as np import pandas as pd from pydantic import ValidationError +from openbb_core.app.model.abstract.error import OpenBBError from openbb_core.app.model.preferences import Preferences from openbb_core.app.model.system_settings import SystemSettings from openbb_core.provider.abstract.data import Data @@ -146,3 +147,12 @@ def get_user_cache_directory() -> str: else Preferences().cache_directory ) return cache_dir + + +def check_single_item( + value: Optional[str], message: Optional[str] = None +) -> Optional[str]: + """Check that string contains a single item.""" + if value and ("," in value or ";" in value): + raise OpenBBError(message if message else "multiple items not allowed") + return value diff --git a/openbb_platform/core/openbb_core/provider/abstract/query_params.py b/openbb_platform/core/openbb_core/provider/abstract/query_params.py index 7018a0bacb3..09714e3565a 100644 --- a/openbb_platform/core/openbb_core/provider/abstract/query_params.py +++ b/openbb_platform/core/openbb_core/provider/abstract/query_params.py @@ -1,14 +1,47 @@ """The OpenBB Standardized QueryParams Model that holds the query input parameters.""" -from typing import Dict +from typing import Any, Dict from pydantic import BaseModel, ConfigDict class QueryParams(BaseModel): - """The OpenBB Standardized QueryParams Model that holds the query input parameters.""" + """The OpenBB Standardized QueryParams Model. + + The `QueryParams` class is designed to hold query parameters, to be extended by + providers and to be used by fetchers when making data provider requests. + + Key Features: + - Alias handling: Utilizes an aliasing mechanism to maintain compatibility with different naming + conventions across various data formats. The alias is only applied when running `model_dump`. + - Json schema extra merging: Merge different json schema extra, identified by provider. + Example: + FMP fetcher: + __json_schema_extra__ = {"symbol": ["multiple_items_allowed"]} + Intrinio fetcher + __json_schema_extra__ = {"symbol": ["multiple_items_allowed"]} + + Creates a new field in the `symbol` schema with: + { + ..., + "multiple_items_allowed": ["fmp", "intrinio"], + ..., + } + + Attributes: + __alias_dict__ (Dict[str, str]): + A dictionary that maps field names to their aliases, + facilitating the use of different naming conventions. + __json_schema_extra__ (Dict[str, List[str]]): + Properties to be included in the json schema extra. + model_config (ConfigDict): + A configuration dictionary that defines the model's behavior, + such as accepting extra fields, populating by name, and alias + generation. + """ __alias_dict__: Dict[str, str] = {} + __json_schema_extra__: Dict[str, Any] = {} def __repr__(self): """Return the string representation of the QueryParams object.""" diff --git a/openbb_platform/core/openbb_core/provider/registry_map.py b/openbb_platform/core/openbb_core/provider/registry_map.py index be433e41a29..0742c54d849 100644 --- a/openbb_platform/core/openbb_core/provider/registry_map.py +++ b/openbb_platform/core/openbb_core/provider/registry_map.py @@ -98,8 +98,38 @@ class RegistryMap: {p: {"model": provider_model, "is_list": is_list}} ) + self._merge_json_schema_extra(p, fetcher, standard_query, extra_query) + return map_, return_schemas + def _merge_json_schema_extra( + self, + provider: str, + fetcher: Fetcher, + standard_query: dict, + extra_query: dict, + ): + """Merge json schema extra for different providers""" + model: BaseModel = RegistryMap._get_model(fetcher, "query_params") + for f, props in getattr(model, "__json_schema_extra__", {}).items(): + for p in props: + if f in standard_query["fields"]: + model_field = standard_query["fields"][f] + elif f in extra_query["fields"]: + model_field = extra_query["fields"][f] + else: + continue + + if model_field.json_schema_extra is None: + model_field.json_schema_extra = {} + + if p not in model_field.json_schema_extra: + model_field.json_schema_extra[p] = [] + + providers = model_field.json_schema_extra[p] + if provider not in providers: + providers.append(provider) + def _get_models(self, map_: MapType) -> List[str]: """Get available models.""" return list(map_.keys()) diff --git a/openbb_platform/core/openbb_core/provider/utils/descriptions.py b/openbb_platform/core/openbb_core/provider/utils/descriptions.py index 70758ef111f..0a67cb450de 100644 --- a/openbb_platform/core/openbb_core/provider/utils/descriptions.py +++ b/openbb_platform/core/openbb_core/provider/utils/descriptions.py @@ -12,8 +12,6 @@ QUERY_DESCRIPTIONS = { "countries": "The country or countries to get data.", "units": "The unit of measurement for the data.", "frequency": "The frequency of the data.", - "symbol_list_warning": "Lists of symbols are not allowed for this function. " - + "Multiple symbols will be ignored in favour of the first symbol.", } DATA_DESCRIPTIONS = { diff --git a/openbb_platform/core/tests/app/test_utils.py b/openbb_platform/core/tests/app/test_utils.py index e03bc406fef..7a963db6c5c 100644 --- a/openbb_platform/core/tests/app/test_utils.py +++ b/openbb_platform/core/tests/app/test_utils.py @@ -1,8 +1,10 @@ import numpy as np import pandas as pd import pytest +from openbb_core.app.model.abstract.error import OpenBBError from openbb_core.app.utils import ( basemodel_to_df, + check_single_item, df_to_basemodel, dict_to_basemodel, get_target_column, @@ -124,3 +126,21 @@ def test_ndarray_to_basemodel(array, expected): result = ndarray_to_basemodel(array) for r, e in zip(result, expected): assert r.model_dump() == e.model_dump() + + +@pytest.mark.parametrize( + "item, expected", + [ + ("SYMBOL", "SYMBOL"), + (None, None), + ("", ""), + ("SYMBOL1,SYMBOL2", OpenBBError), + ("SYMBOL1;SYMBOL2", OpenBBError), + ], +) +def test_check_single_item(item, expected): + if expected is OpenBBError: + with pytest.raises(OpenBBError): + check_single_item(item) + else: + assert check_single_item(item) == expected diff --git a/openbb_platform/openbb/package/crypto.py b/openbb_platform/openbb/package/crypto.py index 88f66999759..0968734fcfc 100644 --- a/openbb_platform/openbb/package/crypto.py +++ b/openbb_platform/openbb/package/crypto.py @@ -85,7 +85,11 @@ class ROUTER_crypto(Container): "/crypto/search", **filter_inputs( provider_choices={ - "provider": provider, + "provider": self._get_provider( + provider, + "/crypto/search", + ("fmp",), + ) }, standard_params={ "query": query, diff --git a/openbb_platform/openbb/package/crypto_price.py b/openbb_platform/openbb/package/crypto_price.py index 28673b562c5..837523ff78f 100644 --- a/openbb_platform/openbb/package/crypto_price.py +++ b/openbb_platform/openbb/package/crypto_price.py @@ -1,7 +1,7 @@ ### THIS FILE IS AUTO-GENERATED. DO NOT EDIT. ### import datetime -from typing import Literal, Optional, Union +from typing import List, Literal, Optional, Union from openbb_core.app.model.custom_parameter import OpenBBCustomParameter from openbb_core.app.model.obbject import OBBject @@ -23,9 +23,9 @@ class ROUTER_crypto_price(Container): def historical( self, symbol: Annotated[ - str, + Union[str, List[str]], OpenBBCustomParameter( - description="Symbol to get data for. Can use CURR1-CURR2 or CURR1CURR2 format." + description="Symbol to get data for. Can use CURR1-CURR2 or CURR1CURR2 format. Multiple items allowed: fmp, polygon, yfinance." ), ], start_date: Annotated[ @@ -47,11 +47,11 @@ class ROUTER_crypto_price(Container): Parameters ---------- - symbol : str - Symbol to get data for. Can use CURR1-CURR2 or CURR1CURR2 format. - start_date : Optional[datetime.date] + symbol : Union[str, List[str]] + Symbol to get data for. Can use CURR1-CURR2 or CURR1CURR2 format. Multiple items allowed: fmp, polygon, yfinance. + start_date : Union[datetime.date, None, str] Start date of the data, in YYYY-MM-DD format. - end_date : Optional[datetime.date] + end_date : Union[datetime.date, None, str] End date of the data, in YYYY-MM-DD format. provider : Optional[Literal['fmp', 'polygon', 'tiingo', 'yfinance']] The provider to use for the query, by default None. @@ -131,7 +131,11 @@ class ROUTER_crypto_price(Container): "/crypto/price/historical", **filter_inputs( provider_choices={ - "provider": provider, + "provider": self._get_provider( + provider, + "/crypto/price/historical", + ("fmp", "polygon", "tiingo", "yfinance"), + ) }, standard_params={ "symbol": symbol, @@ -139,5 +143,8 @@ class ROUTER_crypto_price(Container): "end_date": end_date, }, extra_params=kwargs, + extra_info={ + "symbol": {"multiple_items_allowed": ["fmp", "polygon", "yfinance"]} + }, ) ) diff --git a/openbb_platform/openbb/package/currency.py b/openbb_platform/openbb/package/currency.py index ea4a2c1f5f5..4ba5ab42990 100644 --- a/openbb_platform/openbb/package/currency.py +++ b/openbb_platform/openbb/package/currency.py @@ -126,7 +126,11 @@ class ROUTER_currency(Container): "/currency/search", **filter_inputs( provider_choices={ - "provider": provider, + "provider": self._get_provider( + provider, + "/currency/search", + ("fmp", "intrinio", "polygon"), + ) }, standard_params={}, extra_params=kwargs, diff --git a/openbb_platform/openbb/package/currency_price.py b/openbb_platform/openbb/package/currency_price.py index 1e757613380..66eae4b3efc 100644 --- a/openbb_platform/openbb/package/currency_price.py +++ b/openbb_platform/openbb/package/currency_price.py @@ -1,7 +1,7 @@ ### THIS FILE IS AUTO-GENERATED. DO NOT EDIT. ### import datetime -from typing import Literal, Optional, Union +from typing import List, Literal, Optional, Union from openbb_core.app.model.custom_parameter import OpenBBCustomParameter from openbb_core.app.model.obbject import OBBject @@ -23,9 +23,9 @@ class ROUTER_currency_price(Container): def historical( self, symbol: Annotated[ - str, + Union[str, List[str]], OpenBBCustomParameter( - description="Symbol to get data for. Can use CURR1-CURR2 or CURR1CURR2 format." + description="Symbol to get data for. Can use CURR1-CURR2 or CURR1CURR2 format. Multiple items allowed: polygon, yfinance." ), ], start_date: Annotated[ @@ -55,11 +55,11 @@ class ROUTER_currency_price(Container): Parameters ---------- - symbol : str - Symbol to get data for. Can use CURR1-CURR2 or CURR1CURR2 format. - start_date : Optional[datetime.date] + symbol : Union[str, List[str]] + Symbol to get data for. Can use CURR1-CURR2 or CURR1CURR2 format. Multiple items allowed: polygon, yfinance. + start_date : Union[datetime.date, None, str] Start date of the data, in YYYY-MM-DD format. - end_date : Optional[datetime.date] + end_date : Union[datetime.date, None, str] End date of the data, in YYYY-MM-DD format. provider : Optional[Literal['fmp', 'polygon', 'tiingo', 'yfinance']] The provider to use for the query, by default None. @@ -133,7 +133,11 @@ class ROUTER_currency_price(Container): "/currency/price/historical", **filter_inputs( provider_choices={ - "provider": provider, + "provider": self._get_provider( + provider, + "/currency/price/historical", + ("fmp", "polygon", "tiingo", "yfinance"), + ) }, standard_params={ "symbol": symbol, @@ -141,5 +145,8 @@ class ROUTER_currency_price(Container): "end_date": end_date, }, extra_params=kwargs, + extra_info={ + "symbol": {"multiple_items_allowed": ["polygon", "yfinance"]} + }, ) ) diff --git a/openbb_platform/openbb/package/derivatives_options.py b/openbb_platform/openbb/package/derivatives_options.py index 96324fba4d6..38af40e7194 100644 --- a/openbb_platform/openbb/package/derivatives_options.py +++ b/openbb_platform/openbb/package/derivatives_options.py @@ -158,7 +158,11 @@ class ROUTER_derivatives_options(Container): "/derivatives/options/chains", **filter_inputs( provider_choices={ - "provider": provider, + "provider": self._get_provider( + provider, + "/derivatives/options/chains", + ("intrinio",), + ) }, standard_params={ "symbol": symbol, @@ -243,7 +247,11 @@ class ROUTER_derivatives_options(Container): "/derivatives/options/unusual", **filter_inputs( provider_choices={ - "provider": provider, + "provider": self._get_provider( + provider, + "/derivatives/options/unusual", + ("intrinio",), + ) }, standard_params={ "symbol": symbol, diff --git a/openbb_platform/openbb/package/economy.py b/openbb_platform/openbb/package/economy.py index 456f02fd9a8..4fab46a8170 100644 --- a/openbb_platform/openbb/package/economy.py +++ b/openbb_platform/openbb/package/economy.py @@ -1,7 +1,7 @@ ### THIS FILE IS AUTO-GENERATED. DO NOT EDIT. ### import datetime -from typing import Literal, Optional, Union +from typing import List, Literal, Optional, Union from openbb_core.app.model.custom_parameter import OpenBBCustomParameter from openbb_core.app.model.obbject import OBBject @@ -51,16 +51,16 @@ class ROUTER_economy(Container): Parameters ---------- - start_date : Optional[datetime.date] + start_date : Union[datetime.date, None, str] Start date of the data, in YYYY-MM-DD format. - end_date : Optional[datetime.date] + end_date : Union[datetime.date, None, str] End date of the data, in YYYY-MM-DD format. provider : Optional[Literal['fmp', 'tradingeconomics']] 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. country : Optional[str] - Country of the event. (provider: tradingeconomics) + Country of the event. Multiple items allowed. (provider: tradingeconomics) importance : Optional[Literal['Low', 'Medium', 'High']] Importance of the event. (provider: tradingeconomics) group : Optional[Literal['interest rate', 'inflation', 'bonds', 'consumer', 'gdp', 'government', 'housing', 'labour', 'markets', 'money', 'prices', 'trade', 'business']] @@ -69,7 +69,7 @@ class ROUTER_economy(Container): Returns ------- OBBject - results : EconomicCalendar + results : List[EconomicCalendar] Serializable results. provider : Optional[Literal['fmp', 'tradingeconomics']] Provider name. @@ -131,7 +131,11 @@ class ROUTER_economy(Container): "/economy/calendar", **filter_inputs( provider_choices={ - "provider": provider, + "provider": self._get_provider( + provider, + "/economy/calendar", + ("fmp", "tradingeconomics"), + ) }, standard_params={ "start_date": start_date, @@ -166,9 +170,9 @@ class ROUTER_economy(Container): Parameters ---------- - start_date : Optional[datetime.date] + start_date : Union[datetime.date, None, str] Start date of the data, in YYYY-MM-DD format. - end_date : Optional[datetime.date] + end_date : Union[datetime.date, None, str] End date of the data, in YYYY-MM-DD format. provider : Optional[Literal['oecd']] The provider to use for the query, by default None. @@ -210,7 +214,11 @@ class ROUTER_economy(Container): "/economy/composite_leading_indicator", **filter_inputs( provider_choices={ - "provider": provider, + "provider": self._get_provider( + provider, + "/economy/composite_leading_indicator", + ("oecd",), + ) }, standard_params={ "start_date": start_date, @@ -224,7 +232,10 @@ class ROUTER_economy(Container): def cpi( self, country: Annotated[ - str, OpenBBCustomParameter(description="The country to get data.") + Union[str, List[str]], + OpenBBCustomParameter( + description="The country to get data. Multiple items allowed: fred." + ), ], units: Annotated[ Literal["growth_previous", "growth_same", "index_2015"], @@ -263,8 +274,8 @@ class ROUTER_economy(Container): Parameters ---------- - country : str - The country to get data. + country : Union[str, List[str]] + The country to get data. Multiple items allowed: fred. units : Literal['growth_previous', 'growth_same', 'index_2015'] The unit of measurement for the data. Options: @@ -278,9 +289,9 @@ class ROUTER_economy(Container): Options: `monthly`, `quarter`, and `annual`. harmonized : bool Whether you wish to obtain harmonized data. - start_date : Optional[datetime.date] + start_date : Union[datetime.date, None, str] Start date of the data, in YYYY-MM-DD format. - end_date : Optional[datetime.date] + end_date : Union[datetime.date, None, str] End date of the data, in YYYY-MM-DD format. provider : Optional[Literal['fred']] The provider to use for the query, by default None. @@ -318,7 +329,11 @@ class ROUTER_economy(Container): "/economy/cpi", **filter_inputs( provider_choices={ - "provider": provider, + "provider": self._get_provider( + provider, + "/economy/cpi", + ("fred",), + ) }, standard_params={ "country": country, @@ -329,6 +344,7 @@ class ROUTER_economy(Container): "end_date": end_date, }, extra_params=kwargs, + extra_info={"country": {"multiple_items_allowed": ["fred"]}}, ) ) @@ -435,7 +451,11 @@ class ROUTER_economy(Container): "/economy/fred_search", **filter_inputs( provider_choices={ - "provider": provider, + "provider": self._get_provider( + provider, + "/economy/fred_search", + ("fred",), + ) }, standard_params={ "query": query, @@ -448,7 +468,10 @@ class ROUTER_economy(Container): def fred_series( self, symbol: Annotated[ - str, OpenBBCustomParameter(description="Symbol to get data for.") + Union[str, List[str]], + OpenBBCustomParameter( + description="Symbol to get data for. Multiple items allowed: fred." + ), ], start_date: Annotated[ Union[datetime.date, None, str], @@ -473,11 +496,11 @@ class ROUTER_economy(Container): Parameters ---------- - symbol : str - Symbol to get data for. - start_date : Optional[datetime.date] + symbol : Union[str, List[str]] + Symbol to get data for. Multiple items allowed: fred. + start_date : Union[datetime.date, None, str] Start date of the data, in YYYY-MM-DD format. - end_date : Optional[datetime.date] + end_date : Union[datetime.date, None, str] End date of the data, in YYYY-MM-DD format. limit : Optional[int] The number of data entries to return. @@ -565,7 +588,11 @@ class ROUTER_economy(Container): "/economy/fred_series", **filter_inputs( provider_choices={ - "provider": provider, + "provider": self._get_provider( + provider, + "/economy/fred_series", + ("fred", "intrinio"), + ) }, standard_params={ "symbol": symbol, @@ -574,6 +601,7 @@ class ROUTER_economy(Container): "limit": limit, }, extra_params=kwargs, + extra_info={"symbol": {"multiple_items_allowed": ["fred"]}}, ) ) @@ -615,9 +643,9 @@ class ROUTER_economy(Container): Parameters ---------- - start_date : Optional[datetime.date] + start_date : Union[datetime.date, None, str] Start date of the data, in YYYY-MM-DD format. - end_date : Optional[datetime.date] + end_date : Union[datetime.date, None, str] End date of the data, in YYYY-MM-DD format. provider : Optional[Literal['oecd']] The provider to use for the query, by default None. @@ -631,7 +659,7 @@ class ROUTER_economy(Container): Returns ------- OBBject - results : List[STIR] + results : List[LTIR] Serializable results. provider : Optional[Literal['oecd']] Provider name. @@ -642,7 +670,7 @@ class ROUTER_economy(Container): extra: Dict[str, Any] Extra info. - STIR + LTIR ---- date : Optional[date] The date of the data. @@ -661,7 +689,11 @@ class ROUTER_economy(Container): "/economy/long_term_interest_rate", **filter_inputs( provider_choices={ - "provider": provider, + "provider": self._get_provider( + provider, + "/economy/long_term_interest_rate", + ("oecd",), + ) }, standard_params={ "start_date": start_date, @@ -699,9 +731,9 @@ class ROUTER_economy(Container): Parameters ---------- - start_date : Optional[datetime.date] + start_date : Union[datetime.date, None, str] Start date of the data, in YYYY-MM-DD format. - end_date : Optional[datetime.date] + end_date : Union[datetime.date, None, str] End date of the data, in YYYY-MM-DD format. adjusted : Optional[bool] Whether to return seasonally adjusted data. @@ -753,7 +785,11 @@ class ROUTER_economy(Container): "/economy/money_measures", **filter_inputs( provider_choices={ - "provider": provider, + "provider": self._get_provider( + provider, + "/economy/money_measures", + ("federal_reserve",), + ) }, standard_params={ "start_date": start_date, @@ -812,7 +848,11 @@ class ROUTER_economy(Container): "/economy/risk_premium", **filter_inputs( provider_choices={ - "provider": provider, + "provider": self._get_provider( + provider, + "/economy/risk_premium", + ("fmp",), + ) }, standard_params={}, extra_params=kwargs, @@ -847,9 +887,9 @@ class ROUTER_economy(Container): Parameters ---------- - start_date : Optional[datetime.date] + start_date : Union[datetime.date, None, str] Start date of the data, in YYYY-MM-DD format. - end_date : Optional[datetime.date] + end_date : Union[datetime.date, None, str] End date of the data, in YYYY-MM-DD format. provider : Optional[Literal['oecd']] The provider to use for the query, by default None. @@ -893,7 +933,11 @@ class ROUTER_economy(Container): "/economy/short_term_interest_rate", **filter_inputs( provider_choices={ - "provider": provider, + "provider": self._get_provider( + provider, + "/economy/short_term_interest_rate", + ("oecd",), + ) }, standard_params={ "start_date": start_date, @@ -925,9 +969,9 @@ class ROUTER_economy(Container): Parameters ---------- - start_date : Optional[datetime.date] + start_date : Union[datetime.date, None, str] Start date of the data, in YYYY-MM-DD format. - end_date : Optional[datetime.date] + end_date : Union[datetime.date, None, str] End date of the data, in YYYY-MM-DD format. provider : Optional[Literal['oecd']] The provider to use for the query, by default None. @@ -981,7 +1025,11 @@ class ROUTER_economy(Container): "/economy/unemployment", **filter_inputs( provider_choices={ - "provider": provider, + "provider": self._get_provider( + provider, + "/economy/unemployment", + ("oecd",), + ) }, standard_params={ "start_date": start_date, diff --git a/openbb_platform/openbb/package/economy_gdp.py b/openbb_platform/openbb/package/economy_gdp.py index 5cb9b376d80..2756ca88825 100644 --- a/openbb_platform/openbb/package/economy_gdp.py +++ b/openbb_platform/openbb/package/economy_gdp.py @@ -57,9 +57,9 @@ class ROUTER_economy_gdp(Container): ---------- period : Literal['quarter', 'annual'] Time period of the data to return. Units for nominal GDP period. Either quarter or annual. - start_date : Optional[datetime.date] + start_date : Union[datetime.date, None, str] Start date of the data, in YYYY-MM-DD format. - end_date : Optional[datetime.date] + end_date : Union[datetime.date, None, str] End date of the data, in YYYY-MM-DD format. type : Literal['nominal', 'real'] Type of GDP to get forecast of. Either nominal or real. @@ -101,7 +101,11 @@ class ROUTER_economy_gdp(Container): "/economy/gdp/forecast", **filter_inputs( provider_choices={ - "provider": provider, + "provider": self._get_provider( + provider, + "/economy/gdp/forecast", + ("oecd",), + ) }, standard_params={ "period": period, @@ -143,9 +147,9 @@ class ROUTER_economy_gdp(Container): ---------- units : Literal['usd', 'usd_cap'] The unit of measurement for the data. Units to get nominal GDP in. Either usd or usd_cap indicating per capita. - start_date : Optional[datetime.date] + start_date : Union[datetime.date, None, str] Start date of the data, in YYYY-MM-DD format. - end_date : Optional[datetime.date] + end_date : Union[datetime.date, None, str] End date of the data, in YYYY-MM-DD format. provider : Optional[Literal['oecd']] The provider to use for the query, by default None. @@ -185,7 +189,11 @@ class ROUTER_economy_gdp(Container): "/economy/gdp/nominal", **filter_inputs( provider_choices={ - "provider": provider, + "provider": self._get_provider( + provider, + "/economy/gdp/nominal", + ("oecd",), + ) }, standard_params={ "units": units, @@ -226,9 +234,9 @@ class ROUTER_economy_gdp(Container): ---------- units : Literal['idx', 'qoq', 'yoy'] The unit of measurement for the data. Either idx (indicating 2015=100), qoq (previous period) or yoy (same period, previous year).) - start_date : Optional[datetime.date] + start_date : Union[datetime.date, None, str] Start date of the data, in YYYY-MM-DD format. - end_date : Optional[datetime.date] + end_date : Union[datetime.date, None, str] End date of the data, in YYYY-MM-DD format. provider : Optional[Literal['oecd']] The provider to use for the query, by default None. @@ -268,7 +276,11 @@ class ROUTER_economy_gdp(Container): "/economy/gdp/real", **filter_inputs( provider_choices={ - "provider": provider, + "provider": self._get_provider( + provider, + "/economy/gdp/real", + ("oecd",), + ) }, standard_params={ "units": units, diff --git a/openbb_platform/openbb/package/equity.py b/openbb_platform/openbb/package/equity.py index 185c13df4fd..b6bde8a8562 100644 --- a/openbb_platform/openbb/package/equity.py +++ b/openbb_platform/openbb/package/equity.py @@ -1,6 +1,6 @@ ### THIS FILE IS AUTO-GENERATED. DO NOT EDIT. ### -from typing import Literal, Optional +from typing import List, Literal, Optional, Union from openbb_core.app.model.custom_parameter import OpenBBCustomParameter from openbb_core.app.model.obbject import OBBject @@ -194,7 +194,11 @@ class ROUTER_equity(Container): "/equity/market_snapshots", **filter_inputs( provider_choices={ - "provider": provider, + "provider": self._get_provider( + provider, + "/equity/market_snapshots", + ("fmp", "polygon"), + ) }, standard_params={}, extra_params=kwargs, @@ -221,7 +225,10 @@ class ROUTER_equity(Container): def profile( self, symbol: Annotated[ - str, OpenBBCustomParameter(description="Symbol to get data for.") + Union[str, List[str]], + OpenBBCustomParameter( + description="Symbol to get data for. Multiple items allowed: intrinio, yfinance." + ), ], provider: Optional[Literal["fmp", "intrinio", "yfinance"]] = None, **kwargs @@ -230,8 +237,8 @@ class ROUTER_equity(Container): Parameters ---------- - symbol : str - Symbol to get data for. + symbol : Union[str, List[str]] + Symbol to get data for. Multiple items allowed: intrinio, yfinance. provider : Optional[Literal['fmp', 'intrinio', 'yfinance']] The provider to use for the query, by default None. If None, the provider specified in defaults is selected or 'fmp' if there is @@ -385,12 +392,19 @@ class ROUTER_equity(Container): "/equity/profile", **filter_inputs( provider_choices={ - "provider": provider, + "provider": self._get_provider( + provider, + "/equity/profile", + ("fmp", "intrinio", "yfinance"), + ) }, standard_params={ "symbol": symbol, }, extra_params=kwargs, + extra_info={ + "symbol": {"multiple_items_allowed": ["intrinio", "yfinance"]} + }, ) ) @@ -494,7 +508,11 @@ class ROUTER_equity(Container): "/equity/screener", **filter_inputs( provider_choices={ - "provider": provider, + "provider": self._get_provider( + provider, + "/equity/screener", + ("fmp",), + ) }, standard_params={}, extra_params=kwargs, @@ -575,7 +593,11 @@ class ROUTER_equity(Container): "/equity/search", **filter_inputs( provider_choices={ - "provider": provider, + "provider": self._get_provider( + provider, + "/equity/search", + ("intrinio", "sec"), + ) }, standard_params={ "query": query, diff --git a/openbb_platform/openbb/package/equity_calendar.py b/openbb_platform/openbb/package/equity_calendar.py index 6d8c5cbd085..cb78af9628f 100644 --- a/openbb_platform/openbb/package/equity_calendar.py +++ b/openbb_platform/openbb/package/equity_calendar.py @@ -44,9 +44,9 @@ class ROUTER_equity_calendar(Container): Parameters ---------- - start_date : Optional[datetime.date] + start_date : Union[datetime.date, None, str] Start date of the data, in YYYY-MM-DD format. - end_date : Optional[datetime.date] + end_date : Union[datetime.date, None, str] End date of the data, in YYYY-MM-DD format. provider : Optional[Literal['fmp']] The provider to use for the query, by default None. @@ -98,7 +98,11 @@ class ROUTER_equity_calendar(Container): "/equity/calendar/dividend", **filter_inputs( provider_choices={ - "provider": provider, + "provider": self._get_provider( + provider, + "/equity/calendar/dividend", + ("fmp",), + ) }, standard_params={ "start_date": start_date, @@ -130,9 +134,9 @@ class ROUTER_equity_calendar(Container): Parameters ---------- - start_date : Optional[datetime.date] + start_date : Union[datetime.date, None, str] Start date of the data, in YYYY-MM-DD format. - end_date : Optional[datetime.date] + end_date : Union[datetime.date, None, str] End date of the data, in YYYY-MM-DD format. provider : Optional[Literal['fmp']] The provider to use for the query, by default None. @@ -188,7 +192,11 @@ class ROUTER_equity_calendar(Container): "/equity/calendar/earnings", **filter_inputs( provider_choices={ - "provider": provider, + "provider": self._get_provider( + provider, + "/equity/calendar/earnings", + ("fmp",), + ) }, standard_params={ "start_date": start_date, @@ -229,9 +237,9 @@ class ROUTER_equity_calendar(Container): ---------- symbol : Optional[str] Symbol to get data for. - start_date : Optional[datetime.date] + start_date : Union[datetime.date, None, str] Start date of the data, in YYYY-MM-DD format. - end_date : Optional[datetime.date] + end_date : Union[datetime.date, None, str] End date of the data, in YYYY-MM-DD format. limit : Optional[int] The number of data entries to return. @@ -352,7 +360,11 @@ class ROUTER_equity_calendar(Container): "/equity/calendar/ipo", **filter_inputs( provider_choices={ - "provider": provider, + "provider": self._get_provider( + provider, + "/equity/calendar/ipo", + ("intrinio",), + ) }, standard_params={ "symbol": symbol, @@ -386,9 +398,9 @@ class ROUTER_equity_calendar(Container): Parameters ---------- - start_date : Optional[datetime.date] + start_date : Union[datetime.date, None, str] Start date of the data, in YYYY-MM-DD format. - end_date : Optional[datetime.date] + end_date : Union[datetime.date, None, str] End date of the data, in YYYY-MM-DD format. provider : Optional[Literal['fmp']] The provider to use for the query, by default None. @@ -432,7 +444,11 @@ class ROUTER_equity_calendar(Container): "/equity/calendar/splits", **filter_inputs( provider_choices={ - "provider": provider, + "provider": self._get_provider( + provider, + "/equity/calendar/splits", + ("fmp",), + ) }, standard_params={ "start_date": start_date, diff --git a/openbb_platform/openbb/package/equity_compare.py b/openbb_platform/openbb/package/equity_compare.py index 390144283d4..291c1b341ab 100644 --- a/openbb_platform/openbb/package/equity_compare.py +++ b/openbb_platform/openbb/package/equity_compare.py @@ -67,7 +67,11 @@ class ROUTER_equity_compare(Container): "/equity/compare/peers", **filter_inputs( provider_choices={ - "provider": provider, + "provider": self._get_provider( + provider, + "/equity/compare/peers", + ("fmp",), + ) }, standard_params={ "symbol": symbol, diff --git a/openbb_platform/openbb/package/equity_discovery.py b/openbb_platform/openbb/package/equity_discovery.py index 2eed49a0023..6b272d10c0b 100644 --- a/openbb_platform/openbb/package/equity_discovery.py +++ b/openbb_platform/openbb/package/equity_discovery.py @@ -94,7 +94,11 @@ class ROUTER_equity_discovery(Container): "/equity/discovery/active", **filter_inputs( provider_choices={ - "provider": provider, + "provider": self._get_provider( + provider, + "/equity/discovery/active", + ("yfinance",), + ) }, standard_params={ "sort": sort, @@ -171,7 +175,11 @@ class ROUTER_equity_discovery(Container): "/equity/discovery/aggressive_small_caps", **filter_inputs( provider_choices={ - "provider": provider, + "provider": self._get_provider( + provider, + "/equity/discovery/aggressive_small_caps", + ("yfinance",), + ) }, standard_params={ "sort": sort, @@ -212,9 +220,9 @@ class ROUTER_equity_discovery(Container): Parameters ---------- - start_date : Optional[datetime.date] + start_date : Union[datetime.date, None, str] Start date of the data, in YYYY-MM-DD format. - end_date : Optional[datetime.date] + end_date : Union[datetime.date, None, str] End date of the data, in YYYY-MM-DD format. form_type : Optional[str] Filter by form type. Visit https://www.sec.gov/forms for a list of supported form types. @@ -266,7 +274,11 @@ class ROUTER_equity_discovery(Container): "/equity/discovery/filings", **filter_inputs( provider_choices={ - "provider": provider, + "provider": self._get_provider( + provider, + "/equity/discovery/filings", + ("fmp",), + ) }, standard_params={ "start_date": start_date, @@ -346,7 +358,11 @@ class ROUTER_equity_discovery(Container): "/equity/discovery/gainers", **filter_inputs( provider_choices={ - "provider": provider, + "provider": self._get_provider( + provider, + "/equity/discovery/gainers", + ("yfinance",), + ) }, standard_params={ "sort": sort, @@ -423,7 +439,11 @@ class ROUTER_equity_discovery(Container): "/equity/discovery/growth_tech", **filter_inputs( provider_choices={ - "provider": provider, + "provider": self._get_provider( + provider, + "/equity/discovery/growth_tech", + ("yfinance",), + ) }, standard_params={ "sort": sort, @@ -500,7 +520,11 @@ class ROUTER_equity_discovery(Container): "/equity/discovery/losers", **filter_inputs( provider_choices={ - "provider": provider, + "provider": self._get_provider( + provider, + "/equity/discovery/losers", + ("yfinance",), + ) }, standard_params={ "sort": sort, @@ -577,7 +601,11 @@ class ROUTER_equity_discovery(Container): "/equity/discovery/undervalued_growth", **filter_inputs( provider_choices={ - "provider": provider, + "provider": self._get_provider( + provider, + "/equity/discovery/undervalued_growth", + ("yfinance",), + ) }, standard_params={ "sort": sort, @@ -654,7 +682,11 @@ class ROUTER_equity_discovery(Container): "/equity/discovery/undervalued_large_caps", **filter_inputs( provider_choices={ - "provider": provider, + "provider": self._get_provider( + provider, + "/equity/discovery/undervalued_large_caps", + ("yfinance",), + ) }, standard_params={ "sort": sort, diff --git a/openbb_platform/openbb/package/equity_estimates.py b/openbb_platform/openbb/package/equity_estimates.py index b8d64e93304..4d318e341f9 100644 --- a/openbb_platform/openbb/package/equity_estimates.py +++ b/openbb_platform/openbb/package/equity_estimates.py @@ -1,6 +1,6 @@ ### THIS FILE IS AUTO-GENERATED. DO NOT EDIT. ### -from typing import Literal, Optional +from typing import List, Literal, Optional, Union from openbb_core.app.model.custom_parameter import OpenBBCustomParameter from openbb_core.app.model.obbject import OBBject @@ -24,7 +24,10 @@ class ROUTER_equity_estimates(Container): def consensus( self, symbol: Annotated[ - str, OpenBBCustomParameter(description="Symbol to get data for.") + Union[str, List[str]], + OpenBBCustomParameter( + description="Symbol to get data for. Multiple items allowed: yfinance." + ), ], provider: Optional[Literal["fmp", "yfinance"]] = None, **kwargs @@ -33,8 +36,8 @@ class ROUTER_equity_estimates(Container): Parameters ---------- - symbol : str - Symbol to get data for. + symbol : Union[str, List[str]] + Symbol to get data for. Multiple items allowed: yfinance. provider : Optional[Literal['fmp', 'yfinance']] The provider to use for the query, by default None. If None, the provider specified in defaults is selected or 'fmp' if there is @@ -87,12 +90,17 @@ class ROUTER_equity_estimates(Container): "/equity/estimates/consensus", **filter_inputs( provider_choices={ - "provider": provider, + "provider": self._get_provider( + provider, + "/equity/estimates/consensus", + ("fmp", "yfinance"), + ) }, standard_params={ "symbol": symbol, }, extra_params=kwargs, + extra_info={"symbol": {"multiple_items_allowed": ["yfinance"]}}, ) ) @@ -199,7 +207,11 @@ class ROUTER_equity_estimates(Container): "/equity/estimates/historical", **filter_inputs( provider_choices={ - "provider": provider, + "provider": self._get_provider( + provider, + "/equity/estimates/historical", + ("fmp",), + ) }, standard_params={ "symbol": symbol, @@ -214,7 +226,10 @@ class ROUTER_equity_estimates(Container): def price_target( self, symbol: Annotated[ - str, OpenBBCustomParameter(description="Symbol to get data for.") + Union[str, List[str]], + OpenBBCustomParameter( + description="Symbol to get data for. Multiple items allowed: benzinga." + ), ], limit: Annotated[ int, @@ -227,8 +242,8 @@ class ROUTER_equity_estimates(Container): Parameters ---------- - symbol : str - Symbol to get data for. + symbol : Union[str, List[str]] + Symbol to get data for. Multiple items allowed: benzinga. limit : int The number of data entries to return. provider : Optional[Literal['benzinga', 'fmp']] @@ -347,12 +362,17 @@ class ROUTER_equity_estimates(Container): "/equity/estimates/price_target", **filter_inputs( provider_choices={ - "provider": provider, + "provider": self._get_provider( + provider, + "/equity/estimates/price_target", + ("benzinga", "fmp"), + ) }, standard_params={ "symbol": symbol, "limit": limit, }, extra_params=kwargs, + extra_info={"symbol": {"multiple_items_allowed": ["benzinga"]}}, ) ) diff --git a/openbb_platform/openbb/package/equity_fundamental.py b/openbb_platform/openbb/package/equity_fundamental.py index 76ab9f84ffa..008cda94948 100644 --- a/openbb_platform/openbb/package/equity_fundamental.py +++ b/openbb_platform/openbb/package/equity_fundamental.py @@ -1,7 +1,7 @@ ### THIS FILE IS AUTO-GENERATED. DO NOT EDIT. ### import datetime -from typing import Literal, Optional, Union +from typing import List, Literal, Optional, Union from warnings import simplefilter, warn from annotated_types import Ge @@ -386,7 +386,11 @@ class ROUTER_equity_fundamental(Container): "/equity/fundamental/balance", **filter_inputs( provider_choices={ - "provider": provider, + "provider": self._get_provider( + provider, + "/equity/fundamental/balance", + ("fmp", "intrinio", "polygon", "yfinance"), + ) }, standard_params={ "symbol": symbol, @@ -534,7 +538,11 @@ class ROUTER_equity_fundamental(Container): "/equity/fundamental/balance_growth", **filter_inputs( provider_choices={ - "provider": provider, + "provider": self._get_provider( + provider, + "/equity/fundamental/balance_growth", + ("fmp",), + ) }, standard_params={ "symbol": symbol, @@ -792,7 +800,11 @@ class ROUTER_equity_fundamental(Container): "/equity/fundamental/cash", **filter_inputs( provider_choices={ - "provider": provider, + "provider": self._get_provider( + provider, + "/equity/fundamental/cash", + ("fmp", "intrinio", "polygon", "yfinance"), + ) }, standard_params={ "symbol": symbol, @@ -922,7 +934,11 @@ class ROUTER_equity_fundamental(Container): "/equity/fundamental/cash_growth", **filter_inputs( provider_choices={ - "provider": provider, + "provider": self._get_provider( + provider, + "/equity/fundamental/cash_growth", + ("fmp",), + ) }, standard_params={ "symbol": symbol, @@ -959,9 +975,9 @@ class ROUTER_equity_fundamental(Container): ---------- symbol : str Symbol to get data for. - start_date : Optional[datetime.date] + start_date : Union[datetime.date, None, str] Start date of the data, in YYYY-MM-DD format. - end_date : Optional[datetime.date] + end_date : Union[datetime.date, None, str] End date of the data, in YYYY-MM-DD format. provider : Optional[Literal['fmp', 'intrinio', 'yfinance']] The provider to use for the query, by default None. @@ -1017,7 +1033,11 @@ class ROUTER_equity_fundamental(Container): "/equity/fundamental/dividends", **filter_inputs( provider_choices={ - "provider": provider, + "provider": self._get_provider( + provider, + "/equity/fundamental/dividends", + ("fmp", "intrinio", "yfinance"), + ) }, standard_params={ "symbol": symbol, @@ -1093,7 +1113,11 @@ class ROUTER_equity_fundamental(Container): "/equity/fundamental/employee_count", **filter_inputs( provider_choices={ - "provider": provider, + "provider": self._get_provider( + provider, + "/equity/fundamental/employee_count", + ("fmp",), + ) }, standard_params={ "symbol": symbol, @@ -1227,7 +1251,11 @@ class ROUTER_equity_fundamental(Container): "/equity/fundamental/filings", **filter_inputs( provider_choices={ - "provider": provider, + "provider": self._get_provider( + provider, + "/equity/fundamental/filings", + ("fmp", "intrinio", "sec"), + ) }, standard_params={ "symbol": symbol, @@ -1245,7 +1273,10 @@ class ROUTER_equity_fundamental(Container): str, OpenBBCustomParameter(description="Symbol to get data for.") ], tag: Annotated[ - str, OpenBBCustomParameter(description="Intrinio data tag ID or code.") + Union[str, List[str]], + OpenBBCustomParameter( + description="Intrinio data tag ID or code. Multiple items allowed: intrinio." + ), ], start_date: Annotated[ Union[datetime.date, None, str], @@ -1284,11 +1315,11 @@ class ROUTER_equity_fundamental(Container): ---------- symbol : str Symbol to get data for. - tag : str - Intrinio data tag ID or code. - start_date : Optional[datetime.date] + tag : Union[str, List[str]] + Intrinio data tag ID or code. Multiple items allowed: intrinio. + start_date : Union[datetime.date, None, str] Start date of the data, in YYYY-MM-DD format. - end_date : Optional[datetime.date] + end_date : Union[datetime.date, None, str] End date of the data, in YYYY-MM-DD format. frequency : Optional[Literal['daily', 'weekly', 'monthly', 'quarterly', 'year... The frequency of the data. @@ -1338,7 +1369,11 @@ class ROUTER_equity_fundamental(Container): "/equity/fundamental/historical_attributes", **filter_inputs( provider_choices={ - "provider": provider, + "provider": self._get_provider( + provider, + "/equity/fundamental/historical_attributes", + ("intrinio",), + ) }, standard_params={ "symbol": symbol, @@ -1351,6 +1386,7 @@ class ROUTER_equity_fundamental(Container): "sort": sort, }, extra_params=kwargs, + extra_info={"tag": {"multiple_items_allowed": ["intrinio"]}}, ) ) @@ -1423,7 +1459,11 @@ class ROUTER_equity_fundamental(Container): "/equity/fundamental/historical_eps", **filter_inputs( provider_choices={ - "provider": provider, + "provider": self._get_provider( + provider, + "/equity/fundamental/historical_eps", + ("fmp",), + ) }, standard_params={ "symbol": symbol, @@ -1487,7 +1527,11 @@ class ROUTER_equity_fundamental(Container): "/equity/fundamental/historical_splits", **filter_inputs( provider_choices={ - "provider": provider, + "provider": self._get_provider( + provider, + "/equity/fundamental/historical_splits", + ("fmp",), + ) }, standard_params={ "symbol": symbol, @@ -1838,7 +1882,11 @@ class ROUTER_equity_fundamental(Container): "/equity/fundamental/income", **filter_inputs( provider_choices={ - "provider": provider, + "provider": self._get_provider( + provider, + "/equity/fundamental/income", + ("fmp", "intrinio", "polygon", "yfinance"), + ) }, standard_params={ "symbol": symbol, @@ -1874,7 +1922,7 @@ class ROUTER_equity_fundamental(Container): Symbol to get data for. limit : int The number of data entries to return. - period : Literal['annual', 'quarter'] + period : Literal['quarter', 'annual'] Time period of the data to return. provider : Optional[Literal['fmp']] The provider to use for the query, by default None. @@ -1966,7 +2014,11 @@ class ROUTER_equity_fundamental(Container): "/equity/fundamental/income_growth", **filter_inputs( provider_choices={ - "provider": provider, + "provider": self._get_provider( + provider, + "/equity/fundamental/income_growth", + ("fmp",), + ) }, standard_params={ "symbol": symbol, @@ -1984,7 +2036,10 @@ class ROUTER_equity_fundamental(Container): str, OpenBBCustomParameter(description="Symbol to get data for.") ], tag: Annotated[ - str, OpenBBCustomParameter(description="Intrinio data tag ID or code.") + Union[str, List[str]], + OpenBBCustomParameter( + description="Intrinio data tag ID or code. Multiple items allowed: intrinio." + ), ], provider: Optional[Literal["intrinio"]] = None, **kwargs @@ -1995,8 +2050,8 @@ class ROUTER_equity_fundamental(Container): ---------- symbol : str Symbol to get data for. - tag : str - Intrinio data tag ID or code. + tag : Union[str, List[str]] + Intrinio data tag ID or code. Multiple items allowed: intrinio. provider : Optional[Literal['intrinio']] The provider to use for the query, by default None. If None, the provider specified in defaults is selected or 'intrinio' if there is @@ -2035,13 +2090,18 @@ class ROUTER_equity_fundamental(Container): "/equity/fundamental/latest_attributes", **filter_inputs( provider_choices={ - "provider": provider, + "provider": self._get_provider( + provider, + "/equity/fundamental/latest_attributes", + ("intrinio",), + ) }, standard_params={ "symbol": symbol, "tag": tag, }, extra_params=kwargs, + extra_info={"tag": {"multiple_items_allowed": ["intrinio"]}}, ) ) @@ -2110,7 +2170,11 @@ class ROUTER_equity_fundamental(Container): "/equity/fundamental/management", **filter_inputs( provider_choices={ - "provider": provider, + "provider": self._get_provider( + provider, + "/equity/fundamental/management", + ("fmp", "yfinance"), + ) }, standard_params={ "symbol": symbol, @@ -2123,7 +2187,10 @@ class ROUTER_equity_fundamental(Container): def management_compensation( self, symbol: Annotated[ - str, OpenBBCustomParameter(description="Symbol to get data for.") + Union[str, List[str]], + OpenBBCustomParameter( + description="Symbol to get data for. Multiple items allowed: fmp." + ), ], start_date: Annotated[ Union[datetime.date, None, str], @@ -2144,11 +2211,11 @@ class ROUTER_equity_fundamental(Container): Parameters ---------- - symbol : str - Symbol to get data for. - start_date : Optional[datetime.date] + symbol : Union[str, List[str]] + Symbol to get data for. Multiple items allowed: fmp. + start_date : Union[datetime.date, None, str] Start date of the data, in YYYY-MM-DD format. - end_date : Optional[datetime.date] + end_date : Union[datetime.date, None, str] End date of the data, in YYYY-MM-DD format. provider : Optional[Literal['fmp']] The provider to use for the query, by default None. @@ -2208,7 +2275,11 @@ class ROUTER_equity_fundamental(Container): "/equity/fundamental/management_compensation", **filter_inputs( provider_choices={ - "provider": provider, + "provider": self._get_provider( + provider, + "/equity/fundamental/management_compensation", + ("fmp",), + ) }, standard_params={ "symbol": symbol, @@ -2216,6 +2287,7 @@ class ROUTER_equity_fundamental(Container): "end_date": end_date, }, extra_params=kwargs, + extra_info={"symbol": {"multiple_items_allowed": ["fmp"]}}, ) ) @@ -2223,7 +2295,10 @@ class ROUTER_equity_fundamental(Container): def metrics( self, symbol: Annotated[ - str, OpenBBCustomParameter(description="Symbol to get data for.") + Union[str, List[str]], + OpenBBCustomParameter( + description="Symbol to get data for. Multiple items allowed: fmp." + ), ], period: Annotated[ Optional[Literal["annual", "quarter"]], @@ -2240,8 +2315,8 @@ class ROUTER_equity_fundamental(Container): Parameters ---------- - symbol : str - Symbol to get data for. + symbol : Union[str, List[str]] + Symbol to get data for. Multiple items allowed: fmp. period : Optional[Literal['annual', 'quarter']] Time period of the data to return. limit : Optional[int] @@ -2465,7 +2540,11 @@ class ROUTER_equity_fundamental(Container): "/equity/fundamental/metrics", **filter_inputs( provider_choices={ - "provider": provider, + "provider": self._get_provider( + provider, + "/equity/fundamental/metrics", + ("fmp", "intrinio", "yfinance"), + ) }, standard_params={ "symbol": symbol, @@ -2473,6 +2552,7 @@ class ROUTER_equity_fundamental(Container): "limit": limit, }, extra_params=kwargs, + extra_info={"symbol": {"multiple_items_allowed": ["fmp"]}}, ) ) @@ -2480,7 +2560,10 @@ class ROUTER_equity_fundamental(Container): def multiples( self, symbol: Annotated[ - str, OpenBBCustomParameter(description="Symbol to get data for.") + Union[str, List[str]], + OpenBBCustomParameter( + description="Symbol to get data for. Multiple items allowed: fmp." + ), ], provider: Optional[Literal["fmp"]] = None, **kwargs @@ -2489,8 +2572,8 @@ class ROUTER_equity_fundamental(Container): Parameters ---------- - symbol : str - Symbol to get data for. + symbol : Union[str, List[str]] + Symbol to get data for. Multiple items allowed: fmp. provider : Optional[Literal['fmp']] The provider to use for the query, by default None. If None, the provider specified in defaults is selected or 'fmp' if there is @@ -2645,12 +2728,17 @@ class ROUTER_equity_fundamental(Container): "/equity/fundamental/multiples", **filter_inputs( provider_choices={ - "provider": provider, + "provider": self._get_provider( + provider, + "/equity/fundamental/multiples", + ("fmp",), + ) }, standard_params={ "symbol": symbol, }, extra_params=kwargs, + extra_info={"symbol": {"multiple_items_allowed": ["fmp"]}}, ) ) @@ -2784,7 +2872,11 @@ class ROUTER_equity_fundamental(Container): "/equity/fundamental/overview", **filter_inputs( provider_choices={ - "provider": provider, + "provider": self._get_provider( + provider, + "/equity/fundamental/overview", + ("fmp",), + ) }, standard_params={ "symbol": symbol, @@ -2971,7 +3063,11 @@ class ROUTER_equity_fundamental(Container): "/equity/fundamental/ratios", **filter_inputs( provider_choices={ - "provider": provider, + "provider": self._get_provider( + provider, + "/equity/fundamental/ratios", + ("fmp", "intrinio"), + ) }, standard_params={ "symbol": symbol, @@ -3058,7 +3154,11 @@ class ROUTER_equity_fundamental(Container): "/equity/fundamental/reported_financials", **filter_inputs( provider_choices={ - "provider": provider, + "provider": self._get_provider( + provider, + "/equity/fundamental/reported_financials", + ("intrinio",), + ) }, standard_params={ "symbol": symbol, @@ -3139,7 +3239,11 @@ class ROUTER_equity_fundamental(Container): "/equity/fundamental/revenue_per_geography", **filter_inputs( provider_choices={ - "provider": provider, + "provider": self._get_provider( + provider, + "/equity/fundamental/revenue_per_geography", + ("fmp",), + ) }, standard_params={ "symbol": symbol, @@ -3219,7 +3323,11 @@ class ROUTER_equity_fundamental(Container): "/equity/fundamental/revenue_per_segment", **filter_inputs( provider_choices={ - "provider": provider, + "provider": self._get_provider( + provider, + "/equity/fundamental/revenue_per_segment", + ("fmp",), + ) }, standard_params={ "symbol": symbol, @@ -3305,7 +3413,11 @@ class ROUTER_equity_fundamental(Container): "/equity/fundamental/search_attributes", **filter_inputs( provider_choices={ - "provider": provider, + "provider": self._get_provider( + provider, + "/equity/fundamental/search_attributes", + ("intrinio",), + ) }, standard_params={ "query": query, @@ -3374,7 +3486,11 @@ class ROUTER_equity_fundamental(Container): "/equity/fundamental/trailing_dividend_yield", **filter_inputs( provider_choices={ - "provider": provider, + "provider": self._get_provider( + provider, + "/equity/fundamental/trailing_dividend_yield", + ("tiingo",), + ) }, standard_params={ "symbol": symbol, @@ -3447,7 +3563,11 @@ class ROUTER_equity_fundamental(Container): "/equity/fundamental/transcript", **filter_inputs( provider_choices={ - "provider": provider, + "provider": self._get_provider( + provider, + "/equity/fundamental/transcript", + ("fmp",), + ) }, standard_params={ "symbol": symbol, diff --git a/openbb_platform/openbb/package/equity_ownership.py b/openbb_platform/openbb/package/equity_ownership.py index e67a28319c0..ca38f7f2311 100644 --- a/openbb_platform/openbb/package/equity_ownership.py +++ b/openbb_platform/openbb/package/equity_ownership.py @@ -1,7 +1,7 @@ ### THIS FILE IS AUTO-GENERATED. DO NOT EDIT. ### import datetime -from typing import Literal, Optional, Union +from typing import List, Literal, Optional, Union from openbb_core.app.model.custom_parameter import OpenBBCustomParameter from openbb_core.app.model.obbject import OBBject @@ -143,7 +143,11 @@ class ROUTER_equity_ownership(Container): "/equity/ownership/insider_trading", **filter_inputs( provider_choices={ - "provider": provider, + "provider": self._get_provider( + provider, + "/equity/ownership/insider_trading", + ("fmp", "intrinio"), + ) }, standard_params={ "symbol": symbol, @@ -296,7 +300,11 @@ class ROUTER_equity_ownership(Container): "/equity/ownership/institutional", **filter_inputs( provider_choices={ - "provider": provider, + "provider": self._get_provider( + provider, + "/equity/ownership/institutional", + ("fmp", "intrinio"), + ) }, standard_params={ "symbol": symbol, @@ -328,7 +336,7 @@ class ROUTER_equity_ownership(Container): ---------- symbol : str Symbol to get data for. - date : Optional[datetime.date] + date : Union[datetime.date, None, str] A specific date to get data for. page : Optional[int] Page number of the data to fetch. @@ -442,7 +450,11 @@ class ROUTER_equity_ownership(Container): "/equity/ownership/major_holders", **filter_inputs( provider_choices={ - "provider": provider, + "provider": self._get_provider( + provider, + "/equity/ownership/major_holders", + ("fmp",), + ) }, standard_params={ "symbol": symbol, @@ -457,7 +469,10 @@ class ROUTER_equity_ownership(Container): def share_statistics( self, symbol: Annotated[ - str, OpenBBCustomParameter(description="Symbol to get data for.") + Union[str, List[str]], + OpenBBCustomParameter( + description="Symbol to get data for. Multiple items allowed: yfinance." + ), ], provider: Optional[Literal["fmp", "intrinio", "yfinance"]] = None, **kwargs @@ -466,8 +481,8 @@ class ROUTER_equity_ownership(Container): Parameters ---------- - symbol : str - Symbol to get data for. + symbol : Union[str, List[str]] + Symbol to get data for. Multiple items allowed: yfinance. provider : Optional[Literal['fmp', 'intrinio', 'yfinance']] The provider to use for the query, by default None. If None, the provider specified in defaults is selected or 'fmp' if there is @@ -536,11 +551,16 @@ class ROUTER_equity_ownership(Container): "/equity/ownership/share_statistics", **filter_inputs( provider_choices={ - "provider": provider, + "provider": self._get_provider( + provider, + "/equity/ownership/share_statistics", + ("fmp", "intrinio", "yfinance"), + ) }, standard_params={ "symbol": symbol, }, extra_params=kwargs, + extra_info={"symbol": {"multiple_items_allowed": ["yfinance"]}}, ) ) diff --git a/openbb_platform/openbb/package/equity_price.py b/openbb_platform/openbb/package/equity_price.py index c7ebc4f03fd..bb1f681acd7 100644 --- a/openbb_platform/openbb/package/equity_price.py +++ b/openbb_platform/openbb/package/equity_price.py @@ -1,7 +1,7 @@ ### THIS FILE IS AUTO-GENERATED. DO NOT EDIT. ### import datetime -from typing import Literal, Optional, Union +from typing import List, Literal, Optional, Union from openbb_core.app.model.custom_parameter import OpenBBCustomParameter from openbb_core.app.model.obbject import OBBject @@ -26,7 +26,10 @@ class ROUTER_equity_price(Container): def historical( self, symbol: Annotated[ - str, OpenBBCustomParameter(description="Symbol to get data for.") + Union[str, List[str]], + OpenBBCustomParameter( + description="Symbol to get data for. Multiple items allowed: fmp, polygon, tiingo, yfinance." + ), ], interval: Annotated[ Optional[str], @@ -53,13 +56,13 @@ class ROUTER_equity_price(Container): Parameters ---------- - symbol : str - Symbol to get data for. + symbol : Union[str, List[str]] + Symbol to get data for. Multiple items allowed: fmp, polygon, tiingo, yfinance. interval : Optional[str] Time interval of the data to return. - start_date : Optional[datetime.date] + start_date : Union[datetime.date, None, str] Start date of the data, in YYYY-MM-DD format. - end_date : Optional[datetime.date] + end_date : Union[datetime.date, None, str] End date of the data, in YYYY-MM-DD format. provider : Optional[Literal['fmp', 'intrinio', 'polygon', 'tiingo', 'yfinanc... The provider to use for the query, by default None. @@ -173,7 +176,11 @@ class ROUTER_equity_price(Container): "/equity/price/historical", **filter_inputs( provider_choices={ - "provider": provider, + "provider": self._get_provider( + provider, + "/equity/price/historical", + ("fmp", "intrinio", "polygon", "tiingo", "yfinance"), + ) }, standard_params={ "symbol": symbol, @@ -182,6 +189,16 @@ class ROUTER_equity_price(Container): "end_date": end_date, }, extra_params=kwargs, + extra_info={ + "symbol": { + "multiple_items_allowed": [ + "fmp", + "polygon", + "tiingo", + "yfinance", + ] + } + }, ) ) @@ -301,7 +318,11 @@ class ROUTER_equity_price(Container): "/equity/price/nbbo", **filter_inputs( provider_choices={ - "provider": provider, + "provider": self._get_provider( + provider, + "/equity/price/nbbo", + ("polygon",), + ) }, standard_params={ "symbol": symbol, @@ -387,7 +408,11 @@ class ROUTER_equity_price(Container): "/equity/price/performance", **filter_inputs( provider_choices={ - "provider": provider, + "provider": self._get_provider( + provider, + "/equity/price/performance", + ("fmp",), + ) }, standard_params={ "symbol": symbol, @@ -400,9 +425,9 @@ class ROUTER_equity_price(Container): def quote( self, symbol: Annotated[ - str, + Union[str, List[str]], OpenBBCustomParameter( - description="Symbol to get data for. This endpoint will accept multiple symbols separated by commas." + description="Symbol to get data for. This endpoint will accept multiple symbols separated by commas. Multiple items allowed: fmp, intrinio, yfinance." ), ], provider: Optional[Literal["fmp", "intrinio", "yfinance"]] = None, @@ -412,8 +437,8 @@ class ROUTER_equity_price(Container): Parameters ---------- - symbol : str - Symbol to get data for. This endpoint will accept multiple symbols separated by commas. + symbol : Union[str, List[str]] + Symbol to get data for. This endpoint will accept multiple symbols separated by commas. Multiple items allowed: fmp, intrinio, yfinance. provider : Optional[Literal['fmp', 'intrinio', 'yfinance']] The provider to use for the query, by default None. If None, the provider specified in defaults is selected or 'fmp' if there is @@ -548,11 +573,20 @@ class ROUTER_equity_price(Container): "/equity/price/quote", **filter_inputs( provider_choices={ - "provider": provider, + "provider": self._get_provider( + provider, + "/equity/price/quote", + ("fmp", "intrinio", "yfinance"), + ) }, standard_params={ "symbol": symbol, }, extra_params=kwargs, + extra_info={ + "symbol": { + "multiple_items_allowed": ["fmp", "intrinio", "yfinance"] + } + }, ) ) diff --git a/openbb_platform/openbb/package/equity_shorts.py b/openbb_platform/openbb/package/equity_shorts.py index b6b373e2c07..558b9209897 100644 --- a/openbb_platform/openbb/package/equity_shorts.py +++ b/openbb_platform/openbb/package/equity_shorts.py @@ -86,7 +86,11 @@ class ROUTER_equity_shorts(Container): "/equity/shorts/fails_to_deliver", **filter_inputs( provider_choices={ - "provider": provider, + "provider": self._get_provider( + provider, + "/equity/shorts/fails_to_deliver", + ("sec",), + ) }, standard_params={ "symbol": symbol, diff --git a/openbb_platform/openbb/package/etf.py b/openbb_platform/openbb/package/etf.py index f742144a013..9563e667242 100644 --- a/openbb_platform/openbb/package/etf.py +++ b/openbb_platform/openbb/package/etf.py @@ -1,7 +1,7 @@ ### THIS FILE IS AUTO-GENERATED. DO NOT EDIT. ### import datetime -from typing import Literal, Optional, Union +from typing import List, Literal, Optional, Union from openbb_core.app.model.custom_parameter import OpenBBCustomParameter from openbb_core.app.model.obbject import OBBject @@ -76,7 +76,11 @@ class ROUTER_etf(Container): "/etf/countries", **filter_inputs( provider_choices={ - "provider": provider, + "provider": self._get_provider( + provider, + "/etf/countries", + ("fmp",), + ) }, standard_params={ "symbol": symbol, @@ -112,9 +116,9 @@ class ROUTER_etf(Container): ---------- symbol : str Symbol to get data for. (ETF) - start_date : Optional[datetime.date] + start_date : Union[datetime.date, None, str] Start date of the data, in YYYY-MM-DD format. - end_date : Optional[datetime.date] + end_date : Union[datetime.date, None, str] End date of the data, in YYYY-MM-DD format. provider : Optional[Literal['yfinance']] The provider to use for the query, by default None. @@ -162,7 +166,11 @@ class ROUTER_etf(Container): "/etf/historical", **filter_inputs( provider_choices={ - "provider": provider, + "provider": self._get_provider( + provider, + "/etf/historical", + ("yfinance",), + ) }, standard_params={ "symbol": symbol, @@ -193,7 +201,7 @@ class ROUTER_etf(Container): If None, the provider specified in defaults is selected or 'fmp' if there is no default. date : Optional[Union[str, datetime.date]] - A specific date to get data for. This needs to be _exactly_ the date of the filing. Use the holdings_date command/endpoint to find available filing dates for the ETF. (provider: fmp); + A specific date to get data for. Entering a date will attempt to return the NPORT-P filing for the entered date. This needs to be _exactly_ the date of the filing. Use the holdings_date command/endpoint to find available filing dates for the ETF. (provider: fmp); A specific date to get data for. The date represents the period ending. The date entered will return the closest filing. (provider: sec) cik : Optional[str] The CIK of the filing entity. Overrides symbol. (provider: fmp) @@ -228,16 +236,19 @@ class ROUTER_etf(Container): The CUSIP of the holding. (provider: fmp, sec) isin : Optional[str] The ISIN of the holding. (provider: fmp, sec) - balance : Optional[float] - The balance of the holding. (provider: fmp, sec) + balance : Optional[int] + The balance of the holding, in shares or units. (provider: fmp); + The balance of the holding. (provider: sec) units : Optional[Union[str, float]] - The units of the holding. (provider: fmp, sec) + The type of units. (provider: fmp); + The units of the holding. (provider: sec) currency : Optional[str] The currency of the holding. (provider: fmp, sec) value : Optional[float] - The value of the holding in USD. (provider: fmp, sec) + The value of the holding, in dollars. (provider: fmp, sec) weight : Optional[float] - The weight of the holding in ETF in %. (provider: fmp, sec) + The weight of the holding, as a normalized percent. (provider: fmp); + The weight of the holding in ETF in %. (provider: sec) payoff_profile : Optional[str] The payoff profile of the holding. (provider: fmp, sec) asset_category : Optional[str] @@ -260,6 +271,8 @@ class ROUTER_etf(Container): The CIK of the filing. (provider: fmp) acceptance_datetime : Optional[str] The acceptance datetime of the filing. (provider: fmp) + updated : Optional[Union[date, datetime]] + The date the data was updated. (provider: fmp) other_id : Optional[str] Internal identifier for the holding. (provider: sec) loan_value : Optional[float] @@ -383,7 +396,11 @@ class ROUTER_etf(Container): "/etf/holdings", **filter_inputs( provider_choices={ - "provider": provider, + "provider": self._get_provider( + provider, + "/etf/holdings", + ("fmp", "sec"), + ) }, standard_params={ "symbol": symbol, @@ -443,7 +460,11 @@ class ROUTER_etf(Container): "/etf/holdings_date", **filter_inputs( provider_choices={ - "provider": provider, + "provider": self._get_provider( + provider, + "/etf/holdings_date", + ("fmp",), + ) }, standard_params={ "symbol": symbol, @@ -529,7 +550,11 @@ class ROUTER_etf(Container): "/etf/holdings_performance", **filter_inputs( provider_choices={ - "provider": provider, + "provider": self._get_provider( + provider, + "/etf/holdings_performance", + ("fmp",), + ) }, standard_params={ "symbol": symbol, @@ -542,7 +567,10 @@ class ROUTER_etf(Container): def info( self, symbol: Annotated[ - str, OpenBBCustomParameter(description="Symbol to get data for. (ETF)") + Union[str, List[str]], + OpenBBCustomParameter( + description="Symbol to get data for. (ETF) Multiple items allowed: yfinance." + ), ], provider: Optional[Literal["fmp", "yfinance"]] = None, **kwargs @@ -551,8 +579,8 @@ class ROUTER_etf(Container): Parameters ---------- - symbol : str - Symbol to get data for. (ETF) + symbol : Union[str, List[str]] + Symbol to get data for. (ETF) Multiple items allowed: yfinance. provider : Optional[Literal['fmp', 'yfinance']] The provider to use for the query, by default None. If None, the provider specified in defaults is selected or 'fmp' if there is @@ -679,12 +707,17 @@ class ROUTER_etf(Container): "/etf/info", **filter_inputs( provider_choices={ - "provider": provider, + "provider": self._get_provider( + provider, + "/etf/info", + ("fmp", "yfinance"), + ) }, standard_params={ "symbol": symbol, }, extra_params=kwargs, + extra_info={"symbol": {"multiple_items_allowed": ["yfinance"]}}, ) ) @@ -765,7 +798,11 @@ class ROUTER_etf(Container): "/etf/price_performance", **filter_inputs( provider_choices={ - "provider": provider, + "provider": self._get_provider( + provider, + "/etf/price_performance", + ("fmp",), + ) }, standard_params={ "symbol": symbol, @@ -854,7 +891,11 @@ class ROUTER_etf(Container): "/etf/search", **filter_inputs( provider_choices={ - "provider": provider, + "provider": self._get_provider( + provider, + "/etf/search", + ("fmp",), + ) }, standard_params={ "query": query, @@ -914,7 +955,11 @@ class ROUTER_etf(Container): "/etf/sectors", **filter_inputs( provider_choices={ - "provider": provider, + "provider": self._get_provider( + provider, + "/etf/sectors", + ("fmp",), + ) }, standard_params={ "symbol": symbol, diff --git a/openbb_platform/openbb/package/fixedincome.py b/openbb_platform/openbb/package/fixedincome.py index f79d58d4d92..f4046cc404c 100644 --- a/openbb_platform/openbb/package/fixedincome.py +++ b/openbb_platform/openbb/package/fixedincome.py @@ -76,9 +76,9 @@ class ROUTER_fixedincome(Container): Parameters ---------- - start_date : Optional[datetime.date] + start_date : Union[datetime.date, None, str] Start date of the data, in YYYY-MM-DD format. - end_date : Optional[datetime.date] + end_date : Union[datetime.date, None, str] End date of the data, in YYYY-MM-DD format. provider : Optional[Literal['fred']] The provider to use for the query, by default None. @@ -118,7 +118,11 @@ class ROUTER_fixedincome(Container): "/fixedincome/sofr", **filter_inputs( provider_choices={ - "provider": provider, + "provider": self._get_provider( + provider, + "/fixedincome/sofr", + ("fred",), + ) }, standard_params={ "start_date": start_date, diff --git a/openbb_platform/openbb/package/fixedincome_corporate.py b/openbb_platform/openbb/package/fixedincome_corporate.py index 584b8a16d14..23200fc3e68 100644 --- a/openbb_platform/openbb/package/fixedincome_corporate.py +++ b/openbb_platform/openbb/package/fixedincome_corporate.py @@ -62,9 +62,9 @@ class ROUTER_fixedincome_corporate(Container): Parameters ---------- - start_date : Optional[datetime.date] + start_date : Union[datetime.date, None, str] Start date of the data, in YYYY-MM-DD format. - end_date : Optional[datetime.date] + end_date : Union[datetime.date, None, str] End date of the data, in YYYY-MM-DD format. maturity : Literal['overnight', '7d', '15d', '30d', '60d', '90d'] The maturity. @@ -108,7 +108,11 @@ class ROUTER_fixedincome_corporate(Container): "/fixedincome/corporate/commercial_paper", **filter_inputs( provider_choices={ - "provider": provider, + "provider": self._get_provider( + provider, + "/fixedincome/corporate/commercial_paper", + ("fred",), + ) }, standard_params={ "start_date": start_date, @@ -145,7 +149,7 @@ class ROUTER_fixedincome_corporate(Container): Parameters ---------- - date : Optional[datetime.date] + date : Union[datetime.date, None, str] A specific date to get data for. yield_curve : Literal['spot', 'par'] The yield curve type. @@ -191,7 +195,11 @@ class ROUTER_fixedincome_corporate(Container): "/fixedincome/corporate/hqm", **filter_inputs( provider_choices={ - "provider": provider, + "provider": self._get_provider( + provider, + "/fixedincome/corporate/hqm", + ("fred",), + ) }, standard_params={ "date": date, @@ -234,9 +242,9 @@ class ROUTER_fixedincome_corporate(Container): Parameters ---------- - start_date : Optional[datetime.date] + start_date : Union[datetime.date, None, str] Start date of the data, in YYYY-MM-DD format. - end_date : Optional[datetime.date] + end_date : Union[datetime.date, None, str] End date of the data, in YYYY-MM-DD format. index_type : Literal['yield', 'yield_to_worst', 'total_return', 'spread'] The type of series. @@ -284,7 +292,11 @@ class ROUTER_fixedincome_corporate(Container): "/fixedincome/corporate/ice_bofa", **filter_inputs( provider_choices={ - "provider": provider, + "provider": self._get_provider( + provider, + "/fixedincome/corporate/ice_bofa", + ("fred",), + ) }, standard_params={ "start_date": start_date, @@ -327,9 +339,9 @@ class ROUTER_fixedincome_corporate(Container): Parameters ---------- - start_date : Optional[datetime.date] + start_date : Union[datetime.date, None, str] Start date of the data, in YYYY-MM-DD format. - end_date : Optional[datetime.date] + end_date : Union[datetime.date, None, str] End date of the data, in YYYY-MM-DD format. index_type : Literal['aaa', 'baa'] The type of series. @@ -371,7 +383,11 @@ class ROUTER_fixedincome_corporate(Container): "/fixedincome/corporate/moody", **filter_inputs( provider_choices={ - "provider": provider, + "provider": self._get_provider( + provider, + "/fixedincome/corporate/moody", + ("fred",), + ) }, standard_params={ "start_date": start_date, @@ -417,9 +433,9 @@ class ROUTER_fixedincome_corporate(Container): Parameters ---------- - start_date : Optional[datetime.date] + start_date : Union[datetime.date, None, str] Start date of the data, in YYYY-MM-DD format. - end_date : Optional[datetime.date] + end_date : Union[datetime.date, None, str] End date of the data, in YYYY-MM-DD format. maturity : List[float] The maturities in years. @@ -461,7 +477,11 @@ class ROUTER_fixedincome_corporate(Container): "/fixedincome/corporate/spot_rates", **filter_inputs( provider_choices={ - "provider": provider, + "provider": self._get_provider( + provider, + "/fixedincome/corporate/spot_rates", + ("fred",), + ) }, standard_params={ "start_date": start_date, diff --git a/openbb_platform/openbb/package/fixedincome_government.py b/openbb_platform/openbb/package/fixedincome_government.py index 15f0354e7f3..ed4cc770d9c 100644 --- a/openbb_platform/openbb/package/fixedincome_government.py +++ b/openbb_platform/openbb/package/fixedincome_government.py @@ -42,9 +42,9 @@ class ROUTER_fixedincome_government(Container): Parameters ---------- - start_date : Optional[datetime.date] + start_date : Union[datetime.date, None, str] Start date of the data, in YYYY-MM-DD format. - end_date : Optional[datetime.date] + end_date : Union[datetime.date, None, str] End date of the data, in YYYY-MM-DD format. provider : Optional[Literal['federal_reserve', 'fmp']] The provider to use for the query, by default None. @@ -104,7 +104,11 @@ class ROUTER_fixedincome_government(Container): "/fixedincome/government/treasury_rates", **filter_inputs( provider_choices={ - "provider": provider, + "provider": self._get_provider( + provider, + "/fixedincome/government/treasury_rates", + ("federal_reserve", "fmp"), + ) }, standard_params={ "start_date": start_date, @@ -134,7 +138,7 @@ class ROUTER_fixedincome_government(Container): Parameters ---------- - date : Optional[datetime.date] + date : Union[datetime.date, None, str] A specific date to get data for. Defaults to the most recent FRED entry. inflation_adjusted : Optional[bool] Get inflation adjusted rates. @@ -174,7 +178,11 @@ class ROUTER_fixedincome_government(Container): "/fixedincome/government/us_yield_curve", **filter_inputs( provider_choices={ - "provider": provider, + "provider": self._get_provider( + provider, + "/fixedincome/government/us_yield_curve", + ("fred",), + ) }, standard_params={ "date": date, diff --git a/openbb_platform/openbb/package/fixedincome_rate.py b/openbb_platform/openbb/package/fixedincome_rate.py index 0e4ac5f9f40..5632a9a5938 100644 --- a/openbb_platform/openbb/package/fixedincome_rate.py +++ b/openbb_platform/openbb/package/fixedincome_rate.py @@ -53,9 +53,9 @@ class ROUTER_fixedincome_rate(Container): Parameters ---------- - start_date : Optional[datetime.date] + start_date : Union[datetime.date, None, str] Start date of the data, in YYYY-MM-DD format. - end_date : Optional[datetime.date] + end_date : Union[datetime.date, None, str] End date of the data, in YYYY-MM-DD format. provider : Optional[Literal['fred']] The provider to use for the query, by default None. @@ -95,7 +95,11 @@ class ROUTER_fixedincome_rate(Container): "/fixedincome/rate/ameribor", **filter_inputs( provider_choices={ - "provider": provider, + "provider": self._get_provider( + provider, + "/fixedincome/rate/ameribor", + ("fred",), + ) }, standard_params={ "start_date": start_date, @@ -133,9 +137,9 @@ class ROUTER_fixedincome_rate(Container): Parameters ---------- - start_date : Optional[datetime.date] + start_date : Union[datetime.date, None, str] Start date of the data, in YYYY-MM-DD format. - end_date : Optional[datetime.date] + end_date : Union[datetime.date, None, str] End date of the data, in YYYY-MM-DD format. provider : Optional[Literal['fred']] The provider to use for the query, by default None. @@ -175,7 +179,11 @@ class ROUTER_fixedincome_rate(Container): "/fixedincome/rate/dpcredit", **filter_inputs( provider_choices={ - "provider": provider, + "provider": self._get_provider( + provider, + "/fixedincome/rate/dpcredit", + ("fred",), + ) }, standard_params={ "start_date": start_date, @@ -219,9 +227,9 @@ class ROUTER_fixedincome_rate(Container): Parameters ---------- - start_date : Optional[datetime.date] + start_date : Union[datetime.date, None, str] Start date of the data, in YYYY-MM-DD format. - end_date : Optional[datetime.date] + end_date : Union[datetime.date, None, str] End date of the data, in YYYY-MM-DD format. interest_rate_type : Literal['deposit', 'lending', 'refinancing'] The type of interest rate. @@ -261,7 +269,11 @@ class ROUTER_fixedincome_rate(Container): "/fixedincome/rate/ecb", **filter_inputs( provider_choices={ - "provider": provider, + "provider": self._get_provider( + provider, + "/fixedincome/rate/ecb", + ("fred",), + ) }, standard_params={ "start_date": start_date, @@ -299,9 +311,9 @@ class ROUTER_fixedincome_rate(Container): Parameters ---------- - start_date : Optional[datetime.date] + start_date : Union[datetime.date, None, str] Start date of the data, in YYYY-MM-DD format. - end_date : Optional[datetime.date] + end_date : Union[datetime.date, None, str] End date of the data, in YYYY-MM-DD format. provider : Optional[Literal['federal_reserve', 'fred']] The provider to use for the query, by default None. @@ -341,7 +353,11 @@ class ROUTER_fixedincome_rate(Container): "/fixedincome/rate/effr", **filter_inputs( provider_choices={ - "provider": provider, + "provider": self._get_provider( + provider, + "/fixedincome/rate/effr", + ("federal_reserve", "fred"), + ) }, standard_params={ "start_date": start_date, @@ -415,7 +431,11 @@ class ROUTER_fixedincome_rate(Container): "/fixedincome/rate/effr_forecast", **filter_inputs( provider_choices={ - "provider": provider, + "provider": self._get_provider( + provider, + "/fixedincome/rate/effr_forecast", + ("fred",), + ) }, standard_params={}, extra_params=kwargs, @@ -450,9 +470,9 @@ class ROUTER_fixedincome_rate(Container): Parameters ---------- - start_date : Optional[datetime.date] + start_date : Union[datetime.date, None, str] Start date of the data, in YYYY-MM-DD format. - end_date : Optional[datetime.date] + end_date : Union[datetime.date, None, str] End date of the data, in YYYY-MM-DD format. provider : Optional[Literal['fred']] The provider to use for the query, by default None. @@ -492,7 +512,11 @@ class ROUTER_fixedincome_rate(Container): "/fixedincome/rate/estr", **filter_inputs( provider_choices={ - "provider": provider, + "provider": self._get_provider( + provider, + "/fixedincome/rate/estr", + ("fred",), + ) }, standard_params={ "start_date": start_date, @@ -529,9 +553,9 @@ class ROUTER_fixedincome_rate(Container): Parameters ---------- - start_date : Optional[datetime.date] + start_date : Union[datetime.date, None, str] Start date of the data, in YYYY-MM-DD format. - end_date : Optional[datetime.date] + end_date : Union[datetime.date, None, str] End date of the data, in YYYY-MM-DD format. provider : Optional[Literal['fred']] The provider to use for the query, by default None. @@ -569,7 +593,11 @@ class ROUTER_fixedincome_rate(Container): "/fixedincome/rate/iorb", **filter_inputs( provider_choices={ - "provider": provider, + "provider": self._get_provider( + provider, + "/fixedincome/rate/iorb", + ("fred",), + ) }, standard_params={ "start_date": start_date, @@ -606,9 +634,9 @@ class ROUTER_fixedincome_rate(Container): Parameters ---------- - start_date : Optional[datetime.date] + start_date : Union[datetime.date, None, str] Start date of the data, in YYYY-MM-DD format. - end_date : Optional[datetime.date] + end_date : Union[datetime.date, None, str] End date of the data, in YYYY-MM-DD format. provider : Optional[Literal['fred']] The provider to use for the query, by default None. @@ -648,7 +676,11 @@ class ROUTER_fixedincome_rate(Container): "/fixedincome/rate/sonia", **filter_inputs( provider_choices={ - "provider": provider, + "provider": self._get_provider( + provider, + "/fixedincome/rate/sonia", + ("fred",), + ) }, standard_params={ "start_date": start_date, diff --git a/openbb_platform/openbb/package/fixedincome_spreads.py b/openbb_platform/openbb/package/fixedincome_spreads.py index f161979c842..32e9b008e2a 100644 --- a/openbb_platform/openbb/package/fixedincome_spreads.py +++ b/openbb_platform/openbb/package/fixedincome_spreads.py @@ -53,9 +53,9 @@ class ROUTER_fixedincome_spreads(Container): Parameters ---------- - start_date : Optional[datetime.date] + start_date : Union[datetime.date, None, str] Start date of the data, in YYYY-MM-DD format. - end_date : Optional[datetime.date] + end_date : Union[datetime.date, None, str] End date of the data, in YYYY-MM-DD format. maturity : Optional[Literal['3m', '2y']] The maturity @@ -95,7 +95,11 @@ class ROUTER_fixedincome_spreads(Container): "/fixedincome/spreads/tcm", **filter_inputs( provider_choices={ - "provider": provider, + "provider": self._get_provider( + provider, + "/fixedincome/spreads/tcm", + ("fred",), + ) }, standard_params={ "start_date": start_date, @@ -138,9 +142,9 @@ class ROUTER_fixedincome_spreads(Container): Parameters ---------- - start_date : Optional[datetime.date] + start_date : Union[datetime.date, None, str] Start date of the data, in YYYY-MM-DD format. - end_date : Optional[datetime.date] + end_date : Union[datetime.date, None, str] End date of the data, in YYYY-MM-DD format. maturity : Optional[Literal['10y', '5y', '1y', '6m', '3m']] The maturity @@ -180,7 +184,11 @@ class ROUTER_fixedincome_spreads(Container): "/fixedincome/spreads/tcm_effr", **filter_inputs( provider_choices={ - "provider": provider, + "provider": self._get_provider( + provider, + "/fixedincome/spreads/tcm_effr", + ("fred",), + ) }, standard_params={ "start_date": start_date, @@ -224,9 +232,9 @@ class ROUTER_fixedincome_spreads(Container): Parameters ---------- - start_date : Optional[datetime.date] + start_date : Union[datetime.date, None, str] Start date of the data, in YYYY-MM-DD format. - end_date : Optional[datetime.date] + end_date : Union[datetime.date, None, str] End date of the data, in YYYY-MM-DD format. maturity : Optional[Literal['3m', '6m']] The maturity @@ -266,7 +274,11 @@ class ROUTER_fixedincome_spreads(Container): "/fixedincome/spreads/treasury_effr", **filter_inputs( provider_choices={ - "provider": provider, + "provider": self._get_provider( + provider, + "/fixedincome/spreads/treasury_effr", + ("fred",), + ) }, standard_params={ "start_date": start_date, diff --git a/openbb_platform/openbb/package/index.py b/openbb_platform/openbb/package/index.py index b2930f7244d..c88ed601abf 100644 --- a/openbb_platform/openbb/package/index.py +++ b/openbb_platform/openbb/package/index.py @@ -1,7 +1,7 @@ ### THIS FILE IS AUTO-GENERATED. DO NOT EDIT. ### import datetime -from typing import Literal, Optional, Union +from typing import List, Literal, Optional, Union from warnings import simplefilter, warn from openbb_core.app.deprecation import OpenBBDeprecationWarning @@ -76,7 +76,11 @@ class ROUTER_index(Container): "/index/available", **filter_inputs( provider_choices={ - "provider": provider, + "provider": self._get_provider( + provider, + "/index/available", + ("fmp", "yfinance"), + ) }, standard_params={}, extra_params=kwargs, @@ -149,7 +153,11 @@ class ROUTER_index(Container): "/index/constituents", **filter_inputs( provider_choices={ - "provider": provider, + "provider": self._get_provider( + provider, + "/index/constituents", + ("fmp",), + ) }, standard_params={ "index": index, @@ -166,7 +174,10 @@ class ROUTER_index(Container): def market( self, symbol: Annotated[ - str, OpenBBCustomParameter(description="Symbol to get data for.") + Union[str, List[str]], + OpenBBCustomParameter( + description="Symbol to get data for. Multiple items allowed: yfinance." + ), ], start_date: Annotated[ Union[datetime.date, None, str], @@ -187,11 +198,11 @@ class ROUTER_index(Container): Parameters ---------- - symbol : str - Symbol to get data for. - start_date : Optional[datetime.date] + symbol : Union[str, List[str]] + Symbol to get data for. Multiple items allowed: yfinance. + start_date : Union[datetime.date, None, str] Start date of the data, in YYYY-MM-DD format. - end_date : Optional[datetime.date] + end_date : Union[datetime.date, None, str] End date of the data, in YYYY-MM-DD format. provider : Optional[Literal['fmp', 'intrinio', 'polygon', 'yfinance']] The provider to use for the query, by default None. @@ -284,7 +295,11 @@ class ROUTER_index(Container): "/index/market", **filter_inputs( provider_choices={ - "provider": provider, + "provider": self._get_provider( + provider, + "/index/market", + ("fmp", "intrinio", "polygon", "yfinance"), + ) }, standard_params={ "symbol": symbol, @@ -292,6 +307,7 @@ class ROUTER_index(Container): "end_date": end_date, }, extra_params=kwargs, + extra_info={"symbol": {"multiple_items_allowed": ["yfinance"]}}, ) ) diff --git a/openbb_platform/openbb/package/module_map.json b/openbb_platform/openbb/package/module_map.json index 37ed693004c..2cee252c131 100644 --- a/openbb_platform/openbb/package/module_map.json +++ b/openbb_platform/openbb/package/module_map.json @@ -124,8 +124,8 @@ "fixedincome_rate_sonia": "/fixedincome/rate/sonia", "fixedincome_sofr": "/fixedincome/sofr", "fixedincome_spreads": "/fixedincome/spreads", - "fixedincome_spreads_tmc": "/fixedincome/spreads/tmc", - "fixedincome_spreads_tmc_effr": "/fixedincome/spreads/tmc_effr", + "fixedincome_spreads_tcm": "/fixedincome/spreads/tcm", + "fixedincome_spreads_tcm_effr": "/fixedincome/spreads/tcm_effr", "fixedincome_spreads_treasury_effr": "/fixedincome/spreads/treasury_effr", "index": "/index", "index_available": "/index/available", diff --git a/openbb_platform/openbb/package/news.py b/openbb_platform/openbb/package/news.py index 0fdc29fa225..bcbfb6f1885 100644 --- a/openbb_platform/openbb/package/news.py +++ b/openbb_platform/openbb/package/news.py @@ -1,7 +1,7 @@ ### THIS FILE IS AUTO-GENERATED. DO NOT EDIT. ### import datetime -from typing import Literal, Optional, Union +from typing import List, Literal, Optional, Union from annotated_types import Ge from openbb_core.app.model.custom_parameter import OpenBBCustomParameter @@ -25,9 +25,9 @@ class ROUTER_news(Container): def company( self, symbol: Annotated[ - str, + Union[str, List[str]], OpenBBCustomParameter( - description="Symbol to get data for. This endpoint will accept multiple symbols separated by commas." + description="Symbol to get data for. This endpoint will accept multiple symbols separated by commas. Multiple items allowed: benzinga, intrinio." ), ], limit: Annotated[ @@ -55,13 +55,13 @@ class ROUTER_news(Container): Parameters ---------- - symbol : str - Symbol to get data for. This endpoint will accept multiple symbols separated by commas. + symbol : Union[str, List[str]] + Symbol to get data for. This endpoint will accept multiple symbols separated by commas. Multiple items allowed: benzinga, intrinio. limit : Optional[Annotated[int, Ge(ge=0)]] The number of data entries to return. - start_date : Optional[datetime.date] + start_date : Union[datetime.date, None, str] Start date of the data, in YYYY-MM-DD format. - end_date : Optional[datetime.date] + end_date : Union[datetime.date, None, str] End date of the data, in YYYY-MM-DD format. provider : Optional[Literal['benzinga', 'fmp', 'intrinio', 'polygon', 'tiing... The provider to use for the query, by default None. @@ -183,7 +183,18 @@ class ROUTER_news(Container): "/news/company", **filter_inputs( provider_choices={ - "provider": provider, + "provider": self._get_provider( + provider, + "/news/company", + ( + "benzinga", + "fmp", + "intrinio", + "polygon", + "tiingo", + "yfinance", + ), + ) }, standard_params={ "symbol": symbol, @@ -192,6 +203,9 @@ class ROUTER_news(Container): "end_date": end_date, }, extra_params=kwargs, + extra_info={ + "symbol": {"multiple_items_allowed": ["benzinga", "intrinio"]} + }, ) ) @@ -201,9 +215,9 @@ class ROUTER_news(Container): limit: Annotated[ int, OpenBBCustomParameter( - description="The number of data entries to return. Here its the no. of articles to return." + description="The number of data entries to return. The number of articles to return." ), - ] = 20, + ] = 2500, start_date: Annotated[ Union[datetime.date, None, str], OpenBBCustomParameter( @@ -224,10 +238,10 @@ class ROUTER_news(Container): Parameters ---------- limit : int - The number of data entries to return. Here its the no. of articles to return. - start_date : Optional[datetime.date] + The number of data entries to return. The number of articles to return. + start_date : Union[datetime.date, None, str] Start date of the data, in YYYY-MM-DD format. - end_date : Optional[datetime.date] + end_date : Union[datetime.date, None, str] End date of the data, in YYYY-MM-DD format. provider : Optional[Literal['benzinga', 'fmp', 'intrinio', 'tiingo']] The provider to use for the query, by default None. @@ -257,6 +271,8 @@ class ROUTER_news(Container): Authors of the news to retrieve. (provider: benzinga) content_types : Optional[str] Content types of the news to retrieve. (provider: benzinga) + offset : Optional[int] + Page offset, used in conjunction with limit. (provider: tiingo) source : Optional[str] A comma-separated list of the domains requested. (provider: tiingo) @@ -277,15 +293,15 @@ class ROUTER_news(Container): WorldNews --------- date : datetime - The date of the data. Here it is the published date of the news. + The date of the data. The published date of the article. title : str - Title of the news. + Title of the article. images : Optional[List[Dict[str, str]]] - Images associated with the news. + Images associated with the article. text : Optional[str] - Text/body of the news. + Text/body of the article. url : Optional[str] - URL of the news. + URL to the article. id : Optional[str] Article ID. (provider: benzinga, intrinio) author : Optional[str] @@ -314,7 +330,7 @@ class ROUTER_news(Container): Example ------- >>> from openbb import obb - >>> obb.news.world(limit=20) + >>> obb.news.world(limit=2500) >>> # Get news on the specified dates. >>> obb.news.world(start_date='2024-02-01', end_date='2024-02-07') >>> # Display the headlines of the news. @@ -331,7 +347,11 @@ class ROUTER_news(Container): "/news/world", **filter_inputs( provider_choices={ - "provider": provider, + "provider": self._get_provider( + provider, + "/news/world", + ("benzinga", "fmp", "intrinio", "tiingo"), + ) }, standard_params={ "limit": limit, diff --git a/openbb_platform/openbb/package/regulators_sec.py b/openbb_platform/openbb/package/regulators_sec.py index 8be04d1e0b8..9238d28bd7d 100644 --- a/openbb_platform/openbb/package/regulators_sec.py +++ b/openbb_platform/openbb/package/regulators_sec.py @@ -1,6 +1,6 @@ ### THIS FILE IS AUTO-GENERATED. DO NOT EDIT. ### -from typing import Literal, Optional +from typing import List, Literal, Optional, Union from openbb_core.app.model.custom_parameter import OpenBBCustomParameter from openbb_core.app.model.obbject import OBBject @@ -27,7 +27,10 @@ class ROUTER_regulators_sec(Container): def cik_map( self, symbol: Annotated[ - str, OpenBBCustomParameter(description="Symbol to get data for.") + Union[str, List[str]], + OpenBBCustomParameter( + description="Symbol to get data for. Multiple items allowed: intrinio, yfinance." + ), ], provider: Optional[Literal["sec"]] = None, **kwargs @@ -36,8 +39,8 @@ class ROUTER_regulators_sec(Container): Parameters ---------- - symbol : str - Symbol to get data for. + symbol : Union[str, List[str]] + Symbol to get data for. Multiple items allowed: intrinio, yfinance. provider : Optional[Literal['sec']] The provider to use for the query, by default None. If None, the provider specified in defaults is selected or 'sec' if there is @@ -73,12 +76,19 @@ class ROUTER_regulators_sec(Container): "/regulators/sec/cik_map", **filter_inputs( provider_choices={ - "provider": provider, + "provider": self._get_provider( + provider, + "/regulators/sec/cik_map", + ("sec",), + ) }, standard_params={ "symbol": symbol, }, extra_params=kwargs, + extra_info={ + "symbol": {"multiple_items_allowed": ["intrinio", "yfinance"]} + }, ) ) @@ -139,7 +149,11 @@ class ROUTER_regulators_sec(Container): "/regulators/sec/institutions_search", **filter_inputs( provider_choices={ - "provider": provider, + "provider": self._get_provider( + provider, + "/regulators/sec/institutions_search", + ("sec",), + ) }, standard_params={ "query": query, @@ -199,7 +213,11 @@ class ROUTER_regulators_sec(Container): "/regulators/sec/rss_litigation", **filter_inputs( provider_choices={ - "provider": provider, + "provider": self._get_provider( + provider, + "/regulators/sec/rss_litigation", + ("sec",), + ) }, standard_params={}, extra_params=kwargs, @@ -263,23 +281,27 @@ class ROUTER_regulators_sec(Container): >>> url = data.files[0]+data.files[-1] >>> #### The URL base will always be the 0 position in the list, feed the URL back in as a parameter. #### >>> obb.regulators.sec.schema_files(url=url).results.files - >>> ['https://xbrl.fasb.org/us-gaap/2024/', + >>> ['https://xbrl.fasb.org/us-gaap/2024/' >>> 'USGAAP2024FileList.xml' >>> 'dis/' >>> 'dqcrules/' - >>> 'ebp/' - >>> 'elts/' - >>> 'entire/' - >>> 'meta/' - >>> 'stm/' - >>> 'us-gaap-2024.zip'] + >>> 'ebp/' + >>> 'elts/' + >>> 'entire/' + >>> 'meta/' + >>> 'stm/' + >>> 'us-gaap-2024.zip'] """ # noqa: E501 return self._run( "/regulators/sec/schema_files", **filter_inputs( provider_choices={ - "provider": provider, + "provider": self._get_provider( + provider, + "/regulators/sec/schema_files", + ("sec",), + ) }, standard_params={ "query": query, @@ -348,7 +370,11 @@ class ROUTER_regulators_sec(Container): "/regulators/sec/sic_search", **filter_inputs( provider_choices={ - "provider": provider, + "provider": self._get_provider( + provider, + "/regulators/sec/sic_search", + ("sec",), + ) }, standard_params={ "query": query, @@ -414,7 +440,11 @@ class ROUTER_regulators_sec(Container): "/regulators/sec/symbol_map", **filter_inputs( provider_choices={ - "provider": provider, + "provider": self._get_provider( + provider, + "/regulators/sec/symbol_map", + ("sec",), + ) }, standard_params={ "query": query, diff --git a/openbb_platform/providers/alpha_vantage/openbb_alpha_vantage/models/equity_historical.py b/openbb_platform/providers/alpha_vantage/openbb_alpha_vantage/models/equity_historical.py index d1d28d1de4d..972d563c7aa 100644 --- a/openbb_platform/providers/alpha_vantage/openbb_alpha_vantage/models/equity_historical.py +++ b/openbb_platform/providers/alpha_vantage/openbb_alpha_vantage/models/equity_historical.py @@ -35,6 +35,8 @@ class AVEquityHistoricalQueryParams(EquityHistoricalQueryParams): Source: https://www.alphavantage.co/documentation/#time-series-data """ + __json_schema_extra__ = {"symbol": ["multiple_items_allowed"]} + interval: Literal["1m", "5m", "15m", "30m", "60m", "1d", "1W", "1M"] = Field( default="1d", description=QUERY_DESCRIPTIONS.get("interval", ""), diff --git a/openbb_platform/providers/benzinga/openbb_benzinga/models/company_news.py b/openbb_platform/providers/benzinga/openbb_benzinga/models/company_news.py index a4c9f2db9ba..3b36a061a0a 100644 --- a/openbb_platform/providers/benzinga/openbb_benzinga/models/company_news.py +++ b/openbb_platform/providers/benzinga/openbb_benzinga/models/company_news.py @@ -32,6 +32,8 @@ class BenzingaCompanyNewsQueryParams(CompanyNewsQueryParams): "updated_since": "updatedSince", "published_since": "publishedSince", } + __json_schema_extra__ = {"symbol": ["multiple_items_allowed"]} + date: Optional[dateType] = Field( default=None, description=QUERY_DESCRIPTIONS.get("date", "") ) diff --git a/openbb_platform/providers/benzinga/openbb_benzinga/models/price_target.py b/openbb_platform/providers/benzinga/openbb_benzinga/models/price_target.py index e5a1c4e9844..a8ef2869a24 100644 --- a/openbb_platform/providers/benzinga/openbb_benzinga/models/price_target.py +++ b/openbb_platform/providers/benzinga/openbb_benzinga/models/price_target.py @@ -24,6 +24,7 @@ class BenzingaPriceTargetQueryParams(PriceTargetQueryParams): "limit": "pageSize", "symbol": "parameters[tickers]", } + __json_schema_extra__ = {"symbol": ["multiple_items_allowed"]} fields: Optional[str] = Field( default=None, diff --git a/openbb_platform/providers/cboe/openbb_cboe/models/equity_historical.py b/openbb_platform/providers/cboe/openbb_cboe/models/equity_historical.py index 620a987bf05..c74afc3430a 100644 --- a/openbb_platform/providers/cboe/openbb_cboe/models/equity_historical.py +++ b/openbb_platform/providers/cboe/openbb_cboe/models/equity_historical.py @@ -30,6 +30,8 @@ class CboeEquityHistoricalQueryParams(EquityHistoricalQueryParams): Source: https://www.cboe.com/ """ + __json_schema_extra__ = {"symbol": ["multiple_items_allowed"]} + interval: Literal["1m", "1d"] = Field( default="1d", description=( diff --git a/openbb_platform/providers/cboe/openbb_cboe/models/equity_quote.py b/openbb_platform/providers/cboe/openbb_cboe/models/equity_quote.py index 2a02bbb8b55..bd311c5d2d4 100644 --- a/openbb_platform/providers/cboe/openbb_cboe/models/equity_quote.py +++ b/openbb_platform/providers/cboe/openbb_cboe/models/equity_quote.py @@ -25,6 +25,8 @@ class CboeEquityQuoteQueryParams(EquityQuoteQueryParams): Source: https://www.cboe.com/ """ + __json_schema_extra__ = {"symbol": ["multiple_items_allowed"]} + use_cache: bool = Field( default=True, description="When True, the company directories will be cached for" diff --git a/openbb_platform/providers/cboe/openbb_cboe/models/index_historical.py b/openbb_platform/providers/cboe/openbb_cboe/models/index_historical.py index 32015ce3d9c..ce468e2eafc 100644 --- a/openbb_platform/providers/cboe/openbb_cboe/models/index_historical.py +++ b/openbb_platform/providers/cboe/openbb_cboe/models/index_historical.py @@ -28,6 +28,8 @@ class CboeIndexHistoricalQueryParams(IndexHistoricalQueryParams): Source: https://www.cboe.com/ """ + __json_schema_extra__ = {"symbol": ["multiple_items_allowed"]} + interval: Literal["1m", "1d"] = Field( default="1d", description=( diff --git a/openbb_platform/providers/finra/openbb_finra/models/otc_aggregate.py b/openbb_platform/providers/finra/openbb_finra/models/otc_aggregate.py index 0dce1f6f144..f95473630bc 100644 --- a/openbb_platform/providers/finra/openbb_finra/models/otc_aggregate.py +++ b/openbb_platform/providers/finra/openbb_finra/models/otc_aggregate.py @@ -44,6 +44,7 @@ class FinraOTCAggregateFetcher( """Transform query params.""" return FinraOTCAggregateQueryParams(**params) + # pylint: disable=unused-argument @staticmethod def extract_data( query: FinraOTCAggregateQueryParams, diff --git a/openbb_platform/providers/finviz/openbb_finviz/models/equity_profile.py b/openbb_platform/providers/finviz/openbb_finviz/models/equity_profile.py index c8fd5eff7d4..f6f29c1791a 100644 --- a/openbb_platform/providers/finviz/openbb_finviz/models/equity_profile.py +++ b/openbb_platform/providers/finviz/openbb_finviz/models/equity_profile.py @@ -22,6 +22,8 @@ class FinvizEquityProfileQueryParams(EquityInfoQueryParams): Source: https://finviz.com/screener.ashx """ + __json_schema_extra__ = {"symbol": ["multiple_items_allowed"]} + class FinvizEquityProfileData(EquityInfoData): """Finviz Equity Profile Data.""" diff --git a/openbb_platform/providers/finviz/openbb_finviz/models/key_metrics.py b/openbb_platform/providers/finviz/openbb_finviz/models/key_metrics.py index ea1157acb41..ec7096dc6a1 100644 --- a/openbb_platform/providers/finviz/openbb_finviz/models/key_metrics.py +++ b/openbb_platform/providers/finviz/openbb_finviz/models/key_metrics.py @@ -22,6 +22,8 @@ class FinvizKeyMetricsQueryParams(KeyMetricsQueryParams): Source: https://finviz.com/screener.ashx """ + __json_schema_extra__ = {"symbol": ["multiple_items_allowed"]} + class FinvizKeyMetricsData(KeyMetricsData): """Finviz Key Metrics Data.""" diff --git a/openbb_platform/providers/finviz/openbb_finviz/models/price_target.py b/openbb_platform/providers/finviz/openbb_finviz/models/price_target.py index 95af9a79d3c..e33c04037dd 100644 --- a/openbb_platform/providers/finviz/openbb_finviz/models/price_target.py +++ b/openbb_platform/providers/finviz/openbb_finviz/models/price_target.py @@ -23,6 +23,8 @@ class FinvizPriceTargetQueryParams(PriceTargetQueryParams): Source: https://finviz.com/quote.ashx? """ + __json_schema_extra__ = {"symbol": ["multiple_items_allowed"]} + class FinvizPriceTargetData(PriceTargetData): """Finviz Price Target Data.""" diff --git a/openbb_platform/providers/fmp/openbb_fmp/models/crypto_historical.py b/openbb_platform/providers/fmp/openbb_fmp/models/crypto_historical.py index 5dd814465e5..a9a0c1fceaa 100644 --- a/openbb_platform/providers/fmp/openbb_fmp/models/crypto_historical.py +++ b/openbb_platform/providers/fmp/openbb_fmp/models/crypto_historical.py @@ -24,6 +24,7 @@ class FMPCryptoHistoricalQueryParams(CryptoHistoricalQueryParams): """ __alias_dict__ = {"start_date": "from", "end_date": "to"} + __json_schema_extra__ = {"symbol": ["multiple_items_allowed"]} timeseries: Optional[NonNegativeInt] = Field( default=None, description="Number of days to look back." diff --git a/openbb_platform/providers/fmp/openbb_fmp/models/equity_historical.py b/openbb_platform/providers/fmp/openbb_fmp/models/equity_historical.py index 43b83d78e50..105ce3c72e1 100644 --- a/openbb_platform/providers/fmp/openbb_fmp/models/equity_historical.py +++ b/openbb_platform/providers/fmp/openbb_fmp/models/equity_historical.py @@ -26,6 +26,7 @@ class FMPEquityHistoricalQueryParams(EquityHistoricalQueryParams): """ __alias_dict__ = {"start_date": "from", "end_date": "to"} + __json_schema_extra__ = {"symbol": ["multiple_items_allowed"]} limit: Optional[NonNegativeInt] = Field( default=None, diff --git a/openbb_platform/providers/fmp/openbb_fmp/models/equity_peers.py b/openbb_platform/providers/fmp/openbb_fmp/models/equity_peers.py index cb5d32dfb2f..641c75631a3 100644 --- a/openbb_platform/providers/fmp/openbb_fmp/models/equity_peers.py +++ b/openbb_platform/providers/fmp/openbb_fmp/models/equity_peers.py @@ -51,5 +51,5 @@ class FMPEquityPeersFetcher( query: FMPEquityPeersQueryParams, data: dict, **kwargs: Any ) -> FMPEquityPeersData: """Return the transformed data.""" - data.pop("symbol") + data.pop("symbol", None) return FMPEquityPeersData.model_validate(data) diff --git a/openbb_platform/providers/fmp/openbb_fmp/models/equity_profile.py b/openbb_platform/providers/fmp/openbb_fmp/models/equity_profile.py index 0e6c5ba9381..773fd84fb4d 100644 --- a/openbb_platform/providers/fmp/openbb_fmp/models/equity_profile.py +++ b/openbb_platform/providers/fmp/openbb_fmp/models/equity_profile.py @@ -42,6 +42,7 @@ class FMPEquityProfileData(EquityInfoData): "long_description": "description", "first_stock_price_date": "ipoDate", } + __json_schema_extra__ = {"symbol": ["multiple_items_allowed"]} is_etf: bool = Field(description="If the symbol is an ETF.") is_actively_trading: bool = Field(description="If the company is actively trading.") diff --git a/openbb_platform/providers/fmp/openbb_fmp/models/equity_quote.py b/openbb_platform/providers/fmp/openbb_fmp/models/equity_quote.py index 882eb26ea98..3cc5ecb626e 100644 --- a/openbb_platform/providers/fmp/openbb_fmp/models/equity_quote.py +++ b/openbb_platform/providers/fmp/openbb_fmp/models/equity_quote.py @@ -20,6 +20,8 @@ class FMPEquityQuoteQueryParams(EquityQuoteQueryParams): Source: https://financialmodelingprep.com/developer/docs/#Stock-Historical-Price """ + __json_schema_extra__ = {"symbol": ["multiple_items_allowed"]} + class FMPEquityQuoteData(EquityQuoteData): """FMP Equity Quote Data.""" diff --git a/openbb_platform/providers/fmp/openbb_fmp/models/equity_valuation_multiples.py b/openbb_platform/providers/fmp/openbb_fmp/models/equity_valuation_multiples.py index 3d93b2a55f5..a43fa0967fc 100644 --- a/openbb_platform/providers/fmp/openbb_fmp/models/equity_valuation_multiples.py +++ b/openbb_platform/providers/fmp/openbb_fmp/models/equity_valuation_multiples.py @@ -17,6 +17,8 @@ class FMPEquityValuationMultiplesQueryParams(EquityValuationMultiplesQueryParams Source: https://site.financialmodelingprep.com/developer/docs/#Company-Key-Metrics """ + __json_schema_extra__ = {"symbol": ["multiple_items_allowed"]} + class FMPEquityValuationMultiplesData(EquityValuationMultiplesData): """FMP Equity Valuation Multiples Data.""" diff --git a/openbb_platform/providers/fmp/openbb_fmp/models/executive_compensation.py b/openbb_platform/providers/fmp/openbb_fmp/models/executive_compensation.py index aaab3b0e7a2..c3ffcb44153 100644 --- a/openbb_platform/providers/fmp/openbb_fmp/models/executive_compensation.py +++ b/openbb_platform/providers/fmp/openbb_fmp/models/executive_compensation.py @@ -19,6 +19,8 @@ class FMPExecutiveCompensationQueryParams(ExecutiveCompensationQueryParams): Source: https://site.financialmodelingprep.com/developer/docs/executive-compensation-api/ """ + __json_schema_extra__ = {"symbol": ["multiple_items_allowed"]} + class FMPExecutiveCompensationData(ExecutiveCompensationData): """FMP Executive Compensation Data.""" diff --git a/openbb_platform/providers/fmp/openbb_fmp/models/key_metrics.py b/openbb_platform/providers/fmp/openbb_fmp/models/key_metrics.py index 3fbc7f741c9..f55c51553dc 100644 --- a/openbb_platform/providers/fmp/openbb_fmp/models/key_metrics.py +++ b/openbb_platform/providers/fmp/openbb_fmp/models/key_metrics.py @@ -27,6 +27,8 @@ class FMPKeyMetricsQueryParams(KeyMetricsQueryParams): Source: https://site.financialmodelingprep.com/developer/docs/company-key-metrics-api/ """ + __json_schema_extra__ = {"symbol": ["multiple_items_allowed"]} + with_ttm: Optional[bool] = Field( default=False, description="Include trailing twelve months (TTM) data." ) diff --git a/openbb_platform/providers/fred/openbb_fred/models/cpi.py b/openbb_platform/providers/fred/openbb_fred/models/cpi.py index 3be855a8243..4a86e44869f 100644 --- a/openbb_platform/providers/fred/openbb_fred/models/cpi.py +++ b/openbb_platform/providers/fred/openbb_fred/models/cpi.py @@ -14,6 +14,8 @@ from openbb_fred.utils.fred_helpers import all_cpi_options class FREDConsumerPriceIndexQueryParams(ConsumerPriceIndexQueryParams): """FRED Consumer Price Index Query.""" + __json_schema_extra__ = {"country": ["multiple_items_allowed"]} + class FREDConsumerPriceIndexData(ConsumerPriceIndexData): """FRED Consumer Price Index Data.""" diff --git a/openbb_platform/providers/fred/openbb_fred/models/series.py b/openbb_platform/providers/fred/openbb_fred/models/series.py index 486d351ecc8..8b4eb8cda88 100644 --- a/openbb_platform/providers/fred/openbb_fred/models/series.py +++ b/openbb_platform/providers/fred/openbb_fred/models/series.py @@ -31,6 +31,8 @@ class FredSeriesQueryParams(SeriesQueryParams): "end_date": "observation_end", "transform": "units", } + __json_schema_extra__ = {"symbol": ["multiple_items_allowed"]} + frequency: Literal[ None, "a", diff --git a/openbb_platform/providers/intrinio/openbb_intrinio/models/company_news.py b/openbb_platform/providers/intrinio/openbb_intrinio/models/company_news.py index 237b199c7d6..78b55c9eb2d 100644 --- a/openbb_platform/providers/intrinio/openbb_intrinio/models/company_news.py +++ b/openbb_platform/providers/intrinio/openbb_intrinio/models/company_news.py @@ -24,6 +24,7 @@ class IntrinioCompanyNewsQueryParams(CompanyNewsQueryParams): """ __alias_dict__ = {"symbol": "symbols", "page": "next_page", "limit": "page_size"} + __json_schema_extra__ = {"symbol": ["multiple_items_allowed"]} class IntrinioCompanyNewsData(CompanyNewsData): diff --git a/openbb_platform/providers/intrinio/openbb_intrinio/models/equity_info.py b/openbb_platform/providers/intrinio/openbb_intrinio/models/equity_info.py index 3bcc679a543..6488dbd7025 100644 --- a/openbb_platform/providers/intrinio/openbb_intrinio/models/equity_info.py +++ b/openbb_platform/providers/intrinio/openbb_intrinio/models/equity_info.py @@ -20,6 +20,8 @@ class IntrinioEquityInfoQueryParams(EquityInfoQueryParams): Source: https://docs.intrinio.com/documentation/web_api/get_company_v2 """ + __json_schema_extra__ = {"symbol": ["multiple_items_allowed"]} + class IntrinioEquityInfoData(EquityInfoData): """Intrinio Equity Info Data.""" diff --git a/openbb_platform/providers/intrinio/openbb_intrinio/models/equity_quote.py b/openbb_platform/providers/intrinio/openbb_intrinio/models/equity_quote.py index 56fad6f327e..fe8320bae10 100644 --- a/openbb_platform/providers/intrinio/openbb_intrinio/models/equity_quote.py +++ b/openbb_platform/providers/intrinio/openbb_intrinio/models/equity_quote.py @@ -27,6 +27,8 @@ class IntrinioEquityQuoteQueryParams(EquityQuoteQueryParams): Source: https://docs.intrinio.com/documentation/web_api/get_security_realtime_price_v2 """ + __json_schema_extra__ = {"symbol": ["multiple_items_allowed"]} + symbol: str = Field( description="A Security identifier (Ticker, FIGI, ISIN, CUSIP, Intrinio ID)." ) diff --git a/openbb_platform/providers/intrinio/openbb_intrinio/models/historical_attributes.py b/openbb_platform/providers/intrinio/openbb_intrinio/models/historical_attributes.py index 890cb66be2b..66972313dcf 100644 --- a/openbb_platform/providers/intrinio/openbb_intrinio/models/historical_attributes.py +++ b/openbb_platform/providers/intrinio/openbb_intrinio/models/historical_attributes.py @@ -26,6 +26,7 @@ class IntrinioHistoricalAttributesQueryParams(HistoricalAttributesQueryParams): """ __alias_dict__ = {"sort": "sort_order", "limit": "page_size", "tag_type": "type"} + __json_schema_extra__ = {"tag": ["multiple_items_allowed"]} class IntrinioHistoricalAttributesData(HistoricalAttributesData): diff --git a/openbb_platform/providers/intrinio/openbb_intrinio/models/index_historical.py b/openbb_platform/providers/intrinio/openbb_intrinio/models/index_historical.py index 8163bf7cea6..16a49d890c0 100644 --- a/openbb_platform/providers/intrinio/openbb_intrinio/models/index_historical.py +++ b/openbb_platform/providers/intrinio/openbb_intrinio/models/index_historical.py @@ -21,6 +21,7 @@ class IntrinioIndexHistoricalQueryParams(IndexHistoricalQueryParams): """ __alias_dict__ = {"limit": "page_size", "sort": "sort_order"} + __json_schema_extra__ = {"symbol": ["multiple_items_allowed"]} class IntrinioIndexHistoricalData(IndexHistoricalData): diff --git a/openbb_platform/providers/intrinio/openbb_intrinio/models/latest_attributes.py b/openbb_platform/providers/intrinio/openbb_intrinio/models/latest_attributes.py index 0ca153f6123..b62f76c07d7 100644 --- a/openbb_platform/providers/intrinio/openbb_intrinio/models/latest_attributes.py +++ b/openbb_platform/providers/intrinio/openbb_intrinio/models/latest_attributes.py @@ -22,6 +22,8 @@ class IntrinioLatestAttributesQueryParams(LatestAttributesQueryParams): https://docs.intrinio.com/documentation/web_api/get_data_point_text_v2 """ + __json_schema_extra__ = {"tag": ["multiple_items_allowed"]} + class IntrinioLatestAttributesData(LatestAttributesData): """Intrinio Latest Attributes Data.""" diff --git a/openbb_platform/providers/nasdaq/openbb_nasdaq/models/economic_calendar.py b/openbb_platform/providers/nasdaq/openbb_nasdaq/models/economic_calendar.py index 0f2d526e736..7baae29800e 100644 --- a/openbb_platform/providers/nasdaq/openbb_nasdaq/models/economic_calendar.py +++ b/openbb_platform/providers/nasdaq/openbb_nasdaq/models/economic_calendar.py @@ -22,6 +22,8 @@ class NasdaqEconomicCalendarQueryParams(EconomicCalendarQueryParams): Source: https://www.nasdaq.com/market-activity/economic-calendar """ + __json_schema_extra__ = {"country": ["multiple_items_allowed"]} + country: Optional[Union[str, List[str]]] = Field( default=None, description="Country of the event", diff --git a/openbb_platform/providers/nasdaq/openbb_nasdaq/models/historical_dividends.py b/openbb_platform/providers/nasdaq/openbb_nasdaq/models/historical_dividends.py index 3754a92964c..2ca017a496b 100644 --- a/openbb_platform/providers/nasdaq/openbb_nasdaq/models/historical_dividends.py +++ b/openbb_platform/providers/nasdaq/openbb_nasdaq/models/historical_dividends.py @@ -26,6 +26,8 @@ _warn = warnings.warn class NasdaqHistoricalDividendsQueryParams(HistoricalDividendsQueryParams): """Nasdaq Historical Dividends Query Params.""" + __json_schema_extra__ = {"symbol": ["multiple_items_allowed"]} + class NasdaqHistoricalDividendsData(HistoricalDividendsData): """Nasdaq Historical Dividends Data.""" diff --git a/openbb_platform/providers/polygon/openbb_polygon/models/crypto_historical.py b/openbb_platform/providers/polygon/openbb_polygon/models/crypto_historical.py index 96f2918b4d1..9c19a47579a 100644 --- a/openbb_platform/providers/polygon/openbb_polygon/models/crypto_historical.py +++ b/openbb_platform/providers/polygon/openbb_polygon/models/crypto_historical.py @@ -36,6 +36,8 @@ class PolygonCryptoHistoricalQueryParams(CryptoHistoricalQueryParams): Source: https://polygon.io/docs/crypto/get_v2_aggs_ticker__cryptoticker__range__multiplier___timespan___from___to """ + __json_schema_extra__ = {"symbol": ["multiple_items_allowed"]} + interval: str = Field( default="1d", description=QUERY_DESCRIPTIONS.get("interval", "") ) diff --git a/openbb_platform/providers/polygon/openbb_polygon/models/currency_historical.py b/openbb_platform/providers/polygon/openbb_polygon/models/currency_historical.py index 4b5c0acb436..166fa4262c6 100644 --- a/openbb_platform/providers/polygon/openbb_polygon/models/currency_historical.py +++ b/openbb_platform/providers/polygon/openbb_polygon/models/currency_historical.py @@ -36,6 +36,8 @@ class PolygonCurrencyHistoricalQueryParams(CurrencyHistoricalQueryParams): Source: https://polygon.io/docs/forex/get_v2_aggs_ticker__forexticker__range__multiplier___timespan___from___to """ + __json_schema_extra__ = {"symbol": ["multiple_items_allowed"]} + interval: str = Field( default="1d", description=QUERY_DESCRIPTIONS.get("interval", "") ) diff --git a/openbb_platform/providers/polygon/openbb_polygon/models/equity_historical.py b/openbb_platform/providers/polygon/openbb_polygon/models/equity_historical.py index a74aac6f64f..039c9fd0fdd 100644 --- a/openbb_platform/providers/polygon/openbb_polygon/models/equity_historical.py +++ b/openbb_platform/providers/polygon/openbb_polygon/models/equity_historical.py @@ -36,6 +36,8 @@ class PolygonEquityHistoricalQueryParams(EquityHistoricalQueryParams): Source: https://polygon.io/docs/stocks/getting-started """ + __json_schema_extra__ = {"symbol": ["multiple_items_allowed"]} + interval: str = Field( default="1d", description=QUERY_DESCRIPTIONS.get("interval", "") ) diff --git a/openbb_platform/providers/polygon/openbb_polygon/models/index_historical.py b/openbb_platform/providers/polygon/openbb_polygon/models/index_historical.py index adc57bfa2c6..41169af79dc 100644 --- a/openbb_platform/providers/polygon/openbb_polygon/models/index_historical.py +++ b/openbb_platform/providers/polygon/openbb_polygon/models/index_historical.py @@ -36,6 +36,8 @@ class PolygonIndexHistoricalQueryParams(IndexHistoricalQueryParams): Source: https://polygon.io/docs/indices/getting-started """ + __json_schema_extra__ = {"symbol": ["multiple_items_allowed"]} + interval: str = Field( default="1d", description=QUERY_DESCRIPTIONS.get("interval", "") ) diff --git a/openbb_platform/providers/stockgrid/openbb_stockgrid/models/short_volume.py b/openbb_platform/providers/stockgrid/openbb_stockgrid/models/short_volume.py index f95f5cbfbda..0006f0888cf 100644 --- a/openbb_platform/providers/stockgrid/openbb_stockgrid/models/short_volume.py +++ b/openbb_platform/providers/stockgrid/openbb_stockgrid/models/short_volume.py @@ -23,6 +23,7 @@ class StockgridShortVolumeData(ShortVolumeData): """Stockgrid Short Volume Data.""" __alias_dict__ = {"short_volume_percent": "short_volume%", "symbol": "ticker"} + close: Optional[float] = Field( default=None, description="Closing price of the stock on the date." ) @@ -48,6 +49,7 @@ class StockgridShortVolumeFetcher( """Transform query params.""" return StockgridShortVolumeQueryParams(**params) + # pylint: disable=unused-argument @staticmethod def extract_data( query: StockgridShortVolumeQueryParams, diff --git a/openbb_platform/providers/tiingo/openbb_tiingo/models/equity_historical.py b/openbb_platform/providers/tiingo/openbb_tiingo/models/equity_historical.py index 0282fa945c6..12f508df906 100644 --- a/openbb_platform/providers/tiingo/openbb_tiingo/models/equity_historical.py +++ b/openbb_platform/providers/tiingo/openbb_tiingo/models/equity_historical.py @@ -24,6 +24,7 @@ class TiingoEquityHistoricalQueryParams(EquityHistoricalQueryParams): "start_date": "startDate", "end_date": "endDate", } + __json_schema_extra__ = {"symbol": ["multiple_items_allowed"]} interval: Literal["1d", "1W", "1M", "1Y"] = Field( default="1d", description=QUERY_DESCRIPTIONS.get("interval", "") diff --git a/openbb_platform/providers/tradingeconomics/openbb_tradingeconomics/models/economic_calendar.py b/openbb_platform/providers/tradingeconomics/openbb_tradingeconomics/models/economic_calendar.py index df4a823da0b..c0a14d17818 100644 --- a/openbb_platform/providers/tradingeconomics/openbb_tradingeconomics/models/economic_calendar.py +++ b/openbb_platform/providers/tradingeconomics/openbb_tradingeconomics/models/economic_calendar.py @@ -39,6 +39,8 @@ class TEEconomicCalendarQueryParams(EconomicCalendarQueryParams): Source: https://docs.tradingeconomics.com/economic_calendar/ """ + __json_schema_extra__ = {"country": ["multiple_items_allowed"]} + # TODO: Probably want to figure out the list we can use. country: Optional[str] = Field(default=None, description="Country of the event.") importance: Optional[IMPORTANCE] = Field( diff --git a/openbb_platform/providers/yfinance/openbb_yfinance/models/crypto_historical.py b/openbb_platform/providers/yfinance/openbb_yfinance/models/crypto_historical.py index bf5a5907c1a..0cdb4375c23 100644 --- a/openbb_platform/providers/yfinance/openbb_yfinance/models/crypto_historical.py +++ b/openbb_platform/providers/yfinance/openbb_yfinance/models/crypto_historical.py @@ -26,6 +26,8 @@ class YFinanceCryptoHistoricalQueryParams(CryptoHistoricalQueryParams): Source: https://finance.yahoo.com/crypto/ """ + __json_schema_extra__ = {"symbol": ["multiple_items_allowed"]} + interval: Optional[INTERVALS] = Field(default="1d", description="Data granularity.") period: Optional[PERIODS] = Field( default="max", description=QUERY_DESCRIPTIONS.get("period", "") diff --git a/openbb_platform/providers/yfinance/openbb_yfinance/models/currency_historical.py b/openbb_platform/providers/yfinance/openbb_yfinance/models/currency_historical.py index 5a67d37a81d..549e4e8bee0 100644 --- a/openbb_platform/providers/yfinance/openbb_yfinance/models/currency_historical.py +++ b/openbb_platform/providers/yfinance/openbb_yfinance/models/currency_historical.py @@ -26,6 +26,8 @@ class YFinanceCurrencyHistoricalQueryParams(CurrencyHistoricalQueryParams): Source: https://finance.yahoo.com/currencies/ """ + __json_schema_extra__ = {"symbol": ["multiple_items_allowed"]} + interval: Optional[INTERVALS] = Field(default="1d", description="Data granularity.") period: Optional[PERIODS] = Field( default="max", description=QUERY_DESCRIPTIONS.get("period", "") diff --git a/openbb_platform/providers/yfinance/openbb_yfinance/models/equity_historical.py b/openbb_platform/providers/yfinance/openbb_yfinance/models/equity_historical.py index 86dac144620..df55675d525 100644 --- a/openbb_platform/providers/yfinance/openbb_yfinance/models/equity_historical.py +++ b/openbb_platform/providers/yfinance/openbb_yfinance/models/equity_historical.py @@ -26,6 +26,8 @@ class YFinanceEquityHistoricalQueryParams(EquityHistoricalQueryParams): Source: https://finance.yahoo.com/ """ + __json_schema_extra__ = {"symbol": ["multiple_items_allowed"]} + interval: Optional[ Literal[ "1m", diff --git a/openbb_platform/providers/yfinance/openbb_yfinance/models/equity_profile.py b/openbb_platform/providers/yfinance/openbb_yfinance/models/equity_profile.py index cd3f1ed77e8..cc98e5838c3 100644 --- a/openbb_platform/providers/yfinance/openbb_yfinance/models/equity_profile.py +++ b/openbb_platform/providers/yfinance/openbb_yfinance/models/equity_profile.py @@ -20,6 +20,8 @@ _warn = warnings.warn class YFinanceEquityProfileQueryParams(EquityInfoQueryParams): """YFinance Equity Profile Query.""" + __json_schema_extra__ = {"symbol": ["multiple_items_allowed"]} + class YFinanceEquityProfileData(EquityInfoData): """YFinance Equity Profile Data.""" diff --git a/openbb_platform/providers/yfinance/openbb_yfinance/models/equity_quote.py b/openbb_platform/providers/yfinance/openbb_yfinance/models/equity_quote.py index 01f2a02ce60..a8a88b96e6c 100644 --- a/openbb_platform/providers/yfinance/openbb_yfinance/models/equity_quote.py +++ b/openbb_platform/providers/yfinance/openbb_yfinance/models/equity_quote.py @@ -19,6 +19,8 @@ _warn = warnings.warn class YFinanceEquityQuoteQueryParams(EquityQuoteQueryParams): """YFinance Equity Quote Query.""" + __json_schema_extra__ = {"symbol": ["multiple_items_allowed"]} + class YFinanceEquityQuoteData(EquityQuoteData): """YFinance Equity Quote Data.""" diff --git a/openbb_platform/providers/yfinance/openbb_yfinance/models/etf_info.py b/openbb_platform/providers/yfinance/openbb_yfinance/models/etf_info.py index f2b64728d27..546ee9c8fb3 100644 --- a/openbb_platform/providers/yfinance/openbb_yfinance/models/etf_info.py +++ b/openbb_platform/providers/yfinance/openbb_yfinance/models/etf_info.py @@ -20,6 +20,8 @@ _warn = warnings.warn class YFinanceEtfInfoQueryParams(EtfInfoQueryParams): """YFinance ETF Info Query.""" + __json_schema_extra__ = {"symbol": ["multiple_items_allowed"]} + class YFinanceEtfInfoData(EtfInfoData): """YFinance ETF Info Data.""" diff --git a/openbb_platform/providers/yfinance/openbb_yfinance/models/futures_historical.py b/openbb_platform/providers/yfinance/openbb_yfinance/models/futures_historical.py index 1afc436d360..da1cb731ac5 100644 --- a/openbb_platform/providers/yfinance/openbb_yfinance/models/futures_historical.py +++ b/openbb_platform/providers/yfinance/openbb_yfinance/models/futures_historical.py @@ -26,6 +26,8 @@ class YFinanceFuturesHistoricalQueryParams(FuturesHistoricalQueryParams): Source: https://finance.yahoo.com/crypto/ """ + __json_schema_extra__ = {"symbol": ["multiple_items_allowed"]} + interval: Optional[INTERVALS] = Field(default="1d", description="Data granularity.") period: Optional[PERIODS] = Field( default=None, description=QUERY_DESCRIPTIONS.get("period", "") diff --git a/openbb_platform/providers/yfinance/openbb_yfinance/models/historical_dividends.py b/openbb_platform/providers/yfinance/openbb_yfinance/models/historical_dividends.py index f1a29e1cd22..713d786dd38 100644 --- a/openbb_platform/providers/yfinance/openbb_yfinance/models/historical_dividends.py +++ b/openbb_platform/providers/yfinance/openbb_yfinance/models/historical_dividends.py @@ -1,7 +1,6 @@ """YFinance Historical Dividends Model.""" # pylint: disable=unused-argument -import warnings from typing import Any, Dict, List, Optional from openbb_core.provider.abstract.fetcher import Fetcher @@ -9,11 +8,8 @@ from openbb_core.provider.standard_models.historical_dividends import ( HistoricalDividendsData, HistoricalDividendsQueryParams, ) -from openbb_core.provider.utils.descriptions import QUERY_DESCRIPTIONS from yfinance import Ticker -_warn = warnings.warn - class YFinanceHistoricalDividendsQueryParams(HistoricalDividendsQueryParams): """YFinance Historical Dividends Query.""" @@ -44,16 +40,12 @@ class YFinanceHistoricalDividendsFetcher( **kwargs: Any, ) -> List[Dict]: """Extract the raw data from YFinance.""" - symbols = query.symbol.split(",") - symbol = symbols[0] - if len(symbols) > 1: - _warn(f"{QUERY_DESCRIPTIONS.get('symbol_list_warning', '')} {symbol}") try: - ticker = Ticker(symbol).get_dividends() + ticker = Ticker(query.symbol).get_dividends() if isinstance(ticker, List) and not ticker or ticker.empty: # type: ignore - raise ValueError(f"No dividend data found for {symbol}") + raise ValueError(f"No dividend data found for {query.symbol}") except Exception as e: - raise RuntimeError(f"Error getting data for {symbol}: {e}") from e + raise RuntimeError(f"Error getting data for {query.symbol}: {e}") from e ticker.index.name = "ex_dividend_date" ticker.name = "amount" # type: ignore if query.start_date is not None: diff --git a/openbb_platform/providers/yfinance/openbb_yfinance/models/index_historical.py b/openbb_platform/providers/yfinance/openbb_yfinance/models/index_historical.py index 46f836a7d1c..009ff33991c 100644 --- a/openbb_platform/providers/yfinance/openbb_yfinance/models/index_historical.py +++ b/openbb_platform/providers/yfinance/openbb_yfinance/models/index_historical.py @@ -26,6 +26,8 @@ class YFinanceIndexHistoricalQueryParams(IndexHistoricalQueryParams): Source: https://finance.yahoo.com/world-indices """ + __json_schema_extra__ = {"symbol": ["multiple_items_allowed"]} + interval: Optional[INTERVALS] = Field(default="1d", description="Data granularity.") period: Optional[PERIODS] = Field( default="max", description=QUERY_DESCRIPTIONS.get("period", "") diff --git a/openbb_platform/providers/yfinance/openbb_yfinance/models/key_executives.py b/openbb_platform/providers/yfinance/openbb_yfinance/models/key_executives.py index 60af63abbad..c7eac6c1e8f 100644 --- a/openbb_platform/providers/yfinance/openbb_yfinance/models/key_executives.py +++ b/openbb_platform/providers/yfinance/openbb_yfinance/models/key_executives.py @@ -1,7 +1,6 @@ """YFinance Key Executives Model.""" # pylint: disable=unused-argument -import warnings from typing import Any, Dict, List, Optional from openbb_core.provider.abstract.fetcher import Fetcher @@ -9,12 +8,9 @@ from openbb_core.provider.standard_models.key_executives import ( KeyExecutivesData, KeyExecutivesQueryParams, ) -from openbb_core.provider.utils.descriptions import QUERY_DESCRIPTIONS from pydantic import Field from yfinance import Ticker -_warn = warnings.warn - class YFinanceKeyExecutivesQueryParams(KeyExecutivesQueryParams): """YFinance Key Executives Query.""" @@ -58,16 +54,12 @@ class YFinanceKeyExecutivesFetcher( **kwargs: Any, ) -> List[Dict]: """Extract the raw data from YFinance.""" - symbols = query.symbol.split(",") - symbol = symbols[0] - if len(symbols) > 1: - _warn(f"{QUERY_DESCRIPTIONS.get('symbol_list_warning', '')} {symbol}") try: - ticker = Ticker(symbol).get_info() + ticker = Ticker(query.symbol).get_info() except Exception as e: - raise RuntimeError(f"Error getting data for {symbol}: {e}") from e + raise RuntimeError(f"Error getting data for {query.symbol}: {e}") from e if ticker.get("companyOfficers") is None: - raise ValueError(f"No executive data found for {symbol}") + raise ValueError(f"No executive data found for {query.symbol}") officers_data = ticker.get("companyOfficers", []) [d.pop("maxAge") for d in officers_data] # pylint: disable=W0106 return officers_data diff --git a/openbb_platform/providers/yfinance/openbb_yfinance/models/market_indices.py b/openbb_platform/providers/yfinance/openbb_yfinance/models/market_indices.py index 8378a8c20b0..163856a5cd3 100644 --- a/openbb_platform/providers/yfinance/openbb_yfinance/models/market_indices.py +++ b/openbb_platform/providers/yfinance/openbb_yfinance/models/market_indices.py @@ -27,6 +27,8 @@ class YFinanceMarketIndicesQueryParams(MarketIndicesQueryParams): Source: https://finance.yahoo.com/world-indices """ + __json_schema_extra__ = {"symbol": ["multiple_items_allowed"]} + interval: Optional[INTERVALS] = Field(default="1d", description="Data granularity.") period: Optional[PERIODS] = Field( default="max", description=QUERY_DESCRIPTIONS.get("period", "") diff --git a/openbb_platform/providers/yfinance/openbb_yfinance/models/price_target_consensus.py b/openbb_platform/providers/yfinance/openbb_yfinance/models/price_target_consensus.py index 1a5bfcda9ab..a412f210dae 100644 --- a/openbb_platform/providers/yfinance/openbb_yfinance/models/price_target_consensus.py +++ b/openbb_platform/providers/yfinance/openbb_yfinance/models/price_target_consensus.py @@ -19,6 +19,8 @@ _warn = warnings.warn class YFinancePriceTargetConsensusQueryParams(PriceTargetConsensusQueryParams): """YFinance Price Target Consensus Query.""" + __json_schema_extra__ = {"symbol": ["multiple_items_allowed"]} + class YFinancePriceTargetConsensusData(PriceTargetConsensusData): """YFinance Price Target Consensus Data.""" diff --git a/openbb_platform/providers/yfinance/openbb_yfinance/models/share_statistics.py b/openbb_platform/providers/yfinance/openbb_yfinance/models/share_statistics.py index 9af6b963951..d7dba5e4589 100644 --- a/openbb_platform/providers/yfinance/openbb_yfinance/models/share_statistics.py +++ b/openbb_platform/providers/yfinance/openbb_yfinance/models/share_statistics.py @@ -23,6 +23,8 @@ _warn = warnings.warn class YFinanceShareStatisticsQueryParams(ShareStatisticsQueryParams): """YFinance Share Statistics Query.""" + __json_schema_extra__ = {"symbol": ["multiple_items_allowed"]} + class YFinanceShareStatisticsData(ShareStatisticsData): """YFinance Share Statistics Data."""