Add OECD Provider for economy extension (#5534)

This commit is contained in:
James Maslek
2023-10-10 15:50:54 -04:00
committed by GitHub
parent 7eca47eb33
commit 41be83ff76
39 changed files with 7415 additions and 502 deletions

View File

@@ -254,10 +254,11 @@ Each `Fetcher` comes equipped with a `test` method that will ensure that it is i
To create unit tests for your Fetchers, you can run the following command:
```bash
python openbb_platform/providers/tests/utils/unit_test_generator.py
python openbb_platform/providers/tests/utils/unit_tests_generator.py
```
> Note that you should be running this file from the root of the repository.
> Note that the `tests` folder must exist in order to generate the tests.
The automatic unit test generation will add unit tests for all the fetchers available in a given provider.

View File

@@ -378,3 +378,51 @@ def test_economy_fred_index(params, headers):
result = requests.get(url, headers=headers, timeout=10)
assert isinstance(result, requests.Response)
assert result.status_code == 200
@pytest.mark.parametrize(
"params",
[({'units': 'usd', 'start_date': '2023-01-01', 'end_date': '2023-06-06'}),
({'country': 'united_states', 'provider': 'oecd', 'units': 'usd', 'start_date': '2023-01-01', 'end_date': '2023-06-06'})],
)
@pytest.mark.integration
def test_economy_gdpnom(params, headers):
params = {p: v for p, v in params.items() if v}
query_str = get_querystring(params, [])
url = f"http://0.0.0.0:8000/api/v1/economy/gdpnom?{query_str}"
result = requests.get(url, headers=headers, timeout=10)
assert isinstance(result, requests.Response)
assert result.status_code == 200
@pytest.mark.parametrize(
"params",
[({'units': 'yoy', 'start_date': '2023-01-01', 'end_date': '2023-06-06'}),
({'country': 'united_states', 'provider': 'oecd', 'units': 'yoy', 'start_date': '2023-01-01', 'end_date': '2023-06-06'})],
)
@pytest.mark.integration
def test_economy_gdpreal(params, headers):
params = {p: v for p, v in params.items() if v}
query_str = get_querystring(params, [])
url = f"http://0.0.0.0:8000/api/v1/economy/gdpreal?{query_str}"
result = requests.get(url, headers=headers, timeout=10)
assert isinstance(result, requests.Response)
assert result.status_code == 200
@pytest.mark.parametrize(
"params",
[({'period': 'annual', 'start_date': '2023-01-01', 'end_date': '2023-06-06', 'type': 'real'}),
({'country': 'united_states', 'provider': 'oecd', 'period': 'annual', 'start_date': '2023-01-01', 'end_date': '2023-06-06', 'type': 'real'})],
)
@pytest.mark.integration
def test_economy_gdpforecast(params, headers):
params = {p: v for p, v in params.items() if v}
query_str = get_querystring(params, [])
url = f"http://0.0.0.0:8000/api/v1/economy/gdpforecast?{query_str}"
result = requests.get(url, headers=headers, timeout=10)
assert isinstance(result, requests.Response)
assert result.status_code == 200

View File

@@ -361,3 +361,57 @@ def test_economy_fred_index(params):
assert result
assert isinstance(result, OBBject)
assert len(result.results) > 0
@pytest.mark.parametrize(
"params",
[
({'units': 'usd', 'start_date': '2023-01-01', 'end_date': '2023-06-06'}),
({'country': 'united_states', 'provider': 'oecd', 'units': 'usd', 'start_date': '2023-01-01', 'end_date': '2023-06-06'}),
],
)
@pytest.mark.integration
def test_economy_gdpnom(params, obb):
params = {p: v for p, v in params.items() if v}
result = obb.economy.gdpnom(**params)
assert result
assert isinstance(result, OBBject)
assert len(result.results) > 0
@pytest.mark.parametrize(
"params",
[
({'units': 'yoy', 'start_date': '2023-01-01', 'end_date': '2023-06-06'}),
({'country': 'united_states', 'provider': 'oecd', 'units': 'yoy', 'start_date': '2023-01-01', 'end_date': '2023-06-06'}),
],
)
@pytest.mark.integration
def test_economy_gdpreal(params, obb):
params = {p: v for p, v in params.items() if v}
result = obb.economy.gdpreal(**params)
assert result
assert isinstance(result, OBBject)
assert len(result.results) > 0
@pytest.mark.parametrize(
"params",
[
({'period': 'annual', 'start_date': '2023-01-01', 'end_date': '2023-06-06', 'type': 'real'}),
({'country': 'united_states', 'provider': 'oecd', 'period': 'annual', 'start_date': '2023-01-01', 'end_date': '2023-06-06', 'type': 'real'}),
],
)
@pytest.mark.integration
def test_economy_gdpforecast(params, obb):
params = {p: v for p, v in params.items() if v}
result = obb.economy.gdpforecast(**params)
assert result
assert isinstance(result, OBBject)
assert len(result.results) > 0

View File

@@ -159,3 +159,36 @@ def fred_index(
) -> OBBject[BaseModel]:
"""Fred Historical."""
return OBBject(results=Query(**locals()).execute())
@router.command(model="GDPNom")
def gdpnom(
cc: CommandContext,
provider_choices: ProviderChoices,
standard_params: StandardParams,
extra_params: ExtraParams,
) -> OBBject[BaseModel]:
"""GDP Data."""
return OBBject(results=Query(**locals()).execute())
@router.command(model="GDPReal")
def gdpreal(
cc: CommandContext,
provider_choices: ProviderChoices,
standard_params: StandardParams,
extra_params: ExtraParams,
) -> OBBject[BaseModel]:
"""GDP Data."""
return OBBject(results=Query(**locals()).execute())
@router.command(model="GDPForecast")
def gdpforecast(
cc: CommandContext,
provider_choices: ProviderChoices,
standard_params: StandardParams,
extra_params: ExtraParams,
) -> OBBject[BaseModel]:
"""GDP Data."""
return OBBject(results=Query(**locals()).execute())

View File

@@ -9,25 +9,39 @@ class Extensions(Container):
"""
Routers:
/crypto
/econometrics
/economy
/fixedincome
/forex
/futures
/news
/qa
/stocks
/ta
Extensions:
- crypto@0.1.0a2
- econometrics@0.1.0a2
- economy@0.1.0a2
- fixedincome@0.1.0a2
- forex@0.1.0a2
- futures@0.1.0a2
- news@0.1.0a2
- openbb_charting@0.1.0a2
- qa@0.1.0a2
- stocks@0.1.0a2
- ta@0.1.0a2
- alpha_vantage@0.1.0a2
- benzinga@0.1.0a2
- cboe@0.1.0a2
- fmp@0.1.0a2
- fred@0.1.0a2
- intrinio@0.1.0a2
- polygon@0.1.0a2 """
- oecd@0.1.0a2
- polygon@0.1.0a2
- quandl@0.1.0a2
- yfinance@0.1.0a2 """
# fmt: on
def __repr__(self) -> str:
return self.__doc__ or ""
@@ -38,6 +52,12 @@ Extensions:
return crypto.ROUTER_crypto(command_runner=self._command_runner)
@property
def econometrics(self): # route = "/econometrics"
from . import econometrics
return econometrics.ROUTER_econometrics(command_runner=self._command_runner)
@property
def economy(self): # route = "/economy"
from . import economy
@@ -56,14 +76,32 @@ Extensions:
return forex.ROUTER_forex(command_runner=self._command_runner)
@property
def futures(self): # route = "/futures"
from . import futures
return futures.ROUTER_futures(command_runner=self._command_runner)
@property
def news(self): # route = "/news"
from . import news
return news.ROUTER_news(command_runner=self._command_runner)
@property
def qa(self): # route = "/qa"
from . import qa
return qa.ROUTER_qa(command_runner=self._command_runner)
@property
def stocks(self): # route = "/stocks"
from . import stocks
return stocks.ROUTER_stocks(command_runner=self._command_runner)
@property
def ta(self): # route = "/ta"
from . import ta
return ta.ROUTER_ta(command_runner=self._command_runner)

View File

@@ -1,15 +1,15 @@
### THIS FILE IS AUTO-GENERATED. DO NOT EDIT. ###
import datetime
from typing import List, Literal, Union
from typing import List, Literal, Optional, Union
import typing_extensions
from openbb_core.app.model.custom_parameter import OpenBBCustomParameter
from openbb_core.app.model.obbject import OBBject
from openbb_core.app.static.container import Container
from openbb_core.app.static.filters import filter_inputs
from openbb_provider.abstract.data import Data
from pydantic import validate_call
from typing_extensions import Annotated
class ROUTER_crypto(Container):
@@ -23,23 +23,23 @@ class ROUTER_crypto(Container):
@validate_call
def load(
self,
symbol: typing_extensions.Annotated[
symbol: Annotated[
Union[str, List[str]],
OpenBBCustomParameter(description="Symbol to get data for."),
],
start_date: typing_extensions.Annotated[
start_date: Annotated[
Union[datetime.date, None, str],
OpenBBCustomParameter(
description="Start date of the data, in YYYY-MM-DD format."
),
] = None,
end_date: typing_extensions.Annotated[
end_date: Annotated[
Union[datetime.date, None, str],
OpenBBCustomParameter(
description="End date of the data, in YYYY-MM-DD format."
),
] = None,
provider: Union[Literal["fmp", "polygon"], None] = None,
provider: Optional[Literal["fmp", "polygon", "yfinance"]] = None,
**kwargs
) -> OBBject[List[Data]]:
"""Crypto Historical Price.
@@ -48,18 +48,18 @@ class ROUTER_crypto(Container):
----------
symbol : str
Symbol to get data for.
start_date : Union[datetime.date, None]
start_date : Optional[datetime.date]
Start date of the data, in YYYY-MM-DD format.
end_date : Union[datetime.date, None]
end_date : Optional[datetime.date]
End date of the data, in YYYY-MM-DD format.
provider : Union[Literal['fmp', 'polygon'], None]
provider : Optional[Literal['fmp', 'polygon', '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
no default.
timeseries : Optional[Union[typing_extensions.Annotated[int, Ge(ge=0)]]]
timeseries : Optional[Annotated[int, Ge(ge=0)]]
Number of days to look back. (provider: fmp)
interval : Literal['1min', '5min', '15min', '30min', '1hour', '4hour', '1day']
Data granularity. (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)
multiplier : int
Multiplier of the timespan. (provider: polygon)
timespan : Literal['minute', 'hour', 'day', 'week', 'month', 'quarter', 'year']
@@ -70,13 +70,15 @@ class ROUTER_crypto(Container):
The number of data entries to return. (provider: polygon)
adjusted : bool
Whether the data is adjusted. (provider: polygon)
period : Optional[Literal['1d', '5d', '1mo', '3mo', '6mo', '1y', '2y', '5y', '10y', 'ytd', 'max']]
Period of the data to return. (provider: yfinance)
Returns
-------
OBBject
results : Union[List[CryptoHistorical]]
results : List[CryptoHistorical]
Serializable results.
provider : Union[Literal['fmp', 'polygon'], None]
provider : Optional[Literal['fmp', 'polygon', 'yfinance']]
Provider name.
warnings : Optional[List[Warning_]]
List of warnings.
@@ -99,21 +101,21 @@ class ROUTER_crypto(Container):
The close price of the symbol.
volume : float
The volume of the symbol.
vwap : Optional[Union[typing_extensions.Annotated[float, Gt(gt=0)]]]
vwap : Optional[Annotated[float, Gt(gt=0)]]
Volume Weighted Average Price of the symbol.
adj_close : Optional[Union[float]]
adj_close : Optional[float]
Adjusted Close Price of the symbol. (provider: fmp)
unadjusted_volume : Optional[Union[float]]
unadjusted_volume : Optional[float]
Unadjusted volume of the symbol. (provider: fmp)
change : Optional[Union[float]]
change : Optional[float]
Change in the price of the symbol from the previous day. (provider: fmp)
change_percent : Optional[Union[float]]
change_percent : Optional[float]
Change % in the price of the symbol. (provider: fmp)
label : Optional[Union[str]]
label : Optional[str]
Human readable format of the date. (provider: fmp)
change_over_time : Optional[Union[float]]
change_over_time : Optional[float]
Change % in the price of the symbol over a period of time. (provider: fmp)
transactions : Optional[Union[typing_extensions.Annotated[int, Gt(gt=0)]]]
transactions : Optional[Annotated[int, Gt(gt=0)]]
Number of transactions for the symbol in the time period. (provider: polygon)
""" # noqa: E501

View File

@@ -0,0 +1,514 @@
### THIS FILE IS AUTO-GENERATED. DO NOT EDIT. ###
from typing import Dict, List, Literal, Union
import pandas
from annotated_types import Gt
from openbb_core.app.model.obbject import OBBject
from openbb_core.app.static.container import Container
from openbb_core.app.static.filters import filter_inputs
from openbb_provider.abstract.data import Data
from pydantic import validate_call
from typing_extensions import Annotated
class ROUTER_econometrics(Container):
"""/econometrics
bgot
coint
corr
dwat
granger
ols
ols_summary
panelbols
panelfd
panelfmac
panelols
panelpols
panelre
unitroot
"""
def __repr__(self) -> str:
return self.__doc__ or ""
@validate_call(config=dict(arbitrary_types_allowed=True))
def bgot(
self,
data: Union[List[Data], pandas.DataFrame],
y_column: str,
x_columns: List[str],
lags: Annotated[int, Gt(gt=0)] = 1,
) -> OBBject[Data]:
"""Perform Breusch-Godfrey Lagrange Multiplier tests for residual autocorrelation.
Parameters
----------
data: List[Data]
Input dataset.
y_column: str
Target column.
x_columns: str
List of columns to use as exogenous variables.
lags: PositiveInt
Number of lags to use in the test.
Returns
-------
OBBject[Data]
OBBject with the results being the score from the test.
""" # noqa: E501
inputs = filter_inputs(
data=data,
y_column=y_column,
x_columns=x_columns,
lags=lags,
)
return self._run(
"/econometrics/bgot",
**inputs,
)
@validate_call(config=dict(arbitrary_types_allowed=True))
def coint(
self, data: Union[List[Data], pandas.DataFrame], columns: List[str]
) -> OBBject[Data]:
"""Show co-integration between two timeseries using the two step Engle-Granger test.
Parameters
----------
data: List[Data]
Input dataset.
columns: List[str]
Data columns to check cointegration
maxlag: PositiveInt
Number of lags to use in the test.
Returns
-------
OBBject[Data]
OBBject with the results being the score from the test.
""" # noqa: E501
inputs = filter_inputs(
data=data,
columns=columns,
)
return self._run(
"/econometrics/coint",
**inputs,
)
@validate_call(config=dict(arbitrary_types_allowed=True))
def corr(self, data: Union[List[Data], pandas.DataFrame]) -> OBBject[List[Data]]:
"""Get the corrlelation matrix of an input dataset.
Parameters
----------
data : List[Data]
Input dataset.
Returns
-------
OBBject[List[Data]]
Correlation matrix.
""" # noqa: E501
inputs = filter_inputs(
data=data,
)
return self._run(
"/econometrics/corr",
**inputs,
)
@validate_call(config=dict(arbitrary_types_allowed=True))
def dwat(
self,
data: Union[List[Data], pandas.DataFrame],
y_column: str,
x_columns: List[str],
) -> OBBject[Dict]:
"""Perform Durbin-Watson test for autocorrelation
Parameters
----------
data: List[Data]
Input dataset.
y_column: str
Target column.
x_columns: str
List of columns to use as exogenous variables.
Returns
-------
OBBject[Data]
OBBject with the results being the score from the test.
""" # noqa: E501
inputs = filter_inputs(
data=data,
y_column=y_column,
x_columns=x_columns,
)
return self._run(
"/econometrics/dwat",
**inputs,
)
@validate_call(config=dict(arbitrary_types_allowed=True))
def granger(
self,
data: Union[List[Data], pandas.DataFrame],
y_column: str,
x_column: str,
lag: Annotated[int, Gt(gt=0)] = 3,
) -> OBBject[Data]:
"""Perform Granger causality test to determine if X "causes" y.
Parameters
----------
data: List[Data]
Input dataset.
y_column: str
Target column.
x_column: str
Columns to use as exogenous variables.
lag: PositiveInt
Number of lags to use in the test.
Returns
-------
OBBject[Data]
OBBject with the results being the score from the test.
""" # noqa: E501
inputs = filter_inputs(
data=data,
y_column=y_column,
x_column=x_column,
lag=lag,
)
return self._run(
"/econometrics/granger",
**inputs,
)
@validate_call(config=dict(arbitrary_types_allowed=True))
def ols(
self,
data: Union[List[Data], pandas.DataFrame],
y_column: str,
x_columns: List[str],
) -> OBBject[Dict]:
"""Perform OLS regression. This returns the model and results objects from statsmodels.
Parameters
----------
data: List[Data]
Input dataset.
y_column: str
Target column.
x_columns: str
List of columns to use as exogenous variables.
Returns
-------
OBBject[Dict]
OBBject with the results being model and results objects.
""" # noqa: E501
inputs = filter_inputs(
data=data,
y_column=y_column,
x_columns=x_columns,
)
return self._run(
"/econometrics/ols",
**inputs,
)
@validate_call(config=dict(arbitrary_types_allowed=True))
def ols_summary(
self,
data: Union[List[Data], pandas.DataFrame],
y_column: str,
x_columns: List[str],
) -> OBBject[Data]:
"""Perform OLS regression. This returns the summary object from statsmodels.
Parameters
----------
data: List[Data]
Input dataset.
y_column: str
Target column.
x_columns: str
List of columns to use as exogenous variables.
Returns
-------
OBBject[Dict]
OBBject with the results being summary object.
""" # noqa: E501
inputs = filter_inputs(
data=data,
y_column=y_column,
x_columns=x_columns,
)
return self._run(
"/econometrics/ols_summary",
**inputs,
)
@validate_call(config=dict(arbitrary_types_allowed=True))
def panelbols(
self,
data: Union[List[Data], pandas.DataFrame],
y_column: str,
x_columns: List[str],
) -> OBBject[Dict]:
"""Perform a Between estimator regression on panel data
Parameters
----------
data: List[Data]
Input dataset.
y_column: str
Target column.
x_columns: str
List of columns to use as exogenous variables.
Returns
-------
OBBject[Dict]
OBBject with the fit model returned
""" # noqa: E501
inputs = filter_inputs(
data=data,
y_column=y_column,
x_columns=x_columns,
)
return self._run(
"/econometrics/panelbols",
**inputs,
)
@validate_call(config=dict(arbitrary_types_allowed=True))
def panelfd(
self,
data: Union[List[Data], pandas.DataFrame],
y_column: str,
x_columns: List[str],
) -> OBBject[Dict]:
"""Perform a first-difference estimate for panel data
Parameters
----------
data: List[Data]
Input dataset.
y_column: str
Target column.
x_columns: str
List of columns to use as exogenous variables.
Returns
-------
OBBject[Dict]
OBBject with the fit model returned
""" # noqa: E501
inputs = filter_inputs(
data=data,
y_column=y_column,
x_columns=x_columns,
)
return self._run(
"/econometrics/panelfd",
**inputs,
)
@validate_call(config=dict(arbitrary_types_allowed=True))
def panelfmac(
self,
data: Union[List[Data], pandas.DataFrame],
y_column: str,
x_columns: List[str],
) -> OBBject[Dict]:
"""Fama-MacBeth estimator for panel data
Parameters
----------
data: List[Data]
Input dataset.
y_column: str
Target column.
x_columns: str
List of columns to use as exogenous variables.
Returns
-------
OBBject[Dict]
OBBject with the fit model returned
""" # noqa: E501
inputs = filter_inputs(
data=data,
y_column=y_column,
x_columns=x_columns,
)
return self._run(
"/econometrics/panelfmac",
**inputs,
)
@validate_call(config=dict(arbitrary_types_allowed=True))
def panelols(
self,
data: Union[List[Data], pandas.DataFrame],
y_column: str,
x_columns: List[str],
) -> OBBject[Dict]:
"""One- and two-way fixed effects estimator for panel data
Parameters
----------
data: List[Data]
Input dataset.
y_column: str
Target column.
x_columns: str
List of columns to use as exogenous variables.
Returns
-------
OBBject[Dict]
OBBject with the fit model returned
""" # noqa: E501
inputs = filter_inputs(
data=data,
y_column=y_column,
x_columns=x_columns,
)
return self._run(
"/econometrics/panelols",
**inputs,
)
@validate_call(config=dict(arbitrary_types_allowed=True))
def panelpols(
self,
data: Union[List[Data], pandas.DataFrame],
y_column: str,
x_columns: List[str],
) -> OBBject[Dict]:
"""Perform a Pooled coefficvient estimator regression on panel data
Parameters
----------
data: List[Data]
Input dataset.
y_column: str
Target column.
x_columns: str
List of columns to use as exogenous variables.
Returns
-------
OBBject[Dict]
OBBject with the fit model returned
""" # noqa: E501
inputs = filter_inputs(
data=data,
y_column=y_column,
x_columns=x_columns,
)
return self._run(
"/econometrics/panelpols",
**inputs,
)
@validate_call(config=dict(arbitrary_types_allowed=True))
def panelre(
self,
data: Union[List[Data], pandas.DataFrame],
y_column: str,
x_columns: List[str],
) -> OBBject[Dict]:
"""Perform One-way Random Effects model for panel data
Parameters
----------
data: List[Data]
Input dataset.
y_column: str
Target column.
x_columns: str
List of columns to use as exogenous variables.
Returns
-------
OBBject[Dict]
OBBject with the fit model returned
""" # noqa: E501
inputs = filter_inputs(
data=data,
y_column=y_column,
x_columns=x_columns,
)
return self._run(
"/econometrics/panelre",
**inputs,
)
@validate_call(config=dict(arbitrary_types_allowed=True))
def unitroot(
self,
data: Union[List[Data], pandas.DataFrame],
column: str,
regression: Literal["c", "ct", "ctt"] = "c",
) -> OBBject[Data]:
"""Perform Augmented Dickey-Fuller unit root test.
Parameters
----------
data: List[Data]
Input dataset.
column: str
Data columns to check unit root
regression: str
Regression type to use in the test. Either "c" for constant only, "ct" for constant and trend, or "ctt" for
constant, trend, and trend-squared.
Returns
-------
OBBject[Data]
OBBject with the results being the score from the test.
""" # noqa: E501
inputs = filter_inputs(
data=data,
column=column,
regression=regression,
)
return self._run(
"/econometrics/unitroot",
**inputs,
)

File diff suppressed because it is too large Load Diff

View File

@@ -1,17 +1,27 @@
{
"openbb_core_extension": [
"crypto@0.1.0a2",
"econometrics@0.1.0a2",
"economy@0.1.0a2",
"fixedincome@0.1.0a2",
"forex@0.1.0a2",
"futures@0.1.0a2",
"news@0.1.0a2",
"stocks@0.1.0a2"
"openbb_charting@0.1.0a2",
"qa@0.1.0a2",
"stocks@0.1.0a2",
"ta@0.1.0a2"
],
"openbb_provider_extension": [
"alpha_vantage@0.1.0a2",
"benzinga@0.1.0a2",
"cboe@0.1.0a2",
"fmp@0.1.0a2",
"fred@0.1.0a2",
"intrinio@0.1.0a2",
"polygon@0.1.0a2"
"oecd@0.1.0a2",
"polygon@0.1.0a2",
"quandl@0.1.0a2",
"yfinance@0.1.0a2"
]
}

View File

@@ -1,15 +1,15 @@
### THIS FILE IS AUTO-GENERATED. DO NOT EDIT. ###
import datetime
from typing import List, Literal, Union
from typing import List, Literal, Optional, Union
import typing_extensions
from openbb_core.app.model.custom_parameter import OpenBBCustomParameter
from openbb_core.app.model.obbject import OBBject
from openbb_core.app.static.container import Container
from openbb_core.app.static.filters import filter_inputs
from openbb_provider.abstract.data import Data
from pydantic import validate_call
from typing_extensions import Annotated
class ROUTER_fixedincome(Container):
@@ -31,19 +31,19 @@ class ROUTER_fixedincome(Container):
@validate_call
def ameribor(
self,
start_date: typing_extensions.Annotated[
start_date: Annotated[
Union[datetime.date, None, str],
OpenBBCustomParameter(
description="Start date of the data, in YYYY-MM-DD format."
),
] = None,
end_date: typing_extensions.Annotated[
end_date: Annotated[
Union[datetime.date, None, str],
OpenBBCustomParameter(
description="End date of the data, in YYYY-MM-DD format."
),
] = None,
provider: Union[Literal["fred"], None] = None,
provider: Optional[Literal["fred"]] = None,
**kwargs
) -> OBBject[List[Data]]:
"""
@@ -53,11 +53,11 @@ class ROUTER_fixedincome(Container):
Parameters
----------
start_date : Union[datetime.date, None]
start_date : Optional[datetime.date]
Start date of the data, in YYYY-MM-DD format.
end_date : Union[datetime.date, None]
end_date : Optional[datetime.date]
End date of the data, in YYYY-MM-DD format.
provider : Union[Literal['fred'], None]
provider : Optional[Literal['fred']]
The provider to use for the query, by default None.
If None, the provider specified in defaults is selected or 'fred' if there is
no default.
@@ -67,9 +67,9 @@ class ROUTER_fixedincome(Container):
Returns
-------
OBBject
results : Union[List[AMERIBOR]]
results : List[AMERIBOR]
Serializable results.
provider : Union[Literal['fred'], None]
provider : Optional[Literal['fred']]
Provider name.
warnings : Optional[List[Warning_]]
List of warnings.
@@ -82,7 +82,7 @@ class ROUTER_fixedincome(Container):
--------
date : date
The date of the data.
rate : Union[float]
rate : Optional[float]
AMERIBOR rate.""" # noqa: E501
inputs = filter_inputs(
@@ -104,19 +104,19 @@ class ROUTER_fixedincome(Container):
@validate_call
def estr(
self,
start_date: typing_extensions.Annotated[
start_date: Annotated[
Union[datetime.date, None, str],
OpenBBCustomParameter(
description="Start date of the data, in YYYY-MM-DD format."
),
] = None,
end_date: typing_extensions.Annotated[
end_date: Annotated[
Union[datetime.date, None, str],
OpenBBCustomParameter(
description="End date of the data, in YYYY-MM-DD format."
),
] = None,
provider: Union[Literal["fred"], None] = None,
provider: Optional[Literal["fred"]] = None,
**kwargs
) -> OBBject[List[Data]]:
"""
@@ -127,11 +127,11 @@ class ROUTER_fixedincome(Container):
Parameters
----------
start_date : Union[datetime.date, None]
start_date : Optional[datetime.date]
Start date of the data, in YYYY-MM-DD format.
end_date : Union[datetime.date, None]
end_date : Optional[datetime.date]
End date of the data, in YYYY-MM-DD format.
provider : Union[Literal['fred'], None]
provider : Optional[Literal['fred']]
The provider to use for the query, by default None.
If None, the provider specified in defaults is selected or 'fred' if there is
no default.
@@ -141,9 +141,9 @@ class ROUTER_fixedincome(Container):
Returns
-------
OBBject
results : Union[List[ESTR]]
results : List[ESTR]
Serializable results.
provider : Union[Literal['fred'], None]
provider : Optional[Literal['fred']]
Provider name.
warnings : Optional[List[Warning_]]
List of warnings.
@@ -156,7 +156,7 @@ class ROUTER_fixedincome(Container):
----
date : date
The date of the data.
rate : Union[float]
rate : Optional[float]
ESTR rate.""" # noqa: E501
inputs = filter_inputs(
@@ -178,19 +178,19 @@ class ROUTER_fixedincome(Container):
@validate_call
def fed(
self,
start_date: typing_extensions.Annotated[
start_date: Annotated[
Union[datetime.date, None, str],
OpenBBCustomParameter(
description="Start date of the data, in YYYY-MM-DD format."
),
] = None,
end_date: typing_extensions.Annotated[
end_date: Annotated[
Union[datetime.date, None, str],
OpenBBCustomParameter(
description="End date of the data, in YYYY-MM-DD format."
),
] = None,
provider: Union[Literal["fred"], None] = None,
provider: Optional[Literal["fred"]] = None,
**kwargs
) -> OBBject[List[Data]]:
"""
@@ -201,11 +201,11 @@ class ROUTER_fixedincome(Container):
Parameters
----------
start_date : Union[datetime.date, None]
start_date : Optional[datetime.date]
Start date of the data, in YYYY-MM-DD format.
end_date : Union[datetime.date, None]
end_date : Optional[datetime.date]
End date of the data, in YYYY-MM-DD format.
provider : Union[Literal['fred'], None]
provider : Optional[Literal['fred']]
The provider to use for the query, by default None.
If None, the provider specified in defaults is selected or 'fred' if there is
no default.
@@ -215,9 +215,9 @@ class ROUTER_fixedincome(Container):
Returns
-------
OBBject
results : Union[List[FEDFUNDS]]
results : List[FEDFUNDS]
Serializable results.
provider : Union[Literal['fred'], None]
provider : Optional[Literal['fred']]
Provider name.
warnings : Optional[List[Warning_]]
List of warnings.
@@ -230,7 +230,7 @@ class ROUTER_fixedincome(Container):
--------
date : date
The date of the data.
rate : Union[float]
rate : Optional[float]
FED rate.""" # noqa: E501
inputs = filter_inputs(
@@ -252,19 +252,19 @@ class ROUTER_fixedincome(Container):
@validate_call
def iorb(
self,
start_date: typing_extensions.Annotated[
start_date: Annotated[
Union[datetime.date, None, str],
OpenBBCustomParameter(
description="Start date of the data, in YYYY-MM-DD format."
),
] = None,
end_date: typing_extensions.Annotated[
end_date: Annotated[
Union[datetime.date, None, str],
OpenBBCustomParameter(
description="End date of the data, in YYYY-MM-DD format."
),
] = None,
provider: Union[Literal["fred"], None] = None,
provider: Optional[Literal["fred"]] = None,
**kwargs
) -> OBBject[List[Data]]:
"""
@@ -275,11 +275,11 @@ class ROUTER_fixedincome(Container):
Parameters
----------
start_date : Union[datetime.date, None]
start_date : Optional[datetime.date]
Start date of the data, in YYYY-MM-DD format.
end_date : Union[datetime.date, None]
end_date : Optional[datetime.date]
End date of the data, in YYYY-MM-DD format.
provider : Union[Literal['fred'], None]
provider : Optional[Literal['fred']]
The provider to use for the query, by default None.
If None, the provider specified in defaults is selected or 'fred' if there is
no default.
@@ -287,9 +287,9 @@ class ROUTER_fixedincome(Container):
Returns
-------
OBBject
results : Union[List[IORB]]
results : List[IORB]
Serializable results.
provider : Union[Literal['fred'], None]
provider : Optional[Literal['fred']]
Provider name.
warnings : Optional[List[Warning_]]
List of warnings.
@@ -302,7 +302,7 @@ class ROUTER_fixedincome(Container):
----
date : date
The date of the data.
rate : Union[float]
rate : Optional[float]
IORB rate.""" # noqa: E501
inputs = filter_inputs(
@@ -323,7 +323,7 @@ class ROUTER_fixedincome(Container):
@validate_call
def projections(
self, provider: Union[Literal["fred"], None] = None, **kwargs
self, provider: Optional[Literal["fred"]] = None, **kwargs
) -> OBBject[List[Data]]:
"""
Get Effective Federal Funds Rate data. A bank rate is the interest rate a nation's central bank charges to its
@@ -333,7 +333,7 @@ class ROUTER_fixedincome(Container):
Parameters
----------
provider : Union[Literal['fred'], None]
provider : Optional[Literal['fred']]
The provider to use for the query, by default None.
If None, the provider specified in defaults is selected or 'fred' if there is
no default.
@@ -343,9 +343,9 @@ class ROUTER_fixedincome(Container):
Returns
-------
OBBject
results : Union[List[PROJECTIONS]]
results : List[PROJECTIONS]
Serializable results.
provider : Union[Literal['fred'], None]
provider : Optional[Literal['fred']]
Provider name.
warnings : Optional[List[Warning_]]
List of warnings.
@@ -358,19 +358,19 @@ class ROUTER_fixedincome(Container):
-----------
date : date
The date of the data.
range_high : Union[float]
range_high : Optional[float]
High projection of rates.
central_tendency_high : Union[float]
central_tendency_high : Optional[float]
Central tendency of high projection of rates.
median : Union[float]
median : Optional[float]
Median projection of rates.
range_midpoint : Union[float]
range_midpoint : Optional[float]
Midpoint projection of rates.
central_tendency_midpoint : Union[float]
central_tendency_midpoint : Optional[float]
Central tendency of midpoint projection of rates.
range_low : Union[float]
range_low : Optional[float]
Low projection of rates.
central_tendency_low : Union[float]
central_tendency_low : Optional[float]
Central tendency of low projection of rates.""" # noqa: E501
inputs = filter_inputs(
@@ -389,30 +389,30 @@ class ROUTER_fixedincome(Container):
@validate_call
def sofr(
self,
start_date: typing_extensions.Annotated[
start_date: Annotated[
Union[datetime.date, None, str],
OpenBBCustomParameter(
description="Start date of the data, in YYYY-MM-DD format."
),
] = None,
end_date: typing_extensions.Annotated[
end_date: Annotated[
Union[datetime.date, None, str],
OpenBBCustomParameter(
description="End date of the data, in YYYY-MM-DD format."
),
] = None,
provider: Union[Literal["fred"], None] = None,
provider: Optional[Literal["fred"]] = None,
**kwargs
) -> OBBject[List[Data]]:
"""Get United States yield curve.
Parameters
----------
start_date : Union[datetime.date, None]
start_date : Optional[datetime.date]
Start date of the data, in YYYY-MM-DD format.
end_date : Union[datetime.date, None]
end_date : Optional[datetime.date]
End date of the data, in YYYY-MM-DD format.
provider : Union[Literal['fred'], None]
provider : Optional[Literal['fred']]
The provider to use for the query, by default None.
If None, the provider specified in defaults is selected or 'fred' if there is
no default.
@@ -422,9 +422,9 @@ class ROUTER_fixedincome(Container):
Returns
-------
OBBject
results : Union[List[SOFR]]
results : List[SOFR]
Serializable results.
provider : Union[Literal['fred'], None]
provider : Optional[Literal['fred']]
Provider name.
warnings : Optional[List[Warning_]]
List of warnings.
@@ -437,7 +437,7 @@ class ROUTER_fixedincome(Container):
----
date : date
The date of the data.
rate : Union[float]
rate : Optional[float]
SOFR rate.""" # noqa: E501
inputs = filter_inputs(
@@ -459,19 +459,19 @@ class ROUTER_fixedincome(Container):
@validate_call
def sonia(
self,
start_date: typing_extensions.Annotated[
start_date: Annotated[
Union[datetime.date, None, str],
OpenBBCustomParameter(
description="Start date of the data, in YYYY-MM-DD format."
),
] = None,
end_date: typing_extensions.Annotated[
end_date: Annotated[
Union[datetime.date, None, str],
OpenBBCustomParameter(
description="End date of the data, in YYYY-MM-DD format."
),
] = None,
provider: Union[Literal["fred"], None] = None,
provider: Optional[Literal["fred"]] = None,
**kwargs
) -> OBBject[List[Data]]:
"""
@@ -481,11 +481,11 @@ class ROUTER_fixedincome(Container):
Parameters
----------
start_date : Union[datetime.date, None]
start_date : Optional[datetime.date]
Start date of the data, in YYYY-MM-DD format.
end_date : Union[datetime.date, None]
end_date : Optional[datetime.date]
End date of the data, in YYYY-MM-DD format.
provider : Union[Literal['fred'], None]
provider : Optional[Literal['fred']]
The provider to use for the query, by default None.
If None, the provider specified in defaults is selected or 'fred' if there is
no default.
@@ -495,9 +495,9 @@ class ROUTER_fixedincome(Container):
Returns
-------
OBBject
results : Union[List[SONIA]]
results : List[SONIA]
Serializable results.
provider : Union[Literal['fred'], None]
provider : Optional[Literal['fred']]
Provider name.
warnings : Optional[List[Warning_]]
List of warnings.
@@ -510,7 +510,7 @@ class ROUTER_fixedincome(Container):
-----
date : date
The date of the data.
rate : Union[float]
rate : Optional[float]
SONIA rate.""" # noqa: E501
inputs = filter_inputs(
@@ -532,30 +532,30 @@ class ROUTER_fixedincome(Container):
@validate_call
def treasury(
self,
start_date: typing_extensions.Annotated[
start_date: Annotated[
Union[datetime.date, None, str],
OpenBBCustomParameter(
description="Start date of the data, in YYYY-MM-DD format."
),
] = None,
end_date: typing_extensions.Annotated[
end_date: Annotated[
Union[datetime.date, None, str],
OpenBBCustomParameter(
description="End date of the data, in YYYY-MM-DD format."
),
] = None,
provider: Union[Literal["fmp"], None] = None,
provider: Optional[Literal["fmp"]] = None,
**kwargs
) -> OBBject[List[Data]]:
"""Get treasury rates.
Parameters
----------
start_date : Union[datetime.date, None]
start_date : Optional[datetime.date]
Start date of the data, in YYYY-MM-DD format.
end_date : Union[datetime.date, None]
end_date : Optional[datetime.date]
End date of the data, in YYYY-MM-DD format.
provider : Union[Literal['fmp'], None]
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
no default.
@@ -563,9 +563,9 @@ class ROUTER_fixedincome(Container):
Returns
-------
OBBject
results : Union[List[TreasuryRates]]
results : List[TreasuryRates]
Serializable results.
provider : Union[Literal['fmp'], None]
provider : Optional[Literal['fmp']]
Provider name.
warnings : Optional[List[Warning_]]
List of warnings.
@@ -622,28 +622,28 @@ class ROUTER_fixedincome(Container):
@validate_call
def ycrv(
self,
date: typing_extensions.Annotated[
Union[datetime.date, None],
date: Annotated[
Optional[datetime.date],
OpenBBCustomParameter(
description="Date to get Yield Curve data. Defaults to the most recent FRED entry."
),
] = None,
inflation_adjusted: typing_extensions.Annotated[
Union[bool, None],
inflation_adjusted: Annotated[
Optional[bool],
OpenBBCustomParameter(description="Get inflation adjusted rates."),
] = False,
provider: Union[Literal["fred"], None] = None,
provider: Optional[Literal["fred"]] = None,
**kwargs
) -> OBBject[List[Data]]:
"""Get United States yield curve.
Parameters
----------
date : Union[datetime.date, None]
date : Optional[datetime.date]
Date to get Yield Curve data. Defaults to the most recent FRED entry.
inflation_adjusted : Union[bool, None]
inflation_adjusted : Optional[bool]
Get inflation adjusted rates.
provider : Union[Literal['fred'], None]
provider : Optional[Literal['fred']]
The provider to use for the query, by default None.
If None, the provider specified in defaults is selected or 'fred' if there is
no default.
@@ -651,9 +651,9 @@ class ROUTER_fixedincome(Container):
Returns
-------
OBBject
results : Union[List[USYieldCurve]]
results : List[USYieldCurve]
Serializable results.
provider : Union[Literal['fred'], None]
provider : Optional[Literal['fred']]
Provider name.
warnings : Optional[List[Warning_]]
List of warnings.

View File

@@ -1,15 +1,15 @@
### THIS FILE IS AUTO-GENERATED. DO NOT EDIT. ###
import datetime
from typing import List, Literal, Union
from typing import List, Literal, Optional, Union
import typing_extensions
from openbb_core.app.model.custom_parameter import OpenBBCustomParameter
from openbb_core.app.model.obbject import OBBject
from openbb_core.app.static.container import Container
from openbb_core.app.static.filters import filter_inputs
from openbb_provider.abstract.data import Data
from pydantic import validate_call
from typing_extensions import Annotated
class ROUTER_forex(Container):
@@ -24,23 +24,23 @@ class ROUTER_forex(Container):
@validate_call
def load(
self,
symbol: typing_extensions.Annotated[
symbol: Annotated[
Union[str, List[str]],
OpenBBCustomParameter(description="Symbol to get data for."),
],
start_date: typing_extensions.Annotated[
start_date: Annotated[
Union[datetime.date, None, str],
OpenBBCustomParameter(
description="Start date of the data, in YYYY-MM-DD format."
),
] = None,
end_date: typing_extensions.Annotated[
end_date: Annotated[
Union[datetime.date, None, str],
OpenBBCustomParameter(
description="End date of the data, in YYYY-MM-DD format."
),
] = None,
provider: Union[Literal["fmp", "polygon"], None] = None,
provider: Optional[Literal["fmp", "polygon", "yfinance"]] = None,
**kwargs
) -> OBBject[List[Data]]:
"""Forex Intraday Price.
@@ -49,16 +49,16 @@ class ROUTER_forex(Container):
----------
symbol : str
Symbol to get data for.
start_date : Union[datetime.date, None]
start_date : Optional[datetime.date]
Start date of the data, in YYYY-MM-DD format.
end_date : Union[datetime.date, None]
end_date : Optional[datetime.date]
End date of the data, in YYYY-MM-DD format.
provider : Union[Literal['fmp', 'polygon'], None]
provider : Optional[Literal['fmp', 'polygon', '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
no default.
interval : Literal['1min', '5min', '15min', '30min', '1hour', '4hour', '1day']
Data granularity. (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)
multiplier : int
Multiplier of the timespan. (provider: polygon)
timespan : Literal['minute', 'hour', 'day', 'week', 'month', 'quarter', 'year']
@@ -69,13 +69,15 @@ class ROUTER_forex(Container):
The number of data entries to return. (provider: polygon)
adjusted : bool
Whether the data is adjusted. (provider: polygon)
period : Optional[Literal['1d', '5d', '1mo', '3mo', '6mo', '1y', '2y', '5y', '10y', 'ytd', 'max']]
Period of the data to return. (provider: yfinance)
Returns
-------
OBBject
results : Union[List[ForexHistorical]]
results : List[ForexHistorical]
Serializable results.
provider : Union[Literal['fmp', 'polygon'], None]
provider : Optional[Literal['fmp', 'polygon', 'yfinance']]
Provider name.
warnings : Optional[List[Warning_]]
List of warnings.
@@ -98,21 +100,21 @@ class ROUTER_forex(Container):
The close price of the symbol.
volume : float
The volume of the symbol.
vwap : Optional[Union[typing_extensions.Annotated[float, Gt(gt=0)]]]
vwap : Optional[Annotated[float, Gt(gt=0)]]
Volume Weighted Average Price of the symbol.
adj_close : Optional[Union[float]]
adj_close : Optional[float]
Adjusted Close Price of the symbol. (provider: fmp)
unadjusted_volume : Optional[Union[float]]
unadjusted_volume : Optional[float]
Unadjusted volume of the symbol. (provider: fmp)
change : Optional[Union[float]]
change : Optional[float]
Change in the price of the symbol from the previous day. (provider: fmp)
change_percent : Optional[Union[float]]
change_percent : Optional[float]
Change % in the price of the symbol. (provider: fmp)
label : Optional[Union[str]]
label : Optional[str]
Human readable format of the date. (provider: fmp)
change_over_time : Optional[Union[float]]
change_over_time : Optional[float]
Change % in the price of the symbol over a period of time. (provider: fmp)
transactions : Optional[Union[typing_extensions.Annotated[int, Gt(gt=0)]]]
transactions : Optional[Annotated[int, Gt(gt=0)]]
Number of transactions for the symbol in the time period. (provider: polygon)
""" # noqa: E501
@@ -135,39 +137,37 @@ class ROUTER_forex(Container):
@validate_call
def pairs(
self,
provider: Union[Literal["fmp", "intrinio", "polygon"], None] = None,
**kwargs
self, provider: Optional[Literal["fmp", "intrinio", "polygon"]] = None, **kwargs
) -> OBBject[List[Data]]:
"""Forex Available Pairs.
Parameters
----------
provider : Union[Literal['fmp', 'intrinio', 'polygon'], None]
provider : Optional[Literal['fmp', 'intrinio', 'polygon']]
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.
symbol : Optional[Union[str]]
symbol : Optional[str]
Symbol of the pair to search. (provider: polygon)
date : Optional[Union[datetime.date]]
date : Optional[datetime.date]
A specific date to get data for. (provider: polygon)
search : Optional[Union[str]]
search : Optional[str]
Search for terms within the ticker and/or company name. (provider: polygon)
active : Optional[Union[bool]]
active : Optional[bool]
Specify if the tickers returned should be actively traded on the queried date. (provider: polygon)
order : Optional[Union[Literal['asc', 'desc']]]
order : Optional[Literal['asc', 'desc']]
Order data by ascending or descending. (provider: polygon)
sort : Optional[Union[Literal['ticker', 'name', 'market', 'locale', 'currency_symbol', 'currency_name', 'base_currency_symbol', 'base_currency_name', 'last_updated_utc', 'delisted_utc']]]
sort : Optional[Literal['ticker', 'name', 'market', 'locale', 'currency_symbol', 'currency_name', 'base_currency_symbol', 'base_currency_name', 'last_updated_utc', 'delisted_utc']]
Sort field used for ordering. (provider: polygon)
limit : Optional[Union[typing_extensions.Annotated[int, Gt(gt=0)]]]
limit : Optional[Annotated[int, Gt(gt=0)]]
The number of data entries to return. (provider: polygon)
Returns
-------
OBBject
results : Union[List[ForexPairs]]
results : List[ForexPairs]
Serializable results.
provider : Union[Literal['fmp', 'intrinio', 'polygon'], None]
provider : Optional[Literal['fmp', 'intrinio', 'polygon']]
Provider name.
warnings : Optional[List[Warning_]]
List of warnings.
@@ -180,35 +180,35 @@ class ROUTER_forex(Container):
----------
name : str
Name of the currency pair.
symbol : Optional[Union[str]]
symbol : Optional[str]
Symbol of the currency pair. (provider: fmp)
currency : Optional[Union[str]]
currency : Optional[str]
Base currency of the currency pair. (provider: fmp)
stock_exchange : Optional[Union[str]]
stock_exchange : Optional[str]
Stock exchange of the currency pair. (provider: fmp)
exchange_short_name : Optional[Union[str]]
exchange_short_name : Optional[str]
Short name of the stock exchange of the currency pair. (provider: fmp)
code : Optional[Union[str]]
code : Optional[str]
Code of the currency pair. (provider: intrinio)
base_currency : Optional[Union[str]]
base_currency : Optional[str]
ISO 4217 currency code of the base currency. (provider: intrinio)
quote_currency : Optional[Union[str]]
quote_currency : Optional[str]
ISO 4217 currency code of the quote currency. (provider: intrinio)
market : Optional[Union[str]]
market : Optional[str]
Name of the trading market. Always 'fx'. (provider: polygon)
locale : Optional[Union[str]]
locale : Optional[str]
Locale of the currency pair. (provider: polygon)
currency_symbol : Optional[Union[str]]
currency_symbol : Optional[str]
The symbol of the quote currency. (provider: polygon)
currency_name : Optional[Union[str]]
currency_name : Optional[str]
Name of the quote currency. (provider: polygon)
base_currency_symbol : Optional[Union[str]]
base_currency_symbol : Optional[str]
The symbol of the base currency. (provider: polygon)
base_currency_name : Optional[Union[str]]
base_currency_name : Optional[str]
Name of the base currency. (provider: polygon)
last_updated_utc : Optional[Union[datetime]]
last_updated_utc : Optional[datetime]
The last updated timestamp in UTC. (provider: polygon)
delisted_utc : Optional[Union[datetime]]
delisted_utc : Optional[datetime]
The delisted timestamp in UTC. (provider: polygon)""" # noqa: E501
inputs = filter_inputs(

View File

@@ -0,0 +1,188 @@
### THIS FILE IS AUTO-GENERATED. DO NOT EDIT. ###
import datetime
from typing import List, Literal, Optional, Union
from openbb_core.app.model.custom_parameter import OpenBBCustomParameter
from openbb_core.app.model.obbject import OBBject
from openbb_core.app.static.container import Container
from openbb_core.app.static.filters import filter_inputs
from openbb_provider.abstract.data import Data
from pydantic import validate_call
from typing_extensions import Annotated
class ROUTER_futures(Container):
"""/futures
curve
load
"""
def __repr__(self) -> str:
return self.__doc__ or ""
@validate_call
def curve(
self,
symbol: Annotated[
Union[str, List[str]],
OpenBBCustomParameter(description="Symbol to get data for."),
],
date: Annotated[
Optional[datetime.date],
OpenBBCustomParameter(description="Historical date to search curve for."),
] = None,
provider: Optional[Literal["cboe", "yfinance"]] = None,
**kwargs
) -> OBBject[List[Data]]:
"""Futures Historical Price.
Parameters
----------
symbol : str
Symbol to get data for.
date : Optional[datetime.date]
Historical date to search curve for.
provider : Optional[Literal['cboe', 'yfinance']]
The provider to use for the query, by default None.
If None, the provider specified in defaults is selected or 'cboe' if there is
no default.
Returns
-------
OBBject
results : List[FuturesCurve]
Serializable results.
provider : Optional[Literal['cboe', 'yfinance']]
Provider name.
warnings : Optional[List[Warning_]]
List of warnings.
chart : Optional[Chart]
Chart object.
extra: Dict[str, Any]
Extra info.
FuturesCurve
------------
expiration : str
Futures expiration month.
price : Optional[float]
The close price of the symbol.
symbol : Optional[str]
The trading symbol for the tenor of future. (provider: cboe)""" # noqa: E501
inputs = filter_inputs(
provider_choices={
"provider": provider,
},
standard_params={
"symbol": ",".join(symbol) if isinstance(symbol, list) else symbol,
"date": date,
},
extra_params=kwargs,
)
return self._run(
"/futures/curve",
**inputs,
)
@validate_call
def load(
self,
symbol: Annotated[
Union[str, List[str]],
OpenBBCustomParameter(description="Symbol to get data for."),
],
start_date: Annotated[
Union[datetime.date, None, str],
OpenBBCustomParameter(
description="Start date of the data, in YYYY-MM-DD format."
),
] = None,
end_date: Annotated[
Union[datetime.date, None, str],
OpenBBCustomParameter(
description="End date of the data, in YYYY-MM-DD format."
),
] = None,
expiration: Annotated[
Optional[str],
OpenBBCustomParameter(description="Future expiry date with format YYYY-MM"),
] = None,
provider: Optional[Literal["yfinance"]] = None,
**kwargs
) -> OBBject[List[Data]]:
"""Futures Historical Price.
Parameters
----------
symbol : str
Symbol to get data for.
start_date : Optional[datetime.date]
Start date of the data, in YYYY-MM-DD format.
end_date : Optional[datetime.date]
End date of the data, in YYYY-MM-DD format.
expiration : Optional[str]
Future expiry date with format YYYY-MM
provider : Optional[Literal['yfinance']]
The provider to use for the query, by default None.
If None, the provider specified in defaults is selected or 'yfinance' if there is
no default.
interval : Optional[Literal['1m', '2m', '5m', '15m', '30m', '60m', '90m', '1h', '1d', '5d', '1wk', '1mo', '3mo']]
Data granularity. (provider: yfinance)
period : Optional[Literal['1d', '5d', '1mo', '3mo', '6mo', '1y', '2y', '5y', '10y', 'ytd', 'max']]
Period of the data to return. (provider: yfinance)
prepost : bool
Include Pre and Post market data. (provider: yfinance)
adjust : bool
Adjust all the data automatically. (provider: yfinance)
back_adjust : bool
Back-adjusted data to mimic true historical prices. (provider: yfinance)
Returns
-------
OBBject
results : List[FuturesHistorical]
Serializable results.
provider : Optional[Literal['yfinance']]
Provider name.
warnings : Optional[List[Warning_]]
List of warnings.
chart : Optional[Chart]
Chart object.
extra: Dict[str, Any]
Extra info.
FuturesHistorical
-----------------
date : datetime
The date of the data.
open : float
The open price of the symbol.
high : float
The high price of the symbol.
low : float
The low price of the symbol.
close : float
The close price of the symbol.
volume : float
The volume of the symbol.""" # noqa: E501
inputs = filter_inputs(
provider_choices={
"provider": provider,
},
standard_params={
"symbol": ",".join(symbol) if isinstance(symbol, list) else symbol,
"start_date": start_date,
"end_date": end_date,
"expiration": expiration,
},
extra_params=kwargs,
)
return self._run(
"/futures/load",
**inputs,
)

View File

@@ -2,13 +2,38 @@
"__extensions__": "",
"crypto": "/crypto",
"crypto_load": "/crypto/load",
"econometrics": "/econometrics",
"econometrics_bgot": "/econometrics/bgot",
"econometrics_coint": "/econometrics/coint",
"econometrics_corr": "/econometrics/corr",
"econometrics_dwat": "/econometrics/dwat",
"econometrics_granger": "/econometrics/granger",
"econometrics_ols": "/econometrics/ols",
"econometrics_ols_summary": "/econometrics/ols_summary",
"econometrics_panelbols": "/econometrics/panelbols",
"econometrics_panelfd": "/econometrics/panelfd",
"econometrics_panelfmac": "/econometrics/panelfmac",
"econometrics_panelols": "/econometrics/panelols",
"econometrics_panelpols": "/econometrics/panelpols",
"econometrics_panelre": "/econometrics/panelre",
"econometrics_unitroot": "/econometrics/unitroot",
"economy": "/economy",
"economy_available_indices": "/economy/available_indices",
"economy_const": "/economy/const",
"economy_cot": "/economy/cot",
"economy_cot_search": "/economy/cot_search",
"economy_cpi": "/economy/cpi",
"economy_european_index": "/economy/european_index",
"economy_european_index_constituents": "/economy/european_index_constituents",
"economy_fred_index": "/economy/fred_index",
"economy_gdpforecast": "/economy/gdpforecast",
"economy_gdpnom": "/economy/gdpnom",
"economy_gdpreal": "/economy/gdpreal",
"economy_index": "/economy/index",
"economy_index_search": "/economy/index_search",
"economy_index_snapshots": "/economy/index_snapshots",
"economy_risk": "/economy/risk",
"economy_sp500_multiples": "/economy/sp500_multiples",
"fixedincome": "/fixedincome",
"fixedincome_ameribor": "/fixedincome/ameribor",
"fixedincome_estr": "/fixedincome/estr",
@@ -22,8 +47,22 @@
"forex": "/forex",
"forex_load": "/forex/load",
"forex_pairs": "/forex/pairs",
"futures": "/futures",
"futures_curve": "/futures/curve",
"futures_load": "/futures/load",
"news": "/news",
"news_globalnews": "/news/globalnews",
"qa": "/qa",
"qa_capm": "/qa/capm",
"qa_kurtosis": "/qa/kurtosis",
"qa_normality": "/qa/normality",
"qa_om": "/qa/om",
"qa_quantile": "/qa/quantile",
"qa_sh": "/qa/sh",
"qa_skew": "/qa/skew",
"qa_so": "/qa/so",
"qa_summary": "/qa/summary",
"qa_unitroot": "/qa/unitroot",
"stocks": "/stocks",
"stocks_ca": "/stocks/ca",
"stocks_ca_peers": "/stocks/ca/peers",
@@ -56,10 +95,39 @@
"stocks_fa_shrs": "/stocks/fa/shrs",
"stocks_fa_split": "/stocks/fa/split",
"stocks_fa_transcript": "/stocks/fa/transcript",
"stocks_info": "/stocks/info",
"stocks_load": "/stocks/load",
"stocks_multiples": "/stocks/multiples",
"stocks_news": "/stocks/news",
"stocks_options": "/stocks/options",
"stocks_options_chains": "/stocks/options/chains",
"stocks_quote": "/stocks/quote"
"stocks_quote": "/stocks/quote",
"stocks_search": "/stocks/search",
"ta": "/ta",
"ta_ad": "/ta/ad",
"ta_adosc": "/ta/adosc",
"ta_adx": "/ta/adx",
"ta_aroon": "/ta/aroon",
"ta_atr": "/ta/atr",
"ta_bbands": "/ta/bbands",
"ta_cci": "/ta/cci",
"ta_cg": "/ta/cg",
"ta_clenow": "/ta/clenow",
"ta_cones": "/ta/cones",
"ta_demark": "/ta/demark",
"ta_donchian": "/ta/donchian",
"ta_ema": "/ta/ema",
"ta_fib": "/ta/fib",
"ta_fisher": "/ta/fisher",
"ta_hma": "/ta/hma",
"ta_ichimoku": "/ta/ichimoku",
"ta_kc": "/ta/kc",
"ta_macd": "/ta/macd",
"ta_obv": "/ta/obv",
"ta_rsi": "/ta/rsi",
"ta_sma": "/ta/sma",
"ta_stoch": "/ta/stoch",
"ta_vwap": "/ta/vwap",
"ta_wma": "/ta/wma",
"ta_zlma": "/ta/zlma"
}

View File

@@ -1,14 +1,14 @@
### THIS FILE IS AUTO-GENERATED. DO NOT EDIT. ###
from typing import List, Literal, Union
from typing import List, Literal, Optional
import typing_extensions
from openbb_core.app.model.custom_parameter import OpenBBCustomParameter
from openbb_core.app.model.obbject import OBBject
from openbb_core.app.static.container import Container
from openbb_core.app.static.filters import filter_inputs
from openbb_provider.abstract.data import Data
from pydantic import validate_call
from typing_extensions import Annotated
class ROUTER_news(Container):
@@ -22,10 +22,10 @@ class ROUTER_news(Container):
@validate_call
def globalnews(
self,
limit: typing_extensions.Annotated[
limit: Annotated[
int, OpenBBCustomParameter(description="Number of articles to return.")
] = 20,
provider: Union[Literal["benzinga", "fmp", "intrinio"], None] = None,
provider: Optional[Literal["benzinga", "fmp", "intrinio"]] = None,
**kwargs
) -> OBBject[List[Data]]:
"""Global News.
@@ -34,45 +34,45 @@ class ROUTER_news(Container):
----------
limit : int
Number of articles to return.
provider : Union[Literal['benzinga', 'fmp', 'intrinio'], None]
provider : Optional[Literal['benzinga', 'fmp', 'intrinio']]
The provider to use for the query, by default None.
If None, the provider specified in defaults is selected or 'benzinga' if there is
no default.
display : Literal['headline', 'abstract', 'full']
Specify headline only (headline), headline + teaser (abstract), or headline + full body (full). (provider: benzinga)
date : Optional[Union[str]]
date : Optional[str]
Date of the news to retrieve. (provider: benzinga)
start_date : Optional[Union[str]]
start_date : Optional[str]
Start date of the news to retrieve. (provider: benzinga)
end_date : Optional[Union[str]]
end_date : Optional[str]
End date of the news to retrieve. (provider: benzinga)
updated_since : Optional[Union[int]]
updated_since : Optional[int]
Number of seconds since the news was updated. (provider: benzinga)
published_since : Optional[Union[int]]
published_since : Optional[int]
Number of seconds since the news was published. (provider: benzinga)
sort : Optional[Union[Literal['id', 'created', 'updated']]]
sort : Optional[Literal['id', 'created', 'updated']]
Key to sort the news by. (provider: benzinga)
order : Optional[Union[Literal['asc', 'desc']]]
order : Optional[Literal['asc', 'desc']]
Order to sort the news by. (provider: benzinga)
isin : Optional[Union[str]]
isin : Optional[str]
The ISIN of the news to retrieve. (provider: benzinga)
cusip : Optional[Union[str]]
cusip : Optional[str]
The CUSIP of the news to retrieve. (provider: benzinga)
channels : Optional[Union[str]]
channels : Optional[str]
Channels of the news to retrieve. (provider: benzinga)
topics : Optional[Union[str]]
topics : Optional[str]
Topics of the news to retrieve. (provider: benzinga)
authors : Optional[Union[str]]
authors : Optional[str]
Authors of the news to retrieve. (provider: benzinga)
content_types : Optional[Union[str]]
content_types : Optional[str]
Content types of the news to retrieve. (provider: benzinga)
Returns
-------
OBBject
results : Union[List[GlobalNews]]
results : List[GlobalNews]
Serializable results.
provider : Union[Literal['benzinga', 'fmp', 'intrinio'], None]
provider : Optional[Literal['benzinga', 'fmp', 'intrinio']]
Provider name.
warnings : Optional[List[Warning_]]
List of warnings.
@@ -87,31 +87,31 @@ class ROUTER_news(Container):
Published date of the news.
title : str
Title of the news.
image : Optional[Union[str]]
image : Optional[str]
Image URL of the news.
text : Optional[Union[str]]
text : Optional[str]
Text/body of the news.
url : Optional[Union[str]]
url : Optional[str]
URL of the news.
id : Optional[Union[str]]
id : Optional[str]
ID of the news. (provider: benzinga); Article ID. (provider: intrinio)
author : Optional[Union[str]]
author : Optional[str]
Author of the news. (provider: benzinga)
teaser : Optional[Union[str]]
teaser : Optional[str]
Teaser of the news. (provider: benzinga)
images : Optional[Union[List[Dict[str, str]]]]
images : Optional[List[Dict[str, str]]]
Images associated with the news. (provider: benzinga)
channels : Optional[Union[str]]
channels : Optional[str]
Channels associated with the news. (provider: benzinga)
stocks : Optional[Union[str]]
stocks : Optional[str]
Stocks associated with the news. (provider: benzinga)
tags : Optional[Union[str]]
tags : Optional[str]
Tags associated with the news. (provider: benzinga)
updated : Optional[Union[datetime]]
updated : Optional[datetime]
None
site : Optional[Union[str]]
site : Optional[str]
Site of the news. (provider: fmp)
company : Optional[Union[Dict[str, Any]]]
company : Optional[Dict[str, Any]]
Company details related to the news article. (provider: intrinio)""" # noqa: E501
inputs = filter_inputs(

View File

@@ -0,0 +1,375 @@
### THIS FILE IS AUTO-GENERATED. DO NOT EDIT. ###
from typing import List, Literal, Union
import pandas
from annotated_types import Ge, Gt
from openbb_core.app.model.obbject import OBBject
from openbb_core.app.static.container import Container
from openbb_core.app.static.filters import filter_inputs
from openbb_provider.abstract.data import Data
from openbb_qa.qa_models import (
CAPMModel,
NormalityModel,
OmegaModel,
SummaryModel,
UnitRootModel,
)
from pydantic import validate_call
from typing_extensions import Annotated
class ROUTER_qa(Container):
"""/qa
capm
kurtosis
normality
om
quantile
sh
skew
so
summary
unitroot
"""
def __repr__(self) -> str:
return self.__doc__ or ""
@validate_call(config=dict(arbitrary_types_allowed=True))
def capm(
self, data: Union[List[Data], pandas.DataFrame], target: str
) -> OBBject[CAPMModel]:
"""Capital Asset Pricing Model.""" # noqa: E501
inputs = filter_inputs(
data=data,
target=target,
)
return self._run(
"/qa/capm",
**inputs,
)
@validate_call(config=dict(arbitrary_types_allowed=True))
def kurtosis(
self,
data: Union[List[Data], pandas.DataFrame],
target: str,
window: Annotated[int, Gt(gt=0)],
) -> OBBject[List[Data]]:
"""Kurtosis.
Parameters
----------
data : List[Data]
Time series data.
target : str
Target column name.
window : PositiveInt
Window size.
Returns
-------
OBBject[List[Data]]
Kurtosis.
""" # noqa: E501
inputs = filter_inputs(
data=data,
target=target,
window=window,
)
return self._run(
"/qa/kurtosis",
**inputs,
)
@validate_call(config=dict(arbitrary_types_allowed=True))
def normality(
self, data: Union[List[Data], pandas.DataFrame], target: str
) -> OBBject[NormalityModel]:
"""
Normality Statistics.
- **Kurtosis**: whether the kurtosis of a sample differs from the normal distribution.
- **Skewness**: whether the skewness of a sample differs from the normal distribution.
- **Jarque-Bera**: whether the sample data has the skewness and kurtosis matching a normal distribution.
- **Shapiro-Wilk**: whether a random sample comes from a normal distribution.
- **Kolmogorov-Smirnov**: whether two underlying one-dimensional probability distributions differ.
Parameters
----------
data : List[Data]
Time series data.
target : str
Target column name.
Returns
-------
OBBject[NormalityModel]
Normality tests summary. See qa_models.NormalityModel for details.
""" # noqa: E501
inputs = filter_inputs(
data=data,
target=target,
)
return self._run(
"/qa/normality",
**inputs,
)
@validate_call(config=dict(arbitrary_types_allowed=True))
def om(
self,
data: Union[List[Data], pandas.DataFrame],
target: str,
threshold_start: float = 0.0,
threshold_end: float = 1.5,
) -> OBBject[List[OmegaModel]]:
"""Omega Ratio.
Parameters
----------
data : List[Data]
Time series data.
target : str
Target column name.
threshold_start : float, optional
Start threshold, by default 0.0
threshold_end : float, optional
End threshold, by default 1.5
Returns
-------
OBBject[List[OmegaModel]]
Omega ratios.
""" # noqa: E501
inputs = filter_inputs(
data=data,
target=target,
threshold_start=threshold_start,
threshold_end=threshold_end,
)
return self._run(
"/qa/om",
**inputs,
)
@validate_call(config=dict(arbitrary_types_allowed=True))
def quantile(
self,
data: Union[List[Data], pandas.DataFrame],
target: str,
window: Annotated[int, Gt(gt=0)],
quantile_pct: Annotated[float, Ge(ge=0)] = 0.5,
) -> OBBject[List[Data]]:
"""Quantile.""" # noqa: E501
inputs = filter_inputs(
data=data,
target=target,
window=window,
quantile_pct=quantile_pct,
)
return self._run(
"/qa/quantile",
**inputs,
)
@validate_call(config=dict(arbitrary_types_allowed=True))
def sh(
self,
data: Union[List[Data], pandas.DataFrame],
target: str,
rfr: float = 0.0,
window: Annotated[int, Gt(gt=0)] = 252,
) -> OBBject[List[Data]]:
"""Sharpe Ratio.
Parameters
----------
data : List[Data]
Time series data.
target : str
Target column name.
rfr : float, optional
Risk-free rate, by default 0.0
window : PositiveInt, optional
Window size, by default 252
Returns
-------
OBBject[List[Data]]
Sharpe ratio.
""" # noqa: E501
inputs = filter_inputs(
data=data,
target=target,
rfr=rfr,
window=window,
)
return self._run(
"/qa/sh",
**inputs,
)
@validate_call(config=dict(arbitrary_types_allowed=True))
def skew(
self,
data: Union[List[Data], pandas.DataFrame],
target: str,
window: Annotated[int, Gt(gt=0)],
) -> OBBject[List[Data]]:
"""Skewness.
Parameters
----------
data : List[Data]
Time series data.
target : str
Target column name.
window : PositiveInt
Window size.
Returns
-------
OBBject[List[Data]]
Skewness.
""" # noqa: E501
inputs = filter_inputs(
data=data,
target=target,
window=window,
)
return self._run(
"/qa/skew",
**inputs,
)
@validate_call(config=dict(arbitrary_types_allowed=True))
def so(
self,
data: Union[List[Data], pandas.DataFrame],
target: str,
target_return: float = 0.0,
window: Annotated[int, Gt(gt=0)] = 252,
adjusted: bool = False,
) -> OBBject[List[Data]]:
"""Sortino Ratio.
For method & terminology see: http://www.redrockcapital.com/Sortino__A__Sharper__Ratio_Red_Rock_Capital.pdf
Parameters
----------
data : List[Data]
Time series data.
target : str
Target column name.
target_return : float, optional
Target return, by default 0.0
window : PositiveInt, optional
Window size, by default 252
adjusted : bool, optional
Adjust sortino ratio to compare it to sharpe ratio, by default False
Returns
-------
OBBject[List[Data]]
Sortino ratio.
""" # noqa: E501
inputs = filter_inputs(
data=data,
target=target,
target_return=target_return,
window=window,
adjusted=adjusted,
)
return self._run(
"/qa/so",
**inputs,
)
@validate_call(config=dict(arbitrary_types_allowed=True))
def summary(
self, data: Union[List[Data], pandas.DataFrame], target: str
) -> OBBject[SummaryModel]:
"""Summary.
Parameters
----------
data : List[Data]
Time series data.
target : str
Target column name.
Returns
-------
OBBject[SummaryModel]
Summary table.
""" # noqa: E501
inputs = filter_inputs(
data=data,
target=target,
)
return self._run(
"/qa/summary",
**inputs,
)
@validate_call(config=dict(arbitrary_types_allowed=True))
def unitroot(
self,
data: Union[List[Data], pandas.DataFrame],
target: str,
fuller_reg: Literal["c", "ct", "ctt", "nc"] = "c",
kpss_reg: Literal["c", "ct"] = "c",
) -> OBBject[UnitRootModel]:
"""Unit Root Test.
Augmented Dickey-Fuller test for unit root.
Kwiatkowski-Phillips-Schmidt-Shin test for unit root.
Parameters
----------
data : List[Data]
Time series data.
target : str
Target column name.
fuller_reg : Literal["c", "ct", "ctt", "nc", "c"]
Regression type for ADF test.
kpss_reg : Literal["c", "ct"]
Regression type for KPSS test.
Returns
-------
OBBject[UnitRootModel]
Unit root tests summary.
""" # noqa: E501
inputs = filter_inputs(
data=data,
target=target,
fuller_reg=fuller_reg,
kpss_reg=kpss_reg,
)
return self._run(
"/qa/unitroot",
**inputs,
)

View File

@@ -1,9 +1,8 @@
### THIS FILE IS AUTO-GENERATED. DO NOT EDIT. ###
import datetime
from typing import List, Literal, Union
from typing import List, Literal, Optional, Union
import typing_extensions
from annotated_types import Ge
from openbb_core.app.model.custom_parameter import OpenBBCustomParameter
from openbb_core.app.model.obbject import OBBject
@@ -11,17 +10,20 @@ from openbb_core.app.static.container import Container
from openbb_core.app.static.filters import filter_inputs
from openbb_provider.abstract.data import Data
from pydantic import validate_call
from typing_extensions import Annotated
class ROUTER_stocks(Container):
"""/stocks
/ca
/fa
info
load
multiples
news
/options
quote
search
"""
def __repr__(self) -> str:
@@ -40,25 +42,143 @@ class ROUTER_stocks(Container):
return stocks_fa.ROUTER_stocks_fa(command_runner=self._command_runner)
@validate_call
def load(
def info(
self,
symbol: typing_extensions.Annotated[
symbol: Annotated[
Union[str, List[str]],
OpenBBCustomParameter(description="Symbol to get data for."),
],
start_date: typing_extensions.Annotated[
provider: Optional[Literal["cboe"]] = None,
**kwargs
) -> OBBject[List[Data]]:
"""Get general price and performance metrics of a stock.
Parameters
----------
symbol : str
Symbol to get data for.
provider : Optional[Literal['cboe']]
The provider to use for the query, by default None.
If None, the provider specified in defaults is selected or 'cboe' if there is
no default.
Returns
-------
OBBject
results : List[StockInfo]
Serializable results.
provider : Optional[Literal['cboe']]
Provider name.
warnings : Optional[List[Warning_]]
List of warnings.
chart : Optional[Chart]
Chart object.
extra: Dict[str, Any]
Extra info.
StockInfo
---------
symbol : str
Symbol to get data for.
name : str
Name associated with the ticker symbol.
price : Optional[float]
Last transaction price.
open : Optional[float]
Opening price of the stock.
high : Optional[float]
High price of the current trading day.
low : Optional[float]
Low price of the current trading day.
close : Optional[float]
Closing price of the most recent trading day.
change : Optional[float]
Change in price over the current trading period.
change_percent : Optional[float]
Percent change in price over the current trading period.
prev_close : Optional[float]
Previous closing price.
type : Optional[str]
Type of asset. (provider: cboe)
exchange_id : Optional[int]
The Exchange ID number. (provider: cboe)
tick : Optional[str]
Whether the last sale was an up or down tick. (provider: cboe)
bid : Optional[float]
Current bid price. (provider: cboe)
bid_size : Optional[float]
Bid lot size. (provider: cboe)
ask : Optional[float]
Current ask price. (provider: cboe)
ask_size : Optional[float]
Ask lot size. (provider: cboe)
volume : Optional[float]
Stock volume for the current trading day. (provider: cboe)
iv30 : Optional[float]
The 30-day implied volatility of the stock. (provider: cboe)
iv30_change : Optional[float]
Change in 30-day implied volatility of the stock. (provider: cboe)
last_trade_timestamp : Optional[datetime]
Last trade timestamp for the stock. (provider: cboe)
iv30_annual_high : Optional[float]
The 1-year high of implied volatility. (provider: cboe)
hv30_annual_high : Optional[float]
The 1-year high of realized volatility. (provider: cboe)
iv30_annual_low : Optional[float]
The 1-year low of implied volatility. (provider: cboe)
hv30_annual_low : Optional[float]
The 1-year low of realized volatility. (provider: cboe)
iv60_annual_high : Optional[float]
The 60-day high of implied volatility. (provider: cboe)
hv60_annual_high : Optional[float]
The 60-day high of realized volatility. (provider: cboe)
iv60_annual_low : Optional[float]
The 60-day low of implied volatility. (provider: cboe)
hv60_annual_low : Optional[float]
The 60-day low of realized volatility. (provider: cboe)
iv90_annual_high : Optional[float]
The 90-day high of implied volatility. (provider: cboe)
hv90_annual_high : Optional[float]
The 90-day high of realized volatility. (provider: cboe)""" # noqa: E501
inputs = filter_inputs(
provider_choices={
"provider": provider,
},
standard_params={
"symbol": ",".join(symbol) if isinstance(symbol, list) else symbol,
},
extra_params=kwargs,
)
return self._run(
"/stocks/info",
**inputs,
)
@validate_call
def load(
self,
symbol: Annotated[
Union[str, List[str]],
OpenBBCustomParameter(description="Symbol to get data for."),
],
start_date: Annotated[
Union[datetime.date, None, str],
OpenBBCustomParameter(
description="Start date of the data, in YYYY-MM-DD format."
),
] = None,
end_date: typing_extensions.Annotated[
end_date: Annotated[
Union[datetime.date, None, str],
OpenBBCustomParameter(
description="End date of the data, in YYYY-MM-DD format."
),
] = None,
provider: Union[Literal["fmp", "intrinio", "polygon"], None] = None,
chart: bool = False,
provider: Optional[
Literal["alpha_vantage", "cboe", "fmp", "intrinio", "polygon", "yfinance"]
] = None,
**kwargs
) -> OBBject[List[Data]]:
"""Load stock data for a specific ticker.
@@ -67,27 +187,41 @@ class ROUTER_stocks(Container):
----------
symbol : str
Symbol to get data for.
start_date : Union[datetime.date, None]
start_date : Optional[datetime.date]
Start date of the data, in YYYY-MM-DD format.
end_date : Union[datetime.date, None]
end_date : Optional[datetime.date]
End date of the data, in YYYY-MM-DD format.
provider : Union[Literal['fmp', 'intrinio', 'polygon'], None]
chart : bool
Whether to create a chart or not, by default False.
provider : Optional[Literal['alpha_vantage', 'cboe', 'fmp', 'intrinio', 'pol...
The provider to use for the query, by default None.
If None, the provider specified in defaults is selected or 'fmp' if there is
If None, the provider specified in defaults is selected or 'alpha_vantage' if there is
no default.
timeseries : Optional[Union[typing_extensions.Annotated[int, Ge(ge=0)]]]
function_ : Literal['TIME_SERIES_INTRADAY', 'TIME_SERIES_DAILY', 'TIME_SERIES_WEEKLY', 'TIME_SERIES_MONTHLY', 'TIME_SERIES_DAILY_ADJUSTED', 'TIME_SERIES_WEEKLY_ADJUSTED', 'TIME_SERIES_MONTHLY_ADJUSTED']
The time series of your choice. (provider: alpha_vantage)
period : Optional[Union[Literal['intraday', 'daily', 'weekly', 'monthly'], Literal['1d', '5d', '1mo', '3mo', '6mo', '1y', '2y', '5y', '10y', 'ytd', 'max']]]
Period of the data to return. (provider: alpha_vantage, yfinance)
interval : Optional[Union[Literal['1min', '5min', '15min', '30min', '60min'], Literal['1d', '1m'], 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: alpha_vantage, cboe, fmp, yfinance)
adjusted : Optional[bool]
Output time series is adjusted by historical split and dividend events. (provider: alpha_vantage, polygon)
extended_hours : Optional[bool]
Extended trading hours during pre-market and after-hours. (provider: alpha_vantage)
month : Optional[str]
Query a specific month in history (in YYYY-MM format). (provider: alpha_vantage)
outputsize : Optional[Literal['compact', 'full']]
Compact returns only the latest 100 data points in the intraday time series; full returns trailing 30 days of the most recent intraday data if the month parameter (see above) is not specified, or the full intraday data for a specific month in history if the month parameter is specified. (provider: alpha_vantage)
timeseries : Optional[Annotated[int, Ge(ge=0)]]
Number of days to look back. (provider: fmp)
interval : Literal['1min', '5min', '15min', '30min', '1hour', '4hour', '1day']
Data granularity. (provider: fmp)
timezone : Optional[Union[Literal['Africa/Algiers', 'Africa/Cairo', 'Africa/Casablanca', 'Africa/Harare', 'Africa/Johannesburg', 'Africa/Monrovia', 'Africa/Nairobi', 'America/Argentina/Buenos_Aires', 'America/Bogota', 'America/Caracas', 'America/Chicago', 'America/Chihuahua', 'America/Denver', 'America/Godthab', 'America/Guatemala', 'America/Guyana', 'America/Halifax', 'America/Indiana/Indianapolis', 'America/Juneau', 'America/La_Paz', 'America/Lima', 'America/Lima', 'America/Los_Angeles', 'America/Mazatlan', 'America/Mexico_City', 'America/Mexico_City', 'America/Monterrey', 'America/Montevideo', 'America/New_York', 'America/Phoenix', 'America/Regina', 'America/Santiago', 'America/Sao_Paulo', 'America/St_Johns', 'America/Tijuana', 'Asia/Almaty', 'Asia/Baghdad', 'Asia/Baku', 'Asia/Bangkok', 'Asia/Bangkok', 'Asia/Chongqing', 'Asia/Colombo', 'Asia/Dhaka', 'Asia/Dhaka', 'Asia/Hong_Kong', 'Asia/Irkutsk', 'Asia/Jakarta', 'Asia/Jerusalem', 'Asia/Kabul', 'Asia/Kamchatka', 'Asia/Karachi', 'Asia/Karachi', 'Asia/Kathmandu', 'Asia/Kolkata', 'Asia/Kolkata', 'Asia/Kolkata', 'Asia/Kolkata', 'Asia/Krasnoyarsk', 'Asia/Kuala_Lumpur', 'Asia/Kuwait', 'Asia/Magadan', 'Asia/Muscat', 'Asia/Muscat', 'Asia/Novosibirsk', 'Asia/Rangoon', 'Asia/Riyadh', 'Asia/Seoul', 'Asia/Shanghai', 'Asia/Singapore', 'Asia/Srednekolymsk', 'Asia/Taipei', 'Asia/Tashkent', 'Asia/Tbilisi', 'Asia/Tehran', 'Asia/Tokyo', 'Asia/Tokyo', 'Asia/Tokyo', 'Asia/Ulaanbaatar', 'Asia/Urumqi', 'Asia/Vladivostok', 'Asia/Yakutsk', 'Asia/Yekaterinburg', 'Asia/Yerevan', 'Atlantic/Azores', 'Atlantic/Cape_Verde', 'Atlantic/South_Georgia', 'Australia/Adelaide', 'Australia/Brisbane', 'Australia/Darwin', 'Australia/Hobart', 'Australia/Melbourne', 'Australia/Melbourne', 'Australia/Perth', 'Australia/Sydney', 'Etc/UTC', 'UTC', 'Europe/Amsterdam', 'Europe/Athens', 'Europe/Belgrade', 'Europe/Berlin', 'Europe/Berlin', 'Europe/Bratislava', 'Europe/Brussels', 'Europe/Bucharest', 'Europe/Budapest', 'Europe/Copenhagen', 'Europe/Dublin', 'Europe/Helsinki', 'Europe/Istanbul', 'Europe/Kaliningrad', 'Europe/Kiev', 'Europe/Lisbon', 'Europe/Ljubljana', 'Europe/London', 'Europe/London', 'Europe/Madrid', 'Europe/Minsk', 'Europe/Moscow', 'Europe/Moscow', 'Europe/Paris', 'Europe/Prague', 'Europe/Riga', 'Europe/Rome', 'Europe/Samara', 'Europe/Sarajevo', 'Europe/Skopje', 'Europe/Sofia', 'Europe/Stockholm', 'Europe/Tallinn', 'Europe/Vienna', 'Europe/Vilnius', 'Europe/Volgograd', 'Europe/Warsaw', 'Europe/Zagreb', 'Pacific/Apia', 'Pacific/Auckland', 'Pacific/Auckland', 'Pacific/Chatham', 'Pacific/Fakaofo', 'Pacific/Fiji', 'Pacific/Guadalcanal', 'Pacific/Guam', 'Pacific/Honolulu', 'Pacific/Majuro', 'Pacific/Midway', 'Pacific/Midway', 'Pacific/Noumea', 'Pacific/Pago_Pago', 'Pacific/Port_Moresby', 'Pacific/Tongatapu']]]
timezone : Optional[Literal['Africa/Algiers', 'Africa/Cairo', 'Africa/Casablanca', 'Africa/Harare', 'Africa/Johannesburg', 'Africa/Monrovia', 'Africa/Nairobi', 'America/Argentina/Buenos_Aires', 'America/Bogota', 'America/Caracas', 'America/Chicago', 'America/Chihuahua', 'America/Denver', 'America/Godthab', 'America/Guatemala', 'America/Guyana', 'America/Halifax', 'America/Indiana/Indianapolis', 'America/Juneau', 'America/La_Paz', 'America/Lima', 'America/Los_Angeles', 'America/Mazatlan', 'America/Mexico_City', 'America/Monterrey', 'America/Montevideo', 'America/New_York', 'America/Phoenix', 'America/Regina', 'America/Santiago', 'America/Sao_Paulo', 'America/St_Johns', 'America/Tijuana', 'Asia/Almaty', 'Asia/Baghdad', 'Asia/Baku', 'Asia/Bangkok', 'Asia/Chongqing', 'Asia/Colombo', 'Asia/Dhaka', 'Asia/Hong_Kong', 'Asia/Irkutsk', 'Asia/Jakarta', 'Asia/Jerusalem', 'Asia/Kabul', 'Asia/Kamchatka', 'Asia/Karachi', 'Asia/Kathmandu', 'Asia/Kolkata', 'Asia/Krasnoyarsk', 'Asia/Kuala_Lumpur', 'Asia/Kuwait', 'Asia/Magadan', 'Asia/Muscat', 'Asia/Novosibirsk', 'Asia/Rangoon', 'Asia/Riyadh', 'Asia/Seoul', 'Asia/Shanghai', 'Asia/Singapore', 'Asia/Srednekolymsk', 'Asia/Taipei', 'Asia/Tashkent', 'Asia/Tbilisi', 'Asia/Tehran', 'Asia/Tokyo', 'Asia/Ulaanbaatar', 'Asia/Urumqi', 'Asia/Vladivostok', 'Asia/Yakutsk', 'Asia/Yekaterinburg', 'Asia/Yerevan', 'Atlantic/Azores', 'Atlantic/Cape_Verde', 'Atlantic/South_Georgia', 'Australia/Adelaide', 'Australia/Brisbane', 'Australia/Darwin', 'Australia/Hobart', 'Australia/Melbourne', 'Australia/Perth', 'Australia/Sydney', 'Etc/UTC', 'UTC', 'Europe/Amsterdam', 'Europe/Athens', 'Europe/Belgrade', 'Europe/Berlin', 'Europe/Bratislava', 'Europe/Brussels', 'Europe/Bucharest', 'Europe/Budapest', 'Europe/Copenhagen', 'Europe/Dublin', 'Europe/Helsinki', 'Europe/Istanbul', 'Europe/Kaliningrad', 'Europe/Kiev', 'Europe/Lisbon', 'Europe/Ljubljana', 'Europe/London', 'Europe/Madrid', 'Europe/Minsk', 'Europe/Moscow', 'Europe/Paris', 'Europe/Prague', 'Europe/Riga', 'Europe/Rome', 'Europe/Samara', 'Europe/Sarajevo', 'Europe/Skopje', 'Europe/Sofia', 'Europe/Stockholm', 'Europe/Tallinn', 'Europe/Vienna', 'Europe/Vilnius', 'Europe/Volgograd', 'Europe/Warsaw', 'Europe/Zagreb', 'Pacific/Apia', 'Pacific/Auckland', 'Pacific/Chatham', 'Pacific/Fakaofo', 'Pacific/Fiji', 'Pacific/Guadalcanal', 'Pacific/Guam', 'Pacific/Honolulu', 'Pacific/Majuro', 'Pacific/Midway', 'Pacific/Noumea', 'Pacific/Pago_Pago', 'Pacific/Port_Moresby', 'Pacific/Tongatapu']]
Returns trading times in this timezone. (provider: intrinio)
source : Optional[Union[Literal['realtime', 'delayed', 'nasdaq_basic']]]
source : Optional[Literal['realtime', 'delayed', 'nasdaq_basic']]
The source of the data. (provider: intrinio)
start_time : Optional[Union[datetime.time]]
start_time : Optional[datetime.time]
Return intervals starting at the specified time on the `start_date` formatted as 'hh:mm:ss'. (provider: intrinio)
end_time : Optional[Union[datetime.time]]
end_time : Optional[datetime.time]
Return intervals stopping at the specified time on the `end_date` formatted as 'hh:mm:ss'. (provider: intrinio)
interval_size : Optional[Union[Literal['1m', '5m', '10m', '15m', '30m', '60m', '1h']]]
interval_size : Optional[Literal['1m', '5m', '10m', '15m', '30m', '60m', '1h']]
The data time frequency. (provider: intrinio)
multiplier : int
Multiplier of the timespan. (provider: polygon)
@@ -97,15 +231,33 @@ class ROUTER_stocks(Container):
Sort order of the data. (provider: polygon)
limit : int
The number of data entries to return. (provider: polygon)
adjusted : bool
Output time series is adjusted by historical split and dividend events. (provider: polygon)
prepost : bool
Include Pre and Post market data. (provider: yfinance)
actions : bool
Include actions. (provider: yfinance)
auto_adjust : bool
Adjust all OHLC data automatically. (provider: yfinance)
back_adjust : bool
Attempt to adjust all the data automatically. (provider: yfinance)
progress : bool
Show progress bar. (provider: yfinance)
ignore_tz : bool
When combining from different timezones, ignore that part of datetime. (provider: yfinance)
rounding : bool
Round to two decimal places? (provider: yfinance)
repair : bool
Detect currency unit 100x mixups and attempt repair. (provider: yfinance)
keepna : bool
Keep NaN rows returned by Yahoo? (provider: yfinance)
group_by : Literal['ticker', 'column']
Group by ticker or column. (provider: yfinance)
Returns
-------
OBBject
results : Union[List[StockHistorical]]
results : List[StockHistorical]
Serializable results.
provider : Union[Literal['fmp', 'intrinio', 'polygon'], None]
provider : Optional[Literal['alpha_vantage', 'cboe', 'fmp', 'intrinio', 'polygon', 'yfinance']]
Provider name.
warnings : Optional[List[Warning_]]
List of warnings.
@@ -128,27 +280,37 @@ class ROUTER_stocks(Container):
The close price of the symbol.
volume : Union[float, int]
The volume of the symbol.
vwap : Optional[Union[typing_extensions.Annotated[float, Gt(gt=0)]]]
vwap : Optional[Annotated[float, Gt(gt=0)]]
Volume Weighted Average Price of the symbol.
adj_close : Optional[Union[float]]
Adjusted Close Price of the symbol. (provider: fmp)
unadjusted_volume : Optional[Union[float]]
adj_close : Optional[Union[Annotated[float, Gt(gt=0)], float]]
The adjusted close price of the symbol. (provider: alpha_vantage, fmp)
dividend_amount : Optional[Annotated[float, Ge(ge=0)]]
Dividend amount paid for the corresponding date. (provider: alpha_vantage)
split_coefficient : Optional[Annotated[float, Ge(ge=0)]]
Split coefficient for the corresponding date. (provider: alpha_vantage)
calls_volume : Optional[float]
Number of calls traded during the most recent trading period. Only valid if interval is 1m. (provider: cboe)
puts_volume : Optional[float]
Number of puts traded during the most recent trading period. Only valid if interval is 1m. (provider: cboe)
total_options_volume : Optional[float]
Total number of options traded during the most recent trading period. Only valid if interval is 1m. (provider: cboe)
unadjusted_volume : Optional[float]
Unadjusted volume of the symbol. (provider: fmp)
change : Optional[Union[float]]
change : Optional[float]
Change in the price of the symbol from the previous day. (provider: fmp, intrinio)
change_percent : Optional[Union[float]]
change_percent : Optional[float]
Change % in the price of the symbol. (provider: fmp)
label : Optional[Union[str]]
label : Optional[str]
Human readable format of the date. (provider: fmp)
change_over_time : Optional[Union[float]]
change_over_time : Optional[float]
Change % in the price of the symbol over a period of time. (provider: fmp)
close_time : Optional[Union[datetime]]
close_time : Optional[datetime]
The timestamp that represents the end of the interval span. (provider: intrinio)
interval : Optional[Union[str]]
interval : Optional[str]
The data time frequency. (provider: intrinio)
average : Optional[Union[float]]
average : Optional[float]
Average trade price of an individual stock during the interval. (provider: intrinio)
transactions : Optional[Union[typing_extensions.Annotated[int, Gt(gt=0)]]]
transactions : Optional[Annotated[int, Gt(gt=0)]]
Number of transactions for the symbol in the time period. (provider: polygon)
""" # noqa: E501
@@ -162,6 +324,7 @@ class ROUTER_stocks(Container):
"end_date": end_date,
},
extra_params=kwargs,
chart=chart,
)
return self._run(
@@ -172,15 +335,16 @@ class ROUTER_stocks(Container):
@validate_call
def multiples(
self,
symbol: typing_extensions.Annotated[
symbol: Annotated[
Union[str, List[str]],
OpenBBCustomParameter(description="Symbol to get data for."),
],
limit: typing_extensions.Annotated[
Union[int, None],
limit: Annotated[
Optional[int],
OpenBBCustomParameter(description="The number of data entries to return."),
] = 100,
provider: Union[Literal["fmp"], None] = None,
chart: bool = False,
provider: Optional[Literal["fmp"]] = None,
**kwargs
) -> OBBject[List[Data]]:
"""Get valuation multiples for a stock ticker.
@@ -189,9 +353,11 @@ class ROUTER_stocks(Container):
----------
symbol : str
Symbol to get data for.
limit : Union[int, None]
limit : Optional[int]
The number of data entries to return.
provider : Union[Literal['fmp'], None]
chart : bool
Whether to create a chart or not, by default False.
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
no default.
@@ -199,9 +365,9 @@ class ROUTER_stocks(Container):
Returns
-------
OBBject
results : Union[List[StockMultiples]]
results : List[StockMultiples]
Serializable results.
provider : Union[Literal['fmp'], None]
provider : Optional[Literal['fmp']]
Provider name.
warnings : Optional[List[Warning_]]
List of warnings.
@@ -212,125 +378,125 @@ class ROUTER_stocks(Container):
StockMultiples
--------------
revenue_per_share_ttm : Optional[Union[float]]
revenue_per_share_ttm : Optional[float]
Revenue per share calculated as trailing twelve months.
net_income_per_share_ttm : Optional[Union[float]]
net_income_per_share_ttm : Optional[float]
Net income per share calculated as trailing twelve months.
operating_cash_flow_per_share_ttm : Optional[Union[float]]
operating_cash_flow_per_share_ttm : Optional[float]
Operating cash flow per share calculated as trailing twelve months.
free_cash_flow_per_share_ttm : Optional[Union[float]]
free_cash_flow_per_share_ttm : Optional[float]
Free cash flow per share calculated as trailing twelve months.
cash_per_share_ttm : Optional[Union[float]]
cash_per_share_ttm : Optional[float]
Cash per share calculated as trailing twelve months.
book_value_per_share_ttm : Optional[Union[float]]
book_value_per_share_ttm : Optional[float]
Book value per share calculated as trailing twelve months.
tangible_book_value_per_share_ttm : Optional[Union[float]]
tangible_book_value_per_share_ttm : Optional[float]
Tangible book value per share calculated as trailing twelve months.
shareholders_equity_per_share_ttm : Optional[Union[float]]
shareholders_equity_per_share_ttm : Optional[float]
Shareholders equity per share calculated as trailing twelve months.
interest_debt_per_share_ttm : Optional[Union[float]]
interest_debt_per_share_ttm : Optional[float]
Interest debt per share calculated as trailing twelve months.
market_cap_ttm : Optional[Union[float]]
market_cap_ttm : Optional[float]
Market capitalization calculated as trailing twelve months.
enterprise_value_ttm : Optional[Union[float]]
enterprise_value_ttm : Optional[float]
Enterprise value calculated as trailing twelve months.
pe_ratio_ttm : Optional[Union[float]]
pe_ratio_ttm : Optional[float]
Price-to-earnings ratio (P/E ratio) calculated as trailing twelve months.
price_to_sales_ratio_ttm : Optional[Union[float]]
price_to_sales_ratio_ttm : Optional[float]
Price-to-sales ratio calculated as trailing twelve months.
pocf_ratio_ttm : Optional[Union[float]]
pocf_ratio_ttm : Optional[float]
Price-to-operating cash flow ratio calculated as trailing twelve months.
pfcf_ratio_ttm : Optional[Union[float]]
pfcf_ratio_ttm : Optional[float]
Price-to-free cash flow ratio calculated as trailing twelve months.
pb_ratio_ttm : Optional[Union[float]]
pb_ratio_ttm : Optional[float]
Price-to-book ratio calculated as trailing twelve months.
ptb_ratio_ttm : Optional[Union[float]]
ptb_ratio_ttm : Optional[float]
Price-to-tangible book ratio calculated as trailing twelve months.
ev_to_sales_ttm : Optional[Union[float]]
ev_to_sales_ttm : Optional[float]
Enterprise value-to-sales ratio calculated as trailing twelve months.
enterprise_value_over_ebitda_ttm : Optional[Union[float]]
enterprise_value_over_ebitda_ttm : Optional[float]
Enterprise value-to-EBITDA ratio calculated as trailing twelve months.
ev_to_operating_cash_flow_ttm : Optional[Union[float]]
ev_to_operating_cash_flow_ttm : Optional[float]
Enterprise value-to-operating cash flow ratio calculated as trailing twelve months.
ev_to_free_cash_flow_ttm : Optional[Union[float]]
ev_to_free_cash_flow_ttm : Optional[float]
Enterprise value-to-free cash flow ratio calculated as trailing twelve months.
earnings_yield_ttm : Optional[Union[float]]
earnings_yield_ttm : Optional[float]
Earnings yield calculated as trailing twelve months.
free_cash_flow_yield_ttm : Optional[Union[float]]
free_cash_flow_yield_ttm : Optional[float]
Free cash flow yield calculated as trailing twelve months.
debt_to_equity_ttm : Optional[Union[float]]
debt_to_equity_ttm : Optional[float]
Debt-to-equity ratio calculated as trailing twelve months.
debt_to_assets_ttm : Optional[Union[float]]
debt_to_assets_ttm : Optional[float]
Debt-to-assets ratio calculated as trailing twelve months.
net_debt_to_ebitda_ttm : Optional[Union[float]]
net_debt_to_ebitda_ttm : Optional[float]
Net debt-to-EBITDA ratio calculated as trailing twelve months.
current_ratio_ttm : Optional[Union[float]]
current_ratio_ttm : Optional[float]
Current ratio calculated as trailing twelve months.
interest_coverage_ttm : Optional[Union[float]]
interest_coverage_ttm : Optional[float]
Interest coverage calculated as trailing twelve months.
income_quality_ttm : Optional[Union[float]]
income_quality_ttm : Optional[float]
Income quality calculated as trailing twelve months.
dividend_yield_ttm : Optional[Union[float]]
dividend_yield_ttm : Optional[float]
Dividend yield calculated as trailing twelve months.
dividend_yield_percentage_ttm : Optional[Union[float]]
dividend_yield_percentage_ttm : Optional[float]
Dividend yield percentage calculated as trailing twelve months.
dividend_to_market_cap_ttm : Optional[Union[float]]
dividend_to_market_cap_ttm : Optional[float]
Dividend to market capitalization ratio calculated as trailing twelve months.
dividend_per_share_ttm : Optional[Union[float]]
dividend_per_share_ttm : Optional[float]
Dividend per share calculated as trailing twelve months.
payout_ratio_ttm : Optional[Union[float]]
payout_ratio_ttm : Optional[float]
Payout ratio calculated as trailing twelve months.
sales_general_and_administrative_to_revenue_ttm : Optional[Union[float]]
sales_general_and_administrative_to_revenue_ttm : Optional[float]
Sales general and administrative expenses-to-revenue ratio calculated as trailing twelve months.
research_and_development_to_revenue_ttm : Optional[Union[float]]
research_and_development_to_revenue_ttm : Optional[float]
Research and development expenses-to-revenue ratio calculated as trailing twelve months.
intangibles_to_total_assets_ttm : Optional[Union[float]]
intangibles_to_total_assets_ttm : Optional[float]
Intangibles-to-total assets ratio calculated as trailing twelve months.
capex_to_operating_cash_flow_ttm : Optional[Union[float]]
capex_to_operating_cash_flow_ttm : Optional[float]
Capital expenditures-to-operating cash flow ratio calculated as trailing twelve months.
capex_to_revenue_ttm : Optional[Union[float]]
capex_to_revenue_ttm : Optional[float]
Capital expenditures-to-revenue ratio calculated as trailing twelve months.
capex_to_depreciation_ttm : Optional[Union[float]]
capex_to_depreciation_ttm : Optional[float]
Capital expenditures-to-depreciation ratio calculated as trailing twelve months.
stock_based_compensation_to_revenue_ttm : Optional[Union[float]]
stock_based_compensation_to_revenue_ttm : Optional[float]
Stock-based compensation-to-revenue ratio calculated as trailing twelve months.
graham_number_ttm : Optional[Union[float]]
graham_number_ttm : Optional[float]
Graham number calculated as trailing twelve months.
roic_ttm : Optional[Union[float]]
roic_ttm : Optional[float]
Return on invested capital calculated as trailing twelve months.
return_on_tangible_assets_ttm : Optional[Union[float]]
return_on_tangible_assets_ttm : Optional[float]
Return on tangible assets calculated as trailing twelve months.
graham_net_net_ttm : Optional[Union[float]]
graham_net_net_ttm : Optional[float]
Graham net-net working capital calculated as trailing twelve months.
working_capital_ttm : Optional[Union[float]]
working_capital_ttm : Optional[float]
Working capital calculated as trailing twelve months.
tangible_asset_value_ttm : Optional[Union[float]]
tangible_asset_value_ttm : Optional[float]
Tangible asset value calculated as trailing twelve months.
net_current_asset_value_ttm : Optional[Union[float]]
net_current_asset_value_ttm : Optional[float]
Net current asset value calculated as trailing twelve months.
invested_capital_ttm : Optional[Union[float]]
invested_capital_ttm : Optional[float]
Invested capital calculated as trailing twelve months.
average_receivables_ttm : Optional[Union[float]]
average_receivables_ttm : Optional[float]
Average receivables calculated as trailing twelve months.
average_payables_ttm : Optional[Union[float]]
average_payables_ttm : Optional[float]
Average payables calculated as trailing twelve months.
average_inventory_ttm : Optional[Union[float]]
average_inventory_ttm : Optional[float]
Average inventory calculated as trailing twelve months.
days_sales_outstanding_ttm : Optional[Union[float]]
days_sales_outstanding_ttm : Optional[float]
Days sales outstanding calculated as trailing twelve months.
days_payables_outstanding_ttm : Optional[Union[float]]
days_payables_outstanding_ttm : Optional[float]
Days payables outstanding calculated as trailing twelve months.
days_of_inventory_on_hand_ttm : Optional[Union[float]]
days_of_inventory_on_hand_ttm : Optional[float]
Days of inventory on hand calculated as trailing twelve months.
receivables_turnover_ttm : Optional[Union[float]]
receivables_turnover_ttm : Optional[float]
Receivables turnover calculated as trailing twelve months.
payables_turnover_ttm : Optional[Union[float]]
payables_turnover_ttm : Optional[float]
Payables turnover calculated as trailing twelve months.
inventory_turnover_ttm : Optional[Union[float]]
inventory_turnover_ttm : Optional[float]
Inventory turnover calculated as trailing twelve months.
roe_ttm : Optional[Union[float]]
roe_ttm : Optional[float]
Return on equity calculated as trailing twelve months.
capex_per_share_ttm : Optional[Union[float]]
capex_per_share_ttm : Optional[float]
Capital expenditures per share calculated as trailing twelve months.""" # noqa: E501
inputs = filter_inputs(
@@ -342,6 +508,7 @@ class ROUTER_stocks(Container):
"limit": limit,
},
extra_params=kwargs,
chart=chart,
)
return self._run(
@@ -352,14 +519,17 @@ class ROUTER_stocks(Container):
@validate_call
def news(
self,
symbols: typing_extensions.Annotated[
symbols: Annotated[
str, OpenBBCustomParameter(description="Comma separated list of symbols.")
],
limit: typing_extensions.Annotated[
Union[typing_extensions.Annotated[int, Ge(ge=0)], None],
limit: Annotated[
Optional[Annotated[int, Ge(ge=0)]],
OpenBBCustomParameter(description="Number of results to return per page."),
] = 20,
provider: Union[Literal["benzinga", "fmp", "intrinio", "polygon"], None] = None,
chart: bool = False,
provider: Optional[
Literal["benzinga", "fmp", "intrinio", "polygon", "yfinance"]
] = None,
**kwargs
) -> OBBject[List[Data]]:
"""Get news for one or more stock tickers.
@@ -368,49 +538,51 @@ class ROUTER_stocks(Container):
----------
symbols : str
Comma separated list of symbols.
limit : Union[typing_extensions.Annotated[int, Ge(ge=0)], None]
limit : Optional[Annotated[int, Ge(ge=0)]]
Number of results to return per page.
provider : Union[Literal['benzinga', 'fmp', 'intrinio', 'polygon'], None]
chart : bool
Whether to create a chart or not, by default False.
provider : Optional[Literal['benzinga', 'fmp', 'intrinio', 'polygon', 'yfina...
The provider to use for the query, by default None.
If None, the provider specified in defaults is selected or 'benzinga' if there is
no default.
display : Literal['headline', 'abstract', 'full']
Specify headline only (headline), headline + teaser (abstract), or headline + full body (full). (provider: benzinga)
date : Optional[Union[str]]
date : Optional[str]
Date of the news to retrieve. (provider: benzinga)
start_date : Optional[Union[str]]
start_date : Optional[str]
Start date of the news to retrieve. (provider: benzinga)
end_date : Optional[Union[str]]
end_date : Optional[str]
End date of the news to retrieve. (provider: benzinga)
updated_since : Optional[Union[int]]
updated_since : Optional[int]
Number of seconds since the news was updated. (provider: benzinga)
published_since : Optional[Union[int]]
published_since : Optional[int]
Number of seconds since the news was published. (provider: benzinga)
sort : Optional[Union[Literal['id', 'created', 'updated']]]
sort : Optional[Literal['id', 'created', 'updated']]
Key to sort the news by. (provider: benzinga)
order : Optional[Union[Literal['asc', 'desc']]]
order : Optional[Literal['asc', 'desc']]
Order to sort the news by. (provider: benzinga); Sort order of the articles. (provider: polygon)
isin : Optional[Union[str]]
isin : Optional[str]
The ISIN of the news to retrieve. (provider: benzinga)
cusip : Optional[Union[str]]
cusip : Optional[str]
The CUSIP of the news to retrieve. (provider: benzinga)
channels : Optional[Union[str]]
channels : Optional[str]
Channels of the news to retrieve. (provider: benzinga)
topics : Optional[Union[str]]
topics : Optional[str]
Topics of the news to retrieve. (provider: benzinga)
authors : Optional[Union[str]]
authors : Optional[str]
Authors of the news to retrieve. (provider: benzinga)
content_types : Optional[Union[str]]
content_types : Optional[str]
Content types of the news to retrieve. (provider: benzinga)
published_utc : Optional[Union[str]]
published_utc : Optional[str]
Date query to fetch articles. Supports operators <, <=, >, >= (provider: polygon)
Returns
-------
OBBject
results : Union[List[StockNews]]
results : List[StockNews]
Serializable results.
provider : Union[Literal['benzinga', 'fmp', 'intrinio', 'polygon'], None]
provider : Optional[Literal['benzinga', 'fmp', 'intrinio', 'polygon', 'yfinance']]
Provider name.
warnings : Optional[List[Warning_]]
List of warnings.
@@ -425,42 +597,50 @@ class ROUTER_stocks(Container):
Published date of the news.
title : str
Title of the news.
image : Optional[Union[str]]
image : Optional[str]
Image URL of the news.
text : Optional[Union[str]]
text : Optional[str]
Text/body of the news.
url : str
URL of the news.
id : Optional[Union[str]]
id : Optional[str]
ID of the news. (provider: benzinga); Intrinio ID for the article. (provider: intrinio); Article ID. (provider: polygon)
author : Optional[Union[str]]
author : Optional[str]
Author of the news. (provider: benzinga); Author of the article. (provider: polygon)
teaser : Optional[Union[str]]
teaser : Optional[str]
Teaser of the news. (provider: benzinga)
images : Optional[Union[List[Dict[str, str]]]]
images : Optional[List[Dict[str, str]]]
Images associated with the news. (provider: benzinga)
channels : Optional[Union[str]]
channels : Optional[str]
Channels associated with the news. (provider: benzinga)
stocks : Optional[Union[str]]
stocks : Optional[str]
Stocks associated with the news. (provider: benzinga)
tags : Optional[Union[str]]
tags : Optional[str]
Tags associated with the news. (provider: benzinga)
updated : Optional[Union[datetime]]
updated : Optional[datetime]
None
symbol : Optional[Union[str]]
symbol : Optional[str]
Ticker of the fetched news. (provider: fmp)
site : Optional[Union[str]]
site : Optional[str]
Name of the news source. (provider: fmp)
amp_url : Optional[Union[str]]
amp_url : Optional[str]
AMP URL. (provider: polygon)
image_url : Optional[Union[str]]
image_url : Optional[str]
Image URL. (provider: polygon)
keywords : Optional[Union[List[str]]]
keywords : Optional[List[str]]
Keywords in the article (provider: polygon)
publisher : Optional[Union[openbb_polygon.models.stock_news.PolygonPublisher]]
Publisher of the article. (provider: polygon)
tickers : Optional[Union[List[str]]]
Tickers covered in the article. (provider: polygon)""" # noqa: E501
publisher : Optional[Union[openbb_polygon.models.stock_news.PolygonPublisher, str]]
Publisher of the article. (provider: polygon, yfinance)
tickers : Optional[List[str]]
Tickers covered in the article. (provider: polygon)
uuid : Optional[str]
Unique identifier for the news article (provider: yfinance)
type : Optional[str]
Type of the news article (provider: yfinance)
thumbnail : Optional[List]
Thumbnail related data to the ticker news article. (provider: yfinance)
related_tickers : Optional[str]
Tickers related to the news article. (provider: yfinance)""" # noqa: E501
inputs = filter_inputs(
provider_choices={
@@ -471,6 +651,7 @@ class ROUTER_stocks(Container):
"limit": limit,
},
extra_params=kwargs,
chart=chart,
)
return self._run(
@@ -487,11 +668,11 @@ class ROUTER_stocks(Container):
@validate_call
def quote(
self,
symbol: typing_extensions.Annotated[
symbol: Annotated[
Union[str, List[str]],
OpenBBCustomParameter(description="Comma separated list of symbols."),
] = None,
provider: Union[Literal["fmp", "intrinio"], None] = None,
provider: Optional[Literal["fmp", "intrinio"]] = None,
**kwargs
) -> OBBject[Union[List[Data], Data]]:
"""Load stock data for a specific ticker.
@@ -500,7 +681,7 @@ class ROUTER_stocks(Container):
----------
symbol : str
Comma separated list of symbols.
provider : Union[Literal['fmp', 'intrinio'], None]
provider : Optional[Literal['fmp', 'intrinio']]
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.
@@ -512,7 +693,7 @@ class ROUTER_stocks(Container):
OBBject
results : Union[List[StockQuote], StockQuote]
Serializable results.
provider : Union[Literal['fmp', 'intrinio'], None]
provider : Optional[Literal['fmp', 'intrinio']]
Provider name.
warnings : Optional[List[Warning_]]
List of warnings.
@@ -523,29 +704,29 @@ class ROUTER_stocks(Container):
StockQuote
----------
day_low : Optional[Union[float]]
day_low : Optional[float]
Lowest price of the stock in the current trading day.
day_high : Optional[Union[float]]
day_high : Optional[float]
Highest price of the stock in the current trading day.
date : Optional[Union[datetime]]
date : Optional[datetime]
Timestamp of the stock quote.
symbol : Optional[Union[str]]
symbol : Optional[str]
Symbol of the company. (provider: fmp)
name : Optional[Union[str]]
name : Optional[str]
Name of the company. (provider: fmp)
price : Optional[Union[float]]
price : Optional[float]
Current trading price of the stock. (provider: fmp)
changes_percentage : Optional[Union[float]]
changes_percentage : Optional[float]
Change percentage of the stock price. (provider: fmp)
change : Optional[Union[float]]
change : Optional[float]
Change in the stock price. (provider: fmp)
year_high : Optional[Union[float]]
year_high : Optional[float]
Highest price of the stock in the last 52 weeks. (provider: fmp)
year_low : Optional[Union[float]]
year_low : Optional[float]
Lowest price of the stock in the last 52 weeks. (provider: fmp)
market_cap : Optional[Union[float]]
market_cap : Optional[float]
Market cap of the company. (provider: fmp)
price_avg50 : Optional[Union[float]]
price_avg50 : Optional[float]
50 days average price of the stock. (provider: fmp)
price_avg200 : Optional[int]
200 days average price of the stock. (provider: fmp)
@@ -553,63 +734,63 @@ class ROUTER_stocks(Container):
Volume of the stock in the current trading day. (provider: fmp)
avg_volume : Optional[int]
Average volume of the stock in the last 10 trading days. (provider: fmp)
exchange : Optional[Union[str]]
exchange : Optional[str]
Exchange the stock is traded on. (provider: fmp)
open : Optional[Union[float]]
open : Optional[float]
Opening price of the stock in the current trading day. (provider: fmp)
previous_close : Optional[Union[float]]
previous_close : Optional[float]
Previous closing price of the stock. (provider: fmp)
eps : Optional[Union[float]]
eps : Optional[float]
Earnings per share of the stock. (provider: fmp)
pe : Optional[Union[float]]
pe : Optional[float]
Price earnings ratio of the stock. (provider: fmp)
earnings_announcement : Optional[Union[str]]
earnings_announcement : Optional[str]
Earnings announcement date of the stock. (provider: fmp)
shares_outstanding : Optional[int]
Number of shares outstanding of the stock. (provider: fmp)
last_price : Optional[Union[float]]
last_price : Optional[float]
Price of the last trade. (provider: intrinio)
last_time : Optional[Union[datetime]]
last_time : Optional[datetime]
Date and Time when the last trade occurred. (provider: intrinio)
last_size : Optional[Union[int]]
last_size : Optional[int]
Size of the last trade. (provider: intrinio)
bid_price : Optional[Union[float]]
bid_price : Optional[float]
Price of the top bid order. (provider: intrinio)
bid_size : Optional[Union[int]]
bid_size : Optional[int]
Size of the top bid order. (provider: intrinio)
ask_price : Optional[Union[float]]
ask_price : Optional[float]
Price of the top ask order. (provider: intrinio)
ask_size : Optional[Union[int]]
ask_size : Optional[int]
Size of the top ask order. (provider: intrinio)
open_price : Optional[Union[float]]
open_price : Optional[float]
Open price for the trading day. (provider: intrinio)
close_price : Optional[Union[float]]
close_price : Optional[float]
Closing price for the trading day (IEX source only). (provider: intrinio)
high_price : Optional[Union[float]]
high_price : Optional[float]
High Price for the trading day. (provider: intrinio)
low_price : Optional[Union[float]]
low_price : Optional[float]
Low Price for the trading day. (provider: intrinio)
exchange_volume : Optional[Union[int]]
exchange_volume : Optional[int]
Number of shares exchanged during the trading day on the exchange. (provider: intrinio)
market_volume : Optional[Union[int]]
market_volume : Optional[int]
Number of shares exchanged during the trading day for the whole market. (provider: intrinio)
updated_on : Optional[Union[datetime]]
updated_on : Optional[datetime]
Date and Time when the data was last updated. (provider: intrinio)
source : Optional[Union[str]]
source : Optional[str]
Source of the data. (provider: intrinio)
listing_venue : Optional[Union[str]]
listing_venue : Optional[str]
Listing venue where the trade took place (SIP source only). (provider: intrinio)
sales_conditions : Optional[Union[str]]
sales_conditions : Optional[str]
Indicates any sales condition modifiers associated with the trade. (provider: intrinio)
quote_conditions : Optional[Union[str]]
quote_conditions : Optional[str]
Indicates any quote condition modifiers associated with the trade. (provider: intrinio)
market_center_code : Optional[Union[str]]
market_center_code : Optional[str]
Market center character code. (provider: intrinio)
is_darkpool : Optional[Union[bool]]
is_darkpool : Optional[bool]
Whether or not the current trade is from a darkpool. (provider: intrinio)
messages : Optional[Union[List[str]]]
messages : Optional[List[str]]
Messages associated with the endpoint. (provider: intrinio)
security : Optional[Union[Dict[str, Any]]]
security : Optional[Dict[str, Any]]
Security details related to the quote. (provider: intrinio)""" # noqa: E501
inputs = filter_inputs(
@@ -626,3 +807,68 @@ class ROUTER_stocks(Container):
"/stocks/quote",
**inputs,
)
@validate_call
def search(
self,
query: Annotated[str, OpenBBCustomParameter(description="Search query.")] = "",
ticker: Annotated[
bool,
OpenBBCustomParameter(description="Whether to search by ticker symbol."),
] = False,
provider: Optional[Literal["cboe"]] = None,
**kwargs
) -> OBBject[List[Data]]:
"""Search for a company or stock ticker.
Parameters
----------
query : str
Search query.
ticker : bool
Whether to search by ticker symbol.
provider : Optional[Literal['cboe']]
The provider to use for the query, by default None.
If None, the provider specified in defaults is selected or 'cboe' if there is
no default.
Returns
-------
OBBject
results : List[StockSearch]
Serializable results.
provider : Optional[Literal['cboe']]
Provider name.
warnings : Optional[List[Warning_]]
List of warnings.
chart : Optional[Chart]
Chart object.
extra: Dict[str, Any]
Extra info.
StockSearch
-----------
symbol : str
Symbol to get data for.
name : str
Name of the company.
dpm_name : Optional[str]
Name of the primary market maker. (provider: cboe)
post_station : Optional[str]
Post and station location on the CBOE trading floor. (provider: cboe)""" # noqa: E501
inputs = filter_inputs(
provider_choices={
"provider": provider,
},
standard_params={
"query": query,
"ticker": ticker,
},
extra_params=kwargs,
)
return self._run(
"/stocks/search",
**inputs,
)

View File

@@ -1,14 +1,14 @@
### THIS FILE IS AUTO-GENERATED. DO NOT EDIT. ###
from typing import List, Literal, Union
from typing import List, Literal, Optional, Union
import typing_extensions
from openbb_core.app.model.custom_parameter import OpenBBCustomParameter
from openbb_core.app.model.obbject import OBBject
from openbb_core.app.static.container import Container
from openbb_core.app.static.filters import filter_inputs
from openbb_provider.abstract.data import Data
from pydantic import validate_call
from typing_extensions import Annotated
class ROUTER_stocks_ca(Container):
@@ -22,11 +22,11 @@ class ROUTER_stocks_ca(Container):
@validate_call
def peers(
self,
symbol: typing_extensions.Annotated[
symbol: Annotated[
Union[str, List[str]],
OpenBBCustomParameter(description="Symbol to get data for."),
],
provider: Union[Literal["fmp"], None] = None,
provider: Optional[Literal["fmp"]] = None,
**kwargs
) -> OBBject[Data]:
"""Company peers.
@@ -35,7 +35,7 @@ class ROUTER_stocks_ca(Container):
----------
symbol : str
Symbol to get data for.
provider : Union[Literal['fmp'], None]
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
no default.
@@ -43,9 +43,9 @@ class ROUTER_stocks_ca(Container):
Returns
-------
OBBject
results : Union[StockPeers]
results : StockPeers
Serializable results.
provider : Union[Literal['fmp'], None]
provider : Optional[Literal['fmp']]
Provider name.
warnings : Optional[List[Warning_]]
List of warnings.

View File

@@ -1350,10 +1350,10 @@ class ROUTER_stocks_fa(Container):
URL to the document.
symbol : Optional[str]
The ticker symbol of the company. (provider: fmp)
accepted_date : Optional[date]
Accepted date of the SEC filing. (provider: fmp)
cik : Optional[str]
CIK of the SEC filing. (provider: fmp)
accepted_date : Optional[datetime]
Accepted date of the SEC filing. (provider: fmp)
final_link : Optional[str]
Final link of the SEC filing. (provider: fmp)""" # noqa: E501

View File

@@ -1,14 +1,14 @@
### THIS FILE IS AUTO-GENERATED. DO NOT EDIT. ###
from typing import List, Literal, Union
from typing import List, Literal, Optional, Union
import typing_extensions
from openbb_core.app.model.custom_parameter import OpenBBCustomParameter
from openbb_core.app.model.obbject import OBBject
from openbb_core.app.static.container import Container
from openbb_core.app.static.filters import filter_inputs
from openbb_provider.abstract.data import Data
from pydantic import validate_call
from typing_extensions import Annotated
class ROUTER_stocks_options(Container):
@@ -22,11 +22,11 @@ class ROUTER_stocks_options(Container):
@validate_call
def chains(
self,
symbol: typing_extensions.Annotated[
symbol: Annotated[
Union[str, List[str]],
OpenBBCustomParameter(description="Symbol to get data for."),
],
provider: Union[Literal["intrinio"], None] = None,
provider: Optional[Literal["cboe", "intrinio"]] = None,
**kwargs
) -> OBBject[List[Data]]:
"""Get the complete options chain for a ticker.
@@ -35,19 +35,19 @@ class ROUTER_stocks_options(Container):
----------
symbol : str
Symbol to get data for.
provider : Union[Literal['intrinio'], None]
provider : Optional[Literal['cboe', '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
If None, the provider specified in defaults is selected or 'cboe' if there is
no default.
date : Optional[Union[str]]
date : Optional[str]
Date for which the options chains are returned. (provider: intrinio)
Returns
-------
OBBject
results : Union[List[OptionsChains]]
results : List[OptionsChains]
Serializable results.
provider : Union[Literal['intrinio'], None]
provider : Optional[Literal['cboe', 'intrinio']]
Provider name.
warnings : Optional[List[Warning_]]
List of warnings.
@@ -70,46 +70,68 @@ class ROUTER_stocks_options(Container):
Call or Put.
date : date
Date for which the options chains are returned.
close : Optional[Union[float]]
close : Optional[float]
Close price for the option that day.
close_bid : Optional[Union[float]]
close_bid : Optional[float]
The closing bid price for the option that day.
close_ask : Optional[Union[float]]
close_ask : Optional[float]
The closing ask price for the option that day.
volume : Optional[Union[float]]
volume : Optional[float]
Current trading volume on the contract.
open : Optional[Union[float]]
open : Optional[float]
Opening price of the option.
open_bid : Optional[Union[float]]
open_bid : Optional[float]
The opening bid price for the option that day.
open_ask : Optional[Union[float]]
open_ask : Optional[float]
The opening ask price for the option that day.
open_interest : Optional[Union[float]]
open_interest : Optional[float]
Open interest on the contract.
high : Optional[Union[float]]
high : Optional[float]
High price of the option.
low : Optional[Union[float]]
low : Optional[float]
Low price of the option.
mark : Optional[Union[float]]
mark : Optional[float]
The mid-price between the latest bid-ask spread.
ask_high : Optional[Union[float]]
ask_high : Optional[float]
The highest ask price for the option that day.
ask_low : Optional[Union[float]]
ask_low : Optional[float]
The lowest ask price for the option that day.
bid_high : Optional[Union[float]]
bid_high : Optional[float]
The highest bid price for the option that day.
bid_low : Optional[Union[float]]
bid_low : Optional[float]
The lowest bid price for the option that day.
implied_volatility : Optional[Union[float]]
implied_volatility : Optional[float]
Implied volatility of the option.
delta : Optional[Union[float]]
delta : Optional[float]
Delta of the option.
gamma : Optional[Union[float]]
gamma : Optional[float]
Gamma of the option.
theta : Optional[Union[float]]
theta : Optional[float]
Theta of the option.
vega : Optional[Union[float]]
Vega of the option.""" # noqa: E501
vega : Optional[float]
Vega of the option.
bid_size : Optional[int]
Bid size for the option. (provider: cboe)
ask_size : Optional[int]
Ask size for the option. (provider: cboe)
theoretical : Optional[float]
Theoretical value of the option. (provider: cboe)
last_trade_price : Optional[float]
Last trade price of the option. (provider: cboe)
tick : Optional[str]
Whether the last tick was up or down in price. (provider: cboe)
prev_close : Optional[float]
Previous closing price of the option. (provider: cboe)
change : Optional[float]
Change in price of the option. (provider: cboe)
change_percent : Optional[float]
Change, in percent, of the option. (provider: cboe)
rho : Optional[float]
Rho of the option. (provider: cboe)
last_trade_timestamp : Optional[datetime]
Last trade timestamp of the option. (provider: cboe)
dte : Optional[int]
Days to expiration for the option. (provider: cboe)""" # noqa: E501
inputs = filter_inputs(
provider_choices={

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,39 @@
"""GDP data and query params."""
from datetime import date as dateType
from typing import Literal, Optional
from pydantic import Field
from openbb_provider.abstract.data import Data
from openbb_provider.abstract.query_params import QueryParams
from openbb_provider.utils.descriptions import DATA_DESCRIPTIONS, QUERY_DESCRIPTIONS
class GDPForecastQueryParams(QueryParams):
"""GDP Forecast query."""
period: Literal["quarter", "annual"] = Field(
default="annual",
description="Units for nominal GDP period. Either quarter or annual.",
)
start_date: Optional[dateType] = Field(
default=None, description=QUERY_DESCRIPTIONS.get("start_date")
)
end_date: Optional[dateType] = Field(
default=None, description=QUERY_DESCRIPTIONS.get("end_date")
)
type: Literal["nominal", "real"] = Field(
default="real",
description="Type of GDP to get forecast of. Either nominal or real.",
)
class GDPForecastData(Data):
"""Nominal GDP data."""
date: Optional[dateType] = Field(
default=None, description=DATA_DESCRIPTIONS.get("date")
)
value: Optional[float] = Field(
default=None, description="Nominal GDP value on the date."
)

View File

@@ -0,0 +1,35 @@
"""GDP data and query params."""
from datetime import date as dateType
from typing import Literal, Optional
from pydantic import Field
from openbb_provider.abstract.data import Data
from openbb_provider.abstract.query_params import QueryParams
from openbb_provider.utils.descriptions import DATA_DESCRIPTIONS, QUERY_DESCRIPTIONS
class GDPNomQueryParams(QueryParams):
"""Nominal GDP query."""
units: Literal["usd", "usd_cap"] = Field(
default="usd",
description="Units to get nominal GDP in. Either usd or usd_cap indicating per capita.",
)
start_date: Optional[dateType] = Field(
default=None, description=QUERY_DESCRIPTIONS.get("start_date")
)
end_date: Optional[dateType] = Field(
default=None, description=QUERY_DESCRIPTIONS.get("end_date")
)
class GDPNomData(Data):
"""Nominal GDP data."""
date: Optional[dateType] = Field(
default=None, description=DATA_DESCRIPTIONS.get("date")
)
value: Optional[float] = Field(
default=None, description="Nominal GDP value on the date."
)

View File

@@ -0,0 +1,35 @@
"""GDP data and query params."""
from datetime import date as dateType
from typing import Literal, Optional
from pydantic import Field
from openbb_provider.abstract.data import Data
from openbb_provider.abstract.query_params import QueryParams
from openbb_provider.utils.descriptions import DATA_DESCRIPTIONS, QUERY_DESCRIPTIONS
class GDPRealQueryParams(QueryParams):
"""Real GDP query."""
units: Literal["idx", "qoq", "yoy"] = Field(
default="yoy",
description="Units to get real GDP in. Either idx (indicating 2015=100), qoq (previous period) or yoy (same period, previous year).)",
)
start_date: Optional[dateType] = Field(
default=None, description=QUERY_DESCRIPTIONS.get("start_date")
)
end_date: Optional[dateType] = Field(
default=None, description=QUERY_DESCRIPTIONS.get("end_date")
)
class GDPRealData(Data):
"""Real GDP data."""
date: Optional[dateType] = Field(
default=None, description=DATA_DESCRIPTIONS.get("date")
)
value: Optional[float] = Field(
default=None, description="Nominal GDP value on the date."
)

View File

@@ -11,7 +11,7 @@ python = "^3.8"
importlib_metadata = "^6.8.0"
pydantic = "^2.4.2"
requests = "^2.31.0"
urllib3 = "<2.0.0"
urllib3 = ">2.0.0"
importlib-metadata = "^6.8.0"
python-dotenv = "^1.0.0"
pytest-recorder = "^0.2.3"

View File

View File

@@ -0,0 +1,16 @@
"""FRED provider module."""
from openbb_oecd.models.gdpforecast import OECDGDPForecastFetcher
from openbb_oecd.models.gdpnom import OECDGDPNomFetcher
from openbb_oecd.models.gdpreal import OECDGDPRealFetcher
from openbb_provider.abstract.provider import Provider
oecd_provider = Provider(
name="oecd",
website="https://stats.oecd.org/",
description="""OECD""",
fetcher_dict={
"GDPNom": OECDGDPNomFetcher,
"GDPReal": OECDGDPRealFetcher,
"GDPForecast": OECDGDPForecastFetcher,
},
)

View File

@@ -0,0 +1,94 @@
import re
from datetime import date
from typing import Any, Dict, List, Literal, Optional, Union
from openbb_oecd.utils import constants, helpers
from openbb_provider.abstract.fetcher import Fetcher
from openbb_provider.standard_models.gdpforecast import (
GDPForecastData,
GDPForecastQueryParams,
)
from pydantic import Field, field_validator
gdp_countries = tuple(constants.COUNTRY_TO_CODE_GDP_FORECAST.keys())
class OECDGDPForecastQueryParams(GDPForecastQueryParams):
"""GDP Forecast query."""
country: Literal[*gdp_countries] = Field(
description="Country to get GDP for.", default="united_states"
)
class OECDGDPForecastData(GDPForecastData):
"""GDP Forecast data from OECD."""
@field_validator("date", mode="before")
@classmethod
def date_validate(
cls, in_date: Union[date, Union[str, int]]
): # pylint: disable=E0213
"""Validate value."""
# OECD Returns dates like 2022-Q2, so we map that to the end of the quarter.
if isinstance(in_date, str):
if re.match(r"\d{4}-Q[1-4]$", in_date):
year, quarter = in_date.split("-")
quarter = int(quarter[1])
month = quarter * 3
return date(int(year), month, 1)
else:
raise ValueError("Date string does not match the format YYYY-QN")
if isinstance(in_date, int):
return date(in_date, 12, 31)
return date
class OECDGDPForecastFetcher(
Fetcher[OECDGDPForecastQueryParams, List[OECDGDPForecastData]]
):
"""OECD GDP Forecast Fetcher."""
@staticmethod
def transform_query(params: Dict[str, Any]) -> OECDGDPForecastQueryParams:
transformed_params = params.copy()
if transformed_params["start_date"] is None:
transformed_params["start_date"] = date(1990, 1, 1)
if transformed_params["end_date"] is None:
transformed_params["end_date"] = date(date.today().year + 10, 12, 31)
return OECDGDPForecastQueryParams(**transformed_params)
@staticmethod
def extract_data(
query: OECDGDPForecastQueryParams,
credentials: Optional[Dict[str, str]],
**kwargs: Any,
) -> dict:
units = query.period[0].upper()
if query.type == "real":
url = f"https://stats.oecd.org/sdmx-json/data/DP_LIVE/.REALGDPFORECAST.TOT.AGRWTH.{units}/OECD?contentType=csv&detail=code&separator=comma&csv-lang=en&startPeriod={query.start_date}&endPeriod={query.end_date}"
elif query.type == "nominal":
url = f"https://stats.oecd.org/sdmx-json/data/DP_LIVE/.NOMGDPFORECAST.TOT.AGRWTH.{units}/OECD?contentType=csv&detail=code&separator=comma&csv-lang=en&startPeriod={query.start_date}&endPeriod={query.end_date}"
data_df = helpers.fetch_data(url, csv_kwargs={"encoding": "utf-8"}, **kwargs)
# Sometimes there is weird unicode characters in the column names, so we need to rename them.
# Even changing the encoding on the fetch doesn't seem to help.
data_df = data_df.rename(
columns={
'"LOCATION"': "country",
"TIME": "date",
"Value": "value",
"Location": "country",
}
)
data_df["country"] = data_df["country"].map(
constants.CODE_TO_COUNTRY_GDP_FORECAST
)
data_df = data_df[data_df["country"] == query.country]
data_df = data_df[["country", "date", "value"]]
return data_df.to_dict(orient="records")
@staticmethod
def transform_data(data: dict) -> List[OECDGDPForecastData]:
return [OECDGDPForecastData.model_validate(d) for d in data]

View File

@@ -0,0 +1,74 @@
"""OECD GDP Fetcher."""
from datetime import date
from typing import Any, Dict, List, Literal, Optional, Union
from openbb_oecd.utils import constants, helpers
from openbb_provider.abstract.fetcher import Fetcher
from openbb_provider.standard_models.gdpnom import GDPNomData, GDPNomQueryParams
from pydantic import Field, field_validator
gdp_countries = tuple(constants.COUNTRY_TO_CODE_GDP.keys())
class OECDGDPNomQueryParams(GDPNomQueryParams):
"""GDP query."""
country: Literal[*gdp_countries] = Field(
description="Country to get GDP for.", default="united_states"
)
class OECDGDPNomData(GDPNomData):
"""Nominal GDP data from OECD."""
@field_validator("date", mode="before")
@classmethod
def date_validate(cls, in_date: Union[date, int]): # pylint: disable=E0213
"""Validate value."""
if isinstance(in_date, int):
return date(in_date, 12, 31)
return date
class OECDGDPNomFetcher(Fetcher[OECDGDPNomQueryParams, List[OECDGDPNomData]]):
"""OECD Nominal GDP Fetcher."""
@staticmethod
def transform_query(params: Dict[str, Any]) -> OECDGDPNomQueryParams:
transformed_params = params.copy()
if transformed_params["start_date"] is None:
transformed_params["start_date"] = date(1950, 1, 1)
if transformed_params["end_date"] is None:
transformed_params["end_date"] = date(date.today().year, 12, 31)
return OECDGDPNomQueryParams(**transformed_params)
@staticmethod
def extract_data(
query: OECDGDPNomQueryParams,
credentials: Optional[Dict[str, str]],
**kwargs: Any,
) -> dict:
unit = "MLN_USD" if query.units == "usd" else "USD_CAP"
url = f"https://stats.oecd.org/sdmx-json/data/DP_LIVE/.GDP.TOT.{unit}.A/OECD?contentType=csv&detail=code&separator=comma&csv-lang=en&startPeriod={query.start_date}&endPeriod={query.end_date}"
data_df = helpers.fetch_data(url, csv_kwargs={"encoding": "utf-8"}, **kwargs)
# Sometimes there is weird unicode characters in the column names, so we need to rename them.
# Even changing the encoding on the fetch doesn't seem to help.
data_df = data_df.rename(
columns={
'"LOCATION"': "country",
"TIME": "date",
"Value": "value",
"Location": "country",
}
)
data_df["country"] = data_df["country"].map(constants.CODE_TO_COUNTRY_GDP)
data_df = data_df[data_df["country"] == query.country]
data_df = data_df[["country", "date", "value"]]
return data_df.to_dict(orient="records")
@staticmethod
def transform_data(data: dict) -> List[OECDGDPNomData]:
return [OECDGDPNomData.model_validate(d) for d in data]

View File

@@ -0,0 +1,83 @@
"""OECD GDP Fetcher."""
from datetime import date
from typing import Any, Dict, List, Literal, Optional, Union
from openbb_oecd.utils import constants, helpers
from openbb_provider.abstract.fetcher import Fetcher
from openbb_provider.standard_models.gdpreal import GDPRealData, GDPRealQueryParams
from pydantic import Field, field_validator
rgdp_countries = tuple(constants.COUNTRY_TO_CODE_RGDP.keys())
class OECDGDPRealQueryParams(GDPRealQueryParams):
"""GDP query."""
country: Literal[*rgdp_countries] = Field(
description="Country to get GDP for.", default="united_states"
)
class OECDGDPRealData(GDPRealData):
"""Nominal GDP data from OECD."""
@field_validator("date", mode="before")
@classmethod
def date_validate(cls, in_date: Union[date, str]): # pylint: disable=E0213
"""Validate value."""
if isinstance(in_date, str):
year, quarter = in_date.split("-")
year = int(year)
if quarter == "Q1":
return date(year, 3, 31)
elif quarter == "Q2":
return date(year, 6, 30)
elif quarter == "Q3":
return date(year, 9, 30)
elif quarter == "Q4":
return date(year, 12, 31)
return in_date
class OECDGDPRealFetcher(Fetcher[OECDGDPRealQueryParams, List[OECDGDPRealData]]):
"""OECD Nominal GDP Fetcher."""
@staticmethod
def transform_query(params: Dict[str, Any]) -> OECDGDPRealQueryParams:
transformed_params = params.copy()
if transformed_params["start_date"] is None:
transformed_params["start_date"] = date(1950, 1, 1)
if transformed_params["end_date"] is None:
transformed_params["end_date"] = date(date.today().year, 12, 31)
return OECDGDPRealQueryParams(**transformed_params)
@staticmethod
def extract_data(
query: OECDGDPRealQueryParams,
credentials: Optional[Dict[str, str]],
**kwargs: Any,
) -> dict:
units = {"qoq": "PC_CHGPP", "yoy": "PC_CHGPY", "idx": "IDX"}[query.units]
url = f"https://stats.oecd.org/sdmx-json/data/DP_LIVE/.QGDP.{'VOLIDX' if units == 'IDX' else 'TOT'}.{units}.Q/OECD?contentType=csv&detail=code&separator=comma&csv-lang=en&startPeriod={query.start_date}&endPeriod={query.end_date}"
data_df = helpers.fetch_data(url, csv_kwargs={"encoding": "utf-8"}, **kwargs)
# Sometimes there is weird unicode characters in the column names, so we need to rename them.
# Even changing the encoding on the fetch doesn't seem to help.
data_df = data_df.rename(
columns={
'"LOCATION"': "country",
"TIME": "date",
"Value": "value",
"Location": "country",
}
)
data_df["country"] = data_df["country"].map(constants.CODE_TO_COUNTRY_RGDP)
data_df = data_df[data_df["country"] == query.country]
data_df = data_df[["country", "date", "value"]]
return data_df.to_dict(orient="records")
@staticmethod
def transform_data(data: dict) -> List[OECDGDPRealData]:
return [OECDGDPRealData.model_validate(d) for d in data]

View File

@@ -0,0 +1,456 @@
COUNTRY_TO_CODE_GDP = {
"australia": "AUS",
"austria": "AUT",
"belgium": "BEL",
"brazil": "BRA",
"canada": "CAN",
"chile": "CHL",
"colombia": "COL",
"costa_rica": "CRI",
"czech_republic": "CZE",
"denmark": "DNK",
"estonia": "EST",
"euro_area": "EA",
"european_union": "EU",
"finland": "FIN",
"france": "FRA",
"germany": "DEU",
"greece": "GRC",
"hungary": "HUN",
"iceland": "ISL",
"indonesia": "IDN",
"ireland": "IRL",
"israel": "ISR",
"italy": "ITA",
"japan": "JPN",
"korea": "KOR",
"latvia": "LVA",
"lithuania": "LTU",
"luxembourg": "LUX",
"mexico": "MEX",
"netherlands": "NLD",
"new_zealand": "NZL",
"norway": "NOR",
"poland": "POL",
"portugal": "PRT",
"russia": "RUS",
"slovak_republic": "SVK",
"slovenia": "SVN",
"south_africa": "ZAF",
"spain": "ESP",
"sweden": "SWE",
"switzerland": "CHE",
"turkey": "TUR",
"united_kingdom": "GBR",
"united_states": "USA",
}
CODE_TO_COUNTRY_GDP = {v: k for k, v in COUNTRY_TO_CODE_GDP.items()}
COUNTRY_TO_CODE_RGDP = {
"G20": "G-20",
"G7": "G-7",
"argentina": "ARG",
"australia": "AUS",
"austria": "AUT",
"belgium": "BEL",
"brazil": "BRA",
"bulgaria": "BGR",
"canada": "CAN",
"chile": "CHL",
"china": "CHN",
"colombia": "COL",
"costa_rica": "CRI",
"croatia": "HRV",
"czech_republic": "CZE",
"denmark": "DNK",
"estonia": "EST",
"euro_area_19": "EA19",
"europe": "OECDE",
"european_union_27": "EU27_2020",
"finland": "FIN",
"france": "FRA",
"germany": "DEU",
"greece": "GRC",
"hungary": "HUN",
"iceland": "ISL",
"india": "IND",
"indonesia": "IDN",
"ireland": "IRL",
"israel": "ISR",
"italy": "ITA",
"japan": "JPN",
"korea": "KOR",
"latvia": "LVA",
"lithuania": "LTU",
"luxembourg": "LUX",
"mexico": "MEX",
"netherlands": "NLD",
"new_zealand": "NZL",
"norway": "NOR",
"oecd_total": "OECD",
"poland": "POL",
"portugal": "PRT",
"romania": "ROU",
"russia": "RUS",
"saudi_arabia": "SAU",
"slovak_republic": "SVK",
"slovenia": "SVN",
"south_africa": "ZAF",
"spain": "ESP",
"sweden": "SWE",
"switzerland": "CHE",
"turkey": "TUR",
"united_kingdom": "GBR",
"united_states": "USA",
}
CODE_TO_COUNTRY_RGDP = {v: k for k, v in COUNTRY_TO_CODE_RGDP.items()}
COUNTRY_TO_CODE_GDP_FORECAST = {
"argentina": "ARG",
"asia": "DAE",
"australia": "AUS",
"austria": "AUT",
"belgium": "BEL",
"brazil": "BRA",
"bulgaria": "BGR",
"canada": "CAN",
"chile": "CHL",
"china": "CHN",
"colombia": "COL",
"costa_rica": "CRI",
"croatia": "HRV",
"czech_republic": "CZE",
"denmark": "DNK",
"estonia": "EST",
"euro_area_17": "EA17",
"finland": "FIN",
"france": "FRA",
"germany": "DEU",
"greece": "GRC",
"hungary": "HUN",
"iceland": "ISL",
"india": "IND",
"indonesia": "IDN",
"ireland": "IRL",
"israel": "ISR",
"italy": "ITA",
"japan": "JPN",
"korea": "KOR",
"latvia": "LVA",
"lithuania": "LTU",
"luxembourg": "LUX",
"mexico": "MEX",
"netherlands": "NLD",
"new_zealand": "NZL",
"non-oecd": "NMEC",
"norway": "NOR",
"oecd_total": "OECD",
"peru": "PER",
"poland": "POL",
"portugal": "PRT",
"romania": "ROU",
"russia": "RUS",
"slovak_republic": "SVK",
"slovenia": "SVN",
"south_africa": "ZAF",
"spain": "ESP",
"sweden": "SWE",
"switzerland": "CHE",
"turkey": "TUR",
"united_kingdom": "GBR",
"united_states": "USA",
"world": "WLD",
}
CODE_TO_COUNTRY_GDP_FORECAST = {v: k for k, v in COUNTRY_TO_CODE_GDP_FORECAST.items()}
COUNTRY_TO_CODE_CPI = {
"G20": "G-20",
"G7": "G-7",
"argentina": "ARG",
"australia": "AUS",
"austria": "AUT",
"belgium": "BEL",
"brazil": "BRA",
"canada": "CAN",
"chile": "CHL",
"china": "CHN",
"colombia": "COL",
"costa_rica": "CRI",
"czech_republic": "CZE",
"denmark": "DNK",
"estonia": "EST",
"euro_area_19": "EA19",
"europe": "OECDE",
"european_union_27": "EU27_2020",
"finland": "FIN",
"france": "FRA",
"germany": "DEU",
"greece": "GRC",
"hungary": "HUN",
"iceland": "ISL",
"india": "IND",
"indonesia": "IDN",
"ireland": "IRL",
"israel": "ISR",
"italy": "ITA",
"japan": "JPN",
"korea": "KOR",
"latvia": "LVA",
"lithuania": "LTU",
"luxembourg": "LUX",
"mexico": "MEX",
"netherlands": "NLD",
"new_zealand": "NZL",
"norway": "NOR",
"oecd_total": "OECD",
"poland": "POL",
"portugal": "PRT",
"russia": "RUS",
"saudi_arabia": "SAU",
"slovak_republic": "SVK",
"slovenia": "SVN",
"south_africa": "ZAF",
"spain": "ESP",
"sweden": "SWE",
"switzerland": "CHE",
"turkey": "TUR",
"united_kingdom": "GBR",
"united_states": "USA",
}
COUNTRY_TO_CODE_BALANCE = {
"australia": "AUS",
"austria": "AUT",
"belgium": "BEL",
"brazil": "BRA",
"canada": "CAN",
"chile": "CHL",
"colombia": "COL",
"costa_rica": "CRI",
"czech_republic": "CZE",
"denmark": "DNK",
"estonia": "EST",
"euro_area": "EA",
"european_union": "EU",
"finland": "FIN",
"france": "FRA",
"germany": "DEU",
"greece": "GRC",
"hungary": "HUN",
"iceland": "ISL",
"indonesia": "IDN",
"ireland": "IRL",
"israel": "ISR",
"italy": "ITA",
"japan": "JPN",
"korea": "KOR",
"latvia": "LVA",
"lithuania": "LTU",
"luxembourg": "LUX",
"mexico": "MEX",
"netherlands": "NLD",
"new_zealand": "NZL",
"norway": "NOR",
"poland": "POL",
"portugal": "PRT",
"russia": "RUS",
"slovak_republic": "SVK",
"slovenia": "SVN",
"south_africa": "ZAF",
"spain": "ESP",
"sweden": "SWE",
"switzerland": "CHE",
"turkey": "TUR",
"united_kingdom": "GBR",
"united_states": "USA",
}
COUNTRY_TO_CODE_REVENUE = {
"australia": "AUS",
"austria": "AUT",
"belgium": "BEL",
"brazil": "BRA",
"canada": "CAN",
"chile": "CHL",
"colombia": "COL",
"costa_rica": "CRI",
"czech_republic": "CZE",
"denmark": "DNK",
"estonia": "EST",
"euro_area": "EA",
"european_union": "EU",
"finland": "FIN",
"france": "FRA",
"germany": "DEU",
"greece": "GRC",
"hungary": "HUN",
"iceland": "ISL",
"indonesia": "IDN",
"ireland": "IRL",
"israel": "ISR",
"italy": "ITA",
"japan": "JPN",
"korea": "KOR",
"latvia": "LVA",
"lithuania": "LTU",
"luxembourg": "LUX",
"mexico": "MEX",
"netherlands": "NLD",
"new_zealand": "NZL",
"norway": "NOR",
"oecd_average": "OAVG",
"oecd_europe": "OEU",
"oecd_total": "OECD",
"poland": "POL",
"portugal": "PRT",
"romania": "ROU",
"russia": "RUS",
"slovak_republic": "SVK",
"slovenia": "SVN",
"spain": "ESP",
"sweden": "SWE",
"switzerland": "CHE",
"turkey": "TUR",
"united_kingdom": "GBR",
"united_states": "USA",
}
COUNTRY_TO_CODE_SPENDING = {
"australia": "AUS",
"austria": "AUT",
"belgium": "BEL",
"brazil": "BRA",
"canada": "CAN",
"chile": "CHL",
"colombia": "COL",
"costa_rica": "CRI",
"czech_republic": "CZE",
"denmark": "DNK",
"estonia": "EST",
"finland": "FIN",
"france": "FRA",
"germany": "DEU",
"greece": "GRC",
"hungary": "HUN",
"iceland": "ISL",
"indonesia": "IDN",
"ireland": "IRL",
"israel": "ISR",
"italy": "ITA",
"japan": "JPN",
"korea": "KOR",
"latvia": "LVA",
"lithuania": "LTU",
"luxembourg": "LUX",
"mexico": "MEX",
"netherlands": "NLD",
"new_zealand": "NZL",
"norway": "NOR",
"oecd_average": "OAVG",
"oecd_europe": "OEU",
"oecd_total": "OECD",
"poland": "POL",
"portugal": "PRT",
"romania": "ROU",
"russia": "RUS",
"slovak_republic": "SVK",
"slovenia": "SVN",
"spain": "ESP",
"sweden": "SWE",
"switzerland": "CHE",
"turkey": "TUR",
"united_kingdom": "GBR",
"united_states": "USA",
}
COUNTRY_TO_CODE_DEBT = {
"australia": "AUS",
"austria": "AUT",
"belgium": "BEL",
"brazil": "BRA",
"canada": "CAN",
"chile": "CHL",
"colombia": "COL",
"czech_republic": "CZE",
"denmark": "DNK",
"estonia": "EST",
"finland": "FIN",
"france": "FRA",
"germany": "DEU",
"greece": "GRC",
"hungary": "HUN",
"iceland": "ISL",
"ireland": "IRL",
"israel": "ISR",
"italy": "ITA",
"japan": "JPN",
"korea": "KOR",
"latvia": "LVA",
"lithuania": "LTU",
"luxembourg": "LUX",
"mexico": "MEX",
"netherlands": "NLD",
"new_zealand": "NZL",
"norway": "NOR",
"oecd_average": "OAVG",
"oecd_total": "OECD",
"poland": "POL",
"portugal": "PRT",
"romania": "ROU",
"russia": "RUS",
"slovak_republic": "SVK",
"slovenia": "SVN",
"spain": "ESP",
"sweden": "SWE",
"switzerland": "CHE",
"turkey": "TUR",
"united_kingdom": "GBR",
"united_states": "USA",
}
COUNTRY_TO_CODE_TRUST = {
"australia": "AUS",
"austria": "AUT",
"belgium": "BEL",
"brazil": "BRA",
"canada": "CAN",
"chile": "CHL",
"colombia": "COL",
"costa_rica": "CRI",
"czech_republic": "CZE",
"denmark": "DNK",
"estonia": "EST",
"finland": "FIN",
"france": "FRA",
"germany": "DEU",
"greece": "GRC",
"hungary": "HUN",
"iceland": "ISL",
"ireland": "IRL",
"israel": "ISR",
"italy": "ITA",
"japan": "JPN",
"korea": "KOR",
"latvia": "LVA",
"lithuania": "LTU",
"luxembourg": "LUX",
"mexico": "MEX",
"netherlands": "NLD",
"new_zealand": "NZL",
"norway": "NOR",
"poland": "POL",
"portugal": "PRT",
"russia": "RUS",
"slovak_republic": "SVK",
"slovenia": "SVN",
"south_africa": "ZAF",
"spain": "ESP",
"sweden": "SWE",
"switzerland": "CHE",
"turkey": "TUR",
"united_kingdom": "GBR",
"united_states": "USA",
}

View File

@@ -0,0 +1,66 @@
import ssl
import sys
from io import StringIO
from typing import Any, Dict, Optional
import requests
import urllib3
from openbb_provider import helpers
from pandas import DataFrame, read_csv
if sys.version_info >= (3, 10):
PATCH = True
else:
PATCH = False
# OECD does not play well with newer python. This code block from stackoverflow helps
# to create a custom session:
class CustomHttpAdapter(requests.adapters.HTTPAdapter):
# "Transport adapter" that allows us to use custom ssl_context.
def __init__(self, ssl_context=None, **kwargs):
self.ssl_context = ssl_context
super().__init__(**kwargs)
def init_poolmanager(self, connections, maxsize, block=False):
self.poolmanager = urllib3.poolmanager.PoolManager(
num_pools=connections,
maxsize=maxsize,
block=block,
ssl_context=self.ssl_context,
)
def get_legacy_session():
"""Stackoverflow code to create a custom session."""
ctx = ssl.create_default_context(ssl.Purpose.SERVER_AUTH)
ctx.options |= 0x4 # OP_LEGACY_SERVER_CONNECT
session = requests.Session()
session.mount("https://", CustomHttpAdapter(ctx))
return session
def create_session():
"""Create a session for making requests to the OECD API.
This will create the patched session if the python version is >= 3.10. Otherwise,
it will just use regular requests.
"""
if PATCH:
return get_legacy_session()
return requests.Session()
def fetch_data(url: str, csv_kwargs: Optional[Dict] = None, **kwargs: Any) -> DataFrame:
"""Create a session and fetch data from the OECD API."""
session = create_session()
response = helpers.make_request(url, session=session, **kwargs)
if csv_kwargs is None:
csv_kwargs = {}
# Pass any additional arguments to read_csv. This will likely need to be skiplines
# or a delimiter.
data = read_csv(StringIO(response.text), **csv_kwargs)
return data

1529
openbb_platform/providers/oecd/poetry.lock generated vendored Normal file

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,19 @@
[tool.poetry]
name = "openbb-oecd"
version = "0.1.0a2"
description = "OECD extension for OpenBB"
authors = ["OpenBB Team <hello@openbb.co>"]
readme = "README.md"
packages = [{ include = "openbb_oecd" }]
[tool.poetry.dependencies]
python = "^3.8"
openbb-core = "^0.1.0a2"
urllib3 = ">1.26.16"
[build-system]
requires = ["poetry-core"]
build-backend = "poetry.core.masonry.api"
[tool.poetry.plugins."openbb_provider_extension"]
oecd = "openbb_oecd:oecd_provider"

View File

@@ -0,0 +1,99 @@
interactions:
- request:
body: null
headers:
Accept:
- '*/*'
Accept-Encoding:
- gzip, deflate, br
Connection:
- keep-alive
method: GET
uri: https://stats.oecd.org/sdmx-json/data/DP_LIVE/.REALGDPFORECAST.TOT.AGRWTH.A/OECD?contentType=csv&csv-lang=en&detail=code&endPeriod=2023-06-06&separator=comma&startPeriod=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P3Jp8fvk8nDgGidgqixSxloTsl/DSg0IPLiyI3co+UfCuDJ
e3p/IDQesmXkpsOq7pLDLg7/t1/9JH1/WyAYDwIYirf3yc2m7MoO++rvB4XGs0uLhQTjIfmklFaX
FMD7AaHxkHba2yU3jkJ3yozsMse9PH0fWcZ4SN+S1t8l5iVtqVnF94Mi4yH9RsJzcEChg0RkfSCb
gNB4KB9Ia+P0Hy0YkmoY/cbJ/wPKKADtNCwAAA==
headers:
Access-Control-Allow-Headers:
- Content-Type
Access-Control-Allow-Methods:
- POST,GET,OPTIONS
Access-Control-Allow-Origin:
- '*'
Cache-Control:
- private
Content-Disposition:
- attachment;filename=DP_LIVE_10102023171715433.csv
Content-Encoding:
- gzip
Content-Type:
- text/csv
Date:
- Tue, 10 Oct 2023 15:17:14 GMT
Transfer-Encoding:
- chunked
Vary:
- Accept-Encoding
status:
code: 200
message: OK
version: 1

View File

@@ -0,0 +1,91 @@
interactions:
- request:
body: null
headers:
Accept:
- '*/*'
Accept-Encoding:
- gzip, deflate, br
Connection:
- keep-alive
method: GET
uri: https://stats.oecd.org/sdmx-json/data/DP_LIVE/.GDP.TOT.MLN_USD.A/OECD?contentType=csv&csv-lang=en&detail=code&endPeriod=2023-06-06&separator=comma&startPeriod=2020-01-01
response:
body:
string: !!binary |
H4sIAAAAAAAEAO29B2AcSZYlJi9tynt/SvVK1+B0oQiAYBMk2JBAEOzBiM3mkuwdaUcjKasqgcpl
VmVdZhZAzO2dvPfee++999577733ujudTif33/8/XGZkAWz2zkrayZ4hgKrIHz9+fB8/Iv7Hv/cf
/Oj5lyfHb86+fPHR6KOzF0/P6I8vX9Hvr7968p3Tkzf02xenx6+/enVKvz17dfoTX52+OPl96Pc3
Z1/go5/MynVOP5+V2UV6Us3y5qPfOPno+KvX9NnnT1/Sv2++ZCDPX/z+X71+Sr8d0//3dvZ2Phrt
7t/bOfj00/H+zv7odi/t0kv3H97f3d0bP7z/6S1f2qOXDvZ26JfxzsO90UengiHabnyPMLy/u3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f3viU0mEirrd4h/r59MHB7qc71A/LxOlXew9+/z0GtvlNakBxMuwu6X8m4K1fpU73aE2O3CPy
qR7whN36XWIpChMpYUNK6dP7rNSPn9+GpchLJUVLxBTuff3qNi+Rqj34lFa/hUNu8Q4NbZeWlSkS
oSBJevr89Ev6buNb1BOF5iT9Ow+Y5W/xCnVEC2AP4UMzbidf3MhT1AuFL/ukaGnK8c7r0xtDHnrn
/sGn5MKxV/D/AOJLgA6rJAAA
headers:
Access-Control-Allow-Headers:
- Content-Type
Access-Control-Allow-Methods:
- POST,GET,OPTIONS
Access-Control-Allow-Origin:
- '*'
Cache-Control:
- private
Content-Disposition:
- attachment;filename=DP_LIVE_10102023171713886.csv
Content-Encoding:
- gzip
Content-Type:
- text/csv
Date:
- Tue, 10 Oct 2023 15:17:13 GMT
Transfer-Encoding:
- chunked
Vary:
- Accept-Encoding
status:
code: 200
message: OK
version: 1

View File

@@ -0,0 +1,224 @@
interactions:
- request:
body: null
headers:
Accept:
- '*/*'
Accept-Encoding:
- gzip, deflate, br
Connection:
- keep-alive
method: GET
uri: https://stats.oecd.org/sdmx-json/data/DP_LIVE/.QGDP.TOT.PC_CHGPY.Q/OECD?contentType=csv&csv-lang=en&detail=code&endPeriod=2023-06-06&separator=comma&startPeriod=2020-01-01
response:
body:
string: !!binary |
H4sIAAAAAAAEAO29B2AcSZYlJi9tynt/SvVK1+B0oQiAYBMk2JBAEOzBiM3mkuwdaUcjKasqgcpl
VmVdZhZAzO2dvPfee++999577733ujudTif33/8/XGZkAWz2zkrayZ4hgKrIHz9+fB8/Iv7Hv/cf
/Oj5lyfHb86+fPHR6KOzF0/P6I8vX9Hvr7968p3Tkzf02xenx6+/enVKvz17dfoTX52+OPl96Pc3
Z1/go5/MynVOP5+V2UV6Us3y5qPfOPno6elX9NlPfP70Jf148yWgvDz5/U++/flLvPoT9P+9nb2d
7Z/Y/Wi0vTu+v3fw6ae7uw8eUqv3eXsPb++M7z+4d3/34f0H+9TsfV6/R6/vje8f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OIyShrRCigtb4HL3g8AkQ4LVPfukbdK/MKa+v0gEP1I1ZNZImVC
Vvj9ARANGQCtI9Na0/sCIL4DESi2oMQZ5S4eslf4fgCICBTm7pD3TFIjafP3A0A02CczsAflJjHK
+71PJCDJ2aER7JGv957vExsSBSjqJe6nxb57X+N9IgDCfNI4FOdvmAF6Ifo+jZ8CYAq0aDWJjNl7
90/jx0IWOfVkud+X/iJJpDA//ZTWDMkXxPsnr87o2xveJObjN6FoHzzcIQF+jzeJZmRWPqW0F/lV
pCvf41UiF8UiDx7ScMm3Z6m97atEKfLJ9mkRgjLuMlW3epWYjIYKMdl9QG7kjtjB275KYyU/m9jz
4S7F4DxBt32VxkqJRfI1iEbvMTX0Jg31IQX+B7SqSunMW79J7EQj/ZTYmYJ+Emhmx9u+SQMlQSZF
QEuFD1mQbvsmjZOG+Sn5VZQYvz2F6E0aJ9mQnQdk7EkH3vpNYXviBcprH3z6QFyMb7/6Sfr2hjeJ
jehN4gXSloTt/qdMohtf/WhvB68SibZpeZ9W3miBQzLxt32VaLRNfETLhOQ9isjc9lUiEnli90lQ
aUVUwvdbvUp8RGMlR4xiNXI8iRvEzN72ZRrt3g71e29vh9YdjJG+7ds0YForebBPTEz+4z61ep+3
acwkOp/SssUDYsn3epvYiob9YEwGlRafibOo0fu8TMM+oMQQ2Nn5+bd9mUZ9nzzQe5TrpiVhavQ+
L9OgyRkgb4xWXcgZeI+XRSCIYBQ4wpbuUaOPfuPk/wGQTpkxt6IAAA==
headers:
Access-Control-Allow-Headers:
- Content-Type
Access-Control-Allow-Methods:
- POST,GET,OPTIONS
Access-Control-Allow-Origin:
- '*'
Cache-Control:
- private
Content-Disposition:
- attachment;filename=DP_LIVE_10102023171714667.csv
Content-Encoding:
- gzip
Content-Type:
- text/csv
Date:
- Tue, 10 Oct 2023 15:17:14 GMT
Transfer-Encoding:
- chunked
Vary:
- Accept-Encoding
status:
code: 200
message: OK
version: 1

View File

@@ -0,0 +1,53 @@
import datetime
import pytest
from openbb_core.app.service.user_service import UserService
from openbb_oecd.models.gdpnom import OECDGDPNomFetcher
from openbb_oecd.models.gdpreal import OECDGDPRealFetcher
from openbb_oecd.models.gdpforecast import OECDGDPForecastFetcher
test_credentials = UserService().default_user_settings.credentials.dict()
@pytest.fixture(scope="module")
def vcr_config():
return {
"filter_headers": [("User-Agent", None)],
"filter_query_parameters": [
("token", "MOCK_TOKEN"),
],
}
@pytest.mark.record_http
def test_oecdgdp_nom_fetcher(credentials=test_credentials):
params = {
"start_date": datetime.date(2020, 1, 1),
"end_date": datetime.date(2023, 6, 6),
}
fetcher = OECDGDPNomFetcher()
result = fetcher.test(params, credentials)
assert result is None
@pytest.mark.record_http
def test_oecdgdp_real_fetcher(credentials=test_credentials):
params = {
"start_date": datetime.date(2020, 1, 1),
"end_date": datetime.date(2023, 6, 6),
}
fetcher = OECDGDPRealFetcher()
result = fetcher.test(params, credentials)
assert result is None
@pytest.mark.record_http
def test_oecdgdp_forecast_fetcher(credentials=test_credentials):
params = {
"start_date": datetime.date(2020, 1, 1),
"end_date": datetime.date(2023, 6, 6),
}
fetcher = OECDGDPForecastFetcher()
result = fetcher.test(params, credentials)
assert result is None

View File

@@ -540,6 +540,11 @@ def get_gdp(
no_data_message(error=str(e))
return df
print(
f"https://stats.oecd.org/sdmx-json/data/DP_LIVE/.GDP.TOT.{units_dict[units]}.A/OECD?contentType=csv&detail=code"
f"&separator=comma&csv-lang=en&startPeriod={start_date}&endPeriod={end_date}"
)
df = df.iloc[:, [0, 5]]
result = pd.DataFrame()