Skip to content

Commit

Permalink
static assets built on 3.8
Browse files Browse the repository at this point in the history
  • Loading branch information
hjoaquim committed Oct 18, 2023
1 parent e09629e commit fb82ff7
Show file tree
Hide file tree
Showing 14 changed files with 1,584 additions and 1,164 deletions.
4 changes: 4 additions & 0 deletions openbb_platform/openbb/package/__extensions__.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,11 @@
import typing
from typing import List, Dict, Union, Optional, Literal
from annotated_types import Ge, Le, Gt, Lt
<<<<<<< Updated upstream
from typing_extensions import Annotated
=======
import typing_extensions
>>>>>>> Stashed changes
from openbb_core.app.utils import df_to_basemodel
from openbb_core.app.static.decorators import validate

Expand Down
44 changes: 26 additions & 18 deletions openbb_platform/openbb/package/crypto.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,11 @@
import typing
from typing import List, Dict, Union, Optional, Literal
from annotated_types import Ge, Le, Gt, Lt
<<<<<<< Updated upstream
from typing_extensions import Annotated
=======
import typing_extensions
>>>>>>> Stashed changes
from openbb_core.app.utils import df_to_basemodel
from openbb_core.app.static.decorators import validate

Expand All @@ -35,25 +39,29 @@ def __repr__(self) -> str:
@validate
def load(
self,
symbol: Annotated[
symbol: typing_extensions.Annotated[
Union[str, List[str]],
OpenBBCustomParameter(
description="Symbol Pair to get data for in CURR1-CURR2 or CURR1CURR2 format."
),
],
start_date: Annotated[
start_date: typing_extensions.Annotated[
Union[datetime.date, None, str],
OpenBBCustomParameter(
description="Start date of the data, in YYYY-MM-DD format."
),
] = None,
end_date: Annotated[
end_date: typing_extensions.Annotated[
Union[datetime.date, None, str],
OpenBBCustomParameter(
description="End date of the data, in YYYY-MM-DD format."
),
] = None,
<<<<<<< Updated upstream
provider: Optional[Literal["fmp", "polygon", "yfinance"]] = None,
=======
provider: Union[Literal["fmp", "polygon", "yfinance"], None] = None,
>>>>>>> Stashed changes
**kwargs
) -> OBBject[List[Data]]:
"""Crypto Historical Price. Cryptocurrency historical price data.
Expand All @@ -62,15 +70,15 @@ def load(
----------
symbol : str
Symbol Pair to get data for in CURR1-CURR2 or CURR1CURR2 format.
start_date : Optional[datetime.date]
start_date : Union[datetime.date, None]
Start date of the data, in YYYY-MM-DD format.
end_date : Optional[datetime.date]
end_date : Union[datetime.date, None]
End date of the data, in YYYY-MM-DD format.
provider : Optional[Literal['fmp', 'polygon', 'yfinance']]
provider : Union[Literal['fmp', 'polygon', 'yfinance'], None]
The provider to use for the query, by default None.
If None, the provider specified in defaults is selected or 'fmp' if there is
no default.
timeseries : Optional[Annotated[int, Ge(ge=0)]]
timeseries : Optional[Union[typing_extensions.Annotated[int, Ge(ge=0)]]]
Number of days to look back. (provider: fmp)
interval : Optional[Union[Literal['1min', '5min', '15min', '30min', '1hour', '4hour', '1day'], Literal['1m', '2m', '5m', '15m', '30m', '60m', '90m', '1h', '1d', '5d', '1wk', '1mo', '3mo']]]
Data granularity. (provider: fmp, yfinance)
Expand All @@ -84,15 +92,15 @@ def load(
The number of data entries to return. (provider: polygon)
adjusted : bool
Whether the data is adjusted. (provider: polygon)
period : Optional[Literal['1d', '5d', '1mo', '3mo', '6mo', '1y', '2y', '5y', '10y', 'ytd', 'max']]
period : Optional[Union[Literal['1d', '5d', '1mo', '3mo', '6mo', '1y', '2y', '5y', '10y', 'ytd', 'max']]]
Time period of the data to return. (provider: yfinance)
Returns
-------
OBBject
results : List[CryptoHistorical]
results : Union[List[CryptoHistorical]]
Serializable results.
provider : Optional[Literal['fmp', 'polygon', 'yfinance']]
provider : Union[Literal['fmp', 'polygon', 'yfinance'], None]
Provider name.
warnings : Optional[List[Warning_]]
List of warnings.
Expand All @@ -115,21 +123,21 @@ def load(
The close price of the symbol.
volume : float
The volume of the symbol.
vwap : Optional[Annotated[float, Gt(gt=0)]]
vwap : Optional[Union[typing_extensions.Annotated[float, Gt(gt=0)]]]
Volume Weighted Average Price of the symbol.
adj_close : Optional[float]
adj_close : Optional[Union[float]]
Adjusted Close Price of the symbol. (provider: fmp)
unadjusted_volume : Optional[float]
unadjusted_volume : Optional[Union[float]]
Unadjusted volume of the symbol. (provider: fmp)
change : Optional[float]
change : Optional[Union[float]]
Change in the price of the symbol from the previous day. (provider: fmp)
change_percent : Optional[float]
change_percent : Optional[Union[float]]
Change % in the price of the symbol. (provider: fmp)
label : Optional[str]
label : Optional[Union[str]]
Human readable format of the date. (provider: fmp)
change_over_time : Optional[float]
change_over_time : Optional[Union[float]]
Change % in the price of the symbol over a period of time. (provider: fmp)
transactions : Optional[Annotated[int, Gt(gt=0)]]
transactions : Optional[Union[typing_extensions.Annotated[int, Gt(gt=0)]]]
Number of transactions for the symbol in the time period. (provider: polygon)
Example
--------
Expand Down
8 changes: 6 additions & 2 deletions openbb_platform/openbb/package/econometrics.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,11 @@
import typing
from typing import List, Dict, Union, Optional, Literal
from annotated_types import Ge, Le, Gt, Lt
<<<<<<< Updated upstream
from typing_extensions import Annotated
=======
import typing_extensions
>>>>>>> Stashed changes
from openbb_core.app.utils import df_to_basemodel
from openbb_core.app.static.decorators import validate

Expand Down Expand Up @@ -50,7 +54,7 @@ def bgot(
data: Union[List[Data], pandas.DataFrame],
y_column: str,
x_columns: List[str],
lags: Annotated[int, Gt(gt=0)] = 1,
lags: typing_extensions.Annotated[int, Gt(gt=0)] = 1,
) -> OBBject[Data]:
"""Perform Breusch-Godfrey Lagrange Multiplier tests for residual autocorrelation.
Expand Down Expand Up @@ -179,7 +183,7 @@ def granger(
data: Union[List[Data], pandas.DataFrame],
y_column: str,
x_column: str,
lag: Annotated[int, Gt(gt=0)] = 3,
lag: typing_extensions.Annotated[int, Gt(gt=0)] = 3,
) -> OBBject[Data]:
"""Perform Granger causality test to determine if X "causes" y.
Expand Down
Loading

0 comments on commit fb82ff7

Please sign in to comment.