crypto historical

This commit is contained in:
montezdesousa
2024-02-14 12:24:37 +00:00
parent 62507d0052
commit efc0f2427f
4 changed files with 10 additions and 2 deletions

View File

@@ -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,7 +23,7 @@ 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."
),
@@ -139,5 +139,8 @@ class ROUTER_crypto_price(Container):
"end_date": end_date,
},
extra_params=kwargs,
extra_info={
"symbol": {"multiple_items_allowed": {"yfinance", "fmp", "polygon"}}
},
)
)

View File

@@ -24,6 +24,7 @@ class FMPCryptoHistoricalQueryParams(CryptoHistoricalQueryParams):
"""
__alias_dict__ = {"start_date": "from", "end_date": "to"}
__openbb_extra__ = {"symbol": ["multiple_items_allowed"]}
timeseries: Optional[NonNegativeInt] = Field(
default=None, description="Number of days to look back."

View File

@@ -36,6 +36,8 @@ class PolygonCryptoHistoricalQueryParams(CryptoHistoricalQueryParams):
Source: https://polygon.io/docs/crypto/get_v2_aggs_ticker__cryptoticker__range__multiplier___timespan___from___to
"""
__openbb_extra__ = {"symbol": ["multiple_items_allowed"]}
interval: str = Field(
default="1d", description=QUERY_DESCRIPTIONS.get("interval", "")
)

View File

@@ -26,6 +26,8 @@ class YFinanceCryptoHistoricalQueryParams(CryptoHistoricalQueryParams):
Source: https://finance.yahoo.com/crypto/
"""
__openbb_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", "")