Upload 37 files
Browse files- openbb_platform/openbb/__init__.py +50 -0
- openbb_platform/openbb/assets/reference.json +0 -0
- openbb_platform/openbb/package/__extensions__.py +132 -0
- openbb_platform/openbb/package/commodity.py +405 -0
- openbb_platform/openbb/package/commodity_price.py +206 -0
- openbb_platform/openbb/package/crypto.py +102 -0
- openbb_platform/openbb/package/crypto_price.py +190 -0
- openbb_platform/openbb/package/currency.py +296 -0
- openbb_platform/openbb/package/currency_price.py +190 -0
- openbb_platform/openbb/package/derivatives.py +32 -0
- openbb_platform/openbb/package/derivatives_futures.py +214 -0
- openbb_platform/openbb/package/derivatives_options.py +465 -0
- openbb_platform/openbb/package/economy.py +0 -0
- openbb_platform/openbb/package/economy_gdp.py +490 -0
- openbb_platform/openbb/package/economy_survey.py +974 -0
- openbb_platform/openbb/package/equity.py +1261 -0
- openbb_platform/openbb/package/equity_calendar.py +521 -0
- openbb_platform/openbb/package/equity_compare.py +504 -0
- openbb_platform/openbb/package/equity_discovery.py +1102 -0
- openbb_platform/openbb/package/equity_estimates.py +1111 -0
- openbb_platform/openbb/package/equity_fundamental.py +0 -0
- openbb_platform/openbb/package/equity_ownership.py +854 -0
- openbb_platform/openbb/package/equity_price.py +630 -0
- openbb_platform/openbb/package/equity_shorts.py +104 -0
- openbb_platform/openbb/package/etf.py +1461 -0
- openbb_platform/openbb/package/fixedincome.py +566 -0
- openbb_platform/openbb/package/fixedincome_corporate.py +596 -0
- openbb_platform/openbb/package/fixedincome_government.py +360 -0
- openbb_platform/openbb/package/fixedincome_rate.py +1159 -0
- openbb_platform/openbb/package/fixedincome_spreads.py +291 -0
- openbb_platform/openbb/package/index.py +176 -0
- openbb_platform/openbb/package/index_price.py +163 -0
- openbb_platform/openbb/package/news.py +463 -0
- openbb_platform/openbb/package/regulators.py +30 -0
- openbb_platform/openbb/package/regulators_cftc.py +248 -0
- openbb_platform/openbb/package/regulators_sec.py +613 -0
- openbb_platform/openbb/py.typed +0 -0
openbb_platform/openbb/__init__.py
ADDED
|
@@ -0,0 +1,50 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
"""OpenBB Platform."""
|
| 2 |
+
|
| 3 |
+
# flake8: noqa
|
| 4 |
+
|
| 5 |
+
from pathlib import Path
|
| 6 |
+
from typing import List, Optional, Union
|
| 7 |
+
|
| 8 |
+
from openbb_core.app.static.app_factory import (
|
| 9 |
+
BaseApp as _BaseApp,
|
| 10 |
+
create_app as _create_app,
|
| 11 |
+
)
|
| 12 |
+
from openbb_core.app.static.package_builder import PackageBuilder as _PackageBuilder
|
| 13 |
+
from openbb_core.app.static.reference_loader import ReferenceLoader as _ReferenceLoader
|
| 14 |
+
|
| 15 |
+
_this_dir = Path(__file__).parent.resolve()
|
| 16 |
+
|
| 17 |
+
|
| 18 |
+
def build(
|
| 19 |
+
modules: Optional[Union[str, List[str]]] = None,
|
| 20 |
+
lint: bool = True,
|
| 21 |
+
verbose: bool = False,
|
| 22 |
+
) -> None:
|
| 23 |
+
"""Build extension modules.
|
| 24 |
+
|
| 25 |
+
Parameters
|
| 26 |
+
----------
|
| 27 |
+
modules : Optional[List[str]], optional
|
| 28 |
+
The modules to rebuild, by default None
|
| 29 |
+
For example: "/news" or ["/news", "/crypto"]
|
| 30 |
+
If None, all modules are rebuilt.
|
| 31 |
+
lint : bool, optional
|
| 32 |
+
Whether to lint the code, by default True
|
| 33 |
+
verbose : bool, optional
|
| 34 |
+
Enable/disable verbose mode
|
| 35 |
+
"""
|
| 36 |
+
_PackageBuilder(_this_dir, lint, verbose).build(modules)
|
| 37 |
+
|
| 38 |
+
|
| 39 |
+
_PackageBuilder(_this_dir).auto_build()
|
| 40 |
+
_ReferenceLoader(_this_dir)
|
| 41 |
+
|
| 42 |
+
try:
|
| 43 |
+
# pylint: disable=import-outside-toplevel
|
| 44 |
+
from openbb.package.__extensions__ import Extensions as _Extensions
|
| 45 |
+
|
| 46 |
+
obb: Union[_BaseApp, _Extensions] = _create_app(_Extensions) # type: ignore
|
| 47 |
+
sdk = obb
|
| 48 |
+
except (ImportError, ModuleNotFoundError):
|
| 49 |
+
print("Failed to import extensions.")
|
| 50 |
+
obb = sdk = _create_app() # type: ignore
|
openbb_platform/openbb/assets/reference.json
ADDED
|
The diff for this file is too large to render.
See raw diff
|
|
|
openbb_platform/openbb/package/__extensions__.py
ADDED
|
@@ -0,0 +1,132 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
### THIS FILE IS AUTO-GENERATED. DO NOT EDIT. ###
|
| 2 |
+
|
| 3 |
+
|
| 4 |
+
from openbb_core.app.static.container import Container
|
| 5 |
+
|
| 6 |
+
|
| 7 |
+
class Extensions(Container):
|
| 8 |
+
# fmt: off
|
| 9 |
+
"""
|
| 10 |
+
Routers:
|
| 11 |
+
/commodity
|
| 12 |
+
/crypto
|
| 13 |
+
/currency
|
| 14 |
+
/derivatives
|
| 15 |
+
/economy
|
| 16 |
+
/equity
|
| 17 |
+
/etf
|
| 18 |
+
/fixedincome
|
| 19 |
+
/index
|
| 20 |
+
/news
|
| 21 |
+
/regulators
|
| 22 |
+
|
| 23 |
+
Extensions:
|
| 24 |
+
- commodity@1.3.1
|
| 25 |
+
- crypto@1.4.1
|
| 26 |
+
- currency@1.4.1
|
| 27 |
+
- derivatives@1.4.1
|
| 28 |
+
- economy@1.4.2
|
| 29 |
+
- equity@1.4.1
|
| 30 |
+
- etf@1.4.1
|
| 31 |
+
- fixedincome@1.4.3
|
| 32 |
+
- index@1.4.1
|
| 33 |
+
- news@1.4.1
|
| 34 |
+
- regulators@1.4.2
|
| 35 |
+
|
| 36 |
+
- benzinga@1.4.1
|
| 37 |
+
- bls@1.1.2
|
| 38 |
+
- cftc@1.1.1
|
| 39 |
+
- econdb@1.3.1
|
| 40 |
+
- federal_reserve@1.4.2
|
| 41 |
+
- fmp@1.4.2
|
| 42 |
+
- fred@1.4.4
|
| 43 |
+
- imf@1.1.1
|
| 44 |
+
- intrinio@1.4.1
|
| 45 |
+
- oecd@1.4.1
|
| 46 |
+
- polygon@1.4.1
|
| 47 |
+
- sec@1.4.3
|
| 48 |
+
- tiingo@1.4.1
|
| 49 |
+
- tradingeconomics@1.4.1
|
| 50 |
+
- us_eia@1.1.1
|
| 51 |
+
- yfinance@1.4.6 """
|
| 52 |
+
# fmt: on
|
| 53 |
+
|
| 54 |
+
def __repr__(self) -> str:
|
| 55 |
+
return self.__doc__ or ""
|
| 56 |
+
|
| 57 |
+
@property
|
| 58 |
+
def commodity(self):
|
| 59 |
+
# pylint: disable=import-outside-toplevel
|
| 60 |
+
from . import commodity
|
| 61 |
+
|
| 62 |
+
return commodity.ROUTER_commodity(command_runner=self._command_runner)
|
| 63 |
+
|
| 64 |
+
@property
|
| 65 |
+
def crypto(self):
|
| 66 |
+
# pylint: disable=import-outside-toplevel
|
| 67 |
+
from . import crypto
|
| 68 |
+
|
| 69 |
+
return crypto.ROUTER_crypto(command_runner=self._command_runner)
|
| 70 |
+
|
| 71 |
+
@property
|
| 72 |
+
def currency(self):
|
| 73 |
+
# pylint: disable=import-outside-toplevel
|
| 74 |
+
from . import currency
|
| 75 |
+
|
| 76 |
+
return currency.ROUTER_currency(command_runner=self._command_runner)
|
| 77 |
+
|
| 78 |
+
@property
|
| 79 |
+
def derivatives(self):
|
| 80 |
+
# pylint: disable=import-outside-toplevel
|
| 81 |
+
from . import derivatives
|
| 82 |
+
|
| 83 |
+
return derivatives.ROUTER_derivatives(command_runner=self._command_runner)
|
| 84 |
+
|
| 85 |
+
@property
|
| 86 |
+
def economy(self):
|
| 87 |
+
# pylint: disable=import-outside-toplevel
|
| 88 |
+
from . import economy
|
| 89 |
+
|
| 90 |
+
return economy.ROUTER_economy(command_runner=self._command_runner)
|
| 91 |
+
|
| 92 |
+
@property
|
| 93 |
+
def equity(self):
|
| 94 |
+
# pylint: disable=import-outside-toplevel
|
| 95 |
+
from . import equity
|
| 96 |
+
|
| 97 |
+
return equity.ROUTER_equity(command_runner=self._command_runner)
|
| 98 |
+
|
| 99 |
+
@property
|
| 100 |
+
def etf(self):
|
| 101 |
+
# pylint: disable=import-outside-toplevel
|
| 102 |
+
from . import etf
|
| 103 |
+
|
| 104 |
+
return etf.ROUTER_etf(command_runner=self._command_runner)
|
| 105 |
+
|
| 106 |
+
@property
|
| 107 |
+
def fixedincome(self):
|
| 108 |
+
# pylint: disable=import-outside-toplevel
|
| 109 |
+
from . import fixedincome
|
| 110 |
+
|
| 111 |
+
return fixedincome.ROUTER_fixedincome(command_runner=self._command_runner)
|
| 112 |
+
|
| 113 |
+
@property
|
| 114 |
+
def index(self):
|
| 115 |
+
# pylint: disable=import-outside-toplevel
|
| 116 |
+
from . import index
|
| 117 |
+
|
| 118 |
+
return index.ROUTER_index(command_runner=self._command_runner)
|
| 119 |
+
|
| 120 |
+
@property
|
| 121 |
+
def news(self):
|
| 122 |
+
# pylint: disable=import-outside-toplevel
|
| 123 |
+
from . import news
|
| 124 |
+
|
| 125 |
+
return news.ROUTER_news(command_runner=self._command_runner)
|
| 126 |
+
|
| 127 |
+
@property
|
| 128 |
+
def regulators(self):
|
| 129 |
+
# pylint: disable=import-outside-toplevel
|
| 130 |
+
from . import regulators
|
| 131 |
+
|
| 132 |
+
return regulators.ROUTER_regulators(command_runner=self._command_runner)
|
openbb_platform/openbb/package/commodity.py
ADDED
|
@@ -0,0 +1,405 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|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
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
### THIS FILE IS AUTO-GENERATED. DO NOT EDIT. ###
|
| 2 |
+
|
| 3 |
+
import datetime
|
| 4 |
+
from typing import Literal, Optional, Union
|
| 5 |
+
|
| 6 |
+
from openbb_core.app.model.field import OpenBBField
|
| 7 |
+
from openbb_core.app.model.obbject import OBBject
|
| 8 |
+
from openbb_core.app.static.container import Container
|
| 9 |
+
from openbb_core.app.static.utils.decorators import exception_handler, validate
|
| 10 |
+
from openbb_core.app.static.utils.filters import filter_inputs
|
| 11 |
+
from typing_extensions import Annotated
|
| 12 |
+
|
| 13 |
+
|
| 14 |
+
class ROUTER_commodity(Container):
|
| 15 |
+
"""/commodity
|
| 16 |
+
petroleum_status_report
|
| 17 |
+
/price
|
| 18 |
+
short_term_energy_outlook
|
| 19 |
+
"""
|
| 20 |
+
|
| 21 |
+
def __repr__(self) -> str:
|
| 22 |
+
return self.__doc__ or ""
|
| 23 |
+
|
| 24 |
+
@exception_handler
|
| 25 |
+
@validate
|
| 26 |
+
def petroleum_status_report(
|
| 27 |
+
self,
|
| 28 |
+
start_date: Annotated[
|
| 29 |
+
Union[datetime.date, None, str],
|
| 30 |
+
OpenBBField(description="Start date of the data, in YYYY-MM-DD format."),
|
| 31 |
+
] = None,
|
| 32 |
+
end_date: Annotated[
|
| 33 |
+
Union[datetime.date, None, str],
|
| 34 |
+
OpenBBField(description="End date of the data, in YYYY-MM-DD format."),
|
| 35 |
+
] = None,
|
| 36 |
+
provider: Annotated[
|
| 37 |
+
Optional[Literal["eia"]],
|
| 38 |
+
OpenBBField(
|
| 39 |
+
description="The provider to use, by default None. If None, the priority list configured in the settings is used. Default priority: eia."
|
| 40 |
+
),
|
| 41 |
+
] = None,
|
| 42 |
+
**kwargs
|
| 43 |
+
) -> OBBject:
|
| 44 |
+
"""EIA Weekly Petroleum Status Report.
|
| 45 |
+
|
| 46 |
+
Parameters
|
| 47 |
+
----------
|
| 48 |
+
provider : str
|
| 49 |
+
The provider to use, by default None. If None, the priority list configured in the settings is used. Default priority: eia.
|
| 50 |
+
start_date : Union[date, None, str]
|
| 51 |
+
Start date of the data, in YYYY-MM-DD format.
|
| 52 |
+
end_date : Union[date, None, str]
|
| 53 |
+
End date of the data, in YYYY-MM-DD format.
|
| 54 |
+
category : Literal['balance_sheet', 'inputs_and_production', 'refiner_blender_net_production', 'crude_petroleum_stocks', 'gasoline_fuel_stocks', 'total_gasoline_by_sub_padd', 'distillate_fuel_oil_stocks', 'imports', 'imports_by_country', 'weekly_estimates', 'spot_prices_crude_gas_heating', 'spot_prices_diesel_jet_fuel_propane', 'retail_prices']
|
| 55 |
+
The group of data to be returned. The default is the balance sheet. (provider: eia)
|
| 56 |
+
table : Optional[str]
|
| 57 |
+
The specific table element within the category to be returned, default is 'stocks', if the category is 'weekly_estimates', else 'all'.
|
| 58 |
+
Note: Choices represent all available tables from the entire collection and are not all available for every category.
|
| 59 |
+
Invalid choices will raise a ValidationError with a message indicating the valid choices for the selected category.
|
| 60 |
+
Choices are:
|
| 61 |
+
all
|
| 62 |
+
conventional_gas
|
| 63 |
+
crude
|
| 64 |
+
crude_production
|
| 65 |
+
crude_production_avg
|
| 66 |
+
diesel
|
| 67 |
+
ethanol_plant_production
|
| 68 |
+
ethanol_plant_production_avg
|
| 69 |
+
exports
|
| 70 |
+
exports_avg
|
| 71 |
+
heating_oil
|
| 72 |
+
imports
|
| 73 |
+
imports_avg
|
| 74 |
+
imports_by_country
|
| 75 |
+
imports_by_country_avg
|
| 76 |
+
inputs_and_utilization
|
| 77 |
+
inputs_and_utilization_avg
|
| 78 |
+
jet_fuel
|
| 79 |
+
monthly
|
| 80 |
+
net_imports_inc_spr_avg
|
| 81 |
+
net_imports_incl_spr
|
| 82 |
+
net_production
|
| 83 |
+
net_production_avg
|
| 84 |
+
net_production_by_product
|
| 85 |
+
net_production_by_production_avg
|
| 86 |
+
product_by_region
|
| 87 |
+
product_by_region_avg
|
| 88 |
+
product_supplied
|
| 89 |
+
product_supplied_avg
|
| 90 |
+
propane
|
| 91 |
+
rbob
|
| 92 |
+
refiner_blender_net_production
|
| 93 |
+
refiner_blender_net_production_avg
|
| 94 |
+
stocks
|
| 95 |
+
supply
|
| 96 |
+
supply_avg
|
| 97 |
+
ulta_low_sulfur_distillate_reclassification
|
| 98 |
+
ulta_low_sulfur_distillate_reclassification_avg
|
| 99 |
+
weekly
|
| 100 |
+
Multiple comma separated items allowed. (provider: eia)
|
| 101 |
+
use_cache : bool
|
| 102 |
+
Subsequent requests for the same source data are cached for the session using ALRU cache. (provider: eia)
|
| 103 |
+
|
| 104 |
+
Returns
|
| 105 |
+
-------
|
| 106 |
+
OBBject
|
| 107 |
+
results : list[PetroleumStatusReport]
|
| 108 |
+
Serializable results.
|
| 109 |
+
provider : Optional[str]
|
| 110 |
+
Provider name.
|
| 111 |
+
warnings : Optional[list[Warning_]]
|
| 112 |
+
list of warnings.
|
| 113 |
+
chart : Optional[Chart]
|
| 114 |
+
Chart object.
|
| 115 |
+
extra : Dict[str, Any]
|
| 116 |
+
Extra info.
|
| 117 |
+
|
| 118 |
+
PetroleumStatusReport
|
| 119 |
+
---------------------
|
| 120 |
+
date : date
|
| 121 |
+
The date of the data.
|
| 122 |
+
table : Optional[str]
|
| 123 |
+
Table name for the data.
|
| 124 |
+
symbol : str
|
| 125 |
+
Symbol representing the entity requested in the data.
|
| 126 |
+
order : Optional[int]
|
| 127 |
+
Presented order of the data, relative to the table.
|
| 128 |
+
title : Optional[str]
|
| 129 |
+
Title of the data.
|
| 130 |
+
value : Union[int, float]
|
| 131 |
+
Value of the data.
|
| 132 |
+
unit : Optional[str]
|
| 133 |
+
Unit or scale of the data.
|
| 134 |
+
|
| 135 |
+
Examples
|
| 136 |
+
--------
|
| 137 |
+
>>> from openbb import obb
|
| 138 |
+
>>> # Get the EIA's Weekly Petroleum Status Report.
|
| 139 |
+
>>> obb.commodity.petroleum_status_report(provider='eia')
|
| 140 |
+
>>> # Select the category of data, and filter for a specific table within the report.
|
| 141 |
+
>>> obb.commodity.petroleum_status_report(category='weekly_estimates', table='imports', provider='eia')
|
| 142 |
+
""" # noqa: E501
|
| 143 |
+
|
| 144 |
+
return self._run(
|
| 145 |
+
"/commodity/petroleum_status_report",
|
| 146 |
+
**filter_inputs(
|
| 147 |
+
provider_choices={
|
| 148 |
+
"provider": self._get_provider(
|
| 149 |
+
provider,
|
| 150 |
+
"commodity.petroleum_status_report",
|
| 151 |
+
("eia",),
|
| 152 |
+
)
|
| 153 |
+
},
|
| 154 |
+
standard_params={
|
| 155 |
+
"start_date": start_date,
|
| 156 |
+
"end_date": end_date,
|
| 157 |
+
},
|
| 158 |
+
extra_params=kwargs,
|
| 159 |
+
info={
|
| 160 |
+
"category": {
|
| 161 |
+
"eia": {
|
| 162 |
+
"multiple_items_allowed": False,
|
| 163 |
+
"choices": [
|
| 164 |
+
"balance_sheet",
|
| 165 |
+
"inputs_and_production",
|
| 166 |
+
"refiner_blender_net_production",
|
| 167 |
+
"crude_petroleum_stocks",
|
| 168 |
+
"gasoline_fuel_stocks",
|
| 169 |
+
"total_gasoline_by_sub_padd",
|
| 170 |
+
"distillate_fuel_oil_stocks",
|
| 171 |
+
"imports",
|
| 172 |
+
"imports_by_country",
|
| 173 |
+
"weekly_estimates",
|
| 174 |
+
"spot_prices_crude_gas_heating",
|
| 175 |
+
"spot_prices_diesel_jet_fuel_propane",
|
| 176 |
+
"retail_prices",
|
| 177 |
+
],
|
| 178 |
+
}
|
| 179 |
+
},
|
| 180 |
+
"table": {
|
| 181 |
+
"eia": {
|
| 182 |
+
"multiple_items_allowed": True,
|
| 183 |
+
"choices": [
|
| 184 |
+
"all",
|
| 185 |
+
"conventional_gas",
|
| 186 |
+
"crude",
|
| 187 |
+
"crude_production",
|
| 188 |
+
"crude_production_avg",
|
| 189 |
+
"diesel",
|
| 190 |
+
"ethanol_plant_production",
|
| 191 |
+
"ethanol_plant_production_avg",
|
| 192 |
+
"exports",
|
| 193 |
+
"exports_avg",
|
| 194 |
+
"heating_oil",
|
| 195 |
+
"imports",
|
| 196 |
+
"imports_avg",
|
| 197 |
+
"imports_by_country",
|
| 198 |
+
"imports_by_country_avg",
|
| 199 |
+
"inputs_and_utilization",
|
| 200 |
+
"inputs_and_utilization_avg",
|
| 201 |
+
"jet_fuel",
|
| 202 |
+
"monthly",
|
| 203 |
+
"net_imports_inc_spr_avg",
|
| 204 |
+
"net_imports_incl_spr",
|
| 205 |
+
"net_production",
|
| 206 |
+
"net_production_avg",
|
| 207 |
+
"net_production_by_product",
|
| 208 |
+
"net_production_by_production_avg",
|
| 209 |
+
"product_by_region",
|
| 210 |
+
"product_by_region_avg",
|
| 211 |
+
"product_supplied",
|
| 212 |
+
"product_supplied_avg",
|
| 213 |
+
"propane",
|
| 214 |
+
"rbob",
|
| 215 |
+
"refiner_blender_net_production",
|
| 216 |
+
"refiner_blender_net_production_avg",
|
| 217 |
+
"stocks",
|
| 218 |
+
"supply",
|
| 219 |
+
"supply_avg",
|
| 220 |
+
"ulta_low_sulfur_distillate_reclassification",
|
| 221 |
+
"ulta_low_sulfur_distillate_reclassification_avg",
|
| 222 |
+
"weekly",
|
| 223 |
+
],
|
| 224 |
+
}
|
| 225 |
+
},
|
| 226 |
+
},
|
| 227 |
+
)
|
| 228 |
+
)
|
| 229 |
+
|
| 230 |
+
@property
|
| 231 |
+
def price(self):
|
| 232 |
+
# pylint: disable=import-outside-toplevel
|
| 233 |
+
from . import commodity_price
|
| 234 |
+
|
| 235 |
+
return commodity_price.ROUTER_commodity_price(
|
| 236 |
+
command_runner=self._command_runner
|
| 237 |
+
)
|
| 238 |
+
|
| 239 |
+
@exception_handler
|
| 240 |
+
@validate
|
| 241 |
+
def short_term_energy_outlook(
|
| 242 |
+
self,
|
| 243 |
+
start_date: Annotated[
|
| 244 |
+
Union[datetime.date, None, str],
|
| 245 |
+
OpenBBField(description="Start date of the data, in YYYY-MM-DD format."),
|
| 246 |
+
] = None,
|
| 247 |
+
end_date: Annotated[
|
| 248 |
+
Union[datetime.date, None, str],
|
| 249 |
+
OpenBBField(description="End date of the data, in YYYY-MM-DD format."),
|
| 250 |
+
] = None,
|
| 251 |
+
provider: Annotated[
|
| 252 |
+
Optional[Literal["eia"]],
|
| 253 |
+
OpenBBField(
|
| 254 |
+
description="The provider to use, by default None. If None, the priority list configured in the settings is used. Default priority: eia."
|
| 255 |
+
),
|
| 256 |
+
] = None,
|
| 257 |
+
**kwargs
|
| 258 |
+
) -> OBBject:
|
| 259 |
+
"""Monthly short term (18 month) projections using EIA's STEO model.
|
| 260 |
+
|
| 261 |
+
Source: www.eia.gov/steo/
|
| 262 |
+
|
| 263 |
+
|
| 264 |
+
Parameters
|
| 265 |
+
----------
|
| 266 |
+
provider : str
|
| 267 |
+
The provider to use, by default None. If None, the priority list configured in the settings is used. Default priority: eia.
|
| 268 |
+
start_date : Union[date, None, str]
|
| 269 |
+
Start date of the data, in YYYY-MM-DD format.
|
| 270 |
+
end_date : Union[date, None, str]
|
| 271 |
+
End date of the data, in YYYY-MM-DD format.
|
| 272 |
+
symbol : Optional[str]
|
| 273 |
+
Symbol to get data for. If provided, overrides the 'table' parameter to return only the specified symbol from the STEO API. Multiple comma separated items allowed. (provider: eia)
|
| 274 |
+
table : Literal['01', '02', '03a', '03b', '03c', '03d', '03e', '04a', '04b', '04c', '04d', '05a', '05b', '06', '07a', '07b', '07c', '07d1', '07d2', '07e', '08', '09a', '09b', '09c', '10a', '10b']
|
| 275 |
+
The specific table within the STEO dataset. Default is '01'. When 'symbol' is provided, this parameter is ignored.
|
| 276 |
+
01: US Energy Markets Summary
|
| 277 |
+
02: Nominal Energy Prices
|
| 278 |
+
03a: World Petroleum and Other Liquid Fuels Production, Consumption, and Inventories
|
| 279 |
+
03b: Non-OPEC Petroleum and Other Liquid Fuels Production
|
| 280 |
+
03c: World Petroleum and Other Liquid Fuels Production
|
| 281 |
+
03d: World Crude Oil Production
|
| 282 |
+
03e: World Petroleum and Other Liquid Fuels Consumption
|
| 283 |
+
04a: US Petroleum and Other Liquid Fuels Supply, Consumption, and Inventories
|
| 284 |
+
04b: US Hydrocarbon Gas Liquids (HGL) and Petroleum Refinery Balances
|
| 285 |
+
04c: US Regional Motor Gasoline Prices and Inventories
|
| 286 |
+
04d: US Biofuel Supply, Consumption, and Inventories
|
| 287 |
+
05a: US Natural Gas Supply, Consumption, and Inventories
|
| 288 |
+
05b: US Regional Natural Gas Prices
|
| 289 |
+
06: US Coal Supply, Consumption, and Inventories
|
| 290 |
+
07a: US Electricity Industry Overview
|
| 291 |
+
07b: US Regional Electricity Retail Sales
|
| 292 |
+
07c: US Regional Electricity Prices
|
| 293 |
+
07d1: US Regional Electricity Generation, Electric Power Sector
|
| 294 |
+
07d2: US Regional Electricity Generation, Electric Power Sector, continued
|
| 295 |
+
07e: US Electricity Generating Capacity
|
| 296 |
+
08: US Renewable Energy Consumption
|
| 297 |
+
09a: US Macroeconomic Indicators and CO2 Emissions
|
| 298 |
+
09b: US Regional Macroeconomic Data
|
| 299 |
+
09c: US Regional Weather Data
|
| 300 |
+
10a: Drilling Productivity Metrics
|
| 301 |
+
10b: Crude Oil and Natural Gas Production from Shale and Tight Formations (provider: eia)
|
| 302 |
+
frequency : Literal['month', 'quarter', 'annual']
|
| 303 |
+
The frequency of the data. Default is 'month'. (provider: eia)
|
| 304 |
+
|
| 305 |
+
Returns
|
| 306 |
+
-------
|
| 307 |
+
OBBject
|
| 308 |
+
results : list[ShortTermEnergyOutlook]
|
| 309 |
+
Serializable results.
|
| 310 |
+
provider : Optional[str]
|
| 311 |
+
Provider name.
|
| 312 |
+
warnings : Optional[list[Warning_]]
|
| 313 |
+
list of warnings.
|
| 314 |
+
chart : Optional[Chart]
|
| 315 |
+
Chart object.
|
| 316 |
+
extra : Dict[str, Any]
|
| 317 |
+
Extra info.
|
| 318 |
+
|
| 319 |
+
ShortTermEnergyOutlook
|
| 320 |
+
----------------------
|
| 321 |
+
date : date
|
| 322 |
+
The date of the data.
|
| 323 |
+
table : Optional[str]
|
| 324 |
+
Table name for the data.
|
| 325 |
+
symbol : str
|
| 326 |
+
Symbol representing the entity requested in the data.
|
| 327 |
+
order : Optional[int]
|
| 328 |
+
Presented order of the data, relative to the table.
|
| 329 |
+
title : Optional[str]
|
| 330 |
+
Title of the data.
|
| 331 |
+
value : Union[int, float]
|
| 332 |
+
Value of the data.
|
| 333 |
+
unit : Optional[str]
|
| 334 |
+
Unit or scale of the data.
|
| 335 |
+
|
| 336 |
+
Examples
|
| 337 |
+
--------
|
| 338 |
+
>>> from openbb import obb
|
| 339 |
+
>>> # Get the EIA's Short Term Energy Outlook.
|
| 340 |
+
>>> obb.commodity.short_term_energy_outlook(provider='eia')
|
| 341 |
+
>>> # Select the specific table of data from the STEO. Table 03d is World Crude Oil Production.
|
| 342 |
+
>>> obb.commodity.short_term_energy_outlook(table='03d', provider='eia')
|
| 343 |
+
""" # noqa: E501
|
| 344 |
+
|
| 345 |
+
return self._run(
|
| 346 |
+
"/commodity/short_term_energy_outlook",
|
| 347 |
+
**filter_inputs(
|
| 348 |
+
provider_choices={
|
| 349 |
+
"provider": self._get_provider(
|
| 350 |
+
provider,
|
| 351 |
+
"commodity.short_term_energy_outlook",
|
| 352 |
+
("eia",),
|
| 353 |
+
)
|
| 354 |
+
},
|
| 355 |
+
standard_params={
|
| 356 |
+
"start_date": start_date,
|
| 357 |
+
"end_date": end_date,
|
| 358 |
+
},
|
| 359 |
+
extra_params=kwargs,
|
| 360 |
+
info={
|
| 361 |
+
"symbol": {
|
| 362 |
+
"eia": {"multiple_items_allowed": True, "choices": None}
|
| 363 |
+
},
|
| 364 |
+
"table": {
|
| 365 |
+
"eia": {
|
| 366 |
+
"multiple_items_allowed": False,
|
| 367 |
+
"choices": [
|
| 368 |
+
"01",
|
| 369 |
+
"02",
|
| 370 |
+
"03a",
|
| 371 |
+
"03b",
|
| 372 |
+
"03c",
|
| 373 |
+
"03d",
|
| 374 |
+
"03e",
|
| 375 |
+
"04a",
|
| 376 |
+
"04b",
|
| 377 |
+
"04c",
|
| 378 |
+
"04d",
|
| 379 |
+
"05a",
|
| 380 |
+
"05b",
|
| 381 |
+
"06",
|
| 382 |
+
"07a",
|
| 383 |
+
"07b",
|
| 384 |
+
"07c",
|
| 385 |
+
"07d1",
|
| 386 |
+
"07d2",
|
| 387 |
+
"07e",
|
| 388 |
+
"08",
|
| 389 |
+
"09a",
|
| 390 |
+
"09b",
|
| 391 |
+
"09c",
|
| 392 |
+
"10a",
|
| 393 |
+
"10b",
|
| 394 |
+
],
|
| 395 |
+
}
|
| 396 |
+
},
|
| 397 |
+
"frequency": {
|
| 398 |
+
"eia": {
|
| 399 |
+
"multiple_items_allowed": False,
|
| 400 |
+
"choices": ["month", "quarter", "annual"],
|
| 401 |
+
}
|
| 402 |
+
},
|
| 403 |
+
},
|
| 404 |
+
)
|
| 405 |
+
)
|
openbb_platform/openbb/package/commodity_price.py
ADDED
|
@@ -0,0 +1,206 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
### THIS FILE IS AUTO-GENERATED. DO NOT EDIT. ###
|
| 2 |
+
|
| 3 |
+
import datetime
|
| 4 |
+
from typing import Literal, Optional, Union
|
| 5 |
+
|
| 6 |
+
from openbb_core.app.model.field import OpenBBField
|
| 7 |
+
from openbb_core.app.model.obbject import OBBject
|
| 8 |
+
from openbb_core.app.static.container import Container
|
| 9 |
+
from openbb_core.app.static.utils.decorators import exception_handler, validate
|
| 10 |
+
from openbb_core.app.static.utils.filters import filter_inputs
|
| 11 |
+
from typing_extensions import Annotated
|
| 12 |
+
|
| 13 |
+
|
| 14 |
+
class ROUTER_commodity_price(Container):
|
| 15 |
+
"""/commodity/price
|
| 16 |
+
spot
|
| 17 |
+
"""
|
| 18 |
+
|
| 19 |
+
def __repr__(self) -> str:
|
| 20 |
+
return self.__doc__ or ""
|
| 21 |
+
|
| 22 |
+
@exception_handler
|
| 23 |
+
@validate
|
| 24 |
+
def spot(
|
| 25 |
+
self,
|
| 26 |
+
start_date: Annotated[
|
| 27 |
+
Union[datetime.date, None, str],
|
| 28 |
+
OpenBBField(description="Start date of the data, in YYYY-MM-DD format."),
|
| 29 |
+
] = None,
|
| 30 |
+
end_date: Annotated[
|
| 31 |
+
Union[datetime.date, None, str],
|
| 32 |
+
OpenBBField(description="End date of the data, in YYYY-MM-DD format."),
|
| 33 |
+
] = None,
|
| 34 |
+
provider: Annotated[
|
| 35 |
+
Optional[Literal["fred"]],
|
| 36 |
+
OpenBBField(
|
| 37 |
+
description="The provider to use, by default None. If None, the priority list configured in the settings is used. Default priority: fred."
|
| 38 |
+
),
|
| 39 |
+
] = None,
|
| 40 |
+
**kwargs
|
| 41 |
+
) -> OBBject:
|
| 42 |
+
"""Commodity Spot Prices.
|
| 43 |
+
|
| 44 |
+
Parameters
|
| 45 |
+
----------
|
| 46 |
+
provider : str
|
| 47 |
+
The provider to use, by default None. If None, the priority list configured in the settings is used. Default priority: fred.
|
| 48 |
+
start_date : Union[date, None, str]
|
| 49 |
+
Start date of the data, in YYYY-MM-DD format.
|
| 50 |
+
end_date : Union[date, None, str]
|
| 51 |
+
End date of the data, in YYYY-MM-DD format.
|
| 52 |
+
commodity : Literal['wti', 'brent', 'natural_gas', 'jet_fuel', 'propane', 'heating_oil', 'diesel_gulf_coast', 'diesel_ny_harbor', 'diesel_la', 'gasoline_ny_harbor', 'gasoline_gulf_coast', 'rbob', 'all']
|
| 53 |
+
Commodity name associated with the EIA spot price commodity data, default is 'all'. (provider: fred)
|
| 54 |
+
frequency : Optional[Literal['a', 'q', 'm', 'w', 'd', 'wef', 'weth', 'wew', 'wetu', 'wem', 'wesu', 'wesa', 'bwew', 'bwem']]
|
| 55 |
+
Frequency aggregation to convert high frequency data to lower frequency.
|
| 56 |
+
None = No change
|
| 57 |
+
a = Annual
|
| 58 |
+
q = Quarterly
|
| 59 |
+
m = Monthly
|
| 60 |
+
w = Weekly
|
| 61 |
+
d = Daily
|
| 62 |
+
wef = Weekly, Ending Friday
|
| 63 |
+
weth = Weekly, Ending Thursday
|
| 64 |
+
wew = Weekly, Ending Wednesday
|
| 65 |
+
wetu = Weekly, Ending Tuesday
|
| 66 |
+
wem = Weekly, Ending Monday
|
| 67 |
+
wesu = Weekly, Ending Sunday
|
| 68 |
+
wesa = Weekly, Ending Saturday
|
| 69 |
+
bwew = Biweekly, Ending Wednesday
|
| 70 |
+
bwem = Biweekly, Ending Monday
|
| 71 |
+
(provider: fred)
|
| 72 |
+
aggregation_method : Literal['avg', 'sum', 'eop']
|
| 73 |
+
A key that indicates the aggregation method used for frequency aggregation.
|
| 74 |
+
This parameter has no affect if the frequency parameter is not set.
|
| 75 |
+
avg = Average
|
| 76 |
+
sum = Sum
|
| 77 |
+
eop = End of Period
|
| 78 |
+
(provider: fred)
|
| 79 |
+
transform : Optional[Literal['chg', 'ch1', 'pch', 'pc1', 'pca', 'cch', 'cca', 'log']]
|
| 80 |
+
Transformation type
|
| 81 |
+
None = No transformation
|
| 82 |
+
chg = Change
|
| 83 |
+
ch1 = Change from Year Ago
|
| 84 |
+
pch = Percent Change
|
| 85 |
+
pc1 = Percent Change from Year Ago
|
| 86 |
+
pca = Compounded Annual Rate of Change
|
| 87 |
+
cch = Continuously Compounded Rate of Change
|
| 88 |
+
cca = Continuously Compounded Annual Rate of Change
|
| 89 |
+
log = Natural Log
|
| 90 |
+
(provider: fred)
|
| 91 |
+
|
| 92 |
+
Returns
|
| 93 |
+
-------
|
| 94 |
+
OBBject
|
| 95 |
+
results : list[CommoditySpotPrices]
|
| 96 |
+
Serializable results.
|
| 97 |
+
provider : Optional[str]
|
| 98 |
+
Provider name.
|
| 99 |
+
warnings : Optional[list[Warning_]]
|
| 100 |
+
list of warnings.
|
| 101 |
+
chart : Optional[Chart]
|
| 102 |
+
Chart object.
|
| 103 |
+
extra : Dict[str, Any]
|
| 104 |
+
Extra info.
|
| 105 |
+
|
| 106 |
+
CommoditySpotPrices
|
| 107 |
+
-------------------
|
| 108 |
+
date : date
|
| 109 |
+
The date of the data.
|
| 110 |
+
symbol : Optional[str]
|
| 111 |
+
Symbol representing the entity requested in the data.
|
| 112 |
+
commodity : Optional[str]
|
| 113 |
+
Commodity name.
|
| 114 |
+
price : float
|
| 115 |
+
Price of the commodity.
|
| 116 |
+
unit : Optional[str]
|
| 117 |
+
Unit of the commodity price.
|
| 118 |
+
|
| 119 |
+
Examples
|
| 120 |
+
--------
|
| 121 |
+
>>> from openbb import obb
|
| 122 |
+
>>> obb.commodity.price.spot(provider='fred')
|
| 123 |
+
>>> obb.commodity.price.spot(provider='fred', commodity='wti')
|
| 124 |
+
""" # noqa: E501
|
| 125 |
+
|
| 126 |
+
return self._run(
|
| 127 |
+
"/commodity/price/spot",
|
| 128 |
+
**filter_inputs(
|
| 129 |
+
provider_choices={
|
| 130 |
+
"provider": self._get_provider(
|
| 131 |
+
provider,
|
| 132 |
+
"commodity.price.spot",
|
| 133 |
+
("fred",),
|
| 134 |
+
)
|
| 135 |
+
},
|
| 136 |
+
standard_params={
|
| 137 |
+
"start_date": start_date,
|
| 138 |
+
"end_date": end_date,
|
| 139 |
+
},
|
| 140 |
+
extra_params=kwargs,
|
| 141 |
+
info={
|
| 142 |
+
"commodity": {
|
| 143 |
+
"fred": {
|
| 144 |
+
"multiple_items_allowed": False,
|
| 145 |
+
"choices": [
|
| 146 |
+
"wti",
|
| 147 |
+
"brent",
|
| 148 |
+
"natural_gas",
|
| 149 |
+
"jet_fuel",
|
| 150 |
+
"propane",
|
| 151 |
+
"heating_oil",
|
| 152 |
+
"diesel_gulf_coast",
|
| 153 |
+
"diesel_ny_harbor",
|
| 154 |
+
"diesel_la",
|
| 155 |
+
"gasoline_ny_harbor",
|
| 156 |
+
"gasoline_gulf_coast",
|
| 157 |
+
"rbob",
|
| 158 |
+
"all",
|
| 159 |
+
],
|
| 160 |
+
}
|
| 161 |
+
},
|
| 162 |
+
"frequency": {
|
| 163 |
+
"fred": {
|
| 164 |
+
"multiple_items_allowed": False,
|
| 165 |
+
"choices": [
|
| 166 |
+
"a",
|
| 167 |
+
"q",
|
| 168 |
+
"m",
|
| 169 |
+
"w",
|
| 170 |
+
"d",
|
| 171 |
+
"wef",
|
| 172 |
+
"weth",
|
| 173 |
+
"wew",
|
| 174 |
+
"wetu",
|
| 175 |
+
"wem",
|
| 176 |
+
"wesu",
|
| 177 |
+
"wesa",
|
| 178 |
+
"bwew",
|
| 179 |
+
"bwem",
|
| 180 |
+
],
|
| 181 |
+
}
|
| 182 |
+
},
|
| 183 |
+
"aggregation_method": {
|
| 184 |
+
"fred": {
|
| 185 |
+
"multiple_items_allowed": False,
|
| 186 |
+
"choices": ["avg", "sum", "eop"],
|
| 187 |
+
}
|
| 188 |
+
},
|
| 189 |
+
"transform": {
|
| 190 |
+
"fred": {
|
| 191 |
+
"multiple_items_allowed": False,
|
| 192 |
+
"choices": [
|
| 193 |
+
"chg",
|
| 194 |
+
"ch1",
|
| 195 |
+
"pch",
|
| 196 |
+
"pc1",
|
| 197 |
+
"pca",
|
| 198 |
+
"cch",
|
| 199 |
+
"cca",
|
| 200 |
+
"log",
|
| 201 |
+
],
|
| 202 |
+
}
|
| 203 |
+
},
|
| 204 |
+
},
|
| 205 |
+
)
|
| 206 |
+
)
|
openbb_platform/openbb/package/crypto.py
ADDED
|
@@ -0,0 +1,102 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
### THIS FILE IS AUTO-GENERATED. DO NOT EDIT. ###
|
| 2 |
+
|
| 3 |
+
from typing import Literal, Optional
|
| 4 |
+
|
| 5 |
+
from openbb_core.app.model.field import OpenBBField
|
| 6 |
+
from openbb_core.app.model.obbject import OBBject
|
| 7 |
+
from openbb_core.app.static.container import Container
|
| 8 |
+
from openbb_core.app.static.utils.decorators import exception_handler, validate
|
| 9 |
+
from openbb_core.app.static.utils.filters import filter_inputs
|
| 10 |
+
from typing_extensions import Annotated
|
| 11 |
+
|
| 12 |
+
|
| 13 |
+
class ROUTER_crypto(Container):
|
| 14 |
+
"""/crypto
|
| 15 |
+
/price
|
| 16 |
+
search
|
| 17 |
+
"""
|
| 18 |
+
|
| 19 |
+
def __repr__(self) -> str:
|
| 20 |
+
return self.__doc__ or ""
|
| 21 |
+
|
| 22 |
+
@property
|
| 23 |
+
def price(self):
|
| 24 |
+
# pylint: disable=import-outside-toplevel
|
| 25 |
+
from . import crypto_price
|
| 26 |
+
|
| 27 |
+
return crypto_price.ROUTER_crypto_price(command_runner=self._command_runner)
|
| 28 |
+
|
| 29 |
+
@exception_handler
|
| 30 |
+
@validate
|
| 31 |
+
def search(
|
| 32 |
+
self,
|
| 33 |
+
query: Annotated[
|
| 34 |
+
Optional[str], OpenBBField(description="Search query.")
|
| 35 |
+
] = None,
|
| 36 |
+
provider: Annotated[
|
| 37 |
+
Optional[Literal["fmp"]],
|
| 38 |
+
OpenBBField(
|
| 39 |
+
description="The provider to use, by default None. If None, the priority list configured in the settings is used. Default priority: fmp."
|
| 40 |
+
),
|
| 41 |
+
] = None,
|
| 42 |
+
**kwargs
|
| 43 |
+
) -> OBBject:
|
| 44 |
+
"""Search available cryptocurrency pairs within a provider.
|
| 45 |
+
|
| 46 |
+
Parameters
|
| 47 |
+
----------
|
| 48 |
+
provider : str
|
| 49 |
+
The provider to use, by default None. If None, the priority list configured in the settings is used. Default priority: fmp.
|
| 50 |
+
query : Optional[str]
|
| 51 |
+
Search query.
|
| 52 |
+
|
| 53 |
+
Returns
|
| 54 |
+
-------
|
| 55 |
+
OBBject
|
| 56 |
+
results : list[CryptoSearch]
|
| 57 |
+
Serializable results.
|
| 58 |
+
provider : Optional[str]
|
| 59 |
+
Provider name.
|
| 60 |
+
warnings : Optional[list[Warning_]]
|
| 61 |
+
list of warnings.
|
| 62 |
+
chart : Optional[Chart]
|
| 63 |
+
Chart object.
|
| 64 |
+
extra : Dict[str, Any]
|
| 65 |
+
Extra info.
|
| 66 |
+
|
| 67 |
+
CryptoSearch
|
| 68 |
+
------------
|
| 69 |
+
symbol : str
|
| 70 |
+
Symbol representing the entity requested in the data. (Crypto)
|
| 71 |
+
name : Optional[str]
|
| 72 |
+
Name of the crypto.
|
| 73 |
+
currency : Optional[str]
|
| 74 |
+
The currency the crypto trades for. (provider: fmp)
|
| 75 |
+
exchange : Optional[str]
|
| 76 |
+
The exchange code the crypto trades on. (provider: fmp)
|
| 77 |
+
exchange_name : Optional[str]
|
| 78 |
+
The short name of the exchange the crypto trades on. (provider: fmp)
|
| 79 |
+
|
| 80 |
+
Examples
|
| 81 |
+
--------
|
| 82 |
+
>>> from openbb import obb
|
| 83 |
+
>>> obb.crypto.search(provider='fmp')
|
| 84 |
+
>>> obb.crypto.search(query='BTCUSD', provider='fmp')
|
| 85 |
+
""" # noqa: E501
|
| 86 |
+
|
| 87 |
+
return self._run(
|
| 88 |
+
"/crypto/search",
|
| 89 |
+
**filter_inputs(
|
| 90 |
+
provider_choices={
|
| 91 |
+
"provider": self._get_provider(
|
| 92 |
+
provider,
|
| 93 |
+
"crypto.search",
|
| 94 |
+
("fmp",),
|
| 95 |
+
)
|
| 96 |
+
},
|
| 97 |
+
standard_params={
|
| 98 |
+
"query": query,
|
| 99 |
+
},
|
| 100 |
+
extra_params=kwargs,
|
| 101 |
+
)
|
| 102 |
+
)
|
openbb_platform/openbb/package/crypto_price.py
ADDED
|
@@ -0,0 +1,190 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
### THIS FILE IS AUTO-GENERATED. DO NOT EDIT. ###
|
| 2 |
+
|
| 3 |
+
import datetime
|
| 4 |
+
from typing import Literal, Optional, Union
|
| 5 |
+
|
| 6 |
+
from openbb_core.app.model.field import OpenBBField
|
| 7 |
+
from openbb_core.app.model.obbject import OBBject
|
| 8 |
+
from openbb_core.app.static.container import Container
|
| 9 |
+
from openbb_core.app.static.utils.decorators import exception_handler, validate
|
| 10 |
+
from openbb_core.app.static.utils.filters import filter_inputs
|
| 11 |
+
from typing_extensions import Annotated
|
| 12 |
+
|
| 13 |
+
|
| 14 |
+
class ROUTER_crypto_price(Container):
|
| 15 |
+
"""/crypto/price
|
| 16 |
+
historical
|
| 17 |
+
"""
|
| 18 |
+
|
| 19 |
+
def __repr__(self) -> str:
|
| 20 |
+
return self.__doc__ or ""
|
| 21 |
+
|
| 22 |
+
@exception_handler
|
| 23 |
+
@validate
|
| 24 |
+
def historical(
|
| 25 |
+
self,
|
| 26 |
+
symbol: Annotated[
|
| 27 |
+
Union[str, list[str]],
|
| 28 |
+
OpenBBField(
|
| 29 |
+
description="Symbol to get data for. Can use CURR1-CURR2 or CURR1CURR2 format. Multiple comma separated items allowed for provider(s): fmp, polygon, tiingo, yfinance."
|
| 30 |
+
),
|
| 31 |
+
],
|
| 32 |
+
start_date: Annotated[
|
| 33 |
+
Union[datetime.date, None, str],
|
| 34 |
+
OpenBBField(description="Start date of the data, in YYYY-MM-DD format."),
|
| 35 |
+
] = None,
|
| 36 |
+
end_date: Annotated[
|
| 37 |
+
Union[datetime.date, None, str],
|
| 38 |
+
OpenBBField(description="End date of the data, in YYYY-MM-DD format."),
|
| 39 |
+
] = None,
|
| 40 |
+
provider: Annotated[
|
| 41 |
+
Optional[Literal["fmp", "polygon", "tiingo", "yfinance"]],
|
| 42 |
+
OpenBBField(
|
| 43 |
+
description="The provider to use, by default None. If None, the priority list configured in the settings is used. Default priority: fmp, polygon, tiingo, yfinance."
|
| 44 |
+
),
|
| 45 |
+
] = None,
|
| 46 |
+
**kwargs
|
| 47 |
+
) -> OBBject:
|
| 48 |
+
"""Get historical price data for cryptocurrency pair(s) within a provider.
|
| 49 |
+
|
| 50 |
+
Parameters
|
| 51 |
+
----------
|
| 52 |
+
provider : str
|
| 53 |
+
The provider to use, by default None. If None, the priority list configured in the settings is used. Default priority: fmp, polygon, tiingo, yfinance.
|
| 54 |
+
symbol : Union[str, list[str]]
|
| 55 |
+
Symbol to get data for. Can use CURR1-CURR2 or CURR1CURR2 format. Multiple comma separated items allowed for provider(s): fmp, polygon, tiingo, yfinance.
|
| 56 |
+
start_date : Union[date, None, str]
|
| 57 |
+
Start date of the data, in YYYY-MM-DD format.
|
| 58 |
+
end_date : Union[date, None, str]
|
| 59 |
+
End date of the data, in YYYY-MM-DD format.
|
| 60 |
+
interval : str
|
| 61 |
+
Time interval of the data to return. (provider: fmp, polygon, tiingo, yfinance)
|
| 62 |
+
Choices for fmp: '1m', '5m', '15m', '30m', '1h', '4h', '1d'
|
| 63 |
+
Choices for yfinance: '1m', '2m', '5m', '15m', '30m', '60m', '90m', '1h', '1d', '5d', '1W', '1M', '1Q'
|
| 64 |
+
sort : Literal['asc', 'desc']
|
| 65 |
+
Sort order of the data. This impacts the results in combination with the 'limit' parameter. The results are always returned in ascending order by date. (provider: polygon)
|
| 66 |
+
limit : int
|
| 67 |
+
The number of data entries to return. (provider: polygon)
|
| 68 |
+
exchanges : Union[list[str], str, None]
|
| 69 |
+
To limit the query to a subset of exchanges e.g. ['POLONIEX', 'GDAX'] Multiple comma separated items allowed. (provider: tiingo)
|
| 70 |
+
|
| 71 |
+
Returns
|
| 72 |
+
-------
|
| 73 |
+
OBBject
|
| 74 |
+
results : list[CryptoHistorical]
|
| 75 |
+
Serializable results.
|
| 76 |
+
provider : Optional[str]
|
| 77 |
+
Provider name.
|
| 78 |
+
warnings : Optional[list[Warning_]]
|
| 79 |
+
list of warnings.
|
| 80 |
+
chart : Optional[Chart]
|
| 81 |
+
Chart object.
|
| 82 |
+
extra : Dict[str, Any]
|
| 83 |
+
Extra info.
|
| 84 |
+
|
| 85 |
+
CryptoHistorical
|
| 86 |
+
----------------
|
| 87 |
+
date : Union[date, datetime]
|
| 88 |
+
The date of the data.
|
| 89 |
+
open : float
|
| 90 |
+
The open price.
|
| 91 |
+
high : float
|
| 92 |
+
The high price.
|
| 93 |
+
low : float
|
| 94 |
+
The low price.
|
| 95 |
+
close : float
|
| 96 |
+
The close price.
|
| 97 |
+
volume : Optional[float]
|
| 98 |
+
The trading volume.
|
| 99 |
+
vwap : Optional[float]
|
| 100 |
+
Volume Weighted Average Price over the period.
|
| 101 |
+
adj_close : Optional[float]
|
| 102 |
+
The adjusted close price. (provider: fmp)
|
| 103 |
+
change : Optional[float]
|
| 104 |
+
Change in the price from the previous close. (provider: fmp)
|
| 105 |
+
change_percent : Optional[float]
|
| 106 |
+
Change in the price from the previous close, as a normalized percent. (provider: fmp)
|
| 107 |
+
transactions : Optional[Union[Annotated[int, Gt(gt=0)], int]]
|
| 108 |
+
Number of transactions for the symbol in the time period. (provider: polygon, tiingo)
|
| 109 |
+
volume_notional : Optional[float]
|
| 110 |
+
The last size done for the asset on the specific date in the quote currency. The volume of the asset on the specific date in the quote currency. (provider: tiingo)
|
| 111 |
+
|
| 112 |
+
Examples
|
| 113 |
+
--------
|
| 114 |
+
>>> from openbb import obb
|
| 115 |
+
>>> obb.crypto.price.historical(symbol='BTCUSD', provider='fmp')
|
| 116 |
+
>>> obb.crypto.price.historical(symbol='BTCUSD', start_date='2024-01-01', end_date='2024-01-31', provider='fmp')
|
| 117 |
+
>>> obb.crypto.price.historical(symbol='BTCUSD,ETHUSD', start_date='2024-01-01', end_date='2024-01-31', provider='polygon')
|
| 118 |
+
>>> # Get monthly historical prices from Yahoo Finance for Ethereum.
|
| 119 |
+
>>> obb.crypto.price.historical(symbol='ETH-USD', interval='1m', start_date='2024-01-01', end_date='2024-12-31', provider='yfinance')
|
| 120 |
+
""" # noqa: E501
|
| 121 |
+
|
| 122 |
+
return self._run(
|
| 123 |
+
"/crypto/price/historical",
|
| 124 |
+
**filter_inputs(
|
| 125 |
+
provider_choices={
|
| 126 |
+
"provider": self._get_provider(
|
| 127 |
+
provider,
|
| 128 |
+
"crypto.price.historical",
|
| 129 |
+
("fmp", "polygon", "tiingo", "yfinance"),
|
| 130 |
+
)
|
| 131 |
+
},
|
| 132 |
+
standard_params={
|
| 133 |
+
"symbol": symbol,
|
| 134 |
+
"start_date": start_date,
|
| 135 |
+
"end_date": end_date,
|
| 136 |
+
},
|
| 137 |
+
extra_params=kwargs,
|
| 138 |
+
info={
|
| 139 |
+
"symbol": {
|
| 140 |
+
"fmp": {"multiple_items_allowed": True, "choices": None},
|
| 141 |
+
"polygon": {"multiple_items_allowed": True, "choices": None},
|
| 142 |
+
"tiingo": {"multiple_items_allowed": True, "choices": None},
|
| 143 |
+
"yfinance": {"multiple_items_allowed": True, "choices": None},
|
| 144 |
+
},
|
| 145 |
+
"interval": {
|
| 146 |
+
"fmp": {
|
| 147 |
+
"multiple_items_allowed": False,
|
| 148 |
+
"choices": ["1m", "5m", "15m", "30m", "1h", "4h", "1d"],
|
| 149 |
+
},
|
| 150 |
+
"tiingo": {
|
| 151 |
+
"multiple_items_allowed": False,
|
| 152 |
+
"choices": [
|
| 153 |
+
"1m",
|
| 154 |
+
"5m",
|
| 155 |
+
"15m",
|
| 156 |
+
"30m",
|
| 157 |
+
"90m",
|
| 158 |
+
"1h",
|
| 159 |
+
"2h",
|
| 160 |
+
"4h",
|
| 161 |
+
"1d",
|
| 162 |
+
"7d",
|
| 163 |
+
"30d",
|
| 164 |
+
],
|
| 165 |
+
},
|
| 166 |
+
"yfinance": {
|
| 167 |
+
"multiple_items_allowed": False,
|
| 168 |
+
"choices": [
|
| 169 |
+
"1m",
|
| 170 |
+
"2m",
|
| 171 |
+
"5m",
|
| 172 |
+
"15m",
|
| 173 |
+
"30m",
|
| 174 |
+
"60m",
|
| 175 |
+
"90m",
|
| 176 |
+
"1h",
|
| 177 |
+
"1d",
|
| 178 |
+
"5d",
|
| 179 |
+
"1W",
|
| 180 |
+
"1M",
|
| 181 |
+
"1Q",
|
| 182 |
+
],
|
| 183 |
+
},
|
| 184 |
+
},
|
| 185 |
+
"exchanges": {
|
| 186 |
+
"tiingo": {"multiple_items_allowed": True, "choices": None}
|
| 187 |
+
},
|
| 188 |
+
},
|
| 189 |
+
)
|
| 190 |
+
)
|
openbb_platform/openbb/package/currency.py
ADDED
|
@@ -0,0 +1,296 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|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
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
### THIS FILE IS AUTO-GENERATED. DO NOT EDIT. ###
|
| 2 |
+
|
| 3 |
+
from typing import Literal, Optional, Union
|
| 4 |
+
|
| 5 |
+
from openbb_core.app.model.field import OpenBBField
|
| 6 |
+
from openbb_core.app.model.obbject import OBBject
|
| 7 |
+
from openbb_core.app.static.container import Container
|
| 8 |
+
from openbb_core.app.static.utils.decorators import exception_handler, validate
|
| 9 |
+
from openbb_core.app.static.utils.filters import filter_inputs
|
| 10 |
+
from typing_extensions import Annotated
|
| 11 |
+
|
| 12 |
+
|
| 13 |
+
class ROUTER_currency(Container):
|
| 14 |
+
"""/currency
|
| 15 |
+
/price
|
| 16 |
+
search
|
| 17 |
+
snapshots
|
| 18 |
+
"""
|
| 19 |
+
|
| 20 |
+
def __repr__(self) -> str:
|
| 21 |
+
return self.__doc__ or ""
|
| 22 |
+
|
| 23 |
+
@property
|
| 24 |
+
def price(self):
|
| 25 |
+
# pylint: disable=import-outside-toplevel
|
| 26 |
+
from . import currency_price
|
| 27 |
+
|
| 28 |
+
return currency_price.ROUTER_currency_price(command_runner=self._command_runner)
|
| 29 |
+
|
| 30 |
+
@exception_handler
|
| 31 |
+
@validate
|
| 32 |
+
def search(
|
| 33 |
+
self,
|
| 34 |
+
query: Annotated[
|
| 35 |
+
Optional[str],
|
| 36 |
+
OpenBBField(description="Query to search for currency pairs."),
|
| 37 |
+
] = None,
|
| 38 |
+
provider: Annotated[
|
| 39 |
+
Optional[Literal["fmp", "intrinio", "polygon"]],
|
| 40 |
+
OpenBBField(
|
| 41 |
+
description="The provider to use, by default None. If None, the priority list configured in the settings is used. Default priority: fmp, intrinio, polygon."
|
| 42 |
+
),
|
| 43 |
+
] = None,
|
| 44 |
+
**kwargs
|
| 45 |
+
) -> OBBject:
|
| 46 |
+
"""Currency Search.
|
| 47 |
+
|
| 48 |
+
Search available currency pairs.
|
| 49 |
+
Currency pairs are the national currencies from two countries coupled for trading on
|
| 50 |
+
the foreign exchange (FX) marketplace.
|
| 51 |
+
Both currencies will have exchange rates on which the trade will have its position basis.
|
| 52 |
+
All trading within the forex market, whether selling, buying, or trading, will take place through currency pairs.
|
| 53 |
+
(ref: Investopedia)
|
| 54 |
+
Major currency pairs include pairs such as EUR/USD, USD/JPY, GBP/USD, etc.
|
| 55 |
+
|
| 56 |
+
|
| 57 |
+
Parameters
|
| 58 |
+
----------
|
| 59 |
+
provider : str
|
| 60 |
+
The provider to use, by default None. If None, the priority list configured in the settings is used. Default priority: fmp, intrinio, polygon.
|
| 61 |
+
query : Optional[str]
|
| 62 |
+
Query to search for currency pairs.
|
| 63 |
+
|
| 64 |
+
Returns
|
| 65 |
+
-------
|
| 66 |
+
OBBject
|
| 67 |
+
results : list[CurrencyPairs]
|
| 68 |
+
Serializable results.
|
| 69 |
+
provider : Optional[str]
|
| 70 |
+
Provider name.
|
| 71 |
+
warnings : Optional[list[Warning_]]
|
| 72 |
+
list of warnings.
|
| 73 |
+
chart : Optional[Chart]
|
| 74 |
+
Chart object.
|
| 75 |
+
extra : Dict[str, Any]
|
| 76 |
+
Extra info.
|
| 77 |
+
|
| 78 |
+
CurrencyPairs
|
| 79 |
+
-------------
|
| 80 |
+
symbol : str
|
| 81 |
+
Symbol representing the entity requested in the data.
|
| 82 |
+
name : Optional[str]
|
| 83 |
+
Name of the currency pair.
|
| 84 |
+
currency : Optional[str]
|
| 85 |
+
Base currency of the currency pair. (provider: fmp)
|
| 86 |
+
stock_exchange : Optional[str]
|
| 87 |
+
Stock exchange of the currency pair. (provider: fmp)
|
| 88 |
+
exchange_short_name : Optional[str]
|
| 89 |
+
Short name of the stock exchange of the currency pair. (provider: fmp)
|
| 90 |
+
base_currency : Optional[str]
|
| 91 |
+
ISO 4217 currency code of the base currency. (provider: intrinio)
|
| 92 |
+
quote_currency : Optional[str]
|
| 93 |
+
ISO 4217 currency code of the quote currency. (provider: intrinio)
|
| 94 |
+
currency_symbol : Optional[str]
|
| 95 |
+
The symbol of the quote currency. (provider: polygon)
|
| 96 |
+
base_currency_symbol : Optional[str]
|
| 97 |
+
The symbol of the base currency. (provider: polygon)
|
| 98 |
+
base_currency_name : Optional[str]
|
| 99 |
+
Name of the base currency. (provider: polygon)
|
| 100 |
+
market : Optional[str]
|
| 101 |
+
Name of the trading market. Always 'fx'. (provider: polygon)
|
| 102 |
+
locale : Optional[str]
|
| 103 |
+
Locale of the currency pair. (provider: polygon)
|
| 104 |
+
last_updated : Optional[date]
|
| 105 |
+
The date the reference data was last updated. (provider: polygon)
|
| 106 |
+
delisted : Optional[date]
|
| 107 |
+
The date the item was delisted. (provider: polygon)
|
| 108 |
+
|
| 109 |
+
Examples
|
| 110 |
+
--------
|
| 111 |
+
>>> from openbb import obb
|
| 112 |
+
>>> obb.currency.search(provider='fmp')
|
| 113 |
+
>>> # Search for 'EUR' currency pair using 'intrinio' as provider.
|
| 114 |
+
>>> obb.currency.search(provider='intrinio', query='EUR')
|
| 115 |
+
>>> # Search for terms using 'polygon' as provider.
|
| 116 |
+
>>> obb.currency.search(provider='polygon', query='EUR')
|
| 117 |
+
""" # noqa: E501
|
| 118 |
+
|
| 119 |
+
return self._run(
|
| 120 |
+
"/currency/search",
|
| 121 |
+
**filter_inputs(
|
| 122 |
+
provider_choices={
|
| 123 |
+
"provider": self._get_provider(
|
| 124 |
+
provider,
|
| 125 |
+
"currency.search",
|
| 126 |
+
("fmp", "intrinio", "polygon"),
|
| 127 |
+
)
|
| 128 |
+
},
|
| 129 |
+
standard_params={
|
| 130 |
+
"query": query,
|
| 131 |
+
},
|
| 132 |
+
extra_params=kwargs,
|
| 133 |
+
)
|
| 134 |
+
)
|
| 135 |
+
|
| 136 |
+
@exception_handler
|
| 137 |
+
@validate
|
| 138 |
+
def snapshots(
|
| 139 |
+
self,
|
| 140 |
+
base: Annotated[
|
| 141 |
+
Union[str, list[str]],
|
| 142 |
+
OpenBBField(
|
| 143 |
+
description="The base currency symbol. Multiple comma separated items allowed for provider(s): fmp, polygon."
|
| 144 |
+
),
|
| 145 |
+
] = "usd",
|
| 146 |
+
quote_type: Annotated[
|
| 147 |
+
Literal["direct", "indirect"],
|
| 148 |
+
OpenBBField(
|
| 149 |
+
description="Whether the quote is direct or indirect. Selecting 'direct' will return the exchange rate as the amount of domestic currency required to buy one unit of the foreign currency. Selecting 'indirect' (default) will return the exchange rate as the amount of foreign currency required to buy one unit of the domestic currency."
|
| 150 |
+
),
|
| 151 |
+
] = "indirect",
|
| 152 |
+
counter_currencies: Annotated[
|
| 153 |
+
Union[str, list[str], None],
|
| 154 |
+
OpenBBField(
|
| 155 |
+
description="An optional list of counter currency symbols to filter for. None returns all."
|
| 156 |
+
),
|
| 157 |
+
] = None,
|
| 158 |
+
provider: Annotated[
|
| 159 |
+
Optional[Literal["fmp", "polygon"]],
|
| 160 |
+
OpenBBField(
|
| 161 |
+
description="The provider to use, by default None. If None, the priority list configured in the settings is used. Default priority: fmp, polygon."
|
| 162 |
+
),
|
| 163 |
+
] = None,
|
| 164 |
+
**kwargs
|
| 165 |
+
) -> OBBject:
|
| 166 |
+
"""Snapshots of currency exchange rates from an indirect or direct perspective of a base currency.
|
| 167 |
+
|
| 168 |
+
Parameters
|
| 169 |
+
----------
|
| 170 |
+
provider : str
|
| 171 |
+
The provider to use, by default None. If None, the priority list configured in the settings is used. Default priority: fmp, polygon.
|
| 172 |
+
base : Union[str, list[str]]
|
| 173 |
+
The base currency symbol. Multiple comma separated items allowed for provider(s): fmp, polygon.
|
| 174 |
+
quote_type : Literal['direct', 'indirect']
|
| 175 |
+
Whether the quote is direct or indirect. Selecting 'direct' will return the exchange rate as the amount of domestic currency required to buy one unit of the foreign currency. Selecting 'indirect' (default) will return the exchange rate as the amount of foreign currency required to buy one unit of the domestic currency.
|
| 176 |
+
counter_currencies : Union[str, list[str], None]
|
| 177 |
+
An optional list of counter currency symbols to filter for. None returns all.
|
| 178 |
+
|
| 179 |
+
Returns
|
| 180 |
+
-------
|
| 181 |
+
OBBject
|
| 182 |
+
results : list[CurrencySnapshots]
|
| 183 |
+
Serializable results.
|
| 184 |
+
provider : Optional[str]
|
| 185 |
+
Provider name.
|
| 186 |
+
warnings : Optional[list[Warning_]]
|
| 187 |
+
list of warnings.
|
| 188 |
+
chart : Optional[Chart]
|
| 189 |
+
Chart object.
|
| 190 |
+
extra : Dict[str, Any]
|
| 191 |
+
Extra info.
|
| 192 |
+
|
| 193 |
+
CurrencySnapshots
|
| 194 |
+
-----------------
|
| 195 |
+
base_currency : str
|
| 196 |
+
The base, or domestic, currency.
|
| 197 |
+
counter_currency : str
|
| 198 |
+
The counter, or foreign, currency.
|
| 199 |
+
last_rate : float
|
| 200 |
+
The exchange rate, relative to the base currency. Rates are expressed as the amount of foreign currency received from selling one unit of the base currency, or the quantity of foreign currency required to purchase one unit of the domestic currency. To inverse the perspective, set the 'quote_type' parameter as 'direct'.
|
| 201 |
+
open : Optional[float]
|
| 202 |
+
The open price.
|
| 203 |
+
high : Optional[float]
|
| 204 |
+
The high price.
|
| 205 |
+
low : Optional[float]
|
| 206 |
+
The low price.
|
| 207 |
+
close : Optional[float]
|
| 208 |
+
The close price.
|
| 209 |
+
volume : Optional[int]
|
| 210 |
+
The trading volume.
|
| 211 |
+
prev_close : Optional[float]
|
| 212 |
+
The previous close price.
|
| 213 |
+
change : Optional[float]
|
| 214 |
+
The change in the price from the previous close. (provider: fmp, polygon)
|
| 215 |
+
change_percent : Optional[float]
|
| 216 |
+
The change in the price from the previous close, as a normalized percent. (provider: fmp);
|
| 217 |
+
The percentage change in price from the previous day. (provider: polygon)
|
| 218 |
+
ma50 : Optional[float]
|
| 219 |
+
The 50-day moving average. (provider: fmp)
|
| 220 |
+
ma200 : Optional[float]
|
| 221 |
+
The 200-day moving average. (provider: fmp)
|
| 222 |
+
year_high : Optional[float]
|
| 223 |
+
The 52-week high. (provider: fmp)
|
| 224 |
+
year_low : Optional[float]
|
| 225 |
+
The 52-week low. (provider: fmp)
|
| 226 |
+
last_rate_timestamp : Optional[datetime]
|
| 227 |
+
The timestamp of the last rate. (provider: fmp)
|
| 228 |
+
vwap : Optional[float]
|
| 229 |
+
The volume-weighted average price. (provider: polygon)
|
| 230 |
+
prev_open : Optional[float]
|
| 231 |
+
The previous day's opening price. (provider: polygon)
|
| 232 |
+
prev_high : Optional[float]
|
| 233 |
+
The previous day's high price. (provider: polygon)
|
| 234 |
+
prev_low : Optional[float]
|
| 235 |
+
The previous day's low price. (provider: polygon)
|
| 236 |
+
prev_volume : Optional[float]
|
| 237 |
+
The previous day's volume. (provider: polygon)
|
| 238 |
+
prev_vwap : Optional[float]
|
| 239 |
+
The previous day's VWAP. (provider: polygon)
|
| 240 |
+
bid : Optional[float]
|
| 241 |
+
The current bid price. (provider: polygon)
|
| 242 |
+
ask : Optional[float]
|
| 243 |
+
The current ask price. (provider: polygon)
|
| 244 |
+
minute_open : Optional[float]
|
| 245 |
+
The open price from the most recent minute bar. (provider: polygon)
|
| 246 |
+
minute_high : Optional[float]
|
| 247 |
+
The high price from the most recent minute bar. (provider: polygon)
|
| 248 |
+
minute_low : Optional[float]
|
| 249 |
+
The low price from the most recent minute bar. (provider: polygon)
|
| 250 |
+
minute_close : Optional[float]
|
| 251 |
+
The close price from the most recent minute bar. (provider: polygon)
|
| 252 |
+
minute_volume : Optional[float]
|
| 253 |
+
The volume from the most recent minute bar. (provider: polygon)
|
| 254 |
+
minute_vwap : Optional[float]
|
| 255 |
+
The VWAP from the most recent minute bar. (provider: polygon)
|
| 256 |
+
minute_transactions : Optional[float]
|
| 257 |
+
The number of transactions in the most recent minute bar. (provider: polygon)
|
| 258 |
+
quote_timestamp : Optional[datetime]
|
| 259 |
+
The timestamp of the last quote. (provider: polygon)
|
| 260 |
+
minute_timestamp : Optional[datetime]
|
| 261 |
+
The timestamp for the start of the most recent minute bar. (provider: polygon)
|
| 262 |
+
last_updated : Optional[datetime]
|
| 263 |
+
The last time the data was updated. (provider: polygon)
|
| 264 |
+
|
| 265 |
+
Examples
|
| 266 |
+
--------
|
| 267 |
+
>>> from openbb import obb
|
| 268 |
+
>>> obb.currency.snapshots(provider='fmp')
|
| 269 |
+
>>> # Get exchange rates from USD and XAU to EUR, JPY, and GBP using 'fmp' as provider.
|
| 270 |
+
>>> obb.currency.snapshots(provider='fmp', base='USD,XAU', counter_currencies='EUR,JPY,GBP', quote_type='indirect')
|
| 271 |
+
""" # noqa: E501
|
| 272 |
+
|
| 273 |
+
return self._run(
|
| 274 |
+
"/currency/snapshots",
|
| 275 |
+
**filter_inputs(
|
| 276 |
+
provider_choices={
|
| 277 |
+
"provider": self._get_provider(
|
| 278 |
+
provider,
|
| 279 |
+
"currency.snapshots",
|
| 280 |
+
("fmp", "polygon"),
|
| 281 |
+
)
|
| 282 |
+
},
|
| 283 |
+
standard_params={
|
| 284 |
+
"base": base,
|
| 285 |
+
"quote_type": quote_type,
|
| 286 |
+
"counter_currencies": counter_currencies,
|
| 287 |
+
},
|
| 288 |
+
extra_params=kwargs,
|
| 289 |
+
info={
|
| 290 |
+
"base": {
|
| 291 |
+
"fmp": {"multiple_items_allowed": True, "choices": None},
|
| 292 |
+
"polygon": {"multiple_items_allowed": True, "choices": None},
|
| 293 |
+
}
|
| 294 |
+
},
|
| 295 |
+
)
|
| 296 |
+
)
|
openbb_platform/openbb/package/currency_price.py
ADDED
|
@@ -0,0 +1,190 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
### THIS FILE IS AUTO-GENERATED. DO NOT EDIT. ###
|
| 2 |
+
|
| 3 |
+
import datetime
|
| 4 |
+
from typing import Literal, Optional, Union
|
| 5 |
+
|
| 6 |
+
from openbb_core.app.model.field import OpenBBField
|
| 7 |
+
from openbb_core.app.model.obbject import OBBject
|
| 8 |
+
from openbb_core.app.static.container import Container
|
| 9 |
+
from openbb_core.app.static.utils.decorators import exception_handler, validate
|
| 10 |
+
from openbb_core.app.static.utils.filters import filter_inputs
|
| 11 |
+
from typing_extensions import Annotated
|
| 12 |
+
|
| 13 |
+
|
| 14 |
+
class ROUTER_currency_price(Container):
|
| 15 |
+
"""/currency/price
|
| 16 |
+
historical
|
| 17 |
+
"""
|
| 18 |
+
|
| 19 |
+
def __repr__(self) -> str:
|
| 20 |
+
return self.__doc__ or ""
|
| 21 |
+
|
| 22 |
+
@exception_handler
|
| 23 |
+
@validate
|
| 24 |
+
def historical(
|
| 25 |
+
self,
|
| 26 |
+
symbol: Annotated[
|
| 27 |
+
Union[str, list[str]],
|
| 28 |
+
OpenBBField(
|
| 29 |
+
description="Symbol to get data for. Can use CURR1-CURR2 or CURR1CURR2 format. Multiple comma separated items allowed for provider(s): fmp, polygon, tiingo, yfinance."
|
| 30 |
+
),
|
| 31 |
+
],
|
| 32 |
+
start_date: Annotated[
|
| 33 |
+
Union[datetime.date, None, str],
|
| 34 |
+
OpenBBField(description="Start date of the data, in YYYY-MM-DD format."),
|
| 35 |
+
] = None,
|
| 36 |
+
end_date: Annotated[
|
| 37 |
+
Union[datetime.date, None, str],
|
| 38 |
+
OpenBBField(description="End date of the data, in YYYY-MM-DD format."),
|
| 39 |
+
] = None,
|
| 40 |
+
provider: Annotated[
|
| 41 |
+
Optional[Literal["fmp", "polygon", "tiingo", "yfinance"]],
|
| 42 |
+
OpenBBField(
|
| 43 |
+
description="The provider to use, by default None. If None, the priority list configured in the settings is used. Default priority: fmp, polygon, tiingo, yfinance."
|
| 44 |
+
),
|
| 45 |
+
] = None,
|
| 46 |
+
**kwargs
|
| 47 |
+
) -> OBBject:
|
| 48 |
+
"""Currency Historical Price. Currency historical data.
|
| 49 |
+
|
| 50 |
+
Currency historical prices refer to the past exchange rates of one currency against
|
| 51 |
+
another over a specific period.
|
| 52 |
+
This data provides insight into the fluctuations and trends in the foreign exchange market,
|
| 53 |
+
helping analysts, traders, and economists understand currency performance,
|
| 54 |
+
evaluate economic health, and make predictions about future movements.
|
| 55 |
+
|
| 56 |
+
|
| 57 |
+
Parameters
|
| 58 |
+
----------
|
| 59 |
+
provider : str
|
| 60 |
+
The provider to use, by default None. If None, the priority list configured in the settings is used. Default priority: fmp, polygon, tiingo, yfinance.
|
| 61 |
+
symbol : Union[str, list[str]]
|
| 62 |
+
Symbol to get data for. Can use CURR1-CURR2 or CURR1CURR2 format. Multiple comma separated items allowed for provider(s): fmp, polygon, tiingo, yfinance.
|
| 63 |
+
start_date : Union[date, None, str]
|
| 64 |
+
Start date of the data, in YYYY-MM-DD format.
|
| 65 |
+
end_date : Union[date, None, str]
|
| 66 |
+
End date of the data, in YYYY-MM-DD format.
|
| 67 |
+
interval : str
|
| 68 |
+
Time interval of the data to return. (provider: fmp, polygon, tiingo, yfinance)
|
| 69 |
+
Choices for fmp: '1m', '5m', '15m', '30m', '1h', '4h', '1d'
|
| 70 |
+
Choices for yfinance: '1m', '2m', '5m', '15m', '30m', '60m', '90m', '1h', '1d', '5d', '1W', '1M', '1Q'
|
| 71 |
+
sort : Literal['asc', 'desc']
|
| 72 |
+
Sort order of the data. This impacts the results in combination with the 'limit' parameter. The results are always returned in ascending order by date. (provider: polygon)
|
| 73 |
+
limit : int
|
| 74 |
+
The number of data entries to return. (provider: polygon)
|
| 75 |
+
|
| 76 |
+
Returns
|
| 77 |
+
-------
|
| 78 |
+
OBBject
|
| 79 |
+
results : list[CurrencyHistorical]
|
| 80 |
+
Serializable results.
|
| 81 |
+
provider : Optional[str]
|
| 82 |
+
Provider name.
|
| 83 |
+
warnings : Optional[list[Warning_]]
|
| 84 |
+
list of warnings.
|
| 85 |
+
chart : Optional[Chart]
|
| 86 |
+
Chart object.
|
| 87 |
+
extra : Dict[str, Any]
|
| 88 |
+
Extra info.
|
| 89 |
+
|
| 90 |
+
CurrencyHistorical
|
| 91 |
+
------------------
|
| 92 |
+
date : Union[date, datetime]
|
| 93 |
+
The date of the data.
|
| 94 |
+
open : float
|
| 95 |
+
The open price.
|
| 96 |
+
high : float
|
| 97 |
+
The high price.
|
| 98 |
+
low : float
|
| 99 |
+
The low price.
|
| 100 |
+
close : float
|
| 101 |
+
The close price.
|
| 102 |
+
volume : Optional[float]
|
| 103 |
+
The trading volume.
|
| 104 |
+
vwap : Optional[Annotated[float, Gt(gt=0)]]
|
| 105 |
+
Volume Weighted Average Price over the period.
|
| 106 |
+
adj_close : Optional[float]
|
| 107 |
+
The adjusted close price. (provider: fmp)
|
| 108 |
+
change : Optional[float]
|
| 109 |
+
Change in the price from the previous close. (provider: fmp)
|
| 110 |
+
change_percent : Optional[float]
|
| 111 |
+
Change in the price from the previous close, as a normalized percent. (provider: fmp)
|
| 112 |
+
transactions : Optional[Annotated[int, Gt(gt=0)]]
|
| 113 |
+
Number of transactions for the symbol in the time period. (provider: polygon)
|
| 114 |
+
|
| 115 |
+
Examples
|
| 116 |
+
--------
|
| 117 |
+
>>> from openbb import obb
|
| 118 |
+
>>> obb.currency.price.historical(symbol='EURUSD', provider='fmp')
|
| 119 |
+
>>> # Filter historical data with specific start and end date.
|
| 120 |
+
>>> obb.currency.price.historical(symbol='EURUSD', start_date='2023-01-01', end_date='2023-12-31', provider='fmp')
|
| 121 |
+
>>> # Get data with different granularity.
|
| 122 |
+
>>> obb.currency.price.historical(symbol='EURUSD', provider='polygon', interval='15m')
|
| 123 |
+
""" # noqa: E501
|
| 124 |
+
|
| 125 |
+
return self._run(
|
| 126 |
+
"/currency/price/historical",
|
| 127 |
+
**filter_inputs(
|
| 128 |
+
provider_choices={
|
| 129 |
+
"provider": self._get_provider(
|
| 130 |
+
provider,
|
| 131 |
+
"currency.price.historical",
|
| 132 |
+
("fmp", "polygon", "tiingo", "yfinance"),
|
| 133 |
+
)
|
| 134 |
+
},
|
| 135 |
+
standard_params={
|
| 136 |
+
"symbol": symbol,
|
| 137 |
+
"start_date": start_date,
|
| 138 |
+
"end_date": end_date,
|
| 139 |
+
},
|
| 140 |
+
extra_params=kwargs,
|
| 141 |
+
info={
|
| 142 |
+
"symbol": {
|
| 143 |
+
"fmp": {"multiple_items_allowed": True, "choices": None},
|
| 144 |
+
"polygon": {"multiple_items_allowed": True, "choices": None},
|
| 145 |
+
"tiingo": {"multiple_items_allowed": True, "choices": None},
|
| 146 |
+
"yfinance": {"multiple_items_allowed": True, "choices": None},
|
| 147 |
+
},
|
| 148 |
+
"interval": {
|
| 149 |
+
"fmp": {
|
| 150 |
+
"multiple_items_allowed": False,
|
| 151 |
+
"choices": ["1m", "5m", "15m", "30m", "1h", "4h", "1d"],
|
| 152 |
+
},
|
| 153 |
+
"tiingo": {
|
| 154 |
+
"multiple_items_allowed": False,
|
| 155 |
+
"choices": [
|
| 156 |
+
"1m",
|
| 157 |
+
"5m",
|
| 158 |
+
"15m",
|
| 159 |
+
"30m",
|
| 160 |
+
"90m",
|
| 161 |
+
"1h",
|
| 162 |
+
"2h",
|
| 163 |
+
"4h",
|
| 164 |
+
"1d",
|
| 165 |
+
"5d",
|
| 166 |
+
"21d",
|
| 167 |
+
],
|
| 168 |
+
},
|
| 169 |
+
"yfinance": {
|
| 170 |
+
"multiple_items_allowed": False,
|
| 171 |
+
"choices": [
|
| 172 |
+
"1m",
|
| 173 |
+
"2m",
|
| 174 |
+
"5m",
|
| 175 |
+
"15m",
|
| 176 |
+
"30m",
|
| 177 |
+
"60m",
|
| 178 |
+
"90m",
|
| 179 |
+
"1h",
|
| 180 |
+
"1d",
|
| 181 |
+
"5d",
|
| 182 |
+
"1W",
|
| 183 |
+
"1M",
|
| 184 |
+
"1Q",
|
| 185 |
+
],
|
| 186 |
+
},
|
| 187 |
+
},
|
| 188 |
+
},
|
| 189 |
+
)
|
| 190 |
+
)
|
openbb_platform/openbb/package/derivatives.py
ADDED
|
@@ -0,0 +1,32 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
### THIS FILE IS AUTO-GENERATED. DO NOT EDIT. ###
|
| 2 |
+
|
| 3 |
+
|
| 4 |
+
from openbb_core.app.static.container import Container
|
| 5 |
+
|
| 6 |
+
|
| 7 |
+
class ROUTER_derivatives(Container):
|
| 8 |
+
"""/derivatives
|
| 9 |
+
/futures
|
| 10 |
+
/options
|
| 11 |
+
"""
|
| 12 |
+
|
| 13 |
+
def __repr__(self) -> str:
|
| 14 |
+
return self.__doc__ or ""
|
| 15 |
+
|
| 16 |
+
@property
|
| 17 |
+
def futures(self):
|
| 18 |
+
# pylint: disable=import-outside-toplevel
|
| 19 |
+
from . import derivatives_futures
|
| 20 |
+
|
| 21 |
+
return derivatives_futures.ROUTER_derivatives_futures(
|
| 22 |
+
command_runner=self._command_runner
|
| 23 |
+
)
|
| 24 |
+
|
| 25 |
+
@property
|
| 26 |
+
def options(self):
|
| 27 |
+
# pylint: disable=import-outside-toplevel
|
| 28 |
+
from . import derivatives_options
|
| 29 |
+
|
| 30 |
+
return derivatives_options.ROUTER_derivatives_options(
|
| 31 |
+
command_runner=self._command_runner
|
| 32 |
+
)
|
openbb_platform/openbb/package/derivatives_futures.py
ADDED
|
@@ -0,0 +1,214 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
### THIS FILE IS AUTO-GENERATED. DO NOT EDIT. ###
|
| 2 |
+
|
| 3 |
+
import datetime
|
| 4 |
+
from typing import Literal, Optional, Union
|
| 5 |
+
|
| 6 |
+
from openbb_core.app.model.field import OpenBBField
|
| 7 |
+
from openbb_core.app.model.obbject import OBBject
|
| 8 |
+
from openbb_core.app.static.container import Container
|
| 9 |
+
from openbb_core.app.static.utils.decorators import exception_handler, validate
|
| 10 |
+
from openbb_core.app.static.utils.filters import filter_inputs
|
| 11 |
+
from typing_extensions import Annotated
|
| 12 |
+
|
| 13 |
+
|
| 14 |
+
class ROUTER_derivatives_futures(Container):
|
| 15 |
+
"""/derivatives/futures
|
| 16 |
+
curve
|
| 17 |
+
historical
|
| 18 |
+
"""
|
| 19 |
+
|
| 20 |
+
def __repr__(self) -> str:
|
| 21 |
+
return self.__doc__ or ""
|
| 22 |
+
|
| 23 |
+
@exception_handler
|
| 24 |
+
@validate
|
| 25 |
+
def curve(
|
| 26 |
+
self,
|
| 27 |
+
symbol: Annotated[str, OpenBBField(description="Symbol to get data for.")],
|
| 28 |
+
date: Annotated[
|
| 29 |
+
Union[datetime.date, str, None, list[Union[datetime.date, str, None]]],
|
| 30 |
+
OpenBBField(
|
| 31 |
+
description="A specific date to get data for. Multiple comma separated items allowed for provider(s): yfinance."
|
| 32 |
+
),
|
| 33 |
+
] = None,
|
| 34 |
+
provider: Annotated[
|
| 35 |
+
Optional[Literal["yfinance"]],
|
| 36 |
+
OpenBBField(
|
| 37 |
+
description="The provider to use, by default None. If None, the priority list configured in the settings is used. Default priority: yfinance."
|
| 38 |
+
),
|
| 39 |
+
] = None,
|
| 40 |
+
**kwargs
|
| 41 |
+
) -> OBBject:
|
| 42 |
+
"""Futures Term Structure, current or historical.
|
| 43 |
+
|
| 44 |
+
Parameters
|
| 45 |
+
----------
|
| 46 |
+
provider : str
|
| 47 |
+
The provider to use, by default None. If None, the priority list configured in the settings is used. Default priority: yfinance.
|
| 48 |
+
symbol : str
|
| 49 |
+
Symbol to get data for.
|
| 50 |
+
date : Union[date, str, None, list[Union[date, str, None]]]
|
| 51 |
+
A specific date to get data for. Multiple comma separated items allowed for provider(s): yfinance.
|
| 52 |
+
|
| 53 |
+
Returns
|
| 54 |
+
-------
|
| 55 |
+
OBBject
|
| 56 |
+
results : list[FuturesCurve]
|
| 57 |
+
Serializable results.
|
| 58 |
+
provider : Optional[str]
|
| 59 |
+
Provider name.
|
| 60 |
+
warnings : Optional[list[Warning_]]
|
| 61 |
+
list of warnings.
|
| 62 |
+
chart : Optional[Chart]
|
| 63 |
+
Chart object.
|
| 64 |
+
extra : Dict[str, Any]
|
| 65 |
+
Extra info.
|
| 66 |
+
|
| 67 |
+
FuturesCurve
|
| 68 |
+
------------
|
| 69 |
+
date : Optional[date]
|
| 70 |
+
The date of the data.
|
| 71 |
+
expiration : str
|
| 72 |
+
Futures expiration month.
|
| 73 |
+
price : Optional[float]
|
| 74 |
+
The price of the futures contract.
|
| 75 |
+
|
| 76 |
+
Examples
|
| 77 |
+
--------
|
| 78 |
+
>>> from openbb import obb
|
| 79 |
+
>>> obb.derivatives.futures.curve(symbol='NG', provider='yfinance')
|
| 80 |
+
""" # noqa: E501
|
| 81 |
+
|
| 82 |
+
return self._run(
|
| 83 |
+
"/derivatives/futures/curve",
|
| 84 |
+
**filter_inputs(
|
| 85 |
+
provider_choices={
|
| 86 |
+
"provider": self._get_provider(
|
| 87 |
+
provider,
|
| 88 |
+
"derivatives.futures.curve",
|
| 89 |
+
("yfinance",),
|
| 90 |
+
)
|
| 91 |
+
},
|
| 92 |
+
standard_params={
|
| 93 |
+
"symbol": symbol,
|
| 94 |
+
"date": date,
|
| 95 |
+
},
|
| 96 |
+
extra_params=kwargs,
|
| 97 |
+
info={
|
| 98 |
+
"date": {
|
| 99 |
+
"yfinance": {"multiple_items_allowed": True, "choices": None}
|
| 100 |
+
}
|
| 101 |
+
},
|
| 102 |
+
)
|
| 103 |
+
)
|
| 104 |
+
|
| 105 |
+
@exception_handler
|
| 106 |
+
@validate
|
| 107 |
+
def historical(
|
| 108 |
+
self,
|
| 109 |
+
symbol: Annotated[
|
| 110 |
+
Union[str, list[str]],
|
| 111 |
+
OpenBBField(
|
| 112 |
+
description="Symbol to get data for. Multiple comma separated items allowed for provider(s): yfinance."
|
| 113 |
+
),
|
| 114 |
+
],
|
| 115 |
+
start_date: Annotated[
|
| 116 |
+
Union[datetime.date, None, str],
|
| 117 |
+
OpenBBField(description="Start date of the data, in YYYY-MM-DD format."),
|
| 118 |
+
] = None,
|
| 119 |
+
end_date: Annotated[
|
| 120 |
+
Union[datetime.date, None, str],
|
| 121 |
+
OpenBBField(description="End date of the data, in YYYY-MM-DD format."),
|
| 122 |
+
] = None,
|
| 123 |
+
expiration: Annotated[
|
| 124 |
+
Optional[str],
|
| 125 |
+
OpenBBField(description="Future expiry date with format YYYY-MM"),
|
| 126 |
+
] = None,
|
| 127 |
+
provider: Annotated[
|
| 128 |
+
Optional[Literal["yfinance"]],
|
| 129 |
+
OpenBBField(
|
| 130 |
+
description="The provider to use, by default None. If None, the priority list configured in the settings is used. Default priority: yfinance."
|
| 131 |
+
),
|
| 132 |
+
] = None,
|
| 133 |
+
**kwargs
|
| 134 |
+
) -> OBBject:
|
| 135 |
+
"""Historical futures prices.
|
| 136 |
+
|
| 137 |
+
Parameters
|
| 138 |
+
----------
|
| 139 |
+
provider : str
|
| 140 |
+
The provider to use, by default None. If None, the priority list configured in the settings is used. Default priority: yfinance.
|
| 141 |
+
symbol : Union[str, list[str]]
|
| 142 |
+
Symbol to get data for. Multiple comma separated items allowed for provider(s): yfinance.
|
| 143 |
+
start_date : Union[date, None, str]
|
| 144 |
+
Start date of the data, in YYYY-MM-DD format.
|
| 145 |
+
end_date : Union[date, None, str]
|
| 146 |
+
End date of the data, in YYYY-MM-DD format.
|
| 147 |
+
expiration : Optional[str]
|
| 148 |
+
Future expiry date with format YYYY-MM
|
| 149 |
+
interval : Literal['1m', '2m', '5m', '15m', '30m', '60m', '90m', '1h', '1d', '5d', '1W', '1M', '1Q']
|
| 150 |
+
Time interval of the data to return. (provider: yfinance)
|
| 151 |
+
|
| 152 |
+
Returns
|
| 153 |
+
-------
|
| 154 |
+
OBBject
|
| 155 |
+
results : list[FuturesHistorical]
|
| 156 |
+
Serializable results.
|
| 157 |
+
provider : Optional[str]
|
| 158 |
+
Provider name.
|
| 159 |
+
warnings : Optional[list[Warning_]]
|
| 160 |
+
list of warnings.
|
| 161 |
+
chart : Optional[Chart]
|
| 162 |
+
Chart object.
|
| 163 |
+
extra : Dict[str, Any]
|
| 164 |
+
Extra info.
|
| 165 |
+
|
| 166 |
+
FuturesHistorical
|
| 167 |
+
-----------------
|
| 168 |
+
date : datetime
|
| 169 |
+
The date of the data.
|
| 170 |
+
open : float
|
| 171 |
+
The open price.
|
| 172 |
+
high : float
|
| 173 |
+
The high price.
|
| 174 |
+
low : float
|
| 175 |
+
The low price.
|
| 176 |
+
close : float
|
| 177 |
+
The close price.
|
| 178 |
+
volume : float
|
| 179 |
+
The trading volume.
|
| 180 |
+
|
| 181 |
+
Examples
|
| 182 |
+
--------
|
| 183 |
+
>>> from openbb import obb
|
| 184 |
+
>>> obb.derivatives.futures.historical(symbol='ES', provider='yfinance')
|
| 185 |
+
>>> # Enter multiple symbols.
|
| 186 |
+
>>> obb.derivatives.futures.historical(symbol='ES,NQ', provider='yfinance')
|
| 187 |
+
>>> # Enter expiration dates as "YYYY-MM".
|
| 188 |
+
>>> obb.derivatives.futures.historical(symbol='ES', provider='yfinance', expiration='2025-12')
|
| 189 |
+
""" # noqa: E501
|
| 190 |
+
|
| 191 |
+
return self._run(
|
| 192 |
+
"/derivatives/futures/historical",
|
| 193 |
+
**filter_inputs(
|
| 194 |
+
provider_choices={
|
| 195 |
+
"provider": self._get_provider(
|
| 196 |
+
provider,
|
| 197 |
+
"derivatives.futures.historical",
|
| 198 |
+
("yfinance",),
|
| 199 |
+
)
|
| 200 |
+
},
|
| 201 |
+
standard_params={
|
| 202 |
+
"symbol": symbol,
|
| 203 |
+
"start_date": start_date,
|
| 204 |
+
"end_date": end_date,
|
| 205 |
+
"expiration": expiration,
|
| 206 |
+
},
|
| 207 |
+
extra_params=kwargs,
|
| 208 |
+
info={
|
| 209 |
+
"symbol": {
|
| 210 |
+
"yfinance": {"multiple_items_allowed": True, "choices": None}
|
| 211 |
+
}
|
| 212 |
+
},
|
| 213 |
+
)
|
| 214 |
+
)
|
openbb_platform/openbb/package/derivatives_options.py
ADDED
|
@@ -0,0 +1,465 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|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
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
### THIS FILE IS AUTO-GENERATED. DO NOT EDIT. ###
|
| 2 |
+
|
| 3 |
+
from typing import Literal, Optional
|
| 4 |
+
|
| 5 |
+
from openbb_core.app.model.field import OpenBBField
|
| 6 |
+
from openbb_core.app.model.obbject import OBBject
|
| 7 |
+
from openbb_core.app.static.container import Container
|
| 8 |
+
from openbb_core.app.static.utils.decorators import exception_handler, validate
|
| 9 |
+
from openbb_core.app.static.utils.filters import filter_inputs
|
| 10 |
+
from typing_extensions import Annotated
|
| 11 |
+
|
| 12 |
+
|
| 13 |
+
class ROUTER_derivatives_options(Container):
|
| 14 |
+
"""/derivatives/options
|
| 15 |
+
chains
|
| 16 |
+
snapshots
|
| 17 |
+
unusual
|
| 18 |
+
"""
|
| 19 |
+
|
| 20 |
+
def __repr__(self) -> str:
|
| 21 |
+
return self.__doc__ or ""
|
| 22 |
+
|
| 23 |
+
@exception_handler
|
| 24 |
+
@validate
|
| 25 |
+
def chains(
|
| 26 |
+
self,
|
| 27 |
+
symbol: Annotated[str, OpenBBField(description="Symbol to get data for.")],
|
| 28 |
+
provider: Annotated[
|
| 29 |
+
Optional[Literal["intrinio", "yfinance"]],
|
| 30 |
+
OpenBBField(
|
| 31 |
+
description="The provider to use, by default None. If None, the priority list configured in the settings is used. Default priority: intrinio, yfinance."
|
| 32 |
+
),
|
| 33 |
+
] = None,
|
| 34 |
+
**kwargs
|
| 35 |
+
) -> OBBject:
|
| 36 |
+
"""Get the complete options chain for a ticker.
|
| 37 |
+
|
| 38 |
+
Parameters
|
| 39 |
+
----------
|
| 40 |
+
provider : str
|
| 41 |
+
The provider to use, by default None. If None, the priority list configured in the settings is used. Default priority: intrinio, yfinance.
|
| 42 |
+
symbol : str
|
| 43 |
+
Symbol to get data for.
|
| 44 |
+
delay : Literal['eod', 'realtime', 'delayed']
|
| 45 |
+
Whether to return delayed, realtime, or eod data. (provider: intrinio)
|
| 46 |
+
date : Optional[date]
|
| 47 |
+
The end-of-day date for options chains data. (provider: intrinio)
|
| 48 |
+
option_type : Optional[Literal['call', 'put']]
|
| 49 |
+
The option type, call or put, 'None' is both (default). (provider: intrinio)
|
| 50 |
+
moneyness : Literal['otm', 'itm', 'all']
|
| 51 |
+
Return only contracts that are in or out of the money, default is 'all'. Parameter is ignored when a date is supplied. (provider: intrinio)
|
| 52 |
+
strike_gt : Optional[int]
|
| 53 |
+
Return options with a strike price greater than the given value. Parameter is ignored when a date is supplied. (provider: intrinio)
|
| 54 |
+
strike_lt : Optional[int]
|
| 55 |
+
Return options with a strike price less than the given value. Parameter is ignored when a date is supplied. (provider: intrinio)
|
| 56 |
+
volume_gt : Optional[int]
|
| 57 |
+
Return options with a volume greater than the given value. Parameter is ignored when a date is supplied. (provider: intrinio)
|
| 58 |
+
volume_lt : Optional[int]
|
| 59 |
+
Return options with a volume less than the given value. Parameter is ignored when a date is supplied. (provider: intrinio)
|
| 60 |
+
oi_gt : Optional[int]
|
| 61 |
+
Return options with an open interest greater than the given value. Parameter is ignored when a date is supplied. (provider: intrinio)
|
| 62 |
+
oi_lt : Optional[int]
|
| 63 |
+
Return options with an open interest less than the given value. Parameter is ignored when a date is supplied. (provider: intrinio)
|
| 64 |
+
model : Literal['black_scholes', 'bjerk']
|
| 65 |
+
The pricing model to use for options chains data, default is 'black_scholes'. Parameter is ignored when a date is supplied. (provider: intrinio)
|
| 66 |
+
show_extended_price : bool
|
| 67 |
+
Whether to include OHLC type fields, default is True. Parameter is ignored when a date is supplied. (provider: intrinio)
|
| 68 |
+
include_related_symbols : bool
|
| 69 |
+
Include related symbols that end in a 1 or 2 because of a corporate action, default is False. (provider: intrinio)
|
| 70 |
+
|
| 71 |
+
Returns
|
| 72 |
+
-------
|
| 73 |
+
OBBject
|
| 74 |
+
results : OptionsChains
|
| 75 |
+
Serializable results.
|
| 76 |
+
provider : Optional[str]
|
| 77 |
+
Provider name.
|
| 78 |
+
warnings : Optional[list[Warning_]]
|
| 79 |
+
list of warnings.
|
| 80 |
+
chart : Optional[Chart]
|
| 81 |
+
Chart object.
|
| 82 |
+
extra : Dict[str, Any]
|
| 83 |
+
Extra info.
|
| 84 |
+
|
| 85 |
+
OptionsChains
|
| 86 |
+
-------------
|
| 87 |
+
underlying_symbol : list[Optional[str]]
|
| 88 |
+
Underlying symbol for the option.
|
| 89 |
+
underlying_price : list[Optional[float]]
|
| 90 |
+
Price of the underlying stock.
|
| 91 |
+
contract_symbol : list[str]
|
| 92 |
+
Contract symbol for the option.
|
| 93 |
+
eod_date : list[Optional[date]]
|
| 94 |
+
Date for which the options chains are returned.
|
| 95 |
+
expiration : list[date]
|
| 96 |
+
Expiration date of the contract.
|
| 97 |
+
dte : list[Optional[int]]
|
| 98 |
+
Days to expiration of the contract.
|
| 99 |
+
strike : list[float]
|
| 100 |
+
Strike price of the contract.
|
| 101 |
+
option_type : list[str]
|
| 102 |
+
Call or Put.
|
| 103 |
+
contract_size : list[Union[int, float]]
|
| 104 |
+
Number of underlying units per contract.
|
| 105 |
+
open_interest : list[Union[int, float]]
|
| 106 |
+
Open interest on the contract.
|
| 107 |
+
volume : list[Union[int, float]]
|
| 108 |
+
The trading volume.
|
| 109 |
+
theoretical_price : list[Optional[float]]
|
| 110 |
+
Theoretical value of the option.
|
| 111 |
+
last_trade_price : list[Optional[float]]
|
| 112 |
+
Last trade price of the option.
|
| 113 |
+
last_trade_size : list[Union[int, float]]
|
| 114 |
+
Last trade size of the option.
|
| 115 |
+
last_trade_time : list[Optional[datetime]]
|
| 116 |
+
The timestamp of the last trade.
|
| 117 |
+
tick : list[Optional[str]]
|
| 118 |
+
Whether the last tick was up or down in price.
|
| 119 |
+
bid : list[Optional[float]]
|
| 120 |
+
Current bid price for the option.
|
| 121 |
+
bid_size : list[Union[int, float]]
|
| 122 |
+
Bid size for the option.
|
| 123 |
+
bid_time : list[Optional[datetime]]
|
| 124 |
+
The timestamp of the bid price.
|
| 125 |
+
bid_exchange : list[Optional[str]]
|
| 126 |
+
The exchange of the bid price.
|
| 127 |
+
ask : list[Optional[float]]
|
| 128 |
+
Current ask price for the option.
|
| 129 |
+
ask_size : list[Union[int, float]]
|
| 130 |
+
Ask size for the option.
|
| 131 |
+
ask_time : list[Optional[datetime]]
|
| 132 |
+
The timestamp of the ask price.
|
| 133 |
+
ask_exchange : list[Optional[str]]
|
| 134 |
+
The exchange of the ask price.
|
| 135 |
+
mark : list[Optional[float]]
|
| 136 |
+
The mid-price between the latest bid and ask.
|
| 137 |
+
open : list[Optional[float]]
|
| 138 |
+
The open price.
|
| 139 |
+
open_bid : list[Optional[float]]
|
| 140 |
+
The opening bid price for the option that day.
|
| 141 |
+
open_ask : list[Optional[float]]
|
| 142 |
+
The opening ask price for the option that day.
|
| 143 |
+
high : list[Optional[float]]
|
| 144 |
+
The high price.
|
| 145 |
+
bid_high : list[Optional[float]]
|
| 146 |
+
The highest bid price for the option that day.
|
| 147 |
+
ask_high : list[Optional[float]]
|
| 148 |
+
The highest ask price for the option that day.
|
| 149 |
+
low : list[Optional[float]]
|
| 150 |
+
The low price.
|
| 151 |
+
bid_low : list[Optional[float]]
|
| 152 |
+
The lowest bid price for the option that day.
|
| 153 |
+
ask_low : list[Optional[float]]
|
| 154 |
+
The lowest ask price for the option that day.
|
| 155 |
+
close : list[Optional[float]]
|
| 156 |
+
The close price.
|
| 157 |
+
close_size : list[Union[int, float]]
|
| 158 |
+
The closing trade size for the option that day.
|
| 159 |
+
close_time : list[Optional[datetime]]
|
| 160 |
+
The time of the closing price for the option that day.
|
| 161 |
+
close_bid : list[Optional[float]]
|
| 162 |
+
The closing bid price for the option that day.
|
| 163 |
+
close_bid_size : list[Union[int, float]]
|
| 164 |
+
The closing bid size for the option that day.
|
| 165 |
+
close_bid_time : list[Optional[datetime]]
|
| 166 |
+
The time of the bid closing price for the option that day.
|
| 167 |
+
close_ask : list[Optional[float]]
|
| 168 |
+
The closing ask price for the option that day.
|
| 169 |
+
close_ask_size : list[Union[int, float]]
|
| 170 |
+
The closing ask size for the option that day.
|
| 171 |
+
close_ask_time : list[Optional[datetime]]
|
| 172 |
+
The time of the ask closing price for the option that day.
|
| 173 |
+
prev_close : list[Optional[float]]
|
| 174 |
+
The previous close price.
|
| 175 |
+
change : list[Optional[float]]
|
| 176 |
+
The change in the price of the option.
|
| 177 |
+
change_percent : list[Optional[float]]
|
| 178 |
+
Change, in normalized percentage points, of the option.
|
| 179 |
+
implied_volatility : list[Optional[float]]
|
| 180 |
+
Implied volatility of the option.
|
| 181 |
+
delta : list[Optional[float]]
|
| 182 |
+
Delta of the option.
|
| 183 |
+
gamma : list[Optional[float]]
|
| 184 |
+
Gamma of the option.
|
| 185 |
+
theta : list[Optional[float]]
|
| 186 |
+
Theta of the option.
|
| 187 |
+
vega : list[Optional[float]]
|
| 188 |
+
Vega of the option.
|
| 189 |
+
rho : list[Optional[float]]
|
| 190 |
+
Rho of the option.
|
| 191 |
+
in_the_money : list[Optional[bool]]
|
| 192 |
+
Whether the option is in the money. (provider: yfinance)
|
| 193 |
+
currency : list[Optional[str]]
|
| 194 |
+
Currency of the option. (provider: yfinance)
|
| 195 |
+
|
| 196 |
+
Examples
|
| 197 |
+
--------
|
| 198 |
+
>>> from openbb import obb
|
| 199 |
+
>>> obb.derivatives.options.chains(symbol='AAPL', provider='intrinio')
|
| 200 |
+
>>> # Use the "date" parameter to get the end-of-day-data for a specific date, where supported.
|
| 201 |
+
>>> obb.derivatives.options.chains(symbol='AAPL', date='2023-01-25', provider='intrinio')
|
| 202 |
+
""" # noqa: E501
|
| 203 |
+
|
| 204 |
+
return self._run(
|
| 205 |
+
"/derivatives/options/chains",
|
| 206 |
+
**filter_inputs(
|
| 207 |
+
provider_choices={
|
| 208 |
+
"provider": self._get_provider(
|
| 209 |
+
provider,
|
| 210 |
+
"derivatives.options.chains",
|
| 211 |
+
("intrinio", "yfinance"),
|
| 212 |
+
)
|
| 213 |
+
},
|
| 214 |
+
standard_params={
|
| 215 |
+
"symbol": symbol,
|
| 216 |
+
},
|
| 217 |
+
extra_params=kwargs,
|
| 218 |
+
info={
|
| 219 |
+
"delay": {
|
| 220 |
+
"intrinio": {
|
| 221 |
+
"multiple_items_allowed": False,
|
| 222 |
+
"choices": ["eod", "realtime", "delayed"],
|
| 223 |
+
}
|
| 224 |
+
},
|
| 225 |
+
"option_type": {
|
| 226 |
+
"intrinio": {
|
| 227 |
+
"multiple_items_allowed": False,
|
| 228 |
+
"choices": ["call", "put"],
|
| 229 |
+
}
|
| 230 |
+
},
|
| 231 |
+
"moneyness": {
|
| 232 |
+
"intrinio": {
|
| 233 |
+
"multiple_items_allowed": False,
|
| 234 |
+
"choices": ["otm", "itm", "all"],
|
| 235 |
+
}
|
| 236 |
+
},
|
| 237 |
+
"model": {
|
| 238 |
+
"intrinio": {
|
| 239 |
+
"multiple_items_allowed": False,
|
| 240 |
+
"choices": ["black_scholes", "bjerk"],
|
| 241 |
+
}
|
| 242 |
+
},
|
| 243 |
+
},
|
| 244 |
+
)
|
| 245 |
+
)
|
| 246 |
+
|
| 247 |
+
@exception_handler
|
| 248 |
+
@validate
|
| 249 |
+
def snapshots(
|
| 250 |
+
self,
|
| 251 |
+
provider: Annotated[
|
| 252 |
+
Optional[Literal["intrinio"]],
|
| 253 |
+
OpenBBField(
|
| 254 |
+
description="The provider to use, by default None. If None, the priority list configured in the settings is used. Default priority: intrinio."
|
| 255 |
+
),
|
| 256 |
+
] = None,
|
| 257 |
+
**kwargs
|
| 258 |
+
) -> OBBject:
|
| 259 |
+
"""Get a snapshot of the options market universe.
|
| 260 |
+
|
| 261 |
+
Parameters
|
| 262 |
+
----------
|
| 263 |
+
provider : str
|
| 264 |
+
The provider to use, by default None. If None, the priority list configured in the settings is used. Default priority: intrinio.
|
| 265 |
+
date : Union[date, datetime, str, None]
|
| 266 |
+
The date of the data. Can be a datetime or an ISO datetime string. Data appears to go back to around 2022-06-01 Example: '2024-03-08T12:15:00+0400' (provider: intrinio)
|
| 267 |
+
only_traded : bool
|
| 268 |
+
Only include options that have been traded during the session, default is True. Setting to false will dramatically increase the size of the response - use with caution. (provider: intrinio)
|
| 269 |
+
|
| 270 |
+
Returns
|
| 271 |
+
-------
|
| 272 |
+
OBBject
|
| 273 |
+
results : list[OptionsSnapshots]
|
| 274 |
+
Serializable results.
|
| 275 |
+
provider : Optional[str]
|
| 276 |
+
Provider name.
|
| 277 |
+
warnings : Optional[list[Warning_]]
|
| 278 |
+
list of warnings.
|
| 279 |
+
chart : Optional[Chart]
|
| 280 |
+
Chart object.
|
| 281 |
+
extra : Dict[str, Any]
|
| 282 |
+
Extra info.
|
| 283 |
+
|
| 284 |
+
OptionsSnapshots
|
| 285 |
+
----------------
|
| 286 |
+
underlying_symbol : list[str]
|
| 287 |
+
Ticker symbol of the underlying asset.
|
| 288 |
+
contract_symbol : list[str]
|
| 289 |
+
Symbol of the options contract.
|
| 290 |
+
expiration : list[date]
|
| 291 |
+
Expiration date of the options contract.
|
| 292 |
+
dte : list[Optional[int]]
|
| 293 |
+
Number of days to expiration of the options contract.
|
| 294 |
+
strike : list[float]
|
| 295 |
+
Strike price of the options contract.
|
| 296 |
+
option_type : list[str]
|
| 297 |
+
The type of option.
|
| 298 |
+
volume : list[Optional[int]]
|
| 299 |
+
The trading volume.
|
| 300 |
+
open_interest : list[Optional[int]]
|
| 301 |
+
Open interest at the time.
|
| 302 |
+
last_price : list[Optional[float]]
|
| 303 |
+
Last trade price at the time.
|
| 304 |
+
last_size : list[Optional[int]]
|
| 305 |
+
Lot size of the last trade.
|
| 306 |
+
last_timestamp : list[Optional[datetime]]
|
| 307 |
+
Timestamp of the last price.
|
| 308 |
+
open : list[Optional[float]]
|
| 309 |
+
The open price.
|
| 310 |
+
high : list[Optional[float]]
|
| 311 |
+
The high price.
|
| 312 |
+
low : list[Optional[float]]
|
| 313 |
+
The low price.
|
| 314 |
+
close : list[Optional[float]]
|
| 315 |
+
The close price.
|
| 316 |
+
bid : list[Optional[float]]
|
| 317 |
+
The last bid price at the time. (provider: intrinio)
|
| 318 |
+
bid_size : list[Optional[int]]
|
| 319 |
+
The size of the last bid price. (provider: intrinio)
|
| 320 |
+
bid_timestamp : list[Optional[datetime]]
|
| 321 |
+
The timestamp of the last bid price. (provider: intrinio)
|
| 322 |
+
ask : list[Optional[float]]
|
| 323 |
+
The last ask price at the time. (provider: intrinio)
|
| 324 |
+
ask_size : list[Optional[int]]
|
| 325 |
+
The size of the last ask price. (provider: intrinio)
|
| 326 |
+
ask_timestamp : list[Optional[datetime]]
|
| 327 |
+
The timestamp of the last ask price. (provider: intrinio)
|
| 328 |
+
total_bid_volume : list[Optional[int]]
|
| 329 |
+
Total volume of bids. (provider: intrinio)
|
| 330 |
+
bid_high : list[Optional[float]]
|
| 331 |
+
The highest bid price. (provider: intrinio)
|
| 332 |
+
bid_low : list[Optional[float]]
|
| 333 |
+
The lowest bid price. (provider: intrinio)
|
| 334 |
+
total_ask_volume : list[Optional[int]]
|
| 335 |
+
Total volume of asks. (provider: intrinio)
|
| 336 |
+
ask_high : list[Optional[float]]
|
| 337 |
+
The highest ask price. (provider: intrinio)
|
| 338 |
+
ask_low : list[Optional[float]]
|
| 339 |
+
The lowest ask price. (provider: intrinio)
|
| 340 |
+
|
| 341 |
+
Examples
|
| 342 |
+
--------
|
| 343 |
+
>>> from openbb import obb
|
| 344 |
+
>>> obb.derivatives.options.snapshots(provider='intrinio')
|
| 345 |
+
""" # noqa: E501
|
| 346 |
+
|
| 347 |
+
return self._run(
|
| 348 |
+
"/derivatives/options/snapshots",
|
| 349 |
+
**filter_inputs(
|
| 350 |
+
provider_choices={
|
| 351 |
+
"provider": self._get_provider(
|
| 352 |
+
provider,
|
| 353 |
+
"derivatives.options.snapshots",
|
| 354 |
+
("intrinio",),
|
| 355 |
+
)
|
| 356 |
+
},
|
| 357 |
+
standard_params={},
|
| 358 |
+
extra_params=kwargs,
|
| 359 |
+
)
|
| 360 |
+
)
|
| 361 |
+
|
| 362 |
+
@exception_handler
|
| 363 |
+
@validate
|
| 364 |
+
def unusual(
|
| 365 |
+
self,
|
| 366 |
+
symbol: Annotated[
|
| 367 |
+
Optional[str],
|
| 368 |
+
OpenBBField(description="Symbol to get data for. (the underlying symbol)"),
|
| 369 |
+
] = None,
|
| 370 |
+
provider: Annotated[
|
| 371 |
+
Optional[Literal["intrinio"]],
|
| 372 |
+
OpenBBField(
|
| 373 |
+
description="The provider to use, by default None. If None, the priority list configured in the settings is used. Default priority: intrinio."
|
| 374 |
+
),
|
| 375 |
+
] = None,
|
| 376 |
+
**kwargs
|
| 377 |
+
) -> OBBject:
|
| 378 |
+
"""Get the complete options chain for a ticker.
|
| 379 |
+
|
| 380 |
+
Parameters
|
| 381 |
+
----------
|
| 382 |
+
provider : str
|
| 383 |
+
The provider to use, by default None. If None, the priority list configured in the settings is used. Default priority: intrinio.
|
| 384 |
+
symbol : Optional[str]
|
| 385 |
+
Symbol to get data for. (the underlying symbol)
|
| 386 |
+
start_date : Optional[date]
|
| 387 |
+
Start date of the data, in YYYY-MM-DD format. If no symbol is supplied, requests are only allowed for a single date. Use the start_date for the target date. Intrinio appears to have data beginning Feb/2022, but is unclear when it actually began. (provider: intrinio)
|
| 388 |
+
end_date : Optional[date]
|
| 389 |
+
End date of the data, in YYYY-MM-DD format. If a symbol is not supplied, do not include an end date. (provider: intrinio)
|
| 390 |
+
trade_type : Optional[Literal['block', 'sweep', 'large']]
|
| 391 |
+
The type of unusual activity to query for. (provider: intrinio)
|
| 392 |
+
sentiment : Optional[Literal['bullish', 'bearish', 'neutral']]
|
| 393 |
+
The sentiment type to query for. (provider: intrinio)
|
| 394 |
+
min_value : Union[int, float, None]
|
| 395 |
+
The inclusive minimum total value for the unusual activity. (provider: intrinio)
|
| 396 |
+
max_value : Union[int, float, None]
|
| 397 |
+
The inclusive maximum total value for the unusual activity. (provider: intrinio)
|
| 398 |
+
limit : int
|
| 399 |
+
The number of data entries to return. A typical day for all symbols will yield 50-80K records. The API will paginate at 1000 records. The high default limit (100K) is to be able to reliably capture the most days. The high absolute limit (1.25M) is to allow for outlier days. Queries at the absolute limit will take a long time, and might be unreliable. Apply filters to improve performance. (provider: intrinio)
|
| 400 |
+
source : Literal['delayed', 'realtime']
|
| 401 |
+
The source of the data. Either realtime or delayed. (provider: intrinio)
|
| 402 |
+
|
| 403 |
+
Returns
|
| 404 |
+
-------
|
| 405 |
+
OBBject
|
| 406 |
+
results : list[OptionsUnusual]
|
| 407 |
+
Serializable results.
|
| 408 |
+
provider : Optional[str]
|
| 409 |
+
Provider name.
|
| 410 |
+
warnings : Optional[list[Warning_]]
|
| 411 |
+
list of warnings.
|
| 412 |
+
chart : Optional[Chart]
|
| 413 |
+
Chart object.
|
| 414 |
+
extra : Dict[str, Any]
|
| 415 |
+
Extra info.
|
| 416 |
+
|
| 417 |
+
OptionsUnusual
|
| 418 |
+
--------------
|
| 419 |
+
underlying_symbol : Optional[str]
|
| 420 |
+
Symbol representing the entity requested in the data. (the underlying symbol)
|
| 421 |
+
contract_symbol : str
|
| 422 |
+
Contract symbol for the option.
|
| 423 |
+
trade_timestamp : Optional[datetime]
|
| 424 |
+
The datetime of order placement. (provider: intrinio)
|
| 425 |
+
trade_type : Optional[Literal['block', 'sweep', 'large']]
|
| 426 |
+
The type of unusual trade. (provider: intrinio)
|
| 427 |
+
sentiment : Optional[Literal['bullish', 'bearish', 'neutral']]
|
| 428 |
+
Bullish, Bearish, or Neutral Sentiment is estimated based on whether the trade was executed at the bid, ask, or mark price. (provider: intrinio)
|
| 429 |
+
bid_at_execution : Optional[float]
|
| 430 |
+
Bid price at execution. (provider: intrinio)
|
| 431 |
+
ask_at_execution : Optional[float]
|
| 432 |
+
Ask price at execution. (provider: intrinio)
|
| 433 |
+
average_price : Optional[float]
|
| 434 |
+
The average premium paid per option contract. (provider: intrinio)
|
| 435 |
+
underlying_price_at_execution : Optional[float]
|
| 436 |
+
Price of the underlying security at execution of trade. (provider: intrinio)
|
| 437 |
+
total_size : Optional[int]
|
| 438 |
+
The total number of contracts involved in a single transaction. (provider: intrinio)
|
| 439 |
+
total_value : Optional[Union[int, float]]
|
| 440 |
+
The aggregated value of all option contract premiums included in the trade. (provider: intrinio)
|
| 441 |
+
|
| 442 |
+
Examples
|
| 443 |
+
--------
|
| 444 |
+
>>> from openbb import obb
|
| 445 |
+
>>> obb.derivatives.options.unusual(symbol='TSLA', provider='intrinio')
|
| 446 |
+
>>> # Use the 'symbol' parameter to get the most recent activity for a specific symbol.
|
| 447 |
+
>>> obb.derivatives.options.unusual(symbol='TSLA', provider='intrinio')
|
| 448 |
+
""" # noqa: E501
|
| 449 |
+
|
| 450 |
+
return self._run(
|
| 451 |
+
"/derivatives/options/unusual",
|
| 452 |
+
**filter_inputs(
|
| 453 |
+
provider_choices={
|
| 454 |
+
"provider": self._get_provider(
|
| 455 |
+
provider,
|
| 456 |
+
"derivatives.options.unusual",
|
| 457 |
+
("intrinio",),
|
| 458 |
+
)
|
| 459 |
+
},
|
| 460 |
+
standard_params={
|
| 461 |
+
"symbol": symbol,
|
| 462 |
+
},
|
| 463 |
+
extra_params=kwargs,
|
| 464 |
+
)
|
| 465 |
+
)
|
openbb_platform/openbb/package/economy.py
ADDED
|
The diff for this file is too large to render.
See raw diff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|
+
from typing import Literal, Optional, Union
|
| 5 |
+
|
| 6 |
+
from openbb_core.app.model.field import OpenBBField
|
| 7 |
+
from openbb_core.app.model.obbject import OBBject
|
| 8 |
+
from openbb_core.app.static.container import Container
|
| 9 |
+
from openbb_core.app.static.utils.decorators import exception_handler, validate
|
| 10 |
+
from openbb_core.app.static.utils.filters import filter_inputs
|
| 11 |
+
from typing_extensions import Annotated
|
| 12 |
+
|
| 13 |
+
|
| 14 |
+
class ROUTER_economy_gdp(Container):
|
| 15 |
+
"""/economy/gdp
|
| 16 |
+
forecast
|
| 17 |
+
nominal
|
| 18 |
+
real
|
| 19 |
+
"""
|
| 20 |
+
|
| 21 |
+
def __repr__(self) -> str:
|
| 22 |
+
return self.__doc__ or ""
|
| 23 |
+
|
| 24 |
+
@exception_handler
|
| 25 |
+
@validate
|
| 26 |
+
def forecast(
|
| 27 |
+
self,
|
| 28 |
+
start_date: Annotated[
|
| 29 |
+
Union[datetime.date, None, str],
|
| 30 |
+
OpenBBField(description="Start date of the data, in YYYY-MM-DD format."),
|
| 31 |
+
] = None,
|
| 32 |
+
end_date: Annotated[
|
| 33 |
+
Union[datetime.date, None, str],
|
| 34 |
+
OpenBBField(description="End date of the data, in YYYY-MM-DD format."),
|
| 35 |
+
] = None,
|
| 36 |
+
provider: Annotated[
|
| 37 |
+
Optional[Literal["oecd"]],
|
| 38 |
+
OpenBBField(
|
| 39 |
+
description="The provider to use, by default None. If None, the priority list configured in the settings is used. Default priority: oecd."
|
| 40 |
+
),
|
| 41 |
+
] = None,
|
| 42 |
+
**kwargs
|
| 43 |
+
) -> OBBject:
|
| 44 |
+
"""Get Forecasted GDP Data.
|
| 45 |
+
|
| 46 |
+
Parameters
|
| 47 |
+
----------
|
| 48 |
+
provider : str
|
| 49 |
+
The provider to use, by default None. If None, the priority list configured in the settings is used. Default priority: oecd.
|
| 50 |
+
start_date : Union[date, None, str]
|
| 51 |
+
Start date of the data, in YYYY-MM-DD format.
|
| 52 |
+
end_date : Union[date, None, str]
|
| 53 |
+
End date of the data, in YYYY-MM-DD format.
|
| 54 |
+
country : str
|
| 55 |
+
Country, or countries, to get forward GDP projections for. Default is all. Multiple comma separated items allowed. (provider: oecd)
|
| 56 |
+
frequency : Literal['annual', 'quarter']
|
| 57 |
+
Frequency of the data, default is annual. (provider: oecd)
|
| 58 |
+
units : Literal['current_prices', 'volume', 'capita', 'growth', 'deflator']
|
| 59 |
+
Units of the data, default is volume (chain linked volume, 2015).
|
| 60 |
+
'current_prices', 'volume', and 'capita' are expressed in USD;
|
| 61 |
+
'deflator' as an index. (provider: oecd)
|
| 62 |
+
|
| 63 |
+
Returns
|
| 64 |
+
-------
|
| 65 |
+
OBBject
|
| 66 |
+
results : list[GdpForecast]
|
| 67 |
+
Serializable results.
|
| 68 |
+
provider : Optional[str]
|
| 69 |
+
Provider name.
|
| 70 |
+
warnings : Optional[list[Warning_]]
|
| 71 |
+
list of warnings.
|
| 72 |
+
chart : Optional[Chart]
|
| 73 |
+
Chart object.
|
| 74 |
+
extra : Dict[str, Any]
|
| 75 |
+
Extra info.
|
| 76 |
+
|
| 77 |
+
GdpForecast
|
| 78 |
+
-----------
|
| 79 |
+
date : date
|
| 80 |
+
The date of the data.
|
| 81 |
+
country : str
|
| 82 |
+
None
|
| 83 |
+
value : Union[int, float]
|
| 84 |
+
Forecasted GDP value for the country and date.
|
| 85 |
+
|
| 86 |
+
Examples
|
| 87 |
+
--------
|
| 88 |
+
>>> from openbb import obb
|
| 89 |
+
>>> obb.economy.gdp.forecast(provider='oecd')
|
| 90 |
+
>>> obb.economy.gdp.forecast(country='united_states,germany,france', frequency='annual', units='capita', provider='oecd')
|
| 91 |
+
""" # noqa: E501
|
| 92 |
+
|
| 93 |
+
return self._run(
|
| 94 |
+
"/economy/gdp/forecast",
|
| 95 |
+
**filter_inputs(
|
| 96 |
+
provider_choices={
|
| 97 |
+
"provider": self._get_provider(
|
| 98 |
+
provider,
|
| 99 |
+
"economy.gdp.forecast",
|
| 100 |
+
("oecd",),
|
| 101 |
+
)
|
| 102 |
+
},
|
| 103 |
+
standard_params={
|
| 104 |
+
"start_date": start_date,
|
| 105 |
+
"end_date": end_date,
|
| 106 |
+
},
|
| 107 |
+
extra_params=kwargs,
|
| 108 |
+
info={
|
| 109 |
+
"country": {
|
| 110 |
+
"oecd": {
|
| 111 |
+
"multiple_items_allowed": True,
|
| 112 |
+
"choices": [
|
| 113 |
+
"argentina",
|
| 114 |
+
"asia",
|
| 115 |
+
"australia",
|
| 116 |
+
"austria",
|
| 117 |
+
"belgium",
|
| 118 |
+
"brazil",
|
| 119 |
+
"bulgaria",
|
| 120 |
+
"canada",
|
| 121 |
+
"chile",
|
| 122 |
+
"china",
|
| 123 |
+
"colombia",
|
| 124 |
+
"costa_rica",
|
| 125 |
+
"croatia",
|
| 126 |
+
"czech_republic",
|
| 127 |
+
"denmark",
|
| 128 |
+
"estonia",
|
| 129 |
+
"finland",
|
| 130 |
+
"france",
|
| 131 |
+
"germany",
|
| 132 |
+
"greece",
|
| 133 |
+
"hungary",
|
| 134 |
+
"iceland",
|
| 135 |
+
"india",
|
| 136 |
+
"indonesia",
|
| 137 |
+
"ireland",
|
| 138 |
+
"israel",
|
| 139 |
+
"italy",
|
| 140 |
+
"japan",
|
| 141 |
+
"korea",
|
| 142 |
+
"latvia",
|
| 143 |
+
"lithuania",
|
| 144 |
+
"luxembourg",
|
| 145 |
+
"mexico",
|
| 146 |
+
"netherlands",
|
| 147 |
+
"new_zealand",
|
| 148 |
+
"norway",
|
| 149 |
+
"peru",
|
| 150 |
+
"poland",
|
| 151 |
+
"portugal",
|
| 152 |
+
"romania",
|
| 153 |
+
"russia",
|
| 154 |
+
"slovak_republic",
|
| 155 |
+
"slovenia",
|
| 156 |
+
"south_africa",
|
| 157 |
+
"spain",
|
| 158 |
+
"sweden",
|
| 159 |
+
"switzerland",
|
| 160 |
+
"turkey",
|
| 161 |
+
"united_kingdom",
|
| 162 |
+
"united_states",
|
| 163 |
+
"other_major_oil_producers",
|
| 164 |
+
"rest_of_the_world",
|
| 165 |
+
"world",
|
| 166 |
+
"all",
|
| 167 |
+
],
|
| 168 |
+
}
|
| 169 |
+
}
|
| 170 |
+
},
|
| 171 |
+
)
|
| 172 |
+
)
|
| 173 |
+
|
| 174 |
+
@exception_handler
|
| 175 |
+
@validate
|
| 176 |
+
def nominal(
|
| 177 |
+
self,
|
| 178 |
+
start_date: Annotated[
|
| 179 |
+
Union[datetime.date, None, str],
|
| 180 |
+
OpenBBField(description="Start date of the data, in YYYY-MM-DD format."),
|
| 181 |
+
] = None,
|
| 182 |
+
end_date: Annotated[
|
| 183 |
+
Union[datetime.date, None, str],
|
| 184 |
+
OpenBBField(description="End date of the data, in YYYY-MM-DD format."),
|
| 185 |
+
] = None,
|
| 186 |
+
provider: Annotated[
|
| 187 |
+
Optional[Literal["econdb", "oecd"]],
|
| 188 |
+
OpenBBField(
|
| 189 |
+
description="The provider to use, by default None. If None, the priority list configured in the settings is used. Default priority: econdb, oecd."
|
| 190 |
+
),
|
| 191 |
+
] = None,
|
| 192 |
+
**kwargs
|
| 193 |
+
) -> OBBject:
|
| 194 |
+
"""Get Nominal GDP Data.
|
| 195 |
+
|
| 196 |
+
Parameters
|
| 197 |
+
----------
|
| 198 |
+
provider : str
|
| 199 |
+
The provider to use, by default None. If None, the priority list configured in the settings is used. Default priority: econdb, oecd.
|
| 200 |
+
start_date : Union[date, None, str]
|
| 201 |
+
Start date of the data, in YYYY-MM-DD format.
|
| 202 |
+
end_date : Union[date, None, str]
|
| 203 |
+
End date of the data, in YYYY-MM-DD format.
|
| 204 |
+
country : str
|
| 205 |
+
The country to get data.Use 'all' to get data for all available countries. Multiple comma separated items allowed. (provider: econdb, oecd)
|
| 206 |
+
use_cache : bool
|
| 207 |
+
If True, the request will be cached for one day. Using cache is recommended to avoid needlessly requesting the same data. (provider: econdb)
|
| 208 |
+
frequency : Literal['quarter', 'annual']
|
| 209 |
+
Frequency of the data. (provider: oecd)
|
| 210 |
+
units : Literal['level', 'index', 'capita']
|
| 211 |
+
The unit of measurement for the data.Both 'level' and 'capita' (per) are measured in USD. (provider: oecd)
|
| 212 |
+
price_base : Literal['current_prices', 'volume']
|
| 213 |
+
Price base for the data, volume is chain linked volume. (provider: oecd)
|
| 214 |
+
|
| 215 |
+
Returns
|
| 216 |
+
-------
|
| 217 |
+
OBBject
|
| 218 |
+
results : list[GdpNominal]
|
| 219 |
+
Serializable results.
|
| 220 |
+
provider : Optional[str]
|
| 221 |
+
Provider name.
|
| 222 |
+
warnings : Optional[list[Warning_]]
|
| 223 |
+
list of warnings.
|
| 224 |
+
chart : Optional[Chart]
|
| 225 |
+
Chart object.
|
| 226 |
+
extra : Dict[str, Any]
|
| 227 |
+
Extra info.
|
| 228 |
+
|
| 229 |
+
GdpNominal
|
| 230 |
+
----------
|
| 231 |
+
date : date
|
| 232 |
+
The date of the data.
|
| 233 |
+
country : Optional[str]
|
| 234 |
+
The country represented by the GDP value.
|
| 235 |
+
value : Union[int, float]
|
| 236 |
+
GDP value for the country and date.
|
| 237 |
+
nominal_growth_qoq : Optional[float]
|
| 238 |
+
Nominal GDP growth rate quarter over quarter. (provider: econdb)
|
| 239 |
+
nominal_growth_yoy : Optional[float]
|
| 240 |
+
Nominal GDP growth rate year over year. (provider: econdb)
|
| 241 |
+
|
| 242 |
+
Examples
|
| 243 |
+
--------
|
| 244 |
+
>>> from openbb import obb
|
| 245 |
+
>>> obb.economy.gdp.nominal(provider='oecd')
|
| 246 |
+
>>> obb.economy.gdp.nominal(units='capita', country='all', frequency='annual', provider='oecd')
|
| 247 |
+
""" # noqa: E501
|
| 248 |
+
|
| 249 |
+
return self._run(
|
| 250 |
+
"/economy/gdp/nominal",
|
| 251 |
+
**filter_inputs(
|
| 252 |
+
provider_choices={
|
| 253 |
+
"provider": self._get_provider(
|
| 254 |
+
provider,
|
| 255 |
+
"economy.gdp.nominal",
|
| 256 |
+
("econdb", "oecd"),
|
| 257 |
+
)
|
| 258 |
+
},
|
| 259 |
+
standard_params={
|
| 260 |
+
"start_date": start_date,
|
| 261 |
+
"end_date": end_date,
|
| 262 |
+
},
|
| 263 |
+
extra_params=kwargs,
|
| 264 |
+
info={
|
| 265 |
+
"country": {
|
| 266 |
+
"econdb": {"multiple_items_allowed": True, "choices": None},
|
| 267 |
+
"oecd": {
|
| 268 |
+
"multiple_items_allowed": True,
|
| 269 |
+
"choices": [
|
| 270 |
+
"oecd",
|
| 271 |
+
"oecd_26",
|
| 272 |
+
"oecd_europe",
|
| 273 |
+
"g7",
|
| 274 |
+
"g20",
|
| 275 |
+
"euro_area",
|
| 276 |
+
"european_union_27",
|
| 277 |
+
"european_union_15",
|
| 278 |
+
"nafta",
|
| 279 |
+
"argentina",
|
| 280 |
+
"australia",
|
| 281 |
+
"austria",
|
| 282 |
+
"belgium",
|
| 283 |
+
"bulgaria",
|
| 284 |
+
"brazil",
|
| 285 |
+
"canada",
|
| 286 |
+
"chile",
|
| 287 |
+
"colombia",
|
| 288 |
+
"costa_rica",
|
| 289 |
+
"croatia",
|
| 290 |
+
"czech_republic",
|
| 291 |
+
"denmark",
|
| 292 |
+
"estonia",
|
| 293 |
+
"finland",
|
| 294 |
+
"france",
|
| 295 |
+
"germany",
|
| 296 |
+
"greece",
|
| 297 |
+
"hungary",
|
| 298 |
+
"iceland",
|
| 299 |
+
"india",
|
| 300 |
+
"indonesia",
|
| 301 |
+
"ireland",
|
| 302 |
+
"israel",
|
| 303 |
+
"italy",
|
| 304 |
+
"japan",
|
| 305 |
+
"korea",
|
| 306 |
+
"latvia",
|
| 307 |
+
"lithuania",
|
| 308 |
+
"luxembourg",
|
| 309 |
+
"mexico",
|
| 310 |
+
"netherlands",
|
| 311 |
+
"new_zealand",
|
| 312 |
+
"norway",
|
| 313 |
+
"poland",
|
| 314 |
+
"portugal",
|
| 315 |
+
"romania",
|
| 316 |
+
"russia",
|
| 317 |
+
"saudi_arabia",
|
| 318 |
+
"slovak_republic",
|
| 319 |
+
"slovenia",
|
| 320 |
+
"south_africa",
|
| 321 |
+
"spain",
|
| 322 |
+
"sweden",
|
| 323 |
+
"switzerland",
|
| 324 |
+
"turkey",
|
| 325 |
+
"united_kingdom",
|
| 326 |
+
"united_states",
|
| 327 |
+
"all",
|
| 328 |
+
],
|
| 329 |
+
},
|
| 330 |
+
}
|
| 331 |
+
},
|
| 332 |
+
)
|
| 333 |
+
)
|
| 334 |
+
|
| 335 |
+
@exception_handler
|
| 336 |
+
@validate
|
| 337 |
+
def real(
|
| 338 |
+
self,
|
| 339 |
+
start_date: Annotated[
|
| 340 |
+
Union[datetime.date, None, str],
|
| 341 |
+
OpenBBField(description="Start date of the data, in YYYY-MM-DD format."),
|
| 342 |
+
] = None,
|
| 343 |
+
end_date: Annotated[
|
| 344 |
+
Union[datetime.date, None, str],
|
| 345 |
+
OpenBBField(description="End date of the data, in YYYY-MM-DD format."),
|
| 346 |
+
] = None,
|
| 347 |
+
provider: Annotated[
|
| 348 |
+
Optional[Literal["econdb", "oecd"]],
|
| 349 |
+
OpenBBField(
|
| 350 |
+
description="The provider to use, by default None. If None, the priority list configured in the settings is used. Default priority: econdb, oecd."
|
| 351 |
+
),
|
| 352 |
+
] = None,
|
| 353 |
+
**kwargs
|
| 354 |
+
) -> OBBject:
|
| 355 |
+
"""Get Real GDP Data.
|
| 356 |
+
|
| 357 |
+
Parameters
|
| 358 |
+
----------
|
| 359 |
+
provider : str
|
| 360 |
+
The provider to use, by default None. If None, the priority list configured in the settings is used. Default priority: econdb, oecd.
|
| 361 |
+
start_date : Union[date, None, str]
|
| 362 |
+
Start date of the data, in YYYY-MM-DD format.
|
| 363 |
+
end_date : Union[date, None, str]
|
| 364 |
+
End date of the data, in YYYY-MM-DD format.
|
| 365 |
+
country : str
|
| 366 |
+
The country to get data.Use 'all' to get data for all available countries. Multiple comma separated items allowed. (provider: econdb, oecd)
|
| 367 |
+
use_cache : bool
|
| 368 |
+
If True, the request will be cached for one day. Using cache is recommended to avoid needlessly requesting the same data. (provider: econdb)
|
| 369 |
+
frequency : Literal['quarter', 'annual']
|
| 370 |
+
Frequency of the data. (provider: oecd)
|
| 371 |
+
|
| 372 |
+
Returns
|
| 373 |
+
-------
|
| 374 |
+
OBBject
|
| 375 |
+
results : list[GdpReal]
|
| 376 |
+
Serializable results.
|
| 377 |
+
provider : Optional[str]
|
| 378 |
+
Provider name.
|
| 379 |
+
warnings : Optional[list[Warning_]]
|
| 380 |
+
list of warnings.
|
| 381 |
+
chart : Optional[Chart]
|
| 382 |
+
Chart object.
|
| 383 |
+
extra : Dict[str, Any]
|
| 384 |
+
Extra info.
|
| 385 |
+
|
| 386 |
+
GdpReal
|
| 387 |
+
-------
|
| 388 |
+
date : date
|
| 389 |
+
The date of the data.
|
| 390 |
+
country : Optional[str]
|
| 391 |
+
The country represented by the GDP value.
|
| 392 |
+
value : Union[int, float]
|
| 393 |
+
GDP value for the country and date.
|
| 394 |
+
real_growth_qoq : Optional[float]
|
| 395 |
+
Real GDP growth rate quarter over quarter. (provider: econdb)
|
| 396 |
+
real_growth_yoy : Optional[float]
|
| 397 |
+
Real GDP growth rate year over year. (provider: econdb)
|
| 398 |
+
|
| 399 |
+
Examples
|
| 400 |
+
--------
|
| 401 |
+
>>> from openbb import obb
|
| 402 |
+
>>> obb.economy.gdp.real(provider='oecd')
|
| 403 |
+
>>> obb.economy.gdp.real(country='united_states,germany,japan', provider='econdb')
|
| 404 |
+
""" # noqa: E501
|
| 405 |
+
|
| 406 |
+
return self._run(
|
| 407 |
+
"/economy/gdp/real",
|
| 408 |
+
**filter_inputs(
|
| 409 |
+
provider_choices={
|
| 410 |
+
"provider": self._get_provider(
|
| 411 |
+
provider,
|
| 412 |
+
"economy.gdp.real",
|
| 413 |
+
("econdb", "oecd"),
|
| 414 |
+
)
|
| 415 |
+
},
|
| 416 |
+
standard_params={
|
| 417 |
+
"start_date": start_date,
|
| 418 |
+
"end_date": end_date,
|
| 419 |
+
},
|
| 420 |
+
extra_params=kwargs,
|
| 421 |
+
info={
|
| 422 |
+
"country": {
|
| 423 |
+
"econdb": {"multiple_items_allowed": True, "choices": None},
|
| 424 |
+
"oecd": {
|
| 425 |
+
"multiple_items_allowed": True,
|
| 426 |
+
"choices": [
|
| 427 |
+
"oecd",
|
| 428 |
+
"oecd_26",
|
| 429 |
+
"oecd_europe",
|
| 430 |
+
"g7",
|
| 431 |
+
"g20",
|
| 432 |
+
"euro_area",
|
| 433 |
+
"european_union_27",
|
| 434 |
+
"european_union_15",
|
| 435 |
+
"nafta",
|
| 436 |
+
"argentina",
|
| 437 |
+
"australia",
|
| 438 |
+
"austria",
|
| 439 |
+
"belgium",
|
| 440 |
+
"bulgaria",
|
| 441 |
+
"brazil",
|
| 442 |
+
"canada",
|
| 443 |
+
"chile",
|
| 444 |
+
"colombia",
|
| 445 |
+
"costa_rica",
|
| 446 |
+
"croatia",
|
| 447 |
+
"czech_republic",
|
| 448 |
+
"denmark",
|
| 449 |
+
"estonia",
|
| 450 |
+
"finland",
|
| 451 |
+
"france",
|
| 452 |
+
"germany",
|
| 453 |
+
"greece",
|
| 454 |
+
"hungary",
|
| 455 |
+
"iceland",
|
| 456 |
+
"india",
|
| 457 |
+
"indonesia",
|
| 458 |
+
"ireland",
|
| 459 |
+
"israel",
|
| 460 |
+
"italy",
|
| 461 |
+
"japan",
|
| 462 |
+
"korea",
|
| 463 |
+
"latvia",
|
| 464 |
+
"lithuania",
|
| 465 |
+
"luxembourg",
|
| 466 |
+
"mexico",
|
| 467 |
+
"netherlands",
|
| 468 |
+
"new_zealand",
|
| 469 |
+
"norway",
|
| 470 |
+
"poland",
|
| 471 |
+
"portugal",
|
| 472 |
+
"romania",
|
| 473 |
+
"russia",
|
| 474 |
+
"saudi_arabia",
|
| 475 |
+
"slovak_republic",
|
| 476 |
+
"slovenia",
|
| 477 |
+
"south_africa",
|
| 478 |
+
"spain",
|
| 479 |
+
"sweden",
|
| 480 |
+
"switzerland",
|
| 481 |
+
"turkey",
|
| 482 |
+
"united_kingdom",
|
| 483 |
+
"united_states",
|
| 484 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|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
### THIS FILE IS AUTO-GENERATED. DO NOT EDIT. ###
|
| 2 |
+
|
| 3 |
+
import datetime
|
| 4 |
+
from typing import Literal, Optional, Union
|
| 5 |
+
|
| 6 |
+
from openbb_core.app.model.field import OpenBBField
|
| 7 |
+
from openbb_core.app.model.obbject import OBBject
|
| 8 |
+
from openbb_core.app.static.container import Container
|
| 9 |
+
from openbb_core.app.static.utils.decorators import exception_handler, validate
|
| 10 |
+
from openbb_core.app.static.utils.filters import filter_inputs
|
| 11 |
+
from typing_extensions import Annotated
|
| 12 |
+
|
| 13 |
+
|
| 14 |
+
class ROUTER_economy_survey(Container):
|
| 15 |
+
"""/economy/survey
|
| 16 |
+
bls_search
|
| 17 |
+
bls_series
|
| 18 |
+
economic_conditions_chicago
|
| 19 |
+
manufacturing_outlook_ny
|
| 20 |
+
manufacturing_outlook_texas
|
| 21 |
+
nonfarm_payrolls
|
| 22 |
+
sloos
|
| 23 |
+
university_of_michigan
|
| 24 |
+
"""
|
| 25 |
+
|
| 26 |
+
def __repr__(self) -> str:
|
| 27 |
+
return self.__doc__ or ""
|
| 28 |
+
|
| 29 |
+
@exception_handler
|
| 30 |
+
@validate
|
| 31 |
+
def bls_search(
|
| 32 |
+
self,
|
| 33 |
+
query: Annotated[
|
| 34 |
+
str,
|
| 35 |
+
OpenBBField(
|
| 36 |
+
description="The search word(s). Use semi-colon to separate multiple queries as an & operator."
|
| 37 |
+
),
|
| 38 |
+
] = "",
|
| 39 |
+
provider: Annotated[
|
| 40 |
+
Optional[Literal["bls"]],
|
| 41 |
+
OpenBBField(
|
| 42 |
+
description="The provider to use, by default None. If None, the priority list configured in the settings is used. Default priority: bls."
|
| 43 |
+
),
|
| 44 |
+
] = None,
|
| 45 |
+
**kwargs
|
| 46 |
+
) -> OBBject:
|
| 47 |
+
"""Search BLS surveys by category and keyword or phrase to identify BLS series IDs.
|
| 48 |
+
|
| 49 |
+
Parameters
|
| 50 |
+
----------
|
| 51 |
+
provider : str
|
| 52 |
+
The provider to use, by default None. If None, the priority list configured in the settings is used. Default priority: bls.
|
| 53 |
+
query : str
|
| 54 |
+
The search word(s). Use semi-colon to separate multiple queries as an & operator.
|
| 55 |
+
category : Optional[Literal['cpi', 'pce', 'ppi', 'ip', 'jolts', 'nfp', 'cps', 'lfs', 'wages', 'ec', 'sla', 'bed', 'tu']]
|
| 56 |
+
The category of BLS survey to search within.
|
| 57 |
+
An empty search query will return all series within the category. Options are:
|
| 58 |
+
|
| 59 |
+
cpi - Consumer Price Index
|
| 60 |
+
|
| 61 |
+
pce - Personal Consumption Expenditure
|
| 62 |
+
|
| 63 |
+
ppi - Producer Price Index
|
| 64 |
+
|
| 65 |
+
ip - Industry Productivity
|
| 66 |
+
|
| 67 |
+
jolts - Job Openings and Labor Turnover Survey
|
| 68 |
+
|
| 69 |
+
nfp - Nonfarm Payrolls
|
| 70 |
+
|
| 71 |
+
cps - Current Population Survey
|
| 72 |
+
|
| 73 |
+
lfs - Labor Force Statistics
|
| 74 |
+
|
| 75 |
+
wages - Wages
|
| 76 |
+
|
| 77 |
+
ec - Employer Costs
|
| 78 |
+
|
| 79 |
+
sla - State and Local Area Employment
|
| 80 |
+
|
| 81 |
+
bed - Business Employment Dynamics
|
| 82 |
+
|
| 83 |
+
tu - Time Use
|
| 84 |
+
(provider: bls)
|
| 85 |
+
Choices for bls: 'cpi', 'pce', 'ppi', 'ip', 'jolts', 'nfp', 'cps', 'lfs', 'wages', 'ec', 'sla', 'bed', 'tu'
|
| 86 |
+
include_extras : bool
|
| 87 |
+
Include additional information in the search results. Extra fields returned are metadata and vary by survey. Fields are undefined strings that typically have names ending with '_code'. (provider: bls)
|
| 88 |
+
include_code_map : bool
|
| 89 |
+
When True, includes the complete code map for eaçh survey in the category, returned separately as a nested JSON to the `extras['results_metadata']` property of the response. Example content is the NAICS industry map for PPI surveys. Each code is a value within the 'symbol' of the time series. (provider: bls)
|
| 90 |
+
|
| 91 |
+
Returns
|
| 92 |
+
-------
|
| 93 |
+
OBBject
|
| 94 |
+
results : list[BlsSearch]
|
| 95 |
+
Serializable results.
|
| 96 |
+
provider : Optional[str]
|
| 97 |
+
Provider name.
|
| 98 |
+
warnings : Optional[list[Warning_]]
|
| 99 |
+
list of warnings.
|
| 100 |
+
chart : Optional[Chart]
|
| 101 |
+
Chart object.
|
| 102 |
+
extra : Dict[str, Any]
|
| 103 |
+
Extra info.
|
| 104 |
+
|
| 105 |
+
BlsSearch
|
| 106 |
+
---------
|
| 107 |
+
symbol : str
|
| 108 |
+
Symbol representing the entity requested in the data.
|
| 109 |
+
title : Optional[str]
|
| 110 |
+
The title of the series.
|
| 111 |
+
survey_name : Optional[str]
|
| 112 |
+
The name of the survey.
|
| 113 |
+
|
| 114 |
+
Examples
|
| 115 |
+
--------
|
| 116 |
+
>>> from openbb import obb
|
| 117 |
+
>>> obb.economy.survey.bls_search(provider='bls', category='cpi')
|
| 118 |
+
>>> # Use semi-colon to separate multiple queries as an & operator.
|
| 119 |
+
>>> obb.economy.survey.bls_search(provider='bls', category='cpi', query='seattle;gasoline')
|
| 120 |
+
""" # noqa: E501
|
| 121 |
+
|
| 122 |
+
return self._run(
|
| 123 |
+
"/economy/survey/bls_search",
|
| 124 |
+
**filter_inputs(
|
| 125 |
+
provider_choices={
|
| 126 |
+
"provider": self._get_provider(
|
| 127 |
+
provider,
|
| 128 |
+
"economy.survey.bls_search",
|
| 129 |
+
("bls",),
|
| 130 |
+
)
|
| 131 |
+
},
|
| 132 |
+
standard_params={
|
| 133 |
+
"query": query,
|
| 134 |
+
},
|
| 135 |
+
extra_params=kwargs,
|
| 136 |
+
info={
|
| 137 |
+
"category": {
|
| 138 |
+
"bls": {
|
| 139 |
+
"multiple_items_allowed": False,
|
| 140 |
+
"choices": [
|
| 141 |
+
"cpi",
|
| 142 |
+
"pce",
|
| 143 |
+
"ppi",
|
| 144 |
+
"ip",
|
| 145 |
+
"jolts",
|
| 146 |
+
"nfp",
|
| 147 |
+
"cps",
|
| 148 |
+
"lfs",
|
| 149 |
+
"wages",
|
| 150 |
+
"ec",
|
| 151 |
+
"sla",
|
| 152 |
+
"bed",
|
| 153 |
+
"tu",
|
| 154 |
+
],
|
| 155 |
+
}
|
| 156 |
+
}
|
| 157 |
+
},
|
| 158 |
+
)
|
| 159 |
+
)
|
| 160 |
+
|
| 161 |
+
@exception_handler
|
| 162 |
+
@validate
|
| 163 |
+
def bls_series(
|
| 164 |
+
self,
|
| 165 |
+
symbol: Annotated[
|
| 166 |
+
Union[str, list[str]],
|
| 167 |
+
OpenBBField(
|
| 168 |
+
description="Symbol to get data for. Multiple comma separated items allowed for provider(s): bls."
|
| 169 |
+
),
|
| 170 |
+
],
|
| 171 |
+
start_date: Annotated[
|
| 172 |
+
Union[datetime.date, None, str],
|
| 173 |
+
OpenBBField(description="Start date of the data, in YYYY-MM-DD format."),
|
| 174 |
+
] = None,
|
| 175 |
+
end_date: Annotated[
|
| 176 |
+
Union[datetime.date, None, str],
|
| 177 |
+
OpenBBField(description="End date of the data, in YYYY-MM-DD format."),
|
| 178 |
+
] = None,
|
| 179 |
+
provider: Annotated[
|
| 180 |
+
Optional[Literal["bls"]],
|
| 181 |
+
OpenBBField(
|
| 182 |
+
description="The provider to use, by default None. If None, the priority list configured in the settings is used. Default priority: bls."
|
| 183 |
+
),
|
| 184 |
+
] = None,
|
| 185 |
+
**kwargs
|
| 186 |
+
) -> OBBject:
|
| 187 |
+
"""Get time series data for one, or more, BLS series IDs.
|
| 188 |
+
|
| 189 |
+
Parameters
|
| 190 |
+
----------
|
| 191 |
+
provider : str
|
| 192 |
+
The provider to use, by default None. If None, the priority list configured in the settings is used. Default priority: bls.
|
| 193 |
+
symbol : Union[str, list[str]]
|
| 194 |
+
Symbol to get data for. Multiple comma separated items allowed for provider(s): bls.
|
| 195 |
+
start_date : Union[date, None, str]
|
| 196 |
+
Start date of the data, in YYYY-MM-DD format.
|
| 197 |
+
end_date : Union[date, None, str]
|
| 198 |
+
End date of the data, in YYYY-MM-DD format.
|
| 199 |
+
calculations : bool
|
| 200 |
+
Include calculations in the response, if available. Default is True. (provider: bls)
|
| 201 |
+
annual_average : bool
|
| 202 |
+
Include annual averages in the response, if available. Default is False. (provider: bls)
|
| 203 |
+
aspects : bool
|
| 204 |
+
Include all aspects associated with a data point for a given BLS series ID, if available. Returned with the series metadata, under `extras` of the response object. Default is False. (provider: bls)
|
| 205 |
+
|
| 206 |
+
Returns
|
| 207 |
+
-------
|
| 208 |
+
OBBject
|
| 209 |
+
results : list[BlsSeries]
|
| 210 |
+
Serializable results.
|
| 211 |
+
provider : Optional[str]
|
| 212 |
+
Provider name.
|
| 213 |
+
warnings : Optional[list[Warning_]]
|
| 214 |
+
list of warnings.
|
| 215 |
+
chart : Optional[Chart]
|
| 216 |
+
Chart object.
|
| 217 |
+
extra : Dict[str, Any]
|
| 218 |
+
Extra info.
|
| 219 |
+
|
| 220 |
+
BlsSeries
|
| 221 |
+
---------
|
| 222 |
+
date : date
|
| 223 |
+
The date of the data.
|
| 224 |
+
symbol : str
|
| 225 |
+
Symbol representing the entity requested in the data.
|
| 226 |
+
title : Optional[str]
|
| 227 |
+
Title of the series.
|
| 228 |
+
value : Optional[float]
|
| 229 |
+
Observation value for the symbol and date.
|
| 230 |
+
change_1_m : Optional[float]
|
| 231 |
+
One month change in value. (provider: bls)
|
| 232 |
+
change_3_m : Optional[float]
|
| 233 |
+
Three month change in value. (provider: bls)
|
| 234 |
+
change_6_m : Optional[float]
|
| 235 |
+
Six month change in value. (provider: bls)
|
| 236 |
+
change_12_m : Optional[float]
|
| 237 |
+
One year change in value. (provider: bls)
|
| 238 |
+
change_percent_1_m : Optional[float]
|
| 239 |
+
One month change in percent. (provider: bls)
|
| 240 |
+
change_percent_3_m : Optional[float]
|
| 241 |
+
Three month change in percent. (provider: bls)
|
| 242 |
+
change_percent_6_m : Optional[float]
|
| 243 |
+
Six month change in percent. (provider: bls)
|
| 244 |
+
change_percent_12_m : Optional[float]
|
| 245 |
+
One year change in percent. (provider: bls)
|
| 246 |
+
latest : Optional[bool]
|
| 247 |
+
Latest value indicator. (provider: bls)
|
| 248 |
+
footnotes : Optional[str]
|
| 249 |
+
Footnotes accompanying the value. (provider: bls)
|
| 250 |
+
|
| 251 |
+
Examples
|
| 252 |
+
--------
|
| 253 |
+
>>> from openbb import obb
|
| 254 |
+
>>> obb.economy.survey.bls_series(provider='bls', symbol='CES0000000001')
|
| 255 |
+
""" # noqa: E501
|
| 256 |
+
|
| 257 |
+
return self._run(
|
| 258 |
+
"/economy/survey/bls_series",
|
| 259 |
+
**filter_inputs(
|
| 260 |
+
provider_choices={
|
| 261 |
+
"provider": self._get_provider(
|
| 262 |
+
provider,
|
| 263 |
+
"economy.survey.bls_series",
|
| 264 |
+
("bls",),
|
| 265 |
+
)
|
| 266 |
+
},
|
| 267 |
+
standard_params={
|
| 268 |
+
"symbol": symbol,
|
| 269 |
+
"start_date": start_date,
|
| 270 |
+
"end_date": end_date,
|
| 271 |
+
},
|
| 272 |
+
extra_params=kwargs,
|
| 273 |
+
info={
|
| 274 |
+
"symbol": {"bls": {"multiple_items_allowed": True, "choices": None}}
|
| 275 |
+
},
|
| 276 |
+
)
|
| 277 |
+
)
|
| 278 |
+
|
| 279 |
+
@exception_handler
|
| 280 |
+
@validate
|
| 281 |
+
def economic_conditions_chicago(
|
| 282 |
+
self,
|
| 283 |
+
start_date: Annotated[
|
| 284 |
+
Union[datetime.date, None, str],
|
| 285 |
+
OpenBBField(description="Start date of the data, in YYYY-MM-DD format."),
|
| 286 |
+
] = None,
|
| 287 |
+
end_date: Annotated[
|
| 288 |
+
Union[datetime.date, None, str],
|
| 289 |
+
OpenBBField(description="End date of the data, in YYYY-MM-DD format."),
|
| 290 |
+
] = None,
|
| 291 |
+
provider: Annotated[
|
| 292 |
+
Optional[Literal["fred"]],
|
| 293 |
+
OpenBBField(
|
| 294 |
+
description="The provider to use, by default None. If None, the priority list configured in the settings is used. Default priority: fred."
|
| 295 |
+
),
|
| 296 |
+
] = None,
|
| 297 |
+
**kwargs
|
| 298 |
+
) -> OBBject:
|
| 299 |
+
"""Get The Survey Of Economic Conditions For The Chicago Region.
|
| 300 |
+
|
| 301 |
+
Parameters
|
| 302 |
+
----------
|
| 303 |
+
provider : str
|
| 304 |
+
The provider to use, by default None. If None, the priority list configured in the settings is used. Default priority: fred.
|
| 305 |
+
start_date : Union[date, None, str]
|
| 306 |
+
Start date of the data, in YYYY-MM-DD format.
|
| 307 |
+
end_date : Union[date, None, str]
|
| 308 |
+
End date of the data, in YYYY-MM-DD format.
|
| 309 |
+
frequency : Optional[Literal['annual', 'quarter']]
|
| 310 |
+
Frequency aggregation to convert monthly data to lower frequency. None is monthly. (provider: fred)
|
| 311 |
+
aggregation_method : Optional[Literal['avg', 'sum', 'eop']]
|
| 312 |
+
A key that indicates the aggregation method used for frequency aggregation.
|
| 313 |
+
|
| 314 |
+
avg = Average
|
| 315 |
+
|
| 316 |
+
sum = Sum
|
| 317 |
+
|
| 318 |
+
eop = End of Period
|
| 319 |
+
(provider: fred)
|
| 320 |
+
transform : Optional[Literal['chg', 'ch1', 'pch', 'pc1', 'pca', 'cch', 'cca', 'log']]
|
| 321 |
+
Transformation type
|
| 322 |
+
|
| 323 |
+
None = No transformation
|
| 324 |
+
|
| 325 |
+
chg = Change
|
| 326 |
+
|
| 327 |
+
ch1 = Change from Year Ago
|
| 328 |
+
|
| 329 |
+
pch = Percent Change
|
| 330 |
+
|
| 331 |
+
pc1 = Percent Change from Year Ago
|
| 332 |
+
|
| 333 |
+
pca = Compounded Annual Rate of Change
|
| 334 |
+
|
| 335 |
+
cch = Continuously Compounded Rate of Change
|
| 336 |
+
|
| 337 |
+
cca = Continuously Compounded Annual Rate of Change
|
| 338 |
+
|
| 339 |
+
log = Natural Log
|
| 340 |
+
(provider: fred)
|
| 341 |
+
|
| 342 |
+
Returns
|
| 343 |
+
-------
|
| 344 |
+
OBBject
|
| 345 |
+
results : list[SurveyOfEconomicConditionsChicago]
|
| 346 |
+
Serializable results.
|
| 347 |
+
provider : Optional[str]
|
| 348 |
+
Provider name.
|
| 349 |
+
warnings : Optional[list[Warning_]]
|
| 350 |
+
list of warnings.
|
| 351 |
+
chart : Optional[Chart]
|
| 352 |
+
Chart object.
|
| 353 |
+
extra : Dict[str, Any]
|
| 354 |
+
Extra info.
|
| 355 |
+
|
| 356 |
+
SurveyOfEconomicConditionsChicago
|
| 357 |
+
---------------------------------
|
| 358 |
+
date : date
|
| 359 |
+
The date of the data.
|
| 360 |
+
activity_index : Optional[float]
|
| 361 |
+
Activity Index.
|
| 362 |
+
one_year_outlook : Optional[float]
|
| 363 |
+
One Year Outlook Index.
|
| 364 |
+
manufacturing_activity : Optional[float]
|
| 365 |
+
Manufacturing Activity Index.
|
| 366 |
+
non_manufacturing_activity : Optional[float]
|
| 367 |
+
Non-Manufacturing Activity Index.
|
| 368 |
+
capital_expenditures_expectations : Optional[float]
|
| 369 |
+
Capital Expenditures Expectations Index.
|
| 370 |
+
hiring_expectations : Optional[float]
|
| 371 |
+
Hiring Expectations Index.
|
| 372 |
+
current_hiring : Optional[float]
|
| 373 |
+
Current Hiring Index.
|
| 374 |
+
labor_costs : Optional[float]
|
| 375 |
+
Labor Costs Index.
|
| 376 |
+
non_labor_costs : Optional[float]
|
| 377 |
+
Non-Labor Costs Index.
|
| 378 |
+
|
| 379 |
+
Examples
|
| 380 |
+
--------
|
| 381 |
+
>>> from openbb import obb
|
| 382 |
+
>>> obb.economy.survey.economic_conditions_chicago(provider='fred')
|
| 383 |
+
""" # noqa: E501
|
| 384 |
+
|
| 385 |
+
return self._run(
|
| 386 |
+
"/economy/survey/economic_conditions_chicago",
|
| 387 |
+
**filter_inputs(
|
| 388 |
+
provider_choices={
|
| 389 |
+
"provider": self._get_provider(
|
| 390 |
+
provider,
|
| 391 |
+
"economy.survey.economic_conditions_chicago",
|
| 392 |
+
("fred",),
|
| 393 |
+
)
|
| 394 |
+
},
|
| 395 |
+
standard_params={
|
| 396 |
+
"start_date": start_date,
|
| 397 |
+
"end_date": end_date,
|
| 398 |
+
},
|
| 399 |
+
extra_params=kwargs,
|
| 400 |
+
)
|
| 401 |
+
)
|
| 402 |
+
|
| 403 |
+
@exception_handler
|
| 404 |
+
@validate
|
| 405 |
+
def manufacturing_outlook_ny(
|
| 406 |
+
self,
|
| 407 |
+
start_date: Annotated[
|
| 408 |
+
Union[datetime.date, None, str],
|
| 409 |
+
OpenBBField(description="Start date of the data, in YYYY-MM-DD format."),
|
| 410 |
+
] = None,
|
| 411 |
+
end_date: Annotated[
|
| 412 |
+
Union[datetime.date, None, str],
|
| 413 |
+
OpenBBField(description="End date of the data, in YYYY-MM-DD format."),
|
| 414 |
+
] = None,
|
| 415 |
+
provider: Annotated[
|
| 416 |
+
Optional[Literal["fred"]],
|
| 417 |
+
OpenBBField(
|
| 418 |
+
description="The provider to use, by default None. If None, the priority list configured in the settings is used. Default priority: fred."
|
| 419 |
+
),
|
| 420 |
+
] = None,
|
| 421 |
+
**kwargs
|
| 422 |
+
) -> OBBject:
|
| 423 |
+
"""Get the Empire State Manufacturing Survey.
|
| 424 |
+
|
| 425 |
+
It is a monthly survey of manufacturers in New York State conducted by the Federal Reserve Bank of New York.
|
| 426 |
+
|
| 427 |
+
Participants from across the state in a variety of industries respond to a questionnaire
|
| 428 |
+
and report the change in a variety of indicators from the previous month.
|
| 429 |
+
|
| 430 |
+
Respondents also state the likely direction of these same indicators six months ahead.
|
| 431 |
+
April 2002 is the first report, although survey data date back to July 2001.
|
| 432 |
+
|
| 433 |
+
The survey is sent on the first day of each month to the same pool of about 200
|
| 434 |
+
manufacturing executives in New York State, typically the president or CEO.
|
| 435 |
+
|
| 436 |
+
About 100 responses are received. Most are completed by the tenth, although surveys are accepted until the fifteenth.
|
| 437 |
+
|
| 438 |
+
|
| 439 |
+
Parameters
|
| 440 |
+
----------
|
| 441 |
+
provider : str
|
| 442 |
+
The provider to use, by default None. If None, the priority list configured in the settings is used. Default priority: fred.
|
| 443 |
+
start_date : Union[date, None, str]
|
| 444 |
+
Start date of the data, in YYYY-MM-DD format.
|
| 445 |
+
end_date : Union[date, None, str]
|
| 446 |
+
End date of the data, in YYYY-MM-DD format.
|
| 447 |
+
topic : Union[Literal['business_outlook', 'hours_worked', 'employment', 'inventories', 'prices_received', 'prices_paid', 'capex', 'unfilled_orders', 'new_orders', 'shipments', 'delivery_times'], str]
|
| 448 |
+
The topic for the survey response. Multiple comma separated items allowed. (provider: fred)
|
| 449 |
+
seasonally_adjusted : bool
|
| 450 |
+
Whether the data is seasonally adjusted, default is False (provider: fred)
|
| 451 |
+
frequency : Optional[Literal['quarter', 'annual']]
|
| 452 |
+
Frequency aggregation to convert monthly data to lower frequency. None is monthly. (provider: fred)
|
| 453 |
+
aggregation_method : Optional[Literal['avg', 'sum', 'eop']]
|
| 454 |
+
A key that indicates the aggregation method used for frequency aggregation.
|
| 455 |
+
avg = Average
|
| 456 |
+
sum = Sum
|
| 457 |
+
eop = End of Period
|
| 458 |
+
(provider: fred)
|
| 459 |
+
transform : Optional[Literal['chg', 'ch1', 'pch', 'pc1', 'pca', 'cch', 'cca', 'log']]
|
| 460 |
+
Transformation type
|
| 461 |
+
None = No transformation
|
| 462 |
+
chg = Change
|
| 463 |
+
ch1 = Change from Year Ago
|
| 464 |
+
pch = Percent Change
|
| 465 |
+
pc1 = Percent Change from Year Ago
|
| 466 |
+
pca = Compounded Annual Rate of Change
|
| 467 |
+
cch = Continuously Compounded Rate of Change
|
| 468 |
+
cca = Continuously Compounded Annual Rate of Change
|
| 469 |
+
log = Natural Log
|
| 470 |
+
(provider: fred)
|
| 471 |
+
|
| 472 |
+
Returns
|
| 473 |
+
-------
|
| 474 |
+
OBBject
|
| 475 |
+
results : list[ManufacturingOutlookNY]
|
| 476 |
+
Serializable results.
|
| 477 |
+
provider : Optional[str]
|
| 478 |
+
Provider name.
|
| 479 |
+
warnings : Optional[list[Warning_]]
|
| 480 |
+
list of warnings.
|
| 481 |
+
chart : Optional[Chart]
|
| 482 |
+
Chart object.
|
| 483 |
+
extra : Dict[str, Any]
|
| 484 |
+
Extra info.
|
| 485 |
+
|
| 486 |
+
ManufacturingOutlookNY
|
| 487 |
+
----------------------
|
| 488 |
+
date : date
|
| 489 |
+
The date of the data.
|
| 490 |
+
topic : Optional[str]
|
| 491 |
+
Topic of the survey response.
|
| 492 |
+
diffusion_index : Optional[float]
|
| 493 |
+
Diffusion Index.
|
| 494 |
+
percent_reporting_increase : Optional[float]
|
| 495 |
+
Percent of respondents reporting an increase over the last month.
|
| 496 |
+
percent_reporting_decrease : Optional[float]
|
| 497 |
+
Percent of respondents reporting a decrease over the last month.
|
| 498 |
+
percent_reporting_no_change : Optional[float]
|
| 499 |
+
Percent of respondents reporting no change over the last month.
|
| 500 |
+
|
| 501 |
+
Examples
|
| 502 |
+
--------
|
| 503 |
+
>>> from openbb import obb
|
| 504 |
+
>>> obb.economy.survey.manufacturing_outlook_ny(provider='fred')
|
| 505 |
+
>>> obb.economy.survey.manufacturing_outlook_ny(topic='hours_worked,new_orders', transform='pc1', provider='fred', seasonally_adjusted=True)
|
| 506 |
+
""" # noqa: E501
|
| 507 |
+
|
| 508 |
+
return self._run(
|
| 509 |
+
"/economy/survey/manufacturing_outlook_ny",
|
| 510 |
+
**filter_inputs(
|
| 511 |
+
provider_choices={
|
| 512 |
+
"provider": self._get_provider(
|
| 513 |
+
provider,
|
| 514 |
+
"economy.survey.manufacturing_outlook_ny",
|
| 515 |
+
("fred",),
|
| 516 |
+
)
|
| 517 |
+
},
|
| 518 |
+
standard_params={
|
| 519 |
+
"start_date": start_date,
|
| 520 |
+
"end_date": end_date,
|
| 521 |
+
},
|
| 522 |
+
extra_params=kwargs,
|
| 523 |
+
info={
|
| 524 |
+
"topic": {
|
| 525 |
+
"fred": {
|
| 526 |
+
"multiple_items_allowed": True,
|
| 527 |
+
"choices": [
|
| 528 |
+
"business_outlook",
|
| 529 |
+
"hours_worked",
|
| 530 |
+
"employment",
|
| 531 |
+
"inventories",
|
| 532 |
+
"prices_received",
|
| 533 |
+
"prices_paid",
|
| 534 |
+
"capex",
|
| 535 |
+
"unfilled_orders",
|
| 536 |
+
"new_orders",
|
| 537 |
+
"shipments",
|
| 538 |
+
"delivery_times",
|
| 539 |
+
],
|
| 540 |
+
"x-widget_config": {"value": "new_orders"},
|
| 541 |
+
}
|
| 542 |
+
}
|
| 543 |
+
},
|
| 544 |
+
)
|
| 545 |
+
)
|
| 546 |
+
|
| 547 |
+
@exception_handler
|
| 548 |
+
@validate
|
| 549 |
+
def manufacturing_outlook_texas(
|
| 550 |
+
self,
|
| 551 |
+
start_date: Annotated[
|
| 552 |
+
Union[datetime.date, None, str],
|
| 553 |
+
OpenBBField(description="Start date of the data, in YYYY-MM-DD format."),
|
| 554 |
+
] = None,
|
| 555 |
+
end_date: Annotated[
|
| 556 |
+
Union[datetime.date, None, str],
|
| 557 |
+
OpenBBField(description="End date of the data, in YYYY-MM-DD format."),
|
| 558 |
+
] = None,
|
| 559 |
+
provider: Annotated[
|
| 560 |
+
Optional[Literal["fred"]],
|
| 561 |
+
OpenBBField(
|
| 562 |
+
description="The provider to use, by default None. If None, the priority list configured in the settings is used. Default priority: fred."
|
| 563 |
+
),
|
| 564 |
+
] = None,
|
| 565 |
+
**kwargs
|
| 566 |
+
) -> OBBject:
|
| 567 |
+
"""Get The Manufacturing Outlook Survey For The Texas Region.
|
| 568 |
+
|
| 569 |
+
Parameters
|
| 570 |
+
----------
|
| 571 |
+
provider : str
|
| 572 |
+
The provider to use, by default None. If None, the priority list configured in the settings is used. Default priority: fred.
|
| 573 |
+
start_date : Union[date, None, str]
|
| 574 |
+
Start date of the data, in YYYY-MM-DD format.
|
| 575 |
+
end_date : Union[date, None, str]
|
| 576 |
+
End date of the data, in YYYY-MM-DD format.
|
| 577 |
+
topic : Union[Literal['business_activity', 'business_outlook', 'capex', 'prices_paid', 'production', 'inventory', 'new_orders', 'new_orders_growth', 'unfilled_orders', 'shipments', 'delivery_time', 'employment', 'wages', 'hours_worked'], str]
|
| 578 |
+
The topic for the survey response. Multiple comma separated items allowed. (provider: fred)
|
| 579 |
+
frequency : Optional[Literal['annual', 'quarter']]
|
| 580 |
+
|
| 581 |
+
Frequency aggregation to convert monthly data to lower frequency. None is monthly.
|
| 582 |
+
(provider: fred)
|
| 583 |
+
aggregation_method : Optional[Literal['avg', 'sum', 'eop']]
|
| 584 |
+
|
| 585 |
+
A key that indicates the aggregation method used for frequency aggregation.
|
| 586 |
+
avg = Average
|
| 587 |
+
sum = Sum
|
| 588 |
+
eop = End of Period
|
| 589 |
+
(provider: fred)
|
| 590 |
+
transform : Optional[Literal['chg', 'ch1', 'pch', 'pc1', 'pca', 'cch', 'cca', 'log']]
|
| 591 |
+
|
| 592 |
+
Transformation type
|
| 593 |
+
None = No transformation
|
| 594 |
+
chg = Change
|
| 595 |
+
ch1 = Change from Year Ago
|
| 596 |
+
pch = Percent Change
|
| 597 |
+
pc1 = Percent Change from Year Ago
|
| 598 |
+
pca = Compounded Annual Rate of Change
|
| 599 |
+
cch = Continuously Compounded Rate of Change
|
| 600 |
+
cca = Continuously Compounded Annual Rate of Change
|
| 601 |
+
log = Natural Log
|
| 602 |
+
(provider: fred)
|
| 603 |
+
|
| 604 |
+
Returns
|
| 605 |
+
-------
|
| 606 |
+
OBBject
|
| 607 |
+
results : list[ManufacturingOutlookTexas]
|
| 608 |
+
Serializable results.
|
| 609 |
+
provider : Optional[str]
|
| 610 |
+
Provider name.
|
| 611 |
+
warnings : Optional[list[Warning_]]
|
| 612 |
+
list of warnings.
|
| 613 |
+
chart : Optional[Chart]
|
| 614 |
+
Chart object.
|
| 615 |
+
extra : Dict[str, Any]
|
| 616 |
+
Extra info.
|
| 617 |
+
|
| 618 |
+
ManufacturingOutlookTexas
|
| 619 |
+
-------------------------
|
| 620 |
+
date : date
|
| 621 |
+
The date of the data.
|
| 622 |
+
topic : Optional[str]
|
| 623 |
+
Topic of the survey response.
|
| 624 |
+
diffusion_index : Optional[float]
|
| 625 |
+
Diffusion Index.
|
| 626 |
+
percent_reporting_increase : Optional[float]
|
| 627 |
+
Percent of respondents reporting an increase over the last month.
|
| 628 |
+
percent_reporting_decrease : Optional[float]
|
| 629 |
+
Percent of respondents reporting a decrease over the last month.
|
| 630 |
+
percent_reporting_no_change : Optional[float]
|
| 631 |
+
Percent of respondents reporting no change over the last month.
|
| 632 |
+
|
| 633 |
+
Examples
|
| 634 |
+
--------
|
| 635 |
+
>>> from openbb import obb
|
| 636 |
+
>>> obb.economy.survey.manufacturing_outlook_texas(provider='fred')
|
| 637 |
+
>>> obb.economy.survey.manufacturing_outlook_texas(topic='business_outlook,new_orders', transform='pc1', provider='fred')
|
| 638 |
+
""" # noqa: E501
|
| 639 |
+
|
| 640 |
+
return self._run(
|
| 641 |
+
"/economy/survey/manufacturing_outlook_texas",
|
| 642 |
+
**filter_inputs(
|
| 643 |
+
provider_choices={
|
| 644 |
+
"provider": self._get_provider(
|
| 645 |
+
provider,
|
| 646 |
+
"economy.survey.manufacturing_outlook_texas",
|
| 647 |
+
("fred",),
|
| 648 |
+
)
|
| 649 |
+
},
|
| 650 |
+
standard_params={
|
| 651 |
+
"start_date": start_date,
|
| 652 |
+
"end_date": end_date,
|
| 653 |
+
},
|
| 654 |
+
extra_params=kwargs,
|
| 655 |
+
info={
|
| 656 |
+
"topic": {
|
| 657 |
+
"fred": {
|
| 658 |
+
"multiple_items_allowed": True,
|
| 659 |
+
"choices": [
|
| 660 |
+
"business_activity",
|
| 661 |
+
"business_outlook",
|
| 662 |
+
"capex",
|
| 663 |
+
"prices_paid",
|
| 664 |
+
"production",
|
| 665 |
+
"inventory",
|
| 666 |
+
"new_orders",
|
| 667 |
+
"new_orders_growth",
|
| 668 |
+
"unfilled_orders",
|
| 669 |
+
"shipments",
|
| 670 |
+
"delivery_time",
|
| 671 |
+
"employment",
|
| 672 |
+
"wages",
|
| 673 |
+
"hours_worked",
|
| 674 |
+
],
|
| 675 |
+
}
|
| 676 |
+
}
|
| 677 |
+
},
|
| 678 |
+
)
|
| 679 |
+
)
|
| 680 |
+
|
| 681 |
+
@exception_handler
|
| 682 |
+
@validate
|
| 683 |
+
def nonfarm_payrolls(
|
| 684 |
+
self,
|
| 685 |
+
date: Annotated[
|
| 686 |
+
Union[datetime.date, str, None, list[Union[datetime.date, str, None]]],
|
| 687 |
+
OpenBBField(
|
| 688 |
+
description="A specific date to get data for. Default is the latest report. Multiple comma separated items allowed for provider(s): fred."
|
| 689 |
+
),
|
| 690 |
+
] = None,
|
| 691 |
+
provider: Annotated[
|
| 692 |
+
Optional[Literal["fred"]],
|
| 693 |
+
OpenBBField(
|
| 694 |
+
description="The provider to use, by default None. If None, the priority list configured in the settings is used. Default priority: fred."
|
| 695 |
+
),
|
| 696 |
+
] = None,
|
| 697 |
+
**kwargs
|
| 698 |
+
) -> OBBject:
|
| 699 |
+
"""Get Nonfarm Payrolls Survey.
|
| 700 |
+
|
| 701 |
+
Parameters
|
| 702 |
+
----------
|
| 703 |
+
provider : str
|
| 704 |
+
The provider to use, by default None. If None, the priority list configured in the settings is used. Default priority: fred.
|
| 705 |
+
date : Union[date, str, None, list[Union[date, str, None]]]
|
| 706 |
+
A specific date to get data for. Default is the latest report. Multiple comma separated items allowed for provider(s): fred.
|
| 707 |
+
category : Literal['employees_nsa', 'employees_sa', 'employees_production_and_nonsupervisory', 'employees_women', 'employees_women_percent', 'avg_hours', 'avg_hours_production_and_nonsupervisory', 'avg_hours_overtime', 'avg_hours_overtime_production_and_nonsupervisory', 'avg_earnings_hourly', 'avg_earnings_hourly_production_and_nonsupervisory', 'avg_earnings_weekly', 'avg_earnings_weekly_production_and_nonsupervisory', 'index_weekly_hours', 'index_weekly_hours_production_and_nonsupervisory', 'index_weekly_payrolls', 'index_weekly_payrolls_production_and_nonsupervisory']
|
| 708 |
+
The category to query. (provider: fred)
|
| 709 |
+
|
| 710 |
+
Returns
|
| 711 |
+
-------
|
| 712 |
+
OBBject
|
| 713 |
+
results : list[NonFarmPayrolls]
|
| 714 |
+
Serializable results.
|
| 715 |
+
provider : Optional[str]
|
| 716 |
+
Provider name.
|
| 717 |
+
warnings : Optional[list[Warning_]]
|
| 718 |
+
list of warnings.
|
| 719 |
+
chart : Optional[Chart]
|
| 720 |
+
Chart object.
|
| 721 |
+
extra : Dict[str, Any]
|
| 722 |
+
Extra info.
|
| 723 |
+
|
| 724 |
+
NonFarmPayrolls
|
| 725 |
+
---------------
|
| 726 |
+
date : date
|
| 727 |
+
The date of the data.
|
| 728 |
+
symbol : str
|
| 729 |
+
Symbol representing the entity requested in the data.
|
| 730 |
+
value : float
|
| 731 |
+
|
| 732 |
+
name : Optional[str]
|
| 733 |
+
The name of the series. (provider: fred)
|
| 734 |
+
element_id : Optional[str]
|
| 735 |
+
The element id in the parent/child relationship. (provider: fred)
|
| 736 |
+
parent_id : Optional[str]
|
| 737 |
+
The parent id in the parent/child relationship. (provider: fred)
|
| 738 |
+
children : Optional[str]
|
| 739 |
+
The element_id of each child, as a comma-separated string. (provider: fred)
|
| 740 |
+
level : Optional[int]
|
| 741 |
+
The indentation level of the element. (provider: fred)
|
| 742 |
+
|
| 743 |
+
Examples
|
| 744 |
+
--------
|
| 745 |
+
>>> from openbb import obb
|
| 746 |
+
>>> obb.economy.survey.nonfarm_payrolls(provider='fred')
|
| 747 |
+
>>> obb.economy.survey.nonfarm_payrolls(category='avg_hours', provider='fred')
|
| 748 |
+
""" # noqa: E501
|
| 749 |
+
|
| 750 |
+
return self._run(
|
| 751 |
+
"/economy/survey/nonfarm_payrolls",
|
| 752 |
+
**filter_inputs(
|
| 753 |
+
provider_choices={
|
| 754 |
+
"provider": self._get_provider(
|
| 755 |
+
provider,
|
| 756 |
+
"economy.survey.nonfarm_payrolls",
|
| 757 |
+
("fred",),
|
| 758 |
+
)
|
| 759 |
+
},
|
| 760 |
+
standard_params={
|
| 761 |
+
"date": date,
|
| 762 |
+
},
|
| 763 |
+
extra_params=kwargs,
|
| 764 |
+
info={
|
| 765 |
+
"date": {"fred": {"multiple_items_allowed": True, "choices": None}}
|
| 766 |
+
},
|
| 767 |
+
)
|
| 768 |
+
)
|
| 769 |
+
|
| 770 |
+
@exception_handler
|
| 771 |
+
@validate
|
| 772 |
+
def sloos(
|
| 773 |
+
self,
|
| 774 |
+
start_date: Annotated[
|
| 775 |
+
Union[datetime.date, None, str],
|
| 776 |
+
OpenBBField(description="Start date of the data, in YYYY-MM-DD format."),
|
| 777 |
+
] = None,
|
| 778 |
+
end_date: Annotated[
|
| 779 |
+
Union[datetime.date, None, str],
|
| 780 |
+
OpenBBField(description="End date of the data, in YYYY-MM-DD format."),
|
| 781 |
+
] = None,
|
| 782 |
+
provider: Annotated[
|
| 783 |
+
Optional[Literal["fred"]],
|
| 784 |
+
OpenBBField(
|
| 785 |
+
description="The provider to use, by default None. If None, the priority list configured in the settings is used. Default priority: fred."
|
| 786 |
+
),
|
| 787 |
+
] = None,
|
| 788 |
+
**kwargs
|
| 789 |
+
) -> OBBject:
|
| 790 |
+
"""Get Senior Loan Officers Opinion Survey.
|
| 791 |
+
|
| 792 |
+
Parameters
|
| 793 |
+
----------
|
| 794 |
+
provider : str
|
| 795 |
+
The provider to use, by default None. If None, the priority list configured in the settings is used. Default priority: fred.
|
| 796 |
+
start_date : Union[date, None, str]
|
| 797 |
+
Start date of the data, in YYYY-MM-DD format.
|
| 798 |
+
end_date : Union[date, None, str]
|
| 799 |
+
End date of the data, in YYYY-MM-DD format.
|
| 800 |
+
category : Literal['spreads', 'consumer', 'auto', 'credit_card', 'firms', 'mortgage', 'commercial_real_estate', 'standards', 'demand', 'foreign_banks']
|
| 801 |
+
Category of survey response. (provider: fred)
|
| 802 |
+
transform : Optional[Literal['chg', 'ch1', 'pch', 'pc1', 'pca', 'cch', 'cca', 'log']]
|
| 803 |
+
|
| 804 |
+
Transformation type
|
| 805 |
+
None = No transformation
|
| 806 |
+
chg = Change
|
| 807 |
+
ch1 = Change from Year Ago
|
| 808 |
+
pch = Percent Change
|
| 809 |
+
pc1 = Percent Change from Year Ago
|
| 810 |
+
pca = Compounded Annual Rate of Change
|
| 811 |
+
cch = Continuously Compounded Rate of Change
|
| 812 |
+
cca = Continuously Compounded Annual Rate of Change
|
| 813 |
+
log = Natural Log
|
| 814 |
+
(provider: fred)
|
| 815 |
+
|
| 816 |
+
Returns
|
| 817 |
+
-------
|
| 818 |
+
OBBject
|
| 819 |
+
results : list[SeniorLoanOfficerSurvey]
|
| 820 |
+
Serializable results.
|
| 821 |
+
provider : Optional[str]
|
| 822 |
+
Provider name.
|
| 823 |
+
warnings : Optional[list[Warning_]]
|
| 824 |
+
list of warnings.
|
| 825 |
+
chart : Optional[Chart]
|
| 826 |
+
Chart object.
|
| 827 |
+
extra : Dict[str, Any]
|
| 828 |
+
Extra info.
|
| 829 |
+
|
| 830 |
+
SeniorLoanOfficerSurvey
|
| 831 |
+
-----------------------
|
| 832 |
+
date : date
|
| 833 |
+
The date of the data.
|
| 834 |
+
symbol : Optional[str]
|
| 835 |
+
Symbol representing the entity requested in the data.
|
| 836 |
+
value : float
|
| 837 |
+
Survey value.
|
| 838 |
+
title : Optional[str]
|
| 839 |
+
Survey title.
|
| 840 |
+
|
| 841 |
+
Examples
|
| 842 |
+
--------
|
| 843 |
+
>>> from openbb import obb
|
| 844 |
+
>>> obb.economy.survey.sloos(provider='fred')
|
| 845 |
+
>>> obb.economy.survey.sloos(category='credit_card', provider='fred')
|
| 846 |
+
""" # noqa: E501
|
| 847 |
+
|
| 848 |
+
return self._run(
|
| 849 |
+
"/economy/survey/sloos",
|
| 850 |
+
**filter_inputs(
|
| 851 |
+
provider_choices={
|
| 852 |
+
"provider": self._get_provider(
|
| 853 |
+
provider,
|
| 854 |
+
"economy.survey.sloos",
|
| 855 |
+
("fred",),
|
| 856 |
+
)
|
| 857 |
+
},
|
| 858 |
+
standard_params={
|
| 859 |
+
"start_date": start_date,
|
| 860 |
+
"end_date": end_date,
|
| 861 |
+
},
|
| 862 |
+
extra_params=kwargs,
|
| 863 |
+
)
|
| 864 |
+
)
|
| 865 |
+
|
| 866 |
+
@exception_handler
|
| 867 |
+
@validate
|
| 868 |
+
def university_of_michigan(
|
| 869 |
+
self,
|
| 870 |
+
start_date: Annotated[
|
| 871 |
+
Union[datetime.date, None, str],
|
| 872 |
+
OpenBBField(description="Start date of the data, in YYYY-MM-DD format."),
|
| 873 |
+
] = None,
|
| 874 |
+
end_date: Annotated[
|
| 875 |
+
Union[datetime.date, None, str],
|
| 876 |
+
OpenBBField(description="End date of the data, in YYYY-MM-DD format."),
|
| 877 |
+
] = None,
|
| 878 |
+
provider: Annotated[
|
| 879 |
+
Optional[Literal["fred"]],
|
| 880 |
+
OpenBBField(
|
| 881 |
+
description="The provider to use, by default None. If None, the priority list configured in the settings is used. Default priority: fred."
|
| 882 |
+
),
|
| 883 |
+
] = None,
|
| 884 |
+
**kwargs
|
| 885 |
+
) -> OBBject:
|
| 886 |
+
"""Get University of Michigan Consumer Sentiment and Inflation Expectations Surveys.
|
| 887 |
+
|
| 888 |
+
Parameters
|
| 889 |
+
----------
|
| 890 |
+
provider : str
|
| 891 |
+
The provider to use, by default None. If None, the priority list configured in the settings is used. Default priority: fred.
|
| 892 |
+
start_date : Union[date, None, str]
|
| 893 |
+
Start date of the data, in YYYY-MM-DD format.
|
| 894 |
+
end_date : Union[date, None, str]
|
| 895 |
+
End date of the data, in YYYY-MM-DD format.
|
| 896 |
+
frequency : Optional[Literal['quarter', 'annual']]
|
| 897 |
+
Frequency aggregation to convert monthly data to lower frequency. None is monthly. (provider: fred)
|
| 898 |
+
aggregation_method : Optional[Literal['avg', 'sum', 'eop']]
|
| 899 |
+
A key that indicates the aggregation method used for frequency aggregation.
|
| 900 |
+
|
| 901 |
+
avg = Average
|
| 902 |
+
|
| 903 |
+
sum = Sum
|
| 904 |
+
|
| 905 |
+
eop = End of Period
|
| 906 |
+
(provider: fred)
|
| 907 |
+
transform : Optional[Literal['chg', 'ch1', 'pch', 'pc1', 'pca', 'cch', 'cca', 'log']]
|
| 908 |
+
Transformation type
|
| 909 |
+
|
| 910 |
+
None = No transformation
|
| 911 |
+
|
| 912 |
+
chg = Change
|
| 913 |
+
|
| 914 |
+
ch1 = Change from Year Ago
|
| 915 |
+
|
| 916 |
+
pch = Percent Change
|
| 917 |
+
|
| 918 |
+
pc1 = Percent Change from Year Ago
|
| 919 |
+
|
| 920 |
+
pca = Compounded Annual Rate of Change
|
| 921 |
+
|
| 922 |
+
cch = Continuously Compounded Rate of Change
|
| 923 |
+
|
| 924 |
+
cca = Continuously Compounded Annual Rate of Change
|
| 925 |
+
|
| 926 |
+
log = Natural Log
|
| 927 |
+
(provider: fred)
|
| 928 |
+
|
| 929 |
+
Returns
|
| 930 |
+
-------
|
| 931 |
+
OBBject
|
| 932 |
+
results : list[UniversityOfMichigan]
|
| 933 |
+
Serializable results.
|
| 934 |
+
provider : Optional[str]
|
| 935 |
+
Provider name.
|
| 936 |
+
warnings : Optional[list[Warning_]]
|
| 937 |
+
list of warnings.
|
| 938 |
+
chart : Optional[Chart]
|
| 939 |
+
Chart object.
|
| 940 |
+
extra : Dict[str, Any]
|
| 941 |
+
Extra info.
|
| 942 |
+
|
| 943 |
+
UniversityOfMichigan
|
| 944 |
+
--------------------
|
| 945 |
+
date : date
|
| 946 |
+
The date of the data.
|
| 947 |
+
consumer_sentiment : Optional[float]
|
| 948 |
+
Index of the results of the University of Michigan's monthly Survey of Consumers, which is used to estimate future spending and saving. (1966:Q1=100).
|
| 949 |
+
inflation_expectation : Optional[float]
|
| 950 |
+
Median expected price change next 12 months, Surveys of Consumers.
|
| 951 |
+
|
| 952 |
+
Examples
|
| 953 |
+
--------
|
| 954 |
+
>>> from openbb import obb
|
| 955 |
+
>>> obb.economy.survey.university_of_michigan(provider='fred')
|
| 956 |
+
""" # noqa: E501
|
| 957 |
+
|
| 958 |
+
return self._run(
|
| 959 |
+
"/economy/survey/university_of_michigan",
|
| 960 |
+
**filter_inputs(
|
| 961 |
+
provider_choices={
|
| 962 |
+
"provider": self._get_provider(
|
| 963 |
+
provider,
|
| 964 |
+
"economy.survey.university_of_michigan",
|
| 965 |
+
("fred",),
|
| 966 |
+
)
|
| 967 |
+
},
|
| 968 |
+
standard_params={
|
| 969 |
+
"start_date": start_date,
|
| 970 |
+
"end_date": end_date,
|
| 971 |
+
},
|
| 972 |
+
extra_params=kwargs,
|
| 973 |
+
)
|
| 974 |
+
)
|
openbb_platform/openbb/package/equity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
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
### THIS FILE IS AUTO-GENERATED. DO NOT EDIT. ###
|
| 2 |
+
|
| 3 |
+
import datetime
|
| 4 |
+
from typing import Literal, Optional, Union
|
| 5 |
+
|
| 6 |
+
from openbb_core.app.model.field import OpenBBField
|
| 7 |
+
from openbb_core.app.model.obbject import OBBject
|
| 8 |
+
from openbb_core.app.static.container import Container
|
| 9 |
+
from openbb_core.app.static.utils.decorators import exception_handler, validate
|
| 10 |
+
from openbb_core.app.static.utils.filters import filter_inputs
|
| 11 |
+
from typing_extensions import Annotated
|
| 12 |
+
|
| 13 |
+
|
| 14 |
+
class ROUTER_equity(Container):
|
| 15 |
+
"""/equity
|
| 16 |
+
/calendar
|
| 17 |
+
/compare
|
| 18 |
+
/discovery
|
| 19 |
+
/estimates
|
| 20 |
+
/fundamental
|
| 21 |
+
historical_market_cap
|
| 22 |
+
market_snapshots
|
| 23 |
+
/ownership
|
| 24 |
+
/price
|
| 25 |
+
profile
|
| 26 |
+
screener
|
| 27 |
+
search
|
| 28 |
+
/shorts
|
| 29 |
+
"""
|
| 30 |
+
|
| 31 |
+
def __repr__(self) -> str:
|
| 32 |
+
return self.__doc__ or ""
|
| 33 |
+
|
| 34 |
+
@property
|
| 35 |
+
def calendar(self):
|
| 36 |
+
# pylint: disable=import-outside-toplevel
|
| 37 |
+
from . import equity_calendar
|
| 38 |
+
|
| 39 |
+
return equity_calendar.ROUTER_equity_calendar(
|
| 40 |
+
command_runner=self._command_runner
|
| 41 |
+
)
|
| 42 |
+
|
| 43 |
+
@property
|
| 44 |
+
def compare(self):
|
| 45 |
+
# pylint: disable=import-outside-toplevel
|
| 46 |
+
from . import equity_compare
|
| 47 |
+
|
| 48 |
+
return equity_compare.ROUTER_equity_compare(command_runner=self._command_runner)
|
| 49 |
+
|
| 50 |
+
@property
|
| 51 |
+
def discovery(self):
|
| 52 |
+
# pylint: disable=import-outside-toplevel
|
| 53 |
+
from . import equity_discovery
|
| 54 |
+
|
| 55 |
+
return equity_discovery.ROUTER_equity_discovery(
|
| 56 |
+
command_runner=self._command_runner
|
| 57 |
+
)
|
| 58 |
+
|
| 59 |
+
@property
|
| 60 |
+
def estimates(self):
|
| 61 |
+
# pylint: disable=import-outside-toplevel
|
| 62 |
+
from . import equity_estimates
|
| 63 |
+
|
| 64 |
+
return equity_estimates.ROUTER_equity_estimates(
|
| 65 |
+
command_runner=self._command_runner
|
| 66 |
+
)
|
| 67 |
+
|
| 68 |
+
@property
|
| 69 |
+
def fundamental(self):
|
| 70 |
+
# pylint: disable=import-outside-toplevel
|
| 71 |
+
from . import equity_fundamental
|
| 72 |
+
|
| 73 |
+
return equity_fundamental.ROUTER_equity_fundamental(
|
| 74 |
+
command_runner=self._command_runner
|
| 75 |
+
)
|
| 76 |
+
|
| 77 |
+
@exception_handler
|
| 78 |
+
@validate
|
| 79 |
+
def historical_market_cap(
|
| 80 |
+
self,
|
| 81 |
+
symbol: Annotated[
|
| 82 |
+
Union[str, list[str]],
|
| 83 |
+
OpenBBField(
|
| 84 |
+
description="Symbol to get data for. Multiple comma separated items allowed for provider(s): fmp, intrinio."
|
| 85 |
+
),
|
| 86 |
+
],
|
| 87 |
+
start_date: Annotated[
|
| 88 |
+
Union[datetime.date, None, str],
|
| 89 |
+
OpenBBField(description="Start date of the data, in YYYY-MM-DD format."),
|
| 90 |
+
] = None,
|
| 91 |
+
end_date: Annotated[
|
| 92 |
+
Union[datetime.date, None, str],
|
| 93 |
+
OpenBBField(description="End date of the data, in YYYY-MM-DD format."),
|
| 94 |
+
] = None,
|
| 95 |
+
provider: Annotated[
|
| 96 |
+
Optional[Literal["fmp", "intrinio"]],
|
| 97 |
+
OpenBBField(
|
| 98 |
+
description="The provider to use, by default None. If None, the priority list configured in the settings is used. Default priority: fmp, intrinio."
|
| 99 |
+
),
|
| 100 |
+
] = None,
|
| 101 |
+
**kwargs
|
| 102 |
+
) -> OBBject:
|
| 103 |
+
"""Get the historical market cap of a ticker symbol.
|
| 104 |
+
|
| 105 |
+
Parameters
|
| 106 |
+
----------
|
| 107 |
+
provider : str
|
| 108 |
+
The provider to use, by default None. If None, the priority list configured in the settings is used. Default priority: fmp, intrinio.
|
| 109 |
+
symbol : Union[str, list[str]]
|
| 110 |
+
Symbol to get data for. Multiple comma separated items allowed for provider(s): fmp, intrinio.
|
| 111 |
+
start_date : Union[date, None, str]
|
| 112 |
+
Start date of the data, in YYYY-MM-DD format.
|
| 113 |
+
end_date : Union[date, None, str]
|
| 114 |
+
End date of the data, in YYYY-MM-DD format.
|
| 115 |
+
interval : Literal['day', 'week', 'month', 'quarter', 'year']
|
| 116 |
+
None
|
| 117 |
+
|
| 118 |
+
Returns
|
| 119 |
+
-------
|
| 120 |
+
OBBject
|
| 121 |
+
results : list[HistoricalMarketCap]
|
| 122 |
+
Serializable results.
|
| 123 |
+
provider : Optional[str]
|
| 124 |
+
Provider name.
|
| 125 |
+
warnings : Optional[list[Warning_]]
|
| 126 |
+
list of warnings.
|
| 127 |
+
chart : Optional[Chart]
|
| 128 |
+
Chart object.
|
| 129 |
+
extra : Dict[str, Any]
|
| 130 |
+
Extra info.
|
| 131 |
+
|
| 132 |
+
HistoricalMarketCap
|
| 133 |
+
-------------------
|
| 134 |
+
date : date
|
| 135 |
+
The date of the data.
|
| 136 |
+
symbol : str
|
| 137 |
+
Symbol representing the entity requested in the data.
|
| 138 |
+
market_cap : Union[int, float]
|
| 139 |
+
Market capitalization of the security.
|
| 140 |
+
|
| 141 |
+
Examples
|
| 142 |
+
--------
|
| 143 |
+
>>> from openbb import obb
|
| 144 |
+
>>> obb.equity.historical_market_cap(provider='fmp', symbol='AAPL')
|
| 145 |
+
""" # noqa: E501
|
| 146 |
+
|
| 147 |
+
return self._run(
|
| 148 |
+
"/equity/historical_market_cap",
|
| 149 |
+
**filter_inputs(
|
| 150 |
+
provider_choices={
|
| 151 |
+
"provider": self._get_provider(
|
| 152 |
+
provider,
|
| 153 |
+
"equity.historical_market_cap",
|
| 154 |
+
("fmp", "intrinio"),
|
| 155 |
+
)
|
| 156 |
+
},
|
| 157 |
+
standard_params={
|
| 158 |
+
"symbol": symbol,
|
| 159 |
+
"start_date": start_date,
|
| 160 |
+
"end_date": end_date,
|
| 161 |
+
},
|
| 162 |
+
extra_params=kwargs,
|
| 163 |
+
info={
|
| 164 |
+
"symbol": {
|
| 165 |
+
"fmp": {"multiple_items_allowed": True, "choices": None},
|
| 166 |
+
"intrinio": {"multiple_items_allowed": True, "choices": None},
|
| 167 |
+
},
|
| 168 |
+
"interval": {
|
| 169 |
+
"intrinio": {
|
| 170 |
+
"multiple_items_allowed": False,
|
| 171 |
+
"choices": ["day", "week", "month", "quarter", "year"],
|
| 172 |
+
}
|
| 173 |
+
},
|
| 174 |
+
},
|
| 175 |
+
)
|
| 176 |
+
)
|
| 177 |
+
|
| 178 |
+
@exception_handler
|
| 179 |
+
@validate
|
| 180 |
+
def market_snapshots(
|
| 181 |
+
self,
|
| 182 |
+
provider: Annotated[
|
| 183 |
+
Optional[Literal["fmp", "intrinio", "polygon"]],
|
| 184 |
+
OpenBBField(
|
| 185 |
+
description="The provider to use, by default None. If None, the priority list configured in the settings is used. Default priority: fmp, intrinio, polygon."
|
| 186 |
+
),
|
| 187 |
+
] = None,
|
| 188 |
+
**kwargs
|
| 189 |
+
) -> OBBject:
|
| 190 |
+
"""Get an updated equity market snapshot. This includes price data for thousands of stocks.
|
| 191 |
+
|
| 192 |
+
Parameters
|
| 193 |
+
----------
|
| 194 |
+
provider : str
|
| 195 |
+
The provider to use, by default None. If None, the priority list configured in the settings is used. Default priority: fmp, intrinio, polygon.
|
| 196 |
+
market : Literal['amex', 'ams', 'ase', 'asx', 'ath', 'bme', 'bru', 'bud', 'bue', 'cai', 'cnq', 'cph', 'dfm', 'doh', 'etf', 'euronext', 'hel', 'hkse', 'ice', 'iob', 'ist', 'jkt', 'jnb', 'jpx', 'kls', 'koe', 'ksc', 'kuw', 'lse', 'mex', 'mutual_fund', 'nasdaq', 'neo', 'nse', 'nyse', 'nze', 'osl', 'otc', 'pnk', 'pra', 'ris', 'sao', 'sau', 'set', 'sgo', 'shh', 'shz', 'six', 'sto', 'tai', 'tlv', 'tsx', 'two', 'vie', 'wse', 'xetra']
|
| 197 |
+
The market to fetch data for. (provider: fmp)
|
| 198 |
+
date : Union[date, datetime, str, None]
|
| 199 |
+
The date of the data. Can be a datetime or an ISO datetime string. Historical data appears to go back to mid-June 2022. Example: '2024-03-08T12:15:00+0400' (provider: intrinio)
|
| 200 |
+
|
| 201 |
+
Returns
|
| 202 |
+
-------
|
| 203 |
+
OBBject
|
| 204 |
+
results : list[MarketSnapshots]
|
| 205 |
+
Serializable results.
|
| 206 |
+
provider : Optional[str]
|
| 207 |
+
Provider name.
|
| 208 |
+
warnings : Optional[list[Warning_]]
|
| 209 |
+
list of warnings.
|
| 210 |
+
chart : Optional[Chart]
|
| 211 |
+
Chart object.
|
| 212 |
+
extra : Dict[str, Any]
|
| 213 |
+
Extra info.
|
| 214 |
+
|
| 215 |
+
MarketSnapshots
|
| 216 |
+
---------------
|
| 217 |
+
symbol : str
|
| 218 |
+
Symbol representing the entity requested in the data.
|
| 219 |
+
open : Optional[float]
|
| 220 |
+
The open price.
|
| 221 |
+
high : Optional[float]
|
| 222 |
+
The high price.
|
| 223 |
+
low : Optional[float]
|
| 224 |
+
The low price.
|
| 225 |
+
close : Optional[float]
|
| 226 |
+
The close price.
|
| 227 |
+
volume : Optional[int]
|
| 228 |
+
The trading volume.
|
| 229 |
+
prev_close : Optional[float]
|
| 230 |
+
The previous close price.
|
| 231 |
+
change : Optional[float]
|
| 232 |
+
The change in price from the previous close.
|
| 233 |
+
change_percent : Optional[float]
|
| 234 |
+
The change in price from the previous close, as a normalized percent.
|
| 235 |
+
last_price : Optional[float]
|
| 236 |
+
The last price of the stock. (provider: fmp);
|
| 237 |
+
The last trade price. (provider: intrinio)
|
| 238 |
+
last_price_timestamp : Optional[Union[date, datetime]]
|
| 239 |
+
The timestamp of the last price. (provider: fmp)
|
| 240 |
+
ma50 : Optional[float]
|
| 241 |
+
The 50-day moving average. (provider: fmp)
|
| 242 |
+
ma200 : Optional[float]
|
| 243 |
+
The 200-day moving average. (provider: fmp)
|
| 244 |
+
year_high : Optional[float]
|
| 245 |
+
The 52-week high. (provider: fmp)
|
| 246 |
+
year_low : Optional[float]
|
| 247 |
+
The 52-week low. (provider: fmp)
|
| 248 |
+
volume_avg : Optional[int]
|
| 249 |
+
Average daily trading volume. (provider: fmp)
|
| 250 |
+
market_cap : Optional[int]
|
| 251 |
+
Market cap of the stock. (provider: fmp)
|
| 252 |
+
eps : Optional[float]
|
| 253 |
+
Earnings per share. (provider: fmp)
|
| 254 |
+
pe : Optional[float]
|
| 255 |
+
Price to earnings ratio. (provider: fmp)
|
| 256 |
+
shares_outstanding : Optional[int]
|
| 257 |
+
Number of shares outstanding. (provider: fmp)
|
| 258 |
+
name : Optional[str]
|
| 259 |
+
The company name associated with the symbol. (provider: fmp)
|
| 260 |
+
exchange : Optional[str]
|
| 261 |
+
The exchange of the stock. (provider: fmp)
|
| 262 |
+
earnings_date : Optional[Union[date, datetime]]
|
| 263 |
+
The upcoming earnings announcement date. (provider: fmp)
|
| 264 |
+
last_size : Optional[int]
|
| 265 |
+
The last trade size. (provider: intrinio)
|
| 266 |
+
last_volume : Optional[int]
|
| 267 |
+
The last trade volume. (provider: intrinio)
|
| 268 |
+
last_trade_timestamp : Optional[datetime]
|
| 269 |
+
The timestamp of the last trade. (provider: intrinio);
|
| 270 |
+
The last trade timestamp. (provider: polygon)
|
| 271 |
+
bid_size : Optional[int]
|
| 272 |
+
The size of the last bid price. Bid price and size is not always available. (provider: intrinio);
|
| 273 |
+
The current bid size. (provider: polygon)
|
| 274 |
+
bid_price : Optional[float]
|
| 275 |
+
The last bid price. Bid price and size is not always available. (provider: intrinio)
|
| 276 |
+
ask_price : Optional[float]
|
| 277 |
+
The last ask price. Ask price and size is not always available. (provider: intrinio)
|
| 278 |
+
ask_size : Optional[int]
|
| 279 |
+
The size of the last ask price. Ask price and size is not always available. (provider: intrinio);
|
| 280 |
+
The current ask size. (provider: polygon)
|
| 281 |
+
last_bid_timestamp : Optional[datetime]
|
| 282 |
+
The timestamp of the last bid price. Bid price and size is not always available. (provider: intrinio)
|
| 283 |
+
last_ask_timestamp : Optional[datetime]
|
| 284 |
+
The timestamp of the last ask price. Ask price and size is not always available. (provider: intrinio)
|
| 285 |
+
vwap : Optional[float]
|
| 286 |
+
The volume weighted average price of the stock on the current trading day. (provider: polygon)
|
| 287 |
+
prev_open : Optional[float]
|
| 288 |
+
The previous trading session opening price. (provider: polygon)
|
| 289 |
+
prev_high : Optional[float]
|
| 290 |
+
The previous trading session high price. (provider: polygon)
|
| 291 |
+
prev_low : Optional[float]
|
| 292 |
+
The previous trading session low price. (provider: polygon)
|
| 293 |
+
prev_volume : Optional[float]
|
| 294 |
+
The previous trading session volume. (provider: polygon)
|
| 295 |
+
prev_vwap : Optional[float]
|
| 296 |
+
The previous trading session VWAP. (provider: polygon)
|
| 297 |
+
last_updated : Optional[datetime]
|
| 298 |
+
The last time the data was updated. (provider: polygon)
|
| 299 |
+
bid : Optional[float]
|
| 300 |
+
The current bid price. (provider: polygon)
|
| 301 |
+
ask : Optional[float]
|
| 302 |
+
The current ask price. (provider: polygon)
|
| 303 |
+
quote_timestamp : Optional[datetime]
|
| 304 |
+
The timestamp of the last quote. (provider: polygon)
|
| 305 |
+
last_trade_price : Optional[float]
|
| 306 |
+
The last trade price. (provider: polygon)
|
| 307 |
+
last_trade_size : Optional[int]
|
| 308 |
+
The last trade size. (provider: polygon)
|
| 309 |
+
last_trade_conditions : Optional[list[int]]
|
| 310 |
+
The last trade condition codes. (provider: polygon)
|
| 311 |
+
last_trade_exchange : Optional[int]
|
| 312 |
+
The last trade exchange ID code. (provider: polygon)
|
| 313 |
+
|
| 314 |
+
Examples
|
| 315 |
+
--------
|
| 316 |
+
>>> from openbb import obb
|
| 317 |
+
>>> obb.equity.market_snapshots(provider='fmp')
|
| 318 |
+
""" # noqa: E501
|
| 319 |
+
|
| 320 |
+
return self._run(
|
| 321 |
+
"/equity/market_snapshots",
|
| 322 |
+
**filter_inputs(
|
| 323 |
+
provider_choices={
|
| 324 |
+
"provider": self._get_provider(
|
| 325 |
+
provider,
|
| 326 |
+
"equity.market_snapshots",
|
| 327 |
+
("fmp", "intrinio", "polygon"),
|
| 328 |
+
)
|
| 329 |
+
},
|
| 330 |
+
standard_params={},
|
| 331 |
+
extra_params=kwargs,
|
| 332 |
+
info={
|
| 333 |
+
"market": {
|
| 334 |
+
"fmp": {
|
| 335 |
+
"multiple_items_allowed": False,
|
| 336 |
+
"choices": [
|
| 337 |
+
"amex",
|
| 338 |
+
"ams",
|
| 339 |
+
"ase",
|
| 340 |
+
"asx",
|
| 341 |
+
"ath",
|
| 342 |
+
"bme",
|
| 343 |
+
"bru",
|
| 344 |
+
"bud",
|
| 345 |
+
"bue",
|
| 346 |
+
"cai",
|
| 347 |
+
"cnq",
|
| 348 |
+
"cph",
|
| 349 |
+
"dfm",
|
| 350 |
+
"doh",
|
| 351 |
+
"etf",
|
| 352 |
+
"euronext",
|
| 353 |
+
"hel",
|
| 354 |
+
"hkse",
|
| 355 |
+
"ice",
|
| 356 |
+
"iob",
|
| 357 |
+
"ist",
|
| 358 |
+
"jkt",
|
| 359 |
+
"jnb",
|
| 360 |
+
"jpx",
|
| 361 |
+
"kls",
|
| 362 |
+
"koe",
|
| 363 |
+
"ksc",
|
| 364 |
+
"kuw",
|
| 365 |
+
"lse",
|
| 366 |
+
"mex",
|
| 367 |
+
"mutual_fund",
|
| 368 |
+
"nasdaq",
|
| 369 |
+
"neo",
|
| 370 |
+
"nse",
|
| 371 |
+
"nyse",
|
| 372 |
+
"nze",
|
| 373 |
+
"osl",
|
| 374 |
+
"otc",
|
| 375 |
+
"pnk",
|
| 376 |
+
"pra",
|
| 377 |
+
"ris",
|
| 378 |
+
"sao",
|
| 379 |
+
"sau",
|
| 380 |
+
"set",
|
| 381 |
+
"sgo",
|
| 382 |
+
"shh",
|
| 383 |
+
"shz",
|
| 384 |
+
"six",
|
| 385 |
+
"sto",
|
| 386 |
+
"tai",
|
| 387 |
+
"tlv",
|
| 388 |
+
"tsx",
|
| 389 |
+
"two",
|
| 390 |
+
"vie",
|
| 391 |
+
"wse",
|
| 392 |
+
"xetra",
|
| 393 |
+
],
|
| 394 |
+
}
|
| 395 |
+
}
|
| 396 |
+
},
|
| 397 |
+
)
|
| 398 |
+
)
|
| 399 |
+
|
| 400 |
+
@property
|
| 401 |
+
def ownership(self):
|
| 402 |
+
# pylint: disable=import-outside-toplevel
|
| 403 |
+
from . import equity_ownership
|
| 404 |
+
|
| 405 |
+
return equity_ownership.ROUTER_equity_ownership(
|
| 406 |
+
command_runner=self._command_runner
|
| 407 |
+
)
|
| 408 |
+
|
| 409 |
+
@property
|
| 410 |
+
def price(self):
|
| 411 |
+
# pylint: disable=import-outside-toplevel
|
| 412 |
+
from . import equity_price
|
| 413 |
+
|
| 414 |
+
return equity_price.ROUTER_equity_price(command_runner=self._command_runner)
|
| 415 |
+
|
| 416 |
+
@exception_handler
|
| 417 |
+
@validate
|
| 418 |
+
def profile(
|
| 419 |
+
self,
|
| 420 |
+
symbol: Annotated[
|
| 421 |
+
Union[str, list[str]],
|
| 422 |
+
OpenBBField(
|
| 423 |
+
description="Symbol to get data for. Multiple comma separated items allowed for provider(s): fmp, intrinio, yfinance."
|
| 424 |
+
),
|
| 425 |
+
],
|
| 426 |
+
provider: Annotated[
|
| 427 |
+
Optional[Literal["fmp", "intrinio", "yfinance"]],
|
| 428 |
+
OpenBBField(
|
| 429 |
+
description="The provider to use, by default None. If None, the priority list configured in the settings is used. Default priority: fmp, intrinio, yfinance."
|
| 430 |
+
),
|
| 431 |
+
] = None,
|
| 432 |
+
**kwargs
|
| 433 |
+
) -> OBBject:
|
| 434 |
+
"""Get general information about a company. This includes company name, industry, sector and price data.
|
| 435 |
+
|
| 436 |
+
Parameters
|
| 437 |
+
----------
|
| 438 |
+
provider : str
|
| 439 |
+
The provider to use, by default None. If None, the priority list configured in the settings is used. Default priority: fmp, intrinio, yfinance.
|
| 440 |
+
symbol : Union[str, list[str]]
|
| 441 |
+
Symbol to get data for. Multiple comma separated items allowed for provider(s): fmp, intrinio, yfinance.
|
| 442 |
+
|
| 443 |
+
Returns
|
| 444 |
+
-------
|
| 445 |
+
OBBject
|
| 446 |
+
results : list[EquityInfo]
|
| 447 |
+
Serializable results.
|
| 448 |
+
provider : Optional[str]
|
| 449 |
+
Provider name.
|
| 450 |
+
warnings : Optional[list[Warning_]]
|
| 451 |
+
list of warnings.
|
| 452 |
+
chart : Optional[Chart]
|
| 453 |
+
Chart object.
|
| 454 |
+
extra : Dict[str, Any]
|
| 455 |
+
Extra info.
|
| 456 |
+
|
| 457 |
+
EquityInfo
|
| 458 |
+
----------
|
| 459 |
+
symbol : str
|
| 460 |
+
Symbol representing the entity requested in the data.
|
| 461 |
+
name : Optional[str]
|
| 462 |
+
Common name of the company.
|
| 463 |
+
cik : Optional[str]
|
| 464 |
+
Central Index Key (CIK) for the requested entity.
|
| 465 |
+
cusip : Optional[str]
|
| 466 |
+
CUSIP identifier for the company.
|
| 467 |
+
isin : Optional[str]
|
| 468 |
+
International Securities Identification Number.
|
| 469 |
+
lei : Optional[str]
|
| 470 |
+
Legal Entity Identifier assigned to the company.
|
| 471 |
+
legal_name : Optional[str]
|
| 472 |
+
Official legal name of the company.
|
| 473 |
+
stock_exchange : Optional[str]
|
| 474 |
+
Stock exchange where the company is traded.
|
| 475 |
+
sic : Optional[int]
|
| 476 |
+
Standard Industrial Classification code for the company.
|
| 477 |
+
short_description : Optional[str]
|
| 478 |
+
Short description of the company.
|
| 479 |
+
long_description : Optional[str]
|
| 480 |
+
Long description of the company.
|
| 481 |
+
ceo : Optional[str]
|
| 482 |
+
Chief Executive Officer of the company.
|
| 483 |
+
company_url : Optional[str]
|
| 484 |
+
URL of the company's website.
|
| 485 |
+
business_address : Optional[str]
|
| 486 |
+
Address of the company's headquarters.
|
| 487 |
+
mailing_address : Optional[str]
|
| 488 |
+
Mailing address of the company.
|
| 489 |
+
business_phone_no : Optional[str]
|
| 490 |
+
Phone number of the company's headquarters.
|
| 491 |
+
hq_address1 : Optional[str]
|
| 492 |
+
Address of the company's headquarters.
|
| 493 |
+
hq_address2 : Optional[str]
|
| 494 |
+
Address of the company's headquarters.
|
| 495 |
+
hq_address_city : Optional[str]
|
| 496 |
+
City of the company's headquarters.
|
| 497 |
+
hq_address_postal_code : Optional[str]
|
| 498 |
+
Zip code of the company's headquarters.
|
| 499 |
+
hq_state : Optional[str]
|
| 500 |
+
State of the company's headquarters.
|
| 501 |
+
hq_country : Optional[str]
|
| 502 |
+
Country of the company's headquarters.
|
| 503 |
+
inc_state : Optional[str]
|
| 504 |
+
State in which the company is incorporated.
|
| 505 |
+
inc_country : Optional[str]
|
| 506 |
+
Country in which the company is incorporated.
|
| 507 |
+
employees : Optional[int]
|
| 508 |
+
Number of employees working for the company.
|
| 509 |
+
entity_legal_form : Optional[str]
|
| 510 |
+
Legal form of the company.
|
| 511 |
+
entity_status : Optional[str]
|
| 512 |
+
Status of the company.
|
| 513 |
+
latest_filing_date : Optional[date]
|
| 514 |
+
Date of the company's latest filing.
|
| 515 |
+
irs_number : Optional[str]
|
| 516 |
+
IRS number assigned to the company.
|
| 517 |
+
sector : Optional[str]
|
| 518 |
+
Sector in which the company operates.
|
| 519 |
+
industry_category : Optional[str]
|
| 520 |
+
Category of industry in which the company operates.
|
| 521 |
+
industry_group : Optional[str]
|
| 522 |
+
Group of industry in which the company operates.
|
| 523 |
+
template : Optional[str]
|
| 524 |
+
Template used to standardize the company's financial statements.
|
| 525 |
+
standardized_active : Optional[bool]
|
| 526 |
+
Whether the company is active or not.
|
| 527 |
+
first_fundamental_date : Optional[date]
|
| 528 |
+
Date of the company's first fundamental.
|
| 529 |
+
last_fundamental_date : Optional[date]
|
| 530 |
+
Date of the company's last fundamental.
|
| 531 |
+
first_stock_price_date : Optional[date]
|
| 532 |
+
Date of the company's first stock price.
|
| 533 |
+
last_stock_price_date : Optional[date]
|
| 534 |
+
Date of the company's last stock price.
|
| 535 |
+
is_etf : Optional[bool]
|
| 536 |
+
If the symbol is an ETF. (provider: fmp)
|
| 537 |
+
is_actively_trading : Optional[bool]
|
| 538 |
+
If the company is actively trading. (provider: fmp)
|
| 539 |
+
is_adr : Optional[bool]
|
| 540 |
+
If the stock is an ADR. (provider: fmp)
|
| 541 |
+
is_fund : Optional[bool]
|
| 542 |
+
If the company is a fund. (provider: fmp)
|
| 543 |
+
image : Optional[str]
|
| 544 |
+
Image of the company. (provider: fmp)
|
| 545 |
+
currency : Optional[str]
|
| 546 |
+
Currency in which the stock is traded. (provider: fmp, yfinance)
|
| 547 |
+
market_cap : Optional[int]
|
| 548 |
+
Market capitalization of the company. (provider: fmp);
|
| 549 |
+
The market capitalization of the asset. (provider: yfinance)
|
| 550 |
+
last_price : Optional[float]
|
| 551 |
+
The last traded price. (provider: fmp)
|
| 552 |
+
year_high : Optional[float]
|
| 553 |
+
The one-year high of the price. (provider: fmp)
|
| 554 |
+
year_low : Optional[float]
|
| 555 |
+
The one-year low of the price. (provider: fmp)
|
| 556 |
+
volume_avg : Optional[int]
|
| 557 |
+
Average daily trading volume. (provider: fmp)
|
| 558 |
+
annualized_dividend_amount : Optional[float]
|
| 559 |
+
The annualized dividend payment based on the most recent regular dividend payment. (provider: fmp)
|
| 560 |
+
beta : Optional[float]
|
| 561 |
+
Beta of the stock relative to the market. (provider: fmp, yfinance)
|
| 562 |
+
id : Optional[str]
|
| 563 |
+
Intrinio ID for the company. (provider: intrinio)
|
| 564 |
+
thea_enabled : Optional[bool]
|
| 565 |
+
Whether the company has been enabled for Thea. (provider: intrinio)
|
| 566 |
+
exchange_timezone : Optional[str]
|
| 567 |
+
The timezone of the exchange. (provider: yfinance)
|
| 568 |
+
issue_type : Optional[str]
|
| 569 |
+
The issuance type of the asset. (provider: yfinance)
|
| 570 |
+
shares_outstanding : Optional[int]
|
| 571 |
+
The number of listed shares outstanding. (provider: yfinance)
|
| 572 |
+
shares_float : Optional[int]
|
| 573 |
+
The number of shares in the public float. (provider: yfinance)
|
| 574 |
+
shares_implied_outstanding : Optional[int]
|
| 575 |
+
Implied shares outstanding of common equityassuming the conversion of all convertible subsidiary equity into common. (provider: yfinance)
|
| 576 |
+
shares_short : Optional[int]
|
| 577 |
+
The reported number of shares short. (provider: yfinance)
|
| 578 |
+
dividend_yield : Optional[float]
|
| 579 |
+
The dividend yield of the asset, as a normalized percent. (provider: yfinance)
|
| 580 |
+
|
| 581 |
+
Examples
|
| 582 |
+
--------
|
| 583 |
+
>>> from openbb import obb
|
| 584 |
+
>>> obb.equity.profile(symbol='AAPL', provider='fmp')
|
| 585 |
+
""" # noqa: E501
|
| 586 |
+
|
| 587 |
+
return self._run(
|
| 588 |
+
"/equity/profile",
|
| 589 |
+
**filter_inputs(
|
| 590 |
+
provider_choices={
|
| 591 |
+
"provider": self._get_provider(
|
| 592 |
+
provider,
|
| 593 |
+
"equity.profile",
|
| 594 |
+
("fmp", "intrinio", "yfinance"),
|
| 595 |
+
)
|
| 596 |
+
},
|
| 597 |
+
standard_params={
|
| 598 |
+
"symbol": symbol,
|
| 599 |
+
},
|
| 600 |
+
extra_params=kwargs,
|
| 601 |
+
info={
|
| 602 |
+
"symbol": {
|
| 603 |
+
"fmp": {"multiple_items_allowed": True, "choices": None},
|
| 604 |
+
"intrinio": {"multiple_items_allowed": True, "choices": None},
|
| 605 |
+
"yfinance": {"multiple_items_allowed": True, "choices": None},
|
| 606 |
+
}
|
| 607 |
+
},
|
| 608 |
+
)
|
| 609 |
+
)
|
| 610 |
+
|
| 611 |
+
@exception_handler
|
| 612 |
+
@validate
|
| 613 |
+
def screener(
|
| 614 |
+
self,
|
| 615 |
+
provider: Annotated[
|
| 616 |
+
Optional[Literal["fmp", "yfinance"]],
|
| 617 |
+
OpenBBField(
|
| 618 |
+
description="The provider to use, by default None. If None, the priority list configured in the settings is used. Default priority: fmp, yfinance."
|
| 619 |
+
),
|
| 620 |
+
] = None,
|
| 621 |
+
**kwargs
|
| 622 |
+
) -> OBBject:
|
| 623 |
+
"""Screen for companies meeting various criteria.
|
| 624 |
+
|
| 625 |
+
These criteria include market cap, price, beta, volume, and dividend yield.
|
| 626 |
+
|
| 627 |
+
|
| 628 |
+
Parameters
|
| 629 |
+
----------
|
| 630 |
+
provider : str
|
| 631 |
+
The provider to use, by default None. If None, the priority list configured in the settings is used. Default priority: fmp, yfinance.
|
| 632 |
+
mktcap_min : Optional[int]
|
| 633 |
+
Filter by market cap greater than this value. (provider: fmp, yfinance)
|
| 634 |
+
mktcap_max : Optional[int]
|
| 635 |
+
Filter by market cap less than this value. (provider: fmp, yfinance)
|
| 636 |
+
price_min : Optional[float]
|
| 637 |
+
Filter by price greater than this value. (provider: fmp, yfinance)
|
| 638 |
+
price_max : Optional[float]
|
| 639 |
+
Filter by price less than this value. (provider: fmp, yfinance)
|
| 640 |
+
beta_min : Optional[float]
|
| 641 |
+
Filter by a beta greater than this value. (provider: fmp, yfinance)
|
| 642 |
+
beta_max : Optional[float]
|
| 643 |
+
Filter by a beta less than this value. (provider: fmp, yfinance)
|
| 644 |
+
volume_min : Optional[int]
|
| 645 |
+
Filter by volume greater than this value. (provider: fmp, yfinance)
|
| 646 |
+
volume_max : Optional[int]
|
| 647 |
+
Filter by volume less than this value. (provider: fmp, yfinance)
|
| 648 |
+
dividend_min : Optional[float]
|
| 649 |
+
Filter by dividend amount greater than this value. (provider: fmp)
|
| 650 |
+
dividend_max : Optional[float]
|
| 651 |
+
Filter by dividend amount less than this value. (provider: fmp)
|
| 652 |
+
is_etf : Optional[bool]
|
| 653 |
+
If true, returns only ETFs. (provider: fmp)
|
| 654 |
+
is_active : Optional[bool]
|
| 655 |
+
If false, returns only inactive tickers. (provider: fmp)
|
| 656 |
+
sector : str
|
| 657 |
+
Filter by sector. (provider: fmp, yfinance)
|
| 658 |
+
industry : Optional[str]
|
| 659 |
+
Filter by industry. (provider: fmp, yfinance)
|
| 660 |
+
country : Optional[str]
|
| 661 |
+
Filter by country, as a two-letter country code. (provider: fmp)
|
| 662 |
+
exchange : str
|
| 663 |
+
Filter by exchange. (provider: fmp, yfinance)
|
| 664 |
+
limit : Optional[int]
|
| 665 |
+
Limit the number of results to return. (provider: fmp)
|
| 666 |
+
|
| 667 |
+
Returns
|
| 668 |
+
-------
|
| 669 |
+
OBBject
|
| 670 |
+
results : list[EquityScreener]
|
| 671 |
+
Serializable results.
|
| 672 |
+
provider : Optional[str]
|
| 673 |
+
Provider name.
|
| 674 |
+
warnings : Optional[list[Warning_]]
|
| 675 |
+
list of warnings.
|
| 676 |
+
chart : Optional[Chart]
|
| 677 |
+
Chart object.
|
| 678 |
+
extra : Dict[str, Any]
|
| 679 |
+
Extra info.
|
| 680 |
+
|
| 681 |
+
EquityScreener
|
| 682 |
+
--------------
|
| 683 |
+
symbol : str
|
| 684 |
+
Symbol representing the entity requested in the data.
|
| 685 |
+
name : Optional[str]
|
| 686 |
+
Name of the company.
|
| 687 |
+
market_cap : Optional[Union[int, float]]
|
| 688 |
+
The market cap of ticker. (provider: fmp);
|
| 689 |
+
Market Cap. (provider: yfinance)
|
| 690 |
+
sector : Optional[str]
|
| 691 |
+
The sector the ticker belongs to. (provider: fmp)
|
| 692 |
+
industry : Optional[str]
|
| 693 |
+
The industry ticker belongs to. (provider: fmp)
|
| 694 |
+
beta : Optional[float]
|
| 695 |
+
The beta of the ETF. (provider: fmp)
|
| 696 |
+
price : Optional[float]
|
| 697 |
+
The current price. (provider: fmp)
|
| 698 |
+
last_annual_dividend : Optional[float]
|
| 699 |
+
The last annual amount dividend paid. (provider: fmp)
|
| 700 |
+
volume : Optional[int]
|
| 701 |
+
The current trading volume. (provider: fmp)
|
| 702 |
+
exchange : Optional[str]
|
| 703 |
+
The exchange code the asset trades on. (provider: fmp);
|
| 704 |
+
Exchange where the stock is listed. (provider: yfinance)
|
| 705 |
+
exchange_name : Optional[str]
|
| 706 |
+
The full name of the primary exchange. (provider: fmp)
|
| 707 |
+
country : Optional[str]
|
| 708 |
+
The two-letter country abbreviation where the head office is located. (provider: fmp)
|
| 709 |
+
is_etf : Optional[Literal[True, False]]
|
| 710 |
+
Whether the ticker is an ETF. (provider: fmp)
|
| 711 |
+
actively_trading : Optional[Literal[True, False]]
|
| 712 |
+
Whether the ETF is actively trading. (provider: fmp)
|
| 713 |
+
open : Optional[float]
|
| 714 |
+
Open price for the day. (provider: yfinance)
|
| 715 |
+
high : Optional[float]
|
| 716 |
+
High price for the day. (provider: yfinance)
|
| 717 |
+
low : Optional[float]
|
| 718 |
+
Low price for the day. (provider: yfinance)
|
| 719 |
+
previous_close : Optional[float]
|
| 720 |
+
Previous close price. (provider: yfinance)
|
| 721 |
+
ma50 : Optional[float]
|
| 722 |
+
50-day moving average. (provider: yfinance)
|
| 723 |
+
ma200 : Optional[float]
|
| 724 |
+
200-day moving average. (provider: yfinance)
|
| 725 |
+
year_high : Optional[float]
|
| 726 |
+
52-week high. (provider: yfinance)
|
| 727 |
+
year_low : Optional[float]
|
| 728 |
+
52-week low. (provider: yfinance)
|
| 729 |
+
shares_outstanding : Optional[float]
|
| 730 |
+
Shares outstanding. (provider: yfinance)
|
| 731 |
+
book_value : Optional[float]
|
| 732 |
+
Book value per share. (provider: yfinance)
|
| 733 |
+
price_to_book : Optional[float]
|
| 734 |
+
Price to book ratio. (provider: yfinance)
|
| 735 |
+
eps_ttm : Optional[float]
|
| 736 |
+
Earnings per share over the trailing twelve months. (provider: yfinance)
|
| 737 |
+
eps_forward : Optional[float]
|
| 738 |
+
Forward earnings per share. (provider: yfinance)
|
| 739 |
+
pe_forward : Optional[float]
|
| 740 |
+
Forward price-to-earnings ratio. (provider: yfinance)
|
| 741 |
+
dividend_yield : Optional[float]
|
| 742 |
+
Trailing twelve month dividend yield. (provider: yfinance)
|
| 743 |
+
exchange_timezone : Optional[str]
|
| 744 |
+
Timezone of the exchange. (provider: yfinance)
|
| 745 |
+
earnings_date : Optional[datetime]
|
| 746 |
+
Most recent earnings date. (provider: yfinance)
|
| 747 |
+
currency : Optional[str]
|
| 748 |
+
Currency of the price data. (provider: yfinance)
|
| 749 |
+
|
| 750 |
+
Examples
|
| 751 |
+
--------
|
| 752 |
+
>>> from openbb import obb
|
| 753 |
+
>>> obb.equity.screener(provider='fmp')
|
| 754 |
+
""" # noqa: E501
|
| 755 |
+
|
| 756 |
+
return self._run(
|
| 757 |
+
"/equity/screener",
|
| 758 |
+
**filter_inputs(
|
| 759 |
+
provider_choices={
|
| 760 |
+
"provider": self._get_provider(
|
| 761 |
+
provider,
|
| 762 |
+
"equity.screener",
|
| 763 |
+
("fmp", "yfinance"),
|
| 764 |
+
)
|
| 765 |
+
},
|
| 766 |
+
standard_params={},
|
| 767 |
+
extra_params=kwargs,
|
| 768 |
+
info={
|
| 769 |
+
"sector": {
|
| 770 |
+
"fmp": {
|
| 771 |
+
"multiple_items_allowed": False,
|
| 772 |
+
"choices": [
|
| 773 |
+
"consumer_cyclical",
|
| 774 |
+
"energy",
|
| 775 |
+
"technology",
|
| 776 |
+
"industrials",
|
| 777 |
+
"financial_services",
|
| 778 |
+
"basic_materials",
|
| 779 |
+
"communication_services",
|
| 780 |
+
"consumer_defensive",
|
| 781 |
+
"healthcare",
|
| 782 |
+
"real_estate",
|
| 783 |
+
"utilities",
|
| 784 |
+
"industrial_goods",
|
| 785 |
+
"financial",
|
| 786 |
+
"services",
|
| 787 |
+
],
|
| 788 |
+
},
|
| 789 |
+
"yfinance": {
|
| 790 |
+
"multiple_items_allowed": False,
|
| 791 |
+
"choices": [
|
| 792 |
+
"basic_materials",
|
| 793 |
+
"communication_services",
|
| 794 |
+
"consumer_cyclical",
|
| 795 |
+
"consumer_defensive",
|
| 796 |
+
"energy",
|
| 797 |
+
"financial_services",
|
| 798 |
+
"healthcare",
|
| 799 |
+
"industrials",
|
| 800 |
+
"real_estate",
|
| 801 |
+
"technology",
|
| 802 |
+
"utilities",
|
| 803 |
+
],
|
| 804 |
+
},
|
| 805 |
+
},
|
| 806 |
+
"industry": {
|
| 807 |
+
"yfinance": {
|
| 808 |
+
"multiple_items_allowed": False,
|
| 809 |
+
"choices": [
|
| 810 |
+
"advertising_agencies",
|
| 811 |
+
"aerospace_defense",
|
| 812 |
+
"agricultural_inputs",
|
| 813 |
+
"airlines",
|
| 814 |
+
"airports_air_services",
|
| 815 |
+
"aluminum",
|
| 816 |
+
"apparel_manufacturing",
|
| 817 |
+
"apparel_retail",
|
| 818 |
+
"asset_management",
|
| 819 |
+
"auto_components",
|
| 820 |
+
"auto_manufacturers",
|
| 821 |
+
"auto_parts",
|
| 822 |
+
"auto_truck_dealerships",
|
| 823 |
+
"automobiles",
|
| 824 |
+
"banks",
|
| 825 |
+
"biotechnology",
|
| 826 |
+
"broadcasting",
|
| 827 |
+
"building_materials",
|
| 828 |
+
"building_products",
|
| 829 |
+
"building_products_equipment",
|
| 830 |
+
"business_equipment_supplies",
|
| 831 |
+
"capital_markets",
|
| 832 |
+
"chemicals",
|
| 833 |
+
"coking_coal",
|
| 834 |
+
"commercial_services",
|
| 835 |
+
"communication_equipment",
|
| 836 |
+
"computer_hardware",
|
| 837 |
+
"confectioners",
|
| 838 |
+
"construction_engineering",
|
| 839 |
+
"construction_materials",
|
| 840 |
+
"consulting_services",
|
| 841 |
+
"consumer_durables",
|
| 842 |
+
"consumer_electronics",
|
| 843 |
+
"consumer_services",
|
| 844 |
+
"copper",
|
| 845 |
+
"credit_services",
|
| 846 |
+
"department_stores",
|
| 847 |
+
"diagnostics_research",
|
| 848 |
+
"discount_stores",
|
| 849 |
+
"diversified_financials",
|
| 850 |
+
"education_training_services",
|
| 851 |
+
"electrical_equipment",
|
| 852 |
+
"electrical_equipment_parts",
|
| 853 |
+
"electronic_components",
|
| 854 |
+
"electronic_gaming_multimedia",
|
| 855 |
+
"electronics_computer_distribution",
|
| 856 |
+
"energy_services",
|
| 857 |
+
"engineering_construction",
|
| 858 |
+
"entertainment",
|
| 859 |
+
"farm_heavy_construction_machinery",
|
| 860 |
+
"farm_products",
|
| 861 |
+
"financial_conglomerates",
|
| 862 |
+
"financial_data_stock_exchanges",
|
| 863 |
+
"food_distribution",
|
| 864 |
+
"footwear_accessories",
|
| 865 |
+
"furnishings_fixtures_appliances",
|
| 866 |
+
"gambling",
|
| 867 |
+
"gold",
|
| 868 |
+
"grocery_stores",
|
| 869 |
+
"health_information_services",
|
| 870 |
+
"healthcare_plans",
|
| 871 |
+
"home_builders",
|
| 872 |
+
"home_improvement_retail",
|
| 873 |
+
"household_products",
|
| 874 |
+
"household_personal_products",
|
| 875 |
+
"industrial_conglomerates",
|
| 876 |
+
"industrial_distribution",
|
| 877 |
+
"information_technology_services",
|
| 878 |
+
"infrastructure_operations",
|
| 879 |
+
"insurance",
|
| 880 |
+
"integrated_freight_logistics",
|
| 881 |
+
"internet_content_information",
|
| 882 |
+
"internet_retail",
|
| 883 |
+
"leisure",
|
| 884 |
+
"lodging",
|
| 885 |
+
"lumber_wood_production",
|
| 886 |
+
"luxury_goods",
|
| 887 |
+
"machinery",
|
| 888 |
+
"marine_shipping",
|
| 889 |
+
"media",
|
| 890 |
+
"medical_care_facilities",
|
| 891 |
+
"medical_devices",
|
| 892 |
+
"medical_distribution",
|
| 893 |
+
"medical_instruments_supplies",
|
| 894 |
+
"metal_fabrication",
|
| 895 |
+
"mortgage_finance",
|
| 896 |
+
"oil_gas_drilling",
|
| 897 |
+
"oil_gas_e_p",
|
| 898 |
+
"oil_gas_equipment_services",
|
| 899 |
+
"oil_gas_integrated",
|
| 900 |
+
"oil_gas_midstream",
|
| 901 |
+
"oil_gas_producers",
|
| 902 |
+
"oil_gas_refining_marketing",
|
| 903 |
+
"other_industrial_metals_mining",
|
| 904 |
+
"other_precious_metals_mining",
|
| 905 |
+
"packaged_foods",
|
| 906 |
+
"packaging_containers",
|
| 907 |
+
"paper_forestry",
|
| 908 |
+
"paper_paper_products",
|
| 909 |
+
"personal_services",
|
| 910 |
+
"pharmaceuticals",
|
| 911 |
+
"pharmaceutical_retailers",
|
| 912 |
+
"pollution_treatment_controls",
|
| 913 |
+
"precious_metals",
|
| 914 |
+
"publishing",
|
| 915 |
+
"railroads",
|
| 916 |
+
"real_estate",
|
| 917 |
+
"recreational_vehicles",
|
| 918 |
+
"refiners_pipelines",
|
| 919 |
+
"rental_leasing_services",
|
| 920 |
+
"residential_construction",
|
| 921 |
+
"resorts_casinos",
|
| 922 |
+
"restaurants",
|
| 923 |
+
"retailing",
|
| 924 |
+
"scientific_technical_instruments",
|
| 925 |
+
"security_protection_services",
|
| 926 |
+
"semiconductor_equipment_materials",
|
| 927 |
+
"semiconductors",
|
| 928 |
+
"shell_companies",
|
| 929 |
+
"silver",
|
| 930 |
+
"software_and_services",
|
| 931 |
+
"solar",
|
| 932 |
+
"specialty_business_services",
|
| 933 |
+
"specialty_chemicals",
|
| 934 |
+
"specialty_industrial_machinery",
|
| 935 |
+
"specialty_retail",
|
| 936 |
+
"staffing_employment_services",
|
| 937 |
+
"steel",
|
| 938 |
+
"technology_hardware",
|
| 939 |
+
"telecom_services",
|
| 940 |
+
"textiles_apparel",
|
| 941 |
+
"textile_manufacturing",
|
| 942 |
+
"thermal_coal",
|
| 943 |
+
"tobacco",
|
| 944 |
+
"tools_accessories",
|
| 945 |
+
"traders_distributors",
|
| 946 |
+
"transportation",
|
| 947 |
+
"transportation_infrastructure",
|
| 948 |
+
"travel_services",
|
| 949 |
+
"trucking",
|
| 950 |
+
"uranium",
|
| 951 |
+
"utilities",
|
| 952 |
+
"waste_management",
|
| 953 |
+
],
|
| 954 |
+
}
|
| 955 |
+
},
|
| 956 |
+
"country": {
|
| 957 |
+
"yfinance": {
|
| 958 |
+
"multiple_items_allowed": False,
|
| 959 |
+
"choices": [
|
| 960 |
+
"all",
|
| 961 |
+
"ar",
|
| 962 |
+
"at",
|
| 963 |
+
"au",
|
| 964 |
+
"be",
|
| 965 |
+
"br",
|
| 966 |
+
"ca",
|
| 967 |
+
"ch",
|
| 968 |
+
"cl",
|
| 969 |
+
"cn",
|
| 970 |
+
"cz",
|
| 971 |
+
"de",
|
| 972 |
+
"dk",
|
| 973 |
+
"ee",
|
| 974 |
+
"eg",
|
| 975 |
+
"es",
|
| 976 |
+
"fi",
|
| 977 |
+
"fr",
|
| 978 |
+
"gb",
|
| 979 |
+
"gr",
|
| 980 |
+
"hk",
|
| 981 |
+
"hu",
|
| 982 |
+
"id",
|
| 983 |
+
"ie",
|
| 984 |
+
"il",
|
| 985 |
+
"in",
|
| 986 |
+
"is",
|
| 987 |
+
"it",
|
| 988 |
+
"jp",
|
| 989 |
+
"kr",
|
| 990 |
+
"kw",
|
| 991 |
+
"lk",
|
| 992 |
+
"lt",
|
| 993 |
+
"lv",
|
| 994 |
+
"mx",
|
| 995 |
+
"my",
|
| 996 |
+
"nl",
|
| 997 |
+
"no",
|
| 998 |
+
"nz",
|
| 999 |
+
"pe",
|
| 1000 |
+
"ph",
|
| 1001 |
+
"pk",
|
| 1002 |
+
"pl",
|
| 1003 |
+
"pt",
|
| 1004 |
+
"qa",
|
| 1005 |
+
"ro",
|
| 1006 |
+
"ru",
|
| 1007 |
+
"sa",
|
| 1008 |
+
"se",
|
| 1009 |
+
"sg",
|
| 1010 |
+
"sr",
|
| 1011 |
+
"th",
|
| 1012 |
+
"tr",
|
| 1013 |
+
"tw",
|
| 1014 |
+
"us",
|
| 1015 |
+
"ve",
|
| 1016 |
+
"vn",
|
| 1017 |
+
"za",
|
| 1018 |
+
],
|
| 1019 |
+
}
|
| 1020 |
+
},
|
| 1021 |
+
"exchange": {
|
| 1022 |
+
"fmp": {
|
| 1023 |
+
"multiple_items_allowed": False,
|
| 1024 |
+
"choices": [
|
| 1025 |
+
"amex",
|
| 1026 |
+
"ams",
|
| 1027 |
+
"ase",
|
| 1028 |
+
"asx",
|
| 1029 |
+
"ath",
|
| 1030 |
+
"bme",
|
| 1031 |
+
"bru",
|
| 1032 |
+
"bud",
|
| 1033 |
+
"bue",
|
| 1034 |
+
"cai",
|
| 1035 |
+
"cnq",
|
| 1036 |
+
"cph",
|
| 1037 |
+
"dfm",
|
| 1038 |
+
"doh",
|
| 1039 |
+
"etf",
|
| 1040 |
+
"euronext",
|
| 1041 |
+
"hel",
|
| 1042 |
+
"hkse",
|
| 1043 |
+
"ice",
|
| 1044 |
+
"iob",
|
| 1045 |
+
"ist",
|
| 1046 |
+
"jkt",
|
| 1047 |
+
"jnb",
|
| 1048 |
+
"jpx",
|
| 1049 |
+
"kls",
|
| 1050 |
+
"koe",
|
| 1051 |
+
"ksc",
|
| 1052 |
+
"kuw",
|
| 1053 |
+
"lse",
|
| 1054 |
+
"mex",
|
| 1055 |
+
"mutual_fund",
|
| 1056 |
+
"nasdaq",
|
| 1057 |
+
"neo",
|
| 1058 |
+
"nse",
|
| 1059 |
+
"nyse",
|
| 1060 |
+
"nze",
|
| 1061 |
+
"osl",
|
| 1062 |
+
"otc",
|
| 1063 |
+
"pnk",
|
| 1064 |
+
"pra",
|
| 1065 |
+
"ris",
|
| 1066 |
+
"sao",
|
| 1067 |
+
"sau",
|
| 1068 |
+
"set",
|
| 1069 |
+
"sgo",
|
| 1070 |
+
"shh",
|
| 1071 |
+
"shz",
|
| 1072 |
+
"six",
|
| 1073 |
+
"sto",
|
| 1074 |
+
"tai",
|
| 1075 |
+
"tlv",
|
| 1076 |
+
"tsx",
|
| 1077 |
+
"two",
|
| 1078 |
+
"vie",
|
| 1079 |
+
"wse",
|
| 1080 |
+
"xetra",
|
| 1081 |
+
],
|
| 1082 |
+
},
|
| 1083 |
+
"yfinance": {
|
| 1084 |
+
"multiple_items_allowed": False,
|
| 1085 |
+
"choices": [
|
| 1086 |
+
"ams",
|
| 1087 |
+
"aqs",
|
| 1088 |
+
"ase",
|
| 1089 |
+
"asx",
|
| 1090 |
+
"ath",
|
| 1091 |
+
"ber",
|
| 1092 |
+
"bru",
|
| 1093 |
+
"bse",
|
| 1094 |
+
"bts",
|
| 1095 |
+
"bud",
|
| 1096 |
+
"bue",
|
| 1097 |
+
"bvb",
|
| 1098 |
+
"bvc",
|
| 1099 |
+
"ccs",
|
| 1100 |
+
"cnq",
|
| 1101 |
+
"cph",
|
| 1102 |
+
"cxe",
|
| 1103 |
+
"dfm",
|
| 1104 |
+
"doh",
|
| 1105 |
+
"dus",
|
| 1106 |
+
"ebs",
|
| 1107 |
+
"fka",
|
| 1108 |
+
"fra",
|
| 1109 |
+
"ger",
|
| 1110 |
+
"ham",
|
| 1111 |
+
"han",
|
| 1112 |
+
"hel",
|
| 1113 |
+
"hkg",
|
| 1114 |
+
"ice",
|
| 1115 |
+
"iob",
|
| 1116 |
+
"ise",
|
| 1117 |
+
"ist",
|
| 1118 |
+
"jkt",
|
| 1119 |
+
"jnb",
|
| 1120 |
+
"jpx",
|
| 1121 |
+
"kls",
|
| 1122 |
+
"kuw",
|
| 1123 |
+
"lis",
|
| 1124 |
+
"lit",
|
| 1125 |
+
"lse",
|
| 1126 |
+
"mce",
|
| 1127 |
+
"mex",
|
| 1128 |
+
"mil",
|
| 1129 |
+
"mun",
|
| 1130 |
+
"ncm",
|
| 1131 |
+
"neo",
|
| 1132 |
+
"ngm",
|
| 1133 |
+
"nms",
|
| 1134 |
+
"nsi",
|
| 1135 |
+
"nyq",
|
| 1136 |
+
"nze",
|
| 1137 |
+
"oem",
|
| 1138 |
+
"oqb",
|
| 1139 |
+
"oqx",
|
| 1140 |
+
"osl",
|
| 1141 |
+
"par",
|
| 1142 |
+
"pnk",
|
| 1143 |
+
"pra",
|
| 1144 |
+
"ris",
|
| 1145 |
+
"sau",
|
| 1146 |
+
"ses",
|
| 1147 |
+
"set",
|
| 1148 |
+
"sgo",
|
| 1149 |
+
"shh",
|
| 1150 |
+
"shz",
|
| 1151 |
+
"sto",
|
| 1152 |
+
"stu",
|
| 1153 |
+
"tai",
|
| 1154 |
+
"tal",
|
| 1155 |
+
"tlv",
|
| 1156 |
+
"tor",
|
| 1157 |
+
"two",
|
| 1158 |
+
"van",
|
| 1159 |
+
"vie",
|
| 1160 |
+
"vse",
|
| 1161 |
+
"wse",
|
| 1162 |
+
],
|
| 1163 |
+
},
|
| 1164 |
+
},
|
| 1165 |
+
},
|
| 1166 |
+
)
|
| 1167 |
+
)
|
| 1168 |
+
|
| 1169 |
+
@exception_handler
|
| 1170 |
+
@validate
|
| 1171 |
+
def search(
|
| 1172 |
+
self,
|
| 1173 |
+
query: Annotated[str, OpenBBField(description="Search query.")] = "",
|
| 1174 |
+
is_symbol: Annotated[
|
| 1175 |
+
bool, OpenBBField(description="Whether to search by ticker symbol.")
|
| 1176 |
+
] = False,
|
| 1177 |
+
provider: Annotated[
|
| 1178 |
+
Optional[Literal["intrinio", "sec"]],
|
| 1179 |
+
OpenBBField(
|
| 1180 |
+
description="The provider to use, by default None. If None, the priority list configured in the settings is used. Default priority: intrinio, sec."
|
| 1181 |
+
),
|
| 1182 |
+
] = None,
|
| 1183 |
+
**kwargs
|
| 1184 |
+
) -> OBBject:
|
| 1185 |
+
"""Search for stock symbol, CIK, LEI, or company name.
|
| 1186 |
+
|
| 1187 |
+
Parameters
|
| 1188 |
+
----------
|
| 1189 |
+
provider : str
|
| 1190 |
+
The provider to use, by default None. If None, the priority list configured in the settings is used. Default priority: intrinio, sec.
|
| 1191 |
+
query : str
|
| 1192 |
+
Search query.
|
| 1193 |
+
is_symbol : bool
|
| 1194 |
+
Whether to search by ticker symbol.
|
| 1195 |
+
active : bool
|
| 1196 |
+
When true, return companies that are actively traded (having stock prices within the past 14 days). When false, return companies that are not actively traded or never have been traded. (provider: intrinio)
|
| 1197 |
+
limit : Optional[int]
|
| 1198 |
+
The number of data entries to return. (provider: intrinio)
|
| 1199 |
+
use_cache : bool
|
| 1200 |
+
Whether to use the cache or not. (provider: sec)
|
| 1201 |
+
is_fund : bool
|
| 1202 |
+
Whether to direct the search to the list of mutual funds and ETFs. (provider: sec)
|
| 1203 |
+
|
| 1204 |
+
Returns
|
| 1205 |
+
-------
|
| 1206 |
+
OBBject
|
| 1207 |
+
results : list[EquitySearch]
|
| 1208 |
+
Serializable results.
|
| 1209 |
+
provider : Optional[str]
|
| 1210 |
+
Provider name.
|
| 1211 |
+
warnings : Optional[list[Warning_]]
|
| 1212 |
+
list of warnings.
|
| 1213 |
+
chart : Optional[Chart]
|
| 1214 |
+
Chart object.
|
| 1215 |
+
extra : Dict[str, Any]
|
| 1216 |
+
Extra info.
|
| 1217 |
+
|
| 1218 |
+
EquitySearch
|
| 1219 |
+
------------
|
| 1220 |
+
symbol : Optional[str]
|
| 1221 |
+
Symbol representing the entity requested in the data.
|
| 1222 |
+
name : Optional[str]
|
| 1223 |
+
Name of the company.
|
| 1224 |
+
cik : Optional[str]
|
| 1225 |
+
;
|
| 1226 |
+
Central Index Key (provider: sec)
|
| 1227 |
+
lei : Optional[str]
|
| 1228 |
+
The Legal Entity Identifier (LEI) of the company. (provider: intrinio)
|
| 1229 |
+
intrinio_id : Optional[str]
|
| 1230 |
+
The Intrinio ID of the company. (provider: intrinio)
|
| 1231 |
+
|
| 1232 |
+
Examples
|
| 1233 |
+
--------
|
| 1234 |
+
>>> from openbb import obb
|
| 1235 |
+
>>> obb.equity.search(provider='intrinio')
|
| 1236 |
+
""" # noqa: E501
|
| 1237 |
+
|
| 1238 |
+
return self._run(
|
| 1239 |
+
"/equity/search",
|
| 1240 |
+
**filter_inputs(
|
| 1241 |
+
provider_choices={
|
| 1242 |
+
"provider": self._get_provider(
|
| 1243 |
+
provider,
|
| 1244 |
+
"equity.search",
|
| 1245 |
+
("intrinio", "sec"),
|
| 1246 |
+
)
|
| 1247 |
+
},
|
| 1248 |
+
standard_params={
|
| 1249 |
+
"query": query,
|
| 1250 |
+
"is_symbol": is_symbol,
|
| 1251 |
+
},
|
| 1252 |
+
extra_params=kwargs,
|
| 1253 |
+
)
|
| 1254 |
+
)
|
| 1255 |
+
|
| 1256 |
+
@property
|
| 1257 |
+
def shorts(self):
|
| 1258 |
+
# pylint: disable=import-outside-toplevel
|
| 1259 |
+
from . import equity_shorts
|
| 1260 |
+
|
| 1261 |
+
return equity_shorts.ROUTER_equity_shorts(command_runner=self._command_runner)
|
openbb_platform/openbb/package/equity_calendar.py
ADDED
|
@@ -0,0 +1,521 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
### THIS FILE IS AUTO-GENERATED. DO NOT EDIT. ###
|
| 2 |
+
|
| 3 |
+
import datetime
|
| 4 |
+
from typing import Literal, Optional, Union
|
| 5 |
+
|
| 6 |
+
from openbb_core.app.model.field import OpenBBField
|
| 7 |
+
from openbb_core.app.model.obbject import OBBject
|
| 8 |
+
from openbb_core.app.static.container import Container
|
| 9 |
+
from openbb_core.app.static.utils.decorators import exception_handler, validate
|
| 10 |
+
from openbb_core.app.static.utils.filters import filter_inputs
|
| 11 |
+
from typing_extensions import Annotated
|
| 12 |
+
|
| 13 |
+
|
| 14 |
+
class ROUTER_equity_calendar(Container):
|
| 15 |
+
"""/equity/calendar
|
| 16 |
+
dividend
|
| 17 |
+
earnings
|
| 18 |
+
events
|
| 19 |
+
ipo
|
| 20 |
+
splits
|
| 21 |
+
"""
|
| 22 |
+
|
| 23 |
+
def __repr__(self) -> str:
|
| 24 |
+
return self.__doc__ or ""
|
| 25 |
+
|
| 26 |
+
@exception_handler
|
| 27 |
+
@validate
|
| 28 |
+
def dividend(
|
| 29 |
+
self,
|
| 30 |
+
start_date: Annotated[
|
| 31 |
+
Union[datetime.date, None, str],
|
| 32 |
+
OpenBBField(description="Start date of the data, in YYYY-MM-DD format."),
|
| 33 |
+
] = None,
|
| 34 |
+
end_date: Annotated[
|
| 35 |
+
Union[datetime.date, None, str],
|
| 36 |
+
OpenBBField(description="End date of the data, in YYYY-MM-DD format."),
|
| 37 |
+
] = None,
|
| 38 |
+
provider: Annotated[
|
| 39 |
+
Optional[Literal["fmp"]],
|
| 40 |
+
OpenBBField(
|
| 41 |
+
description="The provider to use, by default None. If None, the priority list configured in the settings is used. Default priority: fmp."
|
| 42 |
+
),
|
| 43 |
+
] = None,
|
| 44 |
+
**kwargs
|
| 45 |
+
) -> OBBject:
|
| 46 |
+
"""Get historical and upcoming dividend payments. Includes dividend amount, ex-dividend and payment dates.
|
| 47 |
+
|
| 48 |
+
Parameters
|
| 49 |
+
----------
|
| 50 |
+
provider : str
|
| 51 |
+
The provider to use, by default None. If None, the priority list configured in the settings is used. Default priority: fmp.
|
| 52 |
+
start_date : Union[date, None, str]
|
| 53 |
+
Start date of the data, in YYYY-MM-DD format.
|
| 54 |
+
end_date : Union[date, None, str]
|
| 55 |
+
End date of the data, in YYYY-MM-DD format.
|
| 56 |
+
|
| 57 |
+
Returns
|
| 58 |
+
-------
|
| 59 |
+
OBBject
|
| 60 |
+
results : list[CalendarDividend]
|
| 61 |
+
Serializable results.
|
| 62 |
+
provider : Optional[str]
|
| 63 |
+
Provider name.
|
| 64 |
+
warnings : Optional[list[Warning_]]
|
| 65 |
+
list of warnings.
|
| 66 |
+
chart : Optional[Chart]
|
| 67 |
+
Chart object.
|
| 68 |
+
extra : Dict[str, Any]
|
| 69 |
+
Extra info.
|
| 70 |
+
|
| 71 |
+
CalendarDividend
|
| 72 |
+
----------------
|
| 73 |
+
ex_dividend_date : date
|
| 74 |
+
The ex-dividend date - the date on which the stock begins trading without rights to the dividend.
|
| 75 |
+
symbol : str
|
| 76 |
+
Symbol representing the entity requested in the data.
|
| 77 |
+
amount : Optional[float]
|
| 78 |
+
The dividend amount per share.
|
| 79 |
+
name : Optional[str]
|
| 80 |
+
Name of the entity.
|
| 81 |
+
record_date : Optional[date]
|
| 82 |
+
The record date of ownership for eligibility.
|
| 83 |
+
payment_date : Optional[date]
|
| 84 |
+
The payment date of the dividend.
|
| 85 |
+
declaration_date : Optional[date]
|
| 86 |
+
Declaration date of the dividend.
|
| 87 |
+
adjusted_amount : Optional[float]
|
| 88 |
+
The adjusted-dividend amount. (provider: fmp)
|
| 89 |
+
label : Optional[str]
|
| 90 |
+
Ex-dividend date formatted for display. (provider: fmp)
|
| 91 |
+
|
| 92 |
+
Examples
|
| 93 |
+
--------
|
| 94 |
+
>>> from openbb import obb
|
| 95 |
+
>>> obb.equity.calendar.dividend(provider='fmp')
|
| 96 |
+
""" # noqa: E501
|
| 97 |
+
|
| 98 |
+
return self._run(
|
| 99 |
+
"/equity/calendar/dividend",
|
| 100 |
+
**filter_inputs(
|
| 101 |
+
provider_choices={
|
| 102 |
+
"provider": self._get_provider(
|
| 103 |
+
provider,
|
| 104 |
+
"equity.calendar.dividend",
|
| 105 |
+
("fmp",),
|
| 106 |
+
)
|
| 107 |
+
},
|
| 108 |
+
standard_params={
|
| 109 |
+
"start_date": start_date,
|
| 110 |
+
"end_date": end_date,
|
| 111 |
+
},
|
| 112 |
+
extra_params=kwargs,
|
| 113 |
+
)
|
| 114 |
+
)
|
| 115 |
+
|
| 116 |
+
@exception_handler
|
| 117 |
+
@validate
|
| 118 |
+
def earnings(
|
| 119 |
+
self,
|
| 120 |
+
start_date: Annotated[
|
| 121 |
+
Union[datetime.date, None, str],
|
| 122 |
+
OpenBBField(description="Start date of the data, in YYYY-MM-DD format."),
|
| 123 |
+
] = None,
|
| 124 |
+
end_date: Annotated[
|
| 125 |
+
Union[datetime.date, None, str],
|
| 126 |
+
OpenBBField(description="End date of the data, in YYYY-MM-DD format."),
|
| 127 |
+
] = None,
|
| 128 |
+
provider: Annotated[
|
| 129 |
+
Optional[Literal["fmp"]],
|
| 130 |
+
OpenBBField(
|
| 131 |
+
description="The provider to use, by default None. If None, the priority list configured in the settings is used. Default priority: fmp."
|
| 132 |
+
),
|
| 133 |
+
] = None,
|
| 134 |
+
**kwargs
|
| 135 |
+
) -> OBBject:
|
| 136 |
+
"""Get historical and upcoming company earnings releases. Includes earnings per share (EPS) and revenue data.
|
| 137 |
+
|
| 138 |
+
Parameters
|
| 139 |
+
----------
|
| 140 |
+
provider : str
|
| 141 |
+
The provider to use, by default None. If None, the priority list configured in the settings is used. Default priority: fmp.
|
| 142 |
+
start_date : Union[date, None, str]
|
| 143 |
+
Start date of the data, in YYYY-MM-DD format.
|
| 144 |
+
end_date : Union[date, None, str]
|
| 145 |
+
End date of the data, in YYYY-MM-DD format.
|
| 146 |
+
|
| 147 |
+
Returns
|
| 148 |
+
-------
|
| 149 |
+
OBBject
|
| 150 |
+
results : list[CalendarEarnings]
|
| 151 |
+
Serializable results.
|
| 152 |
+
provider : Optional[str]
|
| 153 |
+
Provider name.
|
| 154 |
+
warnings : Optional[list[Warning_]]
|
| 155 |
+
list of warnings.
|
| 156 |
+
chart : Optional[Chart]
|
| 157 |
+
Chart object.
|
| 158 |
+
extra : Dict[str, Any]
|
| 159 |
+
Extra info.
|
| 160 |
+
|
| 161 |
+
CalendarEarnings
|
| 162 |
+
----------------
|
| 163 |
+
report_date : date
|
| 164 |
+
The date of the earnings report.
|
| 165 |
+
symbol : str
|
| 166 |
+
Symbol representing the entity requested in the data.
|
| 167 |
+
name : Optional[str]
|
| 168 |
+
Name of the entity.
|
| 169 |
+
eps_previous : Optional[float]
|
| 170 |
+
The earnings-per-share from the same previously reported period.
|
| 171 |
+
eps_consensus : Optional[float]
|
| 172 |
+
The analyst conesus earnings-per-share estimate.
|
| 173 |
+
eps_actual : Optional[float]
|
| 174 |
+
The actual earnings per share announced. (provider: fmp)
|
| 175 |
+
revenue_actual : Optional[float]
|
| 176 |
+
The actual reported revenue. (provider: fmp)
|
| 177 |
+
revenue_consensus : Optional[float]
|
| 178 |
+
The revenue forecast consensus. (provider: fmp)
|
| 179 |
+
period_ending : Optional[date]
|
| 180 |
+
The fiscal period end date. (provider: fmp)
|
| 181 |
+
reporting_time : Optional[str]
|
| 182 |
+
The reporting time - e.g. after market close. (provider: fmp)
|
| 183 |
+
updated_date : Optional[date]
|
| 184 |
+
The date the data was updated last. (provider: fmp)
|
| 185 |
+
|
| 186 |
+
Examples
|
| 187 |
+
--------
|
| 188 |
+
>>> from openbb import obb
|
| 189 |
+
>>> obb.equity.calendar.earnings(provider='fmp')
|
| 190 |
+
>>> # Get earnings calendar for specific dates.
|
| 191 |
+
>>> obb.equity.calendar.earnings(start_date='2024-02-01', end_date='2024-02-07', provider='fmp')
|
| 192 |
+
""" # noqa: E501
|
| 193 |
+
|
| 194 |
+
return self._run(
|
| 195 |
+
"/equity/calendar/earnings",
|
| 196 |
+
**filter_inputs(
|
| 197 |
+
provider_choices={
|
| 198 |
+
"provider": self._get_provider(
|
| 199 |
+
provider,
|
| 200 |
+
"equity.calendar.earnings",
|
| 201 |
+
("fmp",),
|
| 202 |
+
)
|
| 203 |
+
},
|
| 204 |
+
standard_params={
|
| 205 |
+
"start_date": start_date,
|
| 206 |
+
"end_date": end_date,
|
| 207 |
+
},
|
| 208 |
+
extra_params=kwargs,
|
| 209 |
+
)
|
| 210 |
+
)
|
| 211 |
+
|
| 212 |
+
@exception_handler
|
| 213 |
+
@validate
|
| 214 |
+
def events(
|
| 215 |
+
self,
|
| 216 |
+
start_date: Annotated[
|
| 217 |
+
Union[datetime.date, None, str],
|
| 218 |
+
OpenBBField(description="Start date of the data, in YYYY-MM-DD format."),
|
| 219 |
+
] = None,
|
| 220 |
+
end_date: Annotated[
|
| 221 |
+
Union[datetime.date, None, str],
|
| 222 |
+
OpenBBField(description="End date of the data, in YYYY-MM-DD format."),
|
| 223 |
+
] = None,
|
| 224 |
+
provider: Annotated[
|
| 225 |
+
Optional[Literal["fmp"]],
|
| 226 |
+
OpenBBField(
|
| 227 |
+
description="The provider to use, by default None. If None, the priority list configured in the settings is used. Default priority: fmp."
|
| 228 |
+
),
|
| 229 |
+
] = None,
|
| 230 |
+
**kwargs
|
| 231 |
+
) -> OBBject:
|
| 232 |
+
"""Get historical and upcoming company events, such as Investor Day, Conference Call, Earnings Release.
|
| 233 |
+
|
| 234 |
+
Parameters
|
| 235 |
+
----------
|
| 236 |
+
provider : str
|
| 237 |
+
The provider to use, by default None. If None, the priority list configured in the settings is used. Default priority: fmp.
|
| 238 |
+
start_date : Union[date, None, str]
|
| 239 |
+
Start date of the data, in YYYY-MM-DD format.
|
| 240 |
+
end_date : Union[date, None, str]
|
| 241 |
+
End date of the data, in YYYY-MM-DD format.
|
| 242 |
+
|
| 243 |
+
Returns
|
| 244 |
+
-------
|
| 245 |
+
OBBject
|
| 246 |
+
results : list[CalendarEvents]
|
| 247 |
+
Serializable results.
|
| 248 |
+
provider : Optional[str]
|
| 249 |
+
Provider name.
|
| 250 |
+
warnings : Optional[list[Warning_]]
|
| 251 |
+
list of warnings.
|
| 252 |
+
chart : Optional[Chart]
|
| 253 |
+
Chart object.
|
| 254 |
+
extra : Dict[str, Any]
|
| 255 |
+
Extra info.
|
| 256 |
+
|
| 257 |
+
CalendarEvents
|
| 258 |
+
--------------
|
| 259 |
+
date : date
|
| 260 |
+
The date of the data. The date of the event.
|
| 261 |
+
symbol : str
|
| 262 |
+
Symbol representing the entity requested in the data.
|
| 263 |
+
exchange : Optional[str]
|
| 264 |
+
Exchange where the symbol is listed. (provider: fmp)
|
| 265 |
+
time : Optional[str]
|
| 266 |
+
The estimated time of the event, local to the exchange. (provider: fmp)
|
| 267 |
+
timing : Optional[str]
|
| 268 |
+
The timing of the event - e.g. before, during, or after market hours. (provider: fmp)
|
| 269 |
+
description : Optional[str]
|
| 270 |
+
The title of the event. (provider: fmp)
|
| 271 |
+
url : Optional[str]
|
| 272 |
+
The URL to the press release for the announcement. (provider: fmp)
|
| 273 |
+
announcement_date : Optional[date]
|
| 274 |
+
The date when the event was announced. (provider: fmp)
|
| 275 |
+
|
| 276 |
+
Examples
|
| 277 |
+
--------
|
| 278 |
+
>>> from openbb import obb
|
| 279 |
+
>>> obb.equity.calendar.events(provider='fmp')
|
| 280 |
+
>>> # Get company events calendar for specific dates.
|
| 281 |
+
>>> obb.equity.calendar.events(start_date='2024-02-01', end_date='2024-02-07', provider='fmp')
|
| 282 |
+
""" # noqa: E501
|
| 283 |
+
|
| 284 |
+
return self._run(
|
| 285 |
+
"/equity/calendar/events",
|
| 286 |
+
**filter_inputs(
|
| 287 |
+
provider_choices={
|
| 288 |
+
"provider": self._get_provider(
|
| 289 |
+
provider,
|
| 290 |
+
"equity.calendar.events",
|
| 291 |
+
("fmp",),
|
| 292 |
+
)
|
| 293 |
+
},
|
| 294 |
+
standard_params={
|
| 295 |
+
"start_date": start_date,
|
| 296 |
+
"end_date": end_date,
|
| 297 |
+
},
|
| 298 |
+
extra_params=kwargs,
|
| 299 |
+
)
|
| 300 |
+
)
|
| 301 |
+
|
| 302 |
+
@exception_handler
|
| 303 |
+
@validate
|
| 304 |
+
def ipo(
|
| 305 |
+
self,
|
| 306 |
+
symbol: Annotated[
|
| 307 |
+
Optional[str], OpenBBField(description="Symbol to get data for.")
|
| 308 |
+
] = None,
|
| 309 |
+
start_date: Annotated[
|
| 310 |
+
Union[datetime.date, None, str],
|
| 311 |
+
OpenBBField(description="Start date of the data, in YYYY-MM-DD format."),
|
| 312 |
+
] = None,
|
| 313 |
+
end_date: Annotated[
|
| 314 |
+
Union[datetime.date, None, str],
|
| 315 |
+
OpenBBField(description="End date of the data, in YYYY-MM-DD format."),
|
| 316 |
+
] = None,
|
| 317 |
+
limit: Annotated[
|
| 318 |
+
Optional[int],
|
| 319 |
+
OpenBBField(description="The number of data entries to return."),
|
| 320 |
+
] = 100,
|
| 321 |
+
provider: Annotated[
|
| 322 |
+
Optional[Literal["intrinio"]],
|
| 323 |
+
OpenBBField(
|
| 324 |
+
description="The provider to use, by default None. If None, the priority list configured in the settings is used. Default priority: intrinio."
|
| 325 |
+
),
|
| 326 |
+
] = None,
|
| 327 |
+
**kwargs
|
| 328 |
+
) -> OBBject:
|
| 329 |
+
"""Get historical and upcoming initial public offerings (IPOs).
|
| 330 |
+
|
| 331 |
+
Parameters
|
| 332 |
+
----------
|
| 333 |
+
provider : str
|
| 334 |
+
The provider to use, by default None. If None, the priority list configured in the settings is used. Default priority: intrinio.
|
| 335 |
+
symbol : Optional[str]
|
| 336 |
+
Symbol to get data for.
|
| 337 |
+
start_date : Union[date, None, str]
|
| 338 |
+
Start date of the data, in YYYY-MM-DD format.
|
| 339 |
+
end_date : Union[date, None, str]
|
| 340 |
+
End date of the data, in YYYY-MM-DD format.
|
| 341 |
+
limit : Optional[int]
|
| 342 |
+
The number of data entries to return.
|
| 343 |
+
status : Optional[Literal['upcoming', 'priced', 'withdrawn']]
|
| 344 |
+
Status of the IPO. [upcoming, priced, or withdrawn] (provider: intrinio)
|
| 345 |
+
min_value : Optional[int]
|
| 346 |
+
Return IPOs with an offer dollar amount greater than the given amount. (provider: intrinio)
|
| 347 |
+
max_value : Optional[int]
|
| 348 |
+
Return IPOs with an offer dollar amount less than the given amount. (provider: intrinio)
|
| 349 |
+
|
| 350 |
+
Returns
|
| 351 |
+
-------
|
| 352 |
+
OBBject
|
| 353 |
+
results : list[CalendarIpo]
|
| 354 |
+
Serializable results.
|
| 355 |
+
provider : Optional[str]
|
| 356 |
+
Provider name.
|
| 357 |
+
warnings : Optional[list[Warning_]]
|
| 358 |
+
list of warnings.
|
| 359 |
+
chart : Optional[Chart]
|
| 360 |
+
Chart object.
|
| 361 |
+
extra : Dict[str, Any]
|
| 362 |
+
Extra info.
|
| 363 |
+
|
| 364 |
+
CalendarIpo
|
| 365 |
+
-----------
|
| 366 |
+
symbol : Optional[str]
|
| 367 |
+
Symbol representing the entity requested in the data.
|
| 368 |
+
ipo_date : Optional[date]
|
| 369 |
+
The date of the IPO, when the stock first trades on a major exchange.
|
| 370 |
+
status : Optional[Literal['upcoming', 'priced', 'withdrawn']]
|
| 371 |
+
The status of the IPO. Upcoming IPOs have not taken place yet but are expected to. Priced IPOs have taken place. Withdrawn IPOs were expected to take place, but were subsequently withdrawn. (provider: intrinio)
|
| 372 |
+
exchange : Optional[str]
|
| 373 |
+
The acronym of the stock exchange that the company is going to trade publicly on. Typically NYSE or NASDAQ. (provider: intrinio)
|
| 374 |
+
offer_amount : Optional[float]
|
| 375 |
+
The total dollar amount of shares offered in the IPO. Typically this is share price * share count (provider: intrinio)
|
| 376 |
+
share_price : Optional[float]
|
| 377 |
+
The price per share at which the IPO was offered. (provider: intrinio)
|
| 378 |
+
share_price_lowest : Optional[float]
|
| 379 |
+
The expected lowest price per share at which the IPO will be offered. Before an IPO is priced, companies typically provide a range of prices per share at which they expect to offer the IPO (typically available for upcoming IPOs). (provider: intrinio)
|
| 380 |
+
share_price_highest : Optional[float]
|
| 381 |
+
The expected highest price per share at which the IPO will be offered. Before an IPO is priced, companies typically provide a range of prices per share at which they expect to offer the IPO (typically available for upcoming IPOs). (provider: intrinio)
|
| 382 |
+
share_count : Optional[int]
|
| 383 |
+
The number of shares offered in the IPO. (provider: intrinio)
|
| 384 |
+
share_count_lowest : Optional[int]
|
| 385 |
+
The expected lowest number of shares that will be offered in the IPO. Before an IPO is priced, companies typically provide a range of shares that they expect to offer in the IPO (typically available for upcoming IPOs). (provider: intrinio)
|
| 386 |
+
share_count_highest : Optional[int]
|
| 387 |
+
The expected highest number of shares that will be offered in the IPO. Before an IPO is priced, companies typically provide a range of shares that they expect to offer in the IPO (typically available for upcoming IPOs). (provider: intrinio)
|
| 388 |
+
announcement_url : Optional[str]
|
| 389 |
+
The URL to the company's announcement of the IPO (provider: intrinio)
|
| 390 |
+
sec_report_url : Optional[str]
|
| 391 |
+
The URL to the company's S-1, S-1/A, F-1, or F-1/A SEC filing, which is required to be filed before an IPO takes place. (provider: intrinio)
|
| 392 |
+
open_price : Optional[float]
|
| 393 |
+
The opening price at the beginning of the first trading day (only available for priced IPOs). (provider: intrinio)
|
| 394 |
+
close_price : Optional[float]
|
| 395 |
+
The closing price at the end of the first trading day (only available for priced IPOs). (provider: intrinio)
|
| 396 |
+
volume : Optional[int]
|
| 397 |
+
The volume at the end of the first trading day (only available for priced IPOs). (provider: intrinio)
|
| 398 |
+
day_change : Optional[float]
|
| 399 |
+
The percentage change between the open price and the close price on the first trading day (only available for priced IPOs). (provider: intrinio)
|
| 400 |
+
week_change : Optional[float]
|
| 401 |
+
The percentage change between the open price on the first trading day and the close price approximately a week after the first trading day (only available for priced IPOs). (provider: intrinio)
|
| 402 |
+
month_change : Optional[float]
|
| 403 |
+
The percentage change between the open price on the first trading day and the close price approximately a month after the first trading day (only available for priced IPOs). (provider: intrinio)
|
| 404 |
+
id : Optional[str]
|
| 405 |
+
The Intrinio ID of the IPO. (provider: intrinio)
|
| 406 |
+
company : Optional[IntrinioCompany]
|
| 407 |
+
The company that is going public via the IPO. (provider: intrinio)
|
| 408 |
+
security : Optional[IntrinioSecurity]
|
| 409 |
+
The primary Security for the Company that is going public via the IPO (provider: intrinio)
|
| 410 |
+
|
| 411 |
+
Examples
|
| 412 |
+
--------
|
| 413 |
+
>>> from openbb import obb
|
| 414 |
+
>>> obb.equity.calendar.ipo(provider='intrinio')
|
| 415 |
+
>>> # Get all IPOs available.
|
| 416 |
+
>>> obb.equity.calendar.ipo(provider='intrinio')
|
| 417 |
+
""" # noqa: E501
|
| 418 |
+
|
| 419 |
+
return self._run(
|
| 420 |
+
"/equity/calendar/ipo",
|
| 421 |
+
**filter_inputs(
|
| 422 |
+
provider_choices={
|
| 423 |
+
"provider": self._get_provider(
|
| 424 |
+
provider,
|
| 425 |
+
"equity.calendar.ipo",
|
| 426 |
+
("intrinio",),
|
| 427 |
+
)
|
| 428 |
+
},
|
| 429 |
+
standard_params={
|
| 430 |
+
"symbol": symbol,
|
| 431 |
+
"start_date": start_date,
|
| 432 |
+
"end_date": end_date,
|
| 433 |
+
"limit": limit,
|
| 434 |
+
},
|
| 435 |
+
extra_params=kwargs,
|
| 436 |
+
)
|
| 437 |
+
)
|
| 438 |
+
|
| 439 |
+
@exception_handler
|
| 440 |
+
@validate
|
| 441 |
+
def splits(
|
| 442 |
+
self,
|
| 443 |
+
start_date: Annotated[
|
| 444 |
+
Union[datetime.date, None, str],
|
| 445 |
+
OpenBBField(description="Start date of the data, in YYYY-MM-DD format."),
|
| 446 |
+
] = None,
|
| 447 |
+
end_date: Annotated[
|
| 448 |
+
Union[datetime.date, None, str],
|
| 449 |
+
OpenBBField(description="End date of the data, in YYYY-MM-DD format."),
|
| 450 |
+
] = None,
|
| 451 |
+
provider: Annotated[
|
| 452 |
+
Optional[Literal["fmp"]],
|
| 453 |
+
OpenBBField(
|
| 454 |
+
description="The provider to use, by default None. If None, the priority list configured in the settings is used. Default priority: fmp."
|
| 455 |
+
),
|
| 456 |
+
] = None,
|
| 457 |
+
**kwargs
|
| 458 |
+
) -> OBBject:
|
| 459 |
+
"""Get historical and upcoming stock split operations.
|
| 460 |
+
|
| 461 |
+
Parameters
|
| 462 |
+
----------
|
| 463 |
+
provider : str
|
| 464 |
+
The provider to use, by default None. If None, the priority list configured in the settings is used. Default priority: fmp.
|
| 465 |
+
start_date : Union[date, None, str]
|
| 466 |
+
Start date of the data, in YYYY-MM-DD format.
|
| 467 |
+
end_date : Union[date, None, str]
|
| 468 |
+
End date of the data, in YYYY-MM-DD format.
|
| 469 |
+
|
| 470 |
+
Returns
|
| 471 |
+
-------
|
| 472 |
+
OBBject
|
| 473 |
+
results : list[CalendarSplits]
|
| 474 |
+
Serializable results.
|
| 475 |
+
provider : Optional[str]
|
| 476 |
+
Provider name.
|
| 477 |
+
warnings : Optional[list[Warning_]]
|
| 478 |
+
list of warnings.
|
| 479 |
+
chart : Optional[Chart]
|
| 480 |
+
Chart object.
|
| 481 |
+
extra : Dict[str, Any]
|
| 482 |
+
Extra info.
|
| 483 |
+
|
| 484 |
+
CalendarSplits
|
| 485 |
+
--------------
|
| 486 |
+
date : date
|
| 487 |
+
The date of the data.
|
| 488 |
+
label : str
|
| 489 |
+
Label of the stock splits.
|
| 490 |
+
symbol : str
|
| 491 |
+
Symbol representing the entity requested in the data.
|
| 492 |
+
numerator : float
|
| 493 |
+
Numerator of the stock splits.
|
| 494 |
+
denominator : float
|
| 495 |
+
Denominator of the stock splits.
|
| 496 |
+
|
| 497 |
+
Examples
|
| 498 |
+
--------
|
| 499 |
+
>>> from openbb import obb
|
| 500 |
+
>>> obb.equity.calendar.splits(provider='fmp')
|
| 501 |
+
>>> # Get stock splits calendar for specific dates.
|
| 502 |
+
>>> obb.equity.calendar.splits(start_date='2024-02-01', end_date='2024-02-07', provider='fmp')
|
| 503 |
+
""" # noqa: E501
|
| 504 |
+
|
| 505 |
+
return self._run(
|
| 506 |
+
"/equity/calendar/splits",
|
| 507 |
+
**filter_inputs(
|
| 508 |
+
provider_choices={
|
| 509 |
+
"provider": self._get_provider(
|
| 510 |
+
provider,
|
| 511 |
+
"equity.calendar.splits",
|
| 512 |
+
("fmp",),
|
| 513 |
+
)
|
| 514 |
+
},
|
| 515 |
+
standard_params={
|
| 516 |
+
"start_date": start_date,
|
| 517 |
+
"end_date": end_date,
|
| 518 |
+
},
|
| 519 |
+
extra_params=kwargs,
|
| 520 |
+
)
|
| 521 |
+
)
|
openbb_platform/openbb/package/equity_compare.py
ADDED
|
@@ -0,0 +1,504 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
### THIS FILE IS AUTO-GENERATED. DO NOT EDIT. ###
|
| 2 |
+
|
| 3 |
+
from typing import Literal, Optional, Union
|
| 4 |
+
|
| 5 |
+
from openbb_core.app.model.field import OpenBBField
|
| 6 |
+
from openbb_core.app.model.obbject import OBBject
|
| 7 |
+
from openbb_core.app.static.container import Container
|
| 8 |
+
from openbb_core.app.static.utils.decorators import exception_handler, validate
|
| 9 |
+
from openbb_core.app.static.utils.filters import filter_inputs
|
| 10 |
+
from typing_extensions import Annotated
|
| 11 |
+
|
| 12 |
+
|
| 13 |
+
class ROUTER_equity_compare(Container):
|
| 14 |
+
"""/equity/compare
|
| 15 |
+
company_facts
|
| 16 |
+
peers
|
| 17 |
+
"""
|
| 18 |
+
|
| 19 |
+
def __repr__(self) -> str:
|
| 20 |
+
return self.__doc__ or ""
|
| 21 |
+
|
| 22 |
+
@exception_handler
|
| 23 |
+
@validate
|
| 24 |
+
def company_facts(
|
| 25 |
+
self,
|
| 26 |
+
symbol: Annotated[
|
| 27 |
+
Union[str, None, list[Optional[str]]],
|
| 28 |
+
OpenBBField(
|
| 29 |
+
description="Symbol to get data for. Multiple comma separated items allowed for provider(s): sec."
|
| 30 |
+
),
|
| 31 |
+
] = None,
|
| 32 |
+
fact: Annotated[
|
| 33 |
+
str,
|
| 34 |
+
OpenBBField(
|
| 35 |
+
description="The fact to lookup, typically a GAAP-reporting measure. Choices vary by provider.\nChoices for sec: 'AccountsPayableCurrent', 'AccountsReceivableNet', 'AccountsReceivableNetCurrent', 'AccrualForTaxesOtherThanIncomeTaxesCurrent', 'AccrualForTaxesOtherThanIncomeTaxesCurrentAndNoncurrent', 'AccruedIncomeTaxesCurrent', 'AccruedIncomeTaxesNoncurrent', 'AccruedInsuranceCurrent', 'AccruedLiabilitiesCurrent', 'AccumulatedDepreciationDepletionAndAmortizationPropertyPlantAndEquipment', 'AccumulatedOtherComprehensiveIncomeLossNetOfTax', 'AcquisitionsNetOfCashAcquiredAndPurchasesOfIntangibleAndOtherAssets', 'AdjustmentsToAdditionalPaidInCapitalSharebasedCompensationRequisiteServicePeriodRecognitionValue', 'AdvertisingExpense', 'AllocatedShareBasedCompensationExpense', 'AntidilutiveSecuritiesExcludedFromComputationOfEarningsPerShareAmount', 'AssetImpairmentCharges', 'Assets', 'AssetsCurrent', 'AssetsNoncurrent', 'BuildingsAndImprovementsGross', 'CapitalLeaseObligationsCurrent', 'CapitalLeaseObligationsNoncurrent', 'Cash', 'CashAndCashEquivalentsAtCarryingValue', 'CashCashEquivalentsAndShortTermInvestments', 'CashCashEquivalentsRestrictedCashAndRestrictedCashEquivalents', 'CashCashEquivalentsRestrictedCashAndRestrictedCashEquivalentsIncludingDisposalGroupAndDiscontinuedOperations', 'CashCashEquivalentsRestrictedCashAndRestrictedCashEquivalentsPeriodIncreaseDecreaseIncludingExchangeRateEffect', 'CommercialPaper', 'CommitmentsAndContingencies', 'CommonStockDividendsPerShareCashPaid', 'CommonStockDividendsPerShareDeclared', 'CommonStocksIncludingAdditionalPaidInCapital', 'ComprehensiveIncomeNetOfTax', 'ComprehensiveIncomeNetOfTaxAttributableToNoncontrollingInterest', 'ComprehensiveIncomeNetOfTaxIncludingPortionAttributableToNoncontrollingInterest', 'ConstructionInProgressGross', 'ContractWithCustomerAssetNet', 'ContractWithCustomerLiability', 'ContractWithCustomerLiabilityCurrent', 'ContractWithCustomerLiabilityNoncurrent', 'CostOfGoodsAndServicesSold', 'CostOfRevenue', 'CurrentFederalTaxExpenseBenefit', 'CurrentForeignTaxExpenseBenefit', 'CurrentIncomeTaxExpenseBenefit', 'CurrentStateAndLocalTaxExpenseBenefit', 'DebtInstrumentFaceAmount', 'DebtInstrumentFairValue', 'DebtLongtermAndShorttermCombinedAmount', 'DeferredFederalIncomeTaxExpenseBenefit', 'DeferredForeignIncomeTaxExpenseBenefit', 'DeferredIncomeTaxExpenseBenefit', 'DeferredIncomeTaxLiabilities', 'DeferredIncomeTaxLiabilitiesNet', 'DeferredIncomeTaxesAndTaxCredits', 'DeferredRevenue', 'DeferredTaxAssetsGross', 'DeferredTaxAssetsLiabilitiesNet', 'DeferredTaxAssetsNet', 'DeferredTaxLiabilities', 'DefinedContributionPlanCostRecognized', 'Depreciation', 'DepreciationAmortizationAndAccretionNet', 'DepreciationAmortizationAndOther', 'DepreciationAndAmortization', 'DepreciationDepletionAndAmortization', 'DerivativeCollateralObligationToReturnCash', 'DerivativeCollateralRightToReclaimCash', 'DerivativeFairValueOfDerivativeNet', 'DerivativeLiabilityCollateralRightToReclaimCashOffset', 'DerivativeNotionalAmount', 'DistributedEarnings', 'Dividends', 'DividendsCash', 'DividendsPayableAmountPerShare', 'DividendsPayableCurrent', 'EarningsPerShareBasic', 'EarningsPerShareDiluted', 'EffectOfExchangeRateOnCashCashEquivalentsRestrictedCashAndRestrictedCashEquivalents', 'EffectOfExchangeRateOnCashCashEquivalentsRestrictedCashAndRestrictedCashEquivalentsIncludingDisposalGroupAndDiscontinuedOperations', 'EmployeeRelatedLiabilitiesCurrent', 'EmployeeRelatedLiabilitiesCurrentAndNoncurrent', 'EmployeeServiceShareBasedCompensationTaxBenefitFromCompensationExpense', 'FinanceLeaseInterestExpense', 'FinanceLeaseInterestPaymentOnLiability', 'FinanceLeaseLiability', 'FinanceLeaseLiabilityCurrent', 'FinanceLeaseLiabilityNoncurrent', 'FinanceLeaseLiabilityPaymentsDue', 'FinanceLeaseLiabilityPaymentsDueAfterYearFive', 'FinanceLeaseLiabilityPaymentsDueNextTwelveMonths', 'FinanceLeaseLiabilityPaymentsDueYearFive', 'FinanceLeaseLiabilityPaymentsDueYearFour', 'FinanceLeaseLiabilityPaymentsDueYearThree', 'FinanceLeaseLiabilityPaymentsDueYearTwo', 'FinanceLeaseLiabilityPaymentsRemainderOfFiscalYear', 'FinanceLeaseLiabilityUndiscountedExcessAmount', 'FinanceLeasePrincipalPayments', 'FinanceLeaseRightOfUseAsset', 'FinancingReceivableAllowanceForCreditLosses', 'FiniteLivedIntangibleAssetsNet', 'FixturesAndEquipmentGross', 'GainLossOnInvestments', 'GainLossOnInvestmentsAndDerivativeInstruments', 'GainLossOnSaleOfBusiness', 'GainsLossesOnExtinguishmentOfDebt', 'GeneralAndAdministrativeExpense', 'Goodwill', 'GrossProfit', 'ImpairmentOfIntangibleAssetsExcludingGoodwill', 'ImpairmentOfIntangibleAssetsIndefinitelivedExcludingGoodwill', 'IncomeLossFromContinuingOperations', 'IncomeLossFromContinuingOperationsAttributableToNoncontrollingEntity', 'IncomeLossFromContinuingOperationsBeforeIncomeTaxesExtraordinaryItemsNoncontrollingInterest', 'IncomeLossFromContinuingOperationsPerBasicShare', 'IncomeLossFromContinuingOperationsPerDilutedShare', 'IncomeTaxExpenseBenefit', 'IncomeTaxesPaid', 'IncomeTaxesPaidNet', 'IncreaseDecreaseInAccountsAndOtherReceivables', 'IncreaseDecreaseInAccountsPayable', 'IncreaseDecreaseInAccountsReceivable', 'IncreaseDecreaseInAccruedIncomeTaxesPayable', 'IncreaseDecreaseInAccruedLiabilities', 'IncreaseDecreaseInAccruedTaxesPayable', 'IncreaseDecreaseInContractWithCustomerLiability', 'IncreaseDecreaseInDeferredIncomeTaxes', 'IncreaseDecreaseInInventories', 'IncreaseDecreaseInOtherCurrentAssets', 'IncreaseDecreaseInOtherCurrentLiabilities', 'IncreaseDecreaseInOtherNoncurrentAssets', 'IncreaseDecreaseInOtherNoncurrentLiabilities', 'IncreaseDecreaseInPensionPlanObligations', 'IncrementalCommonSharesAttributableToShareBasedPaymentArrangements', 'InterestAndDebtExpense', 'InterestExpenseDebt', 'InterestIncomeExpenseNet', 'InterestPaid', 'InterestPaidNet', 'InventoryNet', 'InvestmentIncomeInterest', 'Land', 'LeaseAndRentalExpense', 'LesseeOperatingLeaseLiabilityPaymentsDue', 'LesseeOperatingLeaseLiabilityPaymentsDueAfterYearFive', 'LesseeOperatingLeaseLiabilityPaymentsDueNextTwelveMonths', 'LesseeOperatingLeaseLiabilityPaymentsDueYearFive', 'LesseeOperatingLeaseLiabilityPaymentsDueYearFour', 'LesseeOperatingLeaseLiabilityPaymentsDueYearThree', 'LesseeOperatingLeaseLiabilityPaymentsDueYearTwo', 'LesseeOperatingLeaseLiabilityPaymentsRemainderOfFiscalYear', 'LettersOfCreditOutstandingAmount', 'Liabilities', 'LiabilitiesAndStockholdersEquity', 'LiabilitiesCurrent', 'LineOfCredit', 'LineOfCreditFacilityMaximumBorrowingCapacity', 'LongTermDebt', 'LongTermDebtCurrent', 'LongTermDebtMaturitiesRepaymentsOfPrincipalAfterYearFive', 'LongTermDebtMaturitiesRepaymentsOfPrincipalInNextTwelveMonths', 'LongTermDebtMaturitiesRepaymentsOfPrincipalInYearFive', 'LongTermDebtMaturitiesRepaymentsOfPrincipalInYearFour', 'LongTermDebtMaturitiesRepaymentsOfPrincipalInYearThree', 'LongTermDebtMaturitiesRepaymentsOfPrincipalInYearTwo', 'LongTermDebtMaturitiesRepaymentsOfPrincipalRemainderOfFiscalYear', 'LongTermDebtNoncurrent', 'LongTermInvestments', 'LossContingencyEstimateOfPossibleLoss', 'MachineryAndEquipmentGross', 'MarketableSecuritiesCurrent', 'MarketableSecuritiesNoncurrent', 'MinorityInterest', 'NetCashProvidedByUsedInFinancingActivities', 'NetCashProvidedByUsedInInvestingActivities', 'NetCashProvidedByUsedInOperatingActivities', 'NetIncomeLoss', 'NetIncomeLossAttributableToNoncontrollingInterest', 'NetIncomeLossAttributableToNonredeemableNoncontrollingInterest', 'NetIncomeLossAttributableToRedeemableNoncontrollingInterest', 'NoncurrentAssets', 'NoncurrentAssets', 'NoninterestIncome', 'NonoperatingIncomeExpense', 'NotesReceivableNet', 'OperatingExpenses', 'OperatingIncomeLoss', 'OperatingLeaseCost', 'OperatingLeaseLiability', 'OperatingLeaseLiabilityCurrent', 'OperatingLeaseLiabilityNoncurrent', 'OperatingLeaseRightOfUseAsset', 'OtherAccruedLiabilitiesCurrent', 'OtherAssetsCurrent', 'OtherAssetsNoncurrent', 'OtherComprehensiveIncomeLossAvailableForSaleSecuritiesAdjustmentNetOfTax', 'OtherComprehensiveIncomeLossCashFlowHedgeGainLossAfterReclassificationAndTax', 'OtherComprehensiveIncomeLossDerivativeInstrumentGainLossafterReclassificationandTax', 'OtherComprehensiveIncomeLossDerivativeInstrumentGainLossbeforeReclassificationafterTax', 'OtherComprehensiveIncomeLossForeignCurrencyTransactionAndTranslationAdjustmentNetOfTax', 'OtherComprehensiveIncomeLossNetOfTax', 'OtherComprehensiveIncomeLossNetOfTaxPortionAttributableToParent', 'OtherComprehensiveIncomeUnrealizedHoldingGainLossOnSecuritiesArisingDuringPeriodNetOfTax', 'OtherIncome', 'OtherLiabilitiesCurrent', 'OtherLiabilitiesNoncurrent', 'OtherLongTermDebt', 'OtherNoncashIncomeExpense', 'PaymentsForCapitalImprovements', 'PaymentsForProceedsFromBusinessesAndInterestInAffiliates', 'PaymentsForProceedsFromOtherInvestingActivities', 'PaymentsForRent', 'PaymentsForRepurchaseOfCommonStock', 'PaymentsOfDebtExtinguishmentCosts', 'PaymentsOfDividends', 'PaymentsOfDividendsMinorityInterest', 'PaymentsToAcquireInvestments', 'PaymentsToAcquirePropertyPlantAndEquipment', 'PreferredStockSharesOutstanding', 'PreferredStockValue', 'PrepaidExpenseAndOtherAssetsCurrent', 'PrepaidExpenseCurrent', 'ProceedsFromDebtMaturingInMoreThanThreeMonths', 'ProceedsFromDebtNetOfIssuanceCosts', 'ProceedsFromDivestitureOfBusinesses', 'ProceedsFromInvestments', 'ProceedsFromIssuanceOfCommonStock', 'ProceedsFromIssuanceOfDebt', 'ProceedsFromIssuanceOfLongTermDebt', 'ProceedsFromIssuanceOfUnsecuredDebt', 'ProceedsFromIssuanceOrSaleOfEquity', 'ProceedsFromMaturitiesPrepaymentsAndCallsOfAvailableForSaleSecurities', 'ProceedsFromPaymentsForOtherFinancingActivities', 'ProceedsFromPaymentsToMinorityShareholders', 'ProceedsFromRepaymentsOfShortTermDebt', 'ProceedsFromRepaymentsOfShortTermDebtMaturingInThreeMonthsOrLess', 'ProceedsFromSaleOfPropertyPlantAndEquipment', 'ProceedsFromStockOptionsExercised', 'ProfitLoss', 'PropertyPlantAndEquipmentGross', 'PropertyPlantAndEquipmentNet', 'ReceivablesNetCurrent', 'RedeemableNoncontrollingInterestEquityCarryingAmount', 'RepaymentsOfDebtMaturingInMoreThanThreeMonths', 'RepaymentsOfLongTermDebt', 'ResearchAndDevelopmentExpense', 'RestrictedCash', 'RestrictedCashAndCashEquivalents', 'RestrictedStockExpense', 'RestructuringCharges', 'RetainedEarningsAccumulatedDeficit', 'RevenueFromContractWithCustomerExcludingAssessedTax', 'Revenues', 'SecuredLongTermDebt', 'SellingAndMarketingExpense', 'SellingGeneralAndAdministrativeExpense', 'ShareBasedCompensation', 'ShortTermBorrowings', 'ShortTermInvestments', 'StockIssuedDuringPeriodValueNewIssues', 'StockOptionPlanExpense', 'StockRedeemedOrCalledDuringPeriodValue', 'StockRepurchasedAndRetiredDuringPeriodValue', 'StockRepurchasedDuringPeriodValue', 'StockholdersEquity', 'StockholdersEquityIncludingPortionAttributableToNoncontrollingInterest', 'StockholdersEquityOther', 'TaxesPayableCurrent', 'TradingSecuritiesDebt', 'TreasuryStockAcquiredAverageCostPerShare', 'TreasuryStockSharesAcquired', 'UnrealizedGainLossOnInvestments', 'UnrecognizedTaxBenefits', 'UnsecuredDebt', 'VariableLeaseCost', 'WeightedAverageNumberDilutedSharesOutstandingAdjustment', 'WeightedAverageNumberOfDilutedSharesOutstanding', 'WeightedAverageNumberOfSharesOutstandingBasic'"
|
| 36 |
+
),
|
| 37 |
+
] = "",
|
| 38 |
+
provider: Annotated[
|
| 39 |
+
Optional[Literal["sec"]],
|
| 40 |
+
OpenBBField(
|
| 41 |
+
description="The provider to use, by default None. If None, the priority list configured in the settings is used. Default priority: sec."
|
| 42 |
+
),
|
| 43 |
+
] = None,
|
| 44 |
+
**kwargs
|
| 45 |
+
) -> OBBject:
|
| 46 |
+
"""Compare reported company facts and fundamental data points.
|
| 47 |
+
|
| 48 |
+
Parameters
|
| 49 |
+
----------
|
| 50 |
+
provider : str
|
| 51 |
+
The provider to use, by default None. If None, the priority list configured in the settings is used. Default priority: sec.
|
| 52 |
+
symbol : Union[str, None, list[Optional[str]]]
|
| 53 |
+
Symbol to get data for. Multiple comma separated items allowed for provider(s): sec.
|
| 54 |
+
fact : str
|
| 55 |
+
The fact to lookup, typically a GAAP-reporting measure. Choices vary by provider.
|
| 56 |
+
Choices for sec: 'AccountsPayableCurrent', 'AccountsReceivableNet', 'AccountsReceivableNetCurrent', 'AccrualForTaxesOtherThanIncomeTaxesCurrent', 'AccrualForTaxesOtherThanIncomeTaxesCurrentAndNoncurrent', 'AccruedIncomeTaxesCurrent', 'AccruedIncomeTaxesNoncurrent', 'AccruedInsuranceCurrent', 'AccruedLiabilitiesCurrent', 'AccumulatedDepreciationDepletionAndAmortizationPropertyPlantAndEquipment', 'AccumulatedOtherComprehensiveIncomeLossNetOfTax', 'AcquisitionsNetOfCashAcquiredAndPurchasesOfIntangibleAndOtherAssets', 'AdjustmentsToAdditionalPaidInCapitalSharebasedCompensationRequisiteServicePeriodRecognitionValue', 'AdvertisingExpense', 'AllocatedShareBasedCompensationExpense', 'AntidilutiveSecuritiesExcludedFromComputationOfEarningsPerShareAmount', 'AssetImpairmentCharges', 'Assets', 'AssetsCurrent', 'AssetsNoncurrent', 'BuildingsAndImprovementsGross', 'CapitalLeaseObligationsCurrent', 'CapitalLeaseObligationsNoncurrent', 'Cash', 'CashAndCashEquivalentsAtCarryingValue', 'CashCashEquivalentsAndShortTermInvestments', 'CashCashEquivalentsRestrictedCashAndRestrictedCashEquivalents', 'CashCashEquivalentsRestrictedCashAndRestrictedCashEquivalentsIncludingDisposalGroupAndDiscontinuedOperations', 'CashCashEquivalentsRestrictedCashAndRestrictedCashEquivalentsPeriodIncreaseDecreaseIncludingExchangeRateEffect', 'CommercialPaper', 'CommitmentsAndContingencies', 'CommonStockDividendsPerShareCashPaid', 'CommonStockDividendsPerShareDeclared', 'CommonStocksIncludingAdditionalPaidInCapital', 'ComprehensiveIncomeNetOfTax', 'ComprehensiveIncomeNetOfTaxAttributableToNoncontrollingInterest', 'ComprehensiveIncomeNetOfTaxIncludingPortionAttributableToNoncontrollingInterest', 'ConstructionInProgressGross', 'ContractWithCustomerAssetNet', 'ContractWithCustomerLiability', 'ContractWithCustomerLiabilityCurrent', 'ContractWithCustomerLiabilityNoncurrent', 'CostOfGoodsAndServicesSold', 'CostOfRevenue', 'CurrentFederalTaxExpenseBenefit', 'CurrentForeignTaxExpenseBenefit', 'CurrentIncomeTaxExpenseBenefit', 'CurrentStateAndLocalTaxExpenseBenefit', 'DebtInstrumentFaceAmount', 'DebtInstrumentFairValue', 'DebtLongtermAndShorttermCombinedAmount', 'DeferredFederalIncomeTaxExpenseBenefit', 'DeferredForeignIncomeTaxExpenseBenefit', 'DeferredIncomeTaxExpenseBenefit', 'DeferredIncomeTaxLiabilities', 'DeferredIncomeTaxLiabilitiesNet', 'DeferredIncomeTaxesAndTaxCredits', 'DeferredRevenue', 'DeferredTaxAssetsGross', 'DeferredTaxAssetsLiabilitiesNet', 'DeferredTaxAssetsNet', 'DeferredTaxLiabilities', 'DefinedContributionPlanCostRecognized', 'Depreciation', 'DepreciationAmortizationAndAccretionNet', 'DepreciationAmortizationAndOther', 'DepreciationAndAmortization', 'DepreciationDepletionAndAmortization', 'DerivativeCollateralObligationToReturnCash', 'DerivativeCollateralRightToReclaimCash', 'DerivativeFairValueOfDerivativeNet', 'DerivativeLiabilityCollateralRightToReclaimCashOffset', 'DerivativeNotionalAmount', 'DistributedEarnings', 'Dividends', 'DividendsCash', 'DividendsPayableAmountPerShare', 'DividendsPayableCurrent', 'EarningsPerShareBasic', 'EarningsPerShareDiluted', 'EffectOfExchangeRateOnCashCashEquivalentsRestrictedCashAndRestrictedCashEquivalents', 'EffectOfExchangeRateOnCashCashEquivalentsRestrictedCashAndRestrictedCashEquivalentsIncludingDisposalGroupAndDiscontinuedOperations', 'EmployeeRelatedLiabilitiesCurrent', 'EmployeeRelatedLiabilitiesCurrentAndNoncurrent', 'EmployeeServiceShareBasedCompensationTaxBenefitFromCompensationExpense', 'FinanceLeaseInterestExpense', 'FinanceLeaseInterestPaymentOnLiability', 'FinanceLeaseLiability', 'FinanceLeaseLiabilityCurrent', 'FinanceLeaseLiabilityNoncurrent', 'FinanceLeaseLiabilityPaymentsDue', 'FinanceLeaseLiabilityPaymentsDueAfterYearFive', 'FinanceLeaseLiabilityPaymentsDueNextTwelveMonths', 'FinanceLeaseLiabilityPaymentsDueYearFive', 'FinanceLeaseLiabilityPaymentsDueYearFour', 'FinanceLeaseLiabilityPaymentsDueYearThree', 'FinanceLeaseLiabilityPaymentsDueYearTwo', 'FinanceLeaseLiabilityPaymentsRemainderOfFiscalYear', 'FinanceLeaseLiabilityUndiscountedExcessAmount', 'FinanceLeasePrincipalPayments', 'FinanceLeaseRightOfUseAsset', 'FinancingReceivableAllowanceForCreditLosses', 'FiniteLivedIntangibleAssetsNet', 'FixturesAndEquipmentGross', 'GainLossOnInvestments', 'GainLossOnInvestmentsAndDerivativeInstruments', 'GainLossOnSaleOfBusiness', 'GainsLossesOnExtinguishmentOfDebt', 'GeneralAndAdministrativeExpense', 'Goodwill', 'GrossProfit', 'ImpairmentOfIntangibleAssetsExcludingGoodwill', 'ImpairmentOfIntangibleAssetsIndefinitelivedExcludingGoodwill', 'IncomeLossFromContinuingOperations', 'IncomeLossFromContinuingOperationsAttributableToNoncontrollingEntity', 'IncomeLossFromContinuingOperationsBeforeIncomeTaxesExtraordinaryItemsNoncontrollingInterest', 'IncomeLossFromContinuingOperationsPerBasicShare', 'IncomeLossFromContinuingOperationsPerDilutedShare', 'IncomeTaxExpenseBenefit', 'IncomeTaxesPaid', 'IncomeTaxesPaidNet', 'IncreaseDecreaseInAccountsAndOtherReceivables', 'IncreaseDecreaseInAccountsPayable', 'IncreaseDecreaseInAccountsReceivable', 'IncreaseDecreaseInAccruedIncomeTaxesPayable', 'IncreaseDecreaseInAccruedLiabilities', 'IncreaseDecreaseInAccruedTaxesPayable', 'IncreaseDecreaseInContractWithCustomerLiability', 'IncreaseDecreaseInDeferredIncomeTaxes', 'IncreaseDecreaseInInventories', 'IncreaseDecreaseInOtherCurrentAssets', 'IncreaseDecreaseInOtherCurrentLiabilities', 'IncreaseDecreaseInOtherNoncurrentAssets', 'IncreaseDecreaseInOtherNoncurrentLiabilities', 'IncreaseDecreaseInPensionPlanObligations', 'IncrementalCommonSharesAttributableToShareBasedPaymentArrangements', 'InterestAndDebtExpense', 'InterestExpenseDebt', 'InterestIncomeExpenseNet', 'InterestPaid', 'InterestPaidNet', 'InventoryNet', 'InvestmentIncomeInterest', 'Land', 'LeaseAndRentalExpense', 'LesseeOperatingLeaseLiabilityPaymentsDue', 'LesseeOperatingLeaseLiabilityPaymentsDueAfterYearFive', 'LesseeOperatingLeaseLiabilityPaymentsDueNextTwelveMonths', 'LesseeOperatingLeaseLiabilityPaymentsDueYearFive', 'LesseeOperatingLeaseLiabilityPaymentsDueYearFour', 'LesseeOperatingLeaseLiabilityPaymentsDueYearThree', 'LesseeOperatingLeaseLiabilityPaymentsDueYearTwo', 'LesseeOperatingLeaseLiabilityPaymentsRemainderOfFiscalYear', 'LettersOfCreditOutstandingAmount', 'Liabilities', 'LiabilitiesAndStockholdersEquity', 'LiabilitiesCurrent', 'LineOfCredit', 'LineOfCreditFacilityMaximumBorrowingCapacity', 'LongTermDebt', 'LongTermDebtCurrent', 'LongTermDebtMaturitiesRepaymentsOfPrincipalAfterYearFive', 'LongTermDebtMaturitiesRepaymentsOfPrincipalInNextTwelveMonths', 'LongTermDebtMaturitiesRepaymentsOfPrincipalInYearFive', 'LongTermDebtMaturitiesRepaymentsOfPrincipalInYearFour', 'LongTermDebtMaturitiesRepaymentsOfPrincipalInYearThree', 'LongTermDebtMaturitiesRepaymentsOfPrincipalInYearTwo', 'LongTermDebtMaturitiesRepaymentsOfPrincipalRemainderOfFiscalYear', 'LongTermDebtNoncurrent', 'LongTermInvestments', 'LossContingencyEstimateOfPossibleLoss', 'MachineryAndEquipmentGross', 'MarketableSecuritiesCurrent', 'MarketableSecuritiesNoncurrent', 'MinorityInterest', 'NetCashProvidedByUsedInFinancingActivities', 'NetCashProvidedByUsedInInvestingActivities', 'NetCashProvidedByUsedInOperatingActivities', 'NetIncomeLoss', 'NetIncomeLossAttributableToNoncontrollingInterest', 'NetIncomeLossAttributableToNonredeemableNoncontrollingInterest', 'NetIncomeLossAttributableToRedeemableNoncontrollingInterest', 'NoncurrentAssets', 'NoncurrentAssets', 'NoninterestIncome', 'NonoperatingIncomeExpense', 'NotesReceivableNet', 'OperatingExpenses', 'OperatingIncomeLoss', 'OperatingLeaseCost', 'OperatingLeaseLiability', 'OperatingLeaseLiabilityCurrent', 'OperatingLeaseLiabilityNoncurrent', 'OperatingLeaseRightOfUseAsset', 'OtherAccruedLiabilitiesCurrent', 'OtherAssetsCurrent', 'OtherAssetsNoncurrent', 'OtherComprehensiveIncomeLossAvailableForSaleSecuritiesAdjustmentNetOfTax', 'OtherComprehensiveIncomeLossCashFlowHedgeGainLossAfterReclassificationAndTax', 'OtherComprehensiveIncomeLossDerivativeInstrumentGainLossafterReclassificationandTax', 'OtherComprehensiveIncomeLossDerivativeInstrumentGainLossbeforeReclassificationafterTax', 'OtherComprehensiveIncomeLossForeignCurrencyTransactionAndTranslationAdjustmentNetOfTax', 'OtherComprehensiveIncomeLossNetOfTax', 'OtherComprehensiveIncomeLossNetOfTaxPortionAttributableToParent', 'OtherComprehensiveIncomeUnrealizedHoldingGainLossOnSecuritiesArisingDuringPeriodNetOfTax', 'OtherIncome', 'OtherLiabilitiesCurrent', 'OtherLiabilitiesNoncurrent', 'OtherLongTermDebt', 'OtherNoncashIncomeExpense', 'PaymentsForCapitalImprovements', 'PaymentsForProceedsFromBusinessesAndInterestInAffiliates', 'PaymentsForProceedsFromOtherInvestingActivities', 'PaymentsForRent', 'PaymentsForRepurchaseOfCommonStock', 'PaymentsOfDebtExtinguishmentCosts', 'PaymentsOfDividends', 'PaymentsOfDividendsMinorityInterest', 'PaymentsToAcquireInvestments', 'PaymentsToAcquirePropertyPlantAndEquipment', 'PreferredStockSharesOutstanding', 'PreferredStockValue', 'PrepaidExpenseAndOtherAssetsCurrent', 'PrepaidExpenseCurrent', 'ProceedsFromDebtMaturingInMoreThanThreeMonths', 'ProceedsFromDebtNetOfIssuanceCosts', 'ProceedsFromDivestitureOfBusinesses', 'ProceedsFromInvestments', 'ProceedsFromIssuanceOfCommonStock', 'ProceedsFromIssuanceOfDebt', 'ProceedsFromIssuanceOfLongTermDebt', 'ProceedsFromIssuanceOfUnsecuredDebt', 'ProceedsFromIssuanceOrSaleOfEquity', 'ProceedsFromMaturitiesPrepaymentsAndCallsOfAvailableForSaleSecurities', 'ProceedsFromPaymentsForOtherFinancingActivities', 'ProceedsFromPaymentsToMinorityShareholders', 'ProceedsFromRepaymentsOfShortTermDebt', 'ProceedsFromRepaymentsOfShortTermDebtMaturingInThreeMonthsOrLess', 'ProceedsFromSaleOfPropertyPlantAndEquipment', 'ProceedsFromStockOptionsExercised', 'ProfitLoss', 'PropertyPlantAndEquipmentGross', 'PropertyPlantAndEquipmentNet', 'ReceivablesNetCurrent', 'RedeemableNoncontrollingInterestEquityCarryingAmount', 'RepaymentsOfDebtMaturingInMoreThanThreeMonths', 'RepaymentsOfLongTermDebt', 'ResearchAndDevelopmentExpense', 'RestrictedCash', 'RestrictedCashAndCashEquivalents', 'RestrictedStockExpense', 'RestructuringCharges', 'RetainedEarningsAccumulatedDeficit', 'RevenueFromContractWithCustomerExcludingAssessedTax', 'Revenues', 'SecuredLongTermDebt', 'SellingAndMarketingExpense', 'SellingGeneralAndAdministrativeExpense', 'ShareBasedCompensation', 'ShortTermBorrowings', 'ShortTermInvestments', 'StockIssuedDuringPeriodValueNewIssues', 'StockOptionPlanExpense', 'StockRedeemedOrCalledDuringPeriodValue', 'StockRepurchasedAndRetiredDuringPeriodValue', 'StockRepurchasedDuringPeriodValue', 'StockholdersEquity', 'StockholdersEquityIncludingPortionAttributableToNoncontrollingInterest', 'StockholdersEquityOther', 'TaxesPayableCurrent', 'TradingSecuritiesDebt', 'TreasuryStockAcquiredAverageCostPerShare', 'TreasuryStockSharesAcquired', 'UnrealizedGainLossOnInvestments', 'UnrecognizedTaxBenefits', 'UnsecuredDebt', 'VariableLeaseCost', 'WeightedAverageNumberDilutedSharesOutstandingAdjustment', 'WeightedAverageNumberOfDilutedSharesOutstanding', 'WeightedAverageNumberOfSharesOutstandingBasic'
|
| 57 |
+
year : Optional[int]
|
| 58 |
+
The year to retrieve the data for. If not provided, the current year is used. When symbol(s) are provided, excluding the year will return all reported values for the concept. (provider: sec)
|
| 59 |
+
fiscal_period : Optional[Literal['fy', 'q1', 'q2', 'q3', 'q4']]
|
| 60 |
+
The fiscal period to retrieve the data for. If not provided, the most recent quarter is used. This parameter is ignored when a symbol is supplied. (provider: sec)
|
| 61 |
+
instantaneous : bool
|
| 62 |
+
Whether to retrieve instantaneous data. See the notes above for more information. Defaults to False. Some facts are only available as instantaneous data.
|
| 63 |
+
The function will automatically attempt the inverse of this parameter if the initial fiscal quarter request fails. This parameter is ignored when a symbol is supplied. (provider: sec)
|
| 64 |
+
use_cache : bool
|
| 65 |
+
Whether to use cache for the request. Defaults to True. (provider: sec)
|
| 66 |
+
|
| 67 |
+
Returns
|
| 68 |
+
-------
|
| 69 |
+
OBBject
|
| 70 |
+
results : list[CompareCompanyFacts]
|
| 71 |
+
Serializable results.
|
| 72 |
+
provider : Optional[str]
|
| 73 |
+
Provider name.
|
| 74 |
+
warnings : Optional[list[Warning_]]
|
| 75 |
+
list of warnings.
|
| 76 |
+
chart : Optional[Chart]
|
| 77 |
+
Chart object.
|
| 78 |
+
extra : Dict[str, Any]
|
| 79 |
+
Extra info.
|
| 80 |
+
|
| 81 |
+
CompareCompanyFacts
|
| 82 |
+
-------------------
|
| 83 |
+
symbol : Optional[str]
|
| 84 |
+
Symbol representing the entity requested in the data.
|
| 85 |
+
name : Optional[str]
|
| 86 |
+
Name of the entity.
|
| 87 |
+
value : float
|
| 88 |
+
The reported value of the fact or concept.
|
| 89 |
+
reported_date : Optional[date]
|
| 90 |
+
The date when the report was filed.
|
| 91 |
+
period_beginning : Optional[date]
|
| 92 |
+
The start date of the reporting period.
|
| 93 |
+
period_ending : Optional[date]
|
| 94 |
+
The end date of the reporting period.
|
| 95 |
+
fiscal_year : Optional[int]
|
| 96 |
+
The fiscal year.
|
| 97 |
+
fiscal_period : Optional[str]
|
| 98 |
+
The fiscal period of the fiscal year.
|
| 99 |
+
cik : Optional[Union[int, str]]
|
| 100 |
+
Central Index Key (CIK) for the requested entity. (provider: sec)
|
| 101 |
+
location : Optional[str]
|
| 102 |
+
Geographic location of the reporting entity. (provider: sec)
|
| 103 |
+
form : Optional[str]
|
| 104 |
+
The SEC form associated with the fact or concept. (provider: sec)
|
| 105 |
+
frame : Optional[str]
|
| 106 |
+
The frame ID associated with the fact or concept, if applicable. (provider: sec)
|
| 107 |
+
accession : Optional[str]
|
| 108 |
+
SEC filing accession number associated with the reported fact or concept. (provider: sec)
|
| 109 |
+
fact : Optional[str]
|
| 110 |
+
The display name of the fact or concept. (provider: sec)
|
| 111 |
+
unit : Optional[str]
|
| 112 |
+
The unit of measurement for the fact or concept. (provider: sec)
|
| 113 |
+
|
| 114 |
+
Examples
|
| 115 |
+
--------
|
| 116 |
+
>>> from openbb import obb
|
| 117 |
+
>>> obb.equity.compare.company_facts(provider='sec')
|
| 118 |
+
>>> obb.equity.compare.company_facts(provider='sec', fact='PaymentsForRepurchaseOfCommonStock', year=2023)
|
| 119 |
+
>>> obb.equity.compare.company_facts(provider='sec', symbol='NVDA,AAPL,AMZN,MSFT,GOOG,SMCI', fact='RevenueFromContractWithCustomerExcludingAssessedTax', year=2024)
|
| 120 |
+
""" # noqa: E501
|
| 121 |
+
|
| 122 |
+
return self._run(
|
| 123 |
+
"/equity/compare/company_facts",
|
| 124 |
+
**filter_inputs(
|
| 125 |
+
provider_choices={
|
| 126 |
+
"provider": self._get_provider(
|
| 127 |
+
provider,
|
| 128 |
+
"equity.compare.company_facts",
|
| 129 |
+
("sec",),
|
| 130 |
+
)
|
| 131 |
+
},
|
| 132 |
+
standard_params={
|
| 133 |
+
"symbol": symbol,
|
| 134 |
+
"fact": fact,
|
| 135 |
+
},
|
| 136 |
+
extra_params=kwargs,
|
| 137 |
+
info={
|
| 138 |
+
"symbol": {
|
| 139 |
+
"sec": {"multiple_items_allowed": True, "choices": None}
|
| 140 |
+
},
|
| 141 |
+
"fact": {
|
| 142 |
+
"sec": {
|
| 143 |
+
"multiple_items_allowed": False,
|
| 144 |
+
"choices": [
|
| 145 |
+
"AccountsPayableCurrent",
|
| 146 |
+
"AccountsReceivableNet",
|
| 147 |
+
"AccountsReceivableNetCurrent",
|
| 148 |
+
"AccrualForTaxesOtherThanIncomeTaxesCurrent",
|
| 149 |
+
"AccrualForTaxesOtherThanIncomeTaxesCurrentAndNoncurrent",
|
| 150 |
+
"AccruedIncomeTaxesCurrent",
|
| 151 |
+
"AccruedIncomeTaxesNoncurrent",
|
| 152 |
+
"AccruedInsuranceCurrent",
|
| 153 |
+
"AccruedLiabilitiesCurrent",
|
| 154 |
+
"AccumulatedDepreciationDepletionAndAmortizationPropertyPlantAndEquipment",
|
| 155 |
+
"AccumulatedOtherComprehensiveIncomeLossNetOfTax",
|
| 156 |
+
"AcquisitionsNetOfCashAcquiredAndPurchasesOfIntangibleAndOtherAssets",
|
| 157 |
+
"AdjustmentsToAdditionalPaidInCapitalSharebasedCompensationRequisiteServicePeriodRecognitionValue",
|
| 158 |
+
"AdvertisingExpense",
|
| 159 |
+
"AllocatedShareBasedCompensationExpense",
|
| 160 |
+
"AntidilutiveSecuritiesExcludedFromComputationOfEarningsPerShareAmount",
|
| 161 |
+
"AssetImpairmentCharges",
|
| 162 |
+
"Assets",
|
| 163 |
+
"AssetsCurrent",
|
| 164 |
+
"AssetsNoncurrent",
|
| 165 |
+
"BuildingsAndImprovementsGross",
|
| 166 |
+
"CapitalLeaseObligationsCurrent",
|
| 167 |
+
"CapitalLeaseObligationsNoncurrent",
|
| 168 |
+
"Cash",
|
| 169 |
+
"CashAndCashEquivalentsAtCarryingValue",
|
| 170 |
+
"CashCashEquivalentsAndShortTermInvestments",
|
| 171 |
+
"CashCashEquivalentsRestrictedCashAndRestrictedCashEquivalents",
|
| 172 |
+
"CashCashEquivalentsRestrictedCashAndRestrictedCashEquivalentsIncludingDisposalGroupAndDiscontinuedOperations",
|
| 173 |
+
"CashCashEquivalentsRestrictedCashAndRestrictedCashEquivalentsPeriodIncreaseDecreaseIncludingExchangeRateEffect",
|
| 174 |
+
"CommercialPaper",
|
| 175 |
+
"CommitmentsAndContingencies",
|
| 176 |
+
"CommonStockDividendsPerShareCashPaid",
|
| 177 |
+
"CommonStockDividendsPerShareDeclared",
|
| 178 |
+
"CommonStocksIncludingAdditionalPaidInCapital",
|
| 179 |
+
"ComprehensiveIncomeNetOfTax",
|
| 180 |
+
"ComprehensiveIncomeNetOfTaxAttributableToNoncontrollingInterest",
|
| 181 |
+
"ComprehensiveIncomeNetOfTaxIncludingPortionAttributableToNoncontrollingInterest",
|
| 182 |
+
"ConstructionInProgressGross",
|
| 183 |
+
"ContractWithCustomerAssetNet",
|
| 184 |
+
"ContractWithCustomerLiability",
|
| 185 |
+
"ContractWithCustomerLiabilityCurrent",
|
| 186 |
+
"ContractWithCustomerLiabilityNoncurrent",
|
| 187 |
+
"CostOfGoodsAndServicesSold",
|
| 188 |
+
"CostOfRevenue",
|
| 189 |
+
"CurrentFederalTaxExpenseBenefit",
|
| 190 |
+
"CurrentForeignTaxExpenseBenefit",
|
| 191 |
+
"CurrentIncomeTaxExpenseBenefit",
|
| 192 |
+
"CurrentStateAndLocalTaxExpenseBenefit",
|
| 193 |
+
"DebtInstrumentFaceAmount",
|
| 194 |
+
"DebtInstrumentFairValue",
|
| 195 |
+
"DebtLongtermAndShorttermCombinedAmount",
|
| 196 |
+
"DeferredFederalIncomeTaxExpenseBenefit",
|
| 197 |
+
"DeferredForeignIncomeTaxExpenseBenefit",
|
| 198 |
+
"DeferredIncomeTaxExpenseBenefit",
|
| 199 |
+
"DeferredIncomeTaxLiabilities",
|
| 200 |
+
"DeferredIncomeTaxLiabilitiesNet",
|
| 201 |
+
"DeferredIncomeTaxesAndTaxCredits",
|
| 202 |
+
"DeferredRevenue",
|
| 203 |
+
"DeferredTaxAssetsGross",
|
| 204 |
+
"DeferredTaxAssetsLiabilitiesNet",
|
| 205 |
+
"DeferredTaxAssetsNet",
|
| 206 |
+
"DeferredTaxLiabilities",
|
| 207 |
+
"DefinedContributionPlanCostRecognized",
|
| 208 |
+
"Depreciation",
|
| 209 |
+
"DepreciationAmortizationAndAccretionNet",
|
| 210 |
+
"DepreciationAmortizationAndOther",
|
| 211 |
+
"DepreciationAndAmortization",
|
| 212 |
+
"DepreciationDepletionAndAmortization",
|
| 213 |
+
"DerivativeCollateralObligationToReturnCash",
|
| 214 |
+
"DerivativeCollateralRightToReclaimCash",
|
| 215 |
+
"DerivativeFairValueOfDerivativeNet",
|
| 216 |
+
"DerivativeLiabilityCollateralRightToReclaimCashOffset",
|
| 217 |
+
"DerivativeNotionalAmount",
|
| 218 |
+
"DistributedEarnings",
|
| 219 |
+
"Dividends",
|
| 220 |
+
"DividendsCash",
|
| 221 |
+
"DividendsPayableAmountPerShare",
|
| 222 |
+
"DividendsPayableCurrent",
|
| 223 |
+
"EarningsPerShareBasic",
|
| 224 |
+
"EarningsPerShareDiluted",
|
| 225 |
+
"EffectOfExchangeRateOnCashCashEquivalentsRestrictedCashAndRestrictedCashEquivalents",
|
| 226 |
+
"EffectOfExchangeRateOnCashCashEquivalentsRestrictedCashAndRestrictedCashEquivalentsIncludingDisposalGroupAndDiscontinuedOperations",
|
| 227 |
+
"EmployeeRelatedLiabilitiesCurrent",
|
| 228 |
+
"EmployeeRelatedLiabilitiesCurrentAndNoncurrent",
|
| 229 |
+
"EmployeeServiceShareBasedCompensationTaxBenefitFromCompensationExpense",
|
| 230 |
+
"FinanceLeaseInterestExpense",
|
| 231 |
+
"FinanceLeaseInterestPaymentOnLiability",
|
| 232 |
+
"FinanceLeaseLiability",
|
| 233 |
+
"FinanceLeaseLiabilityCurrent",
|
| 234 |
+
"FinanceLeaseLiabilityNoncurrent",
|
| 235 |
+
"FinanceLeaseLiabilityPaymentsDue",
|
| 236 |
+
"FinanceLeaseLiabilityPaymentsDueAfterYearFive",
|
| 237 |
+
"FinanceLeaseLiabilityPaymentsDueNextTwelveMonths",
|
| 238 |
+
"FinanceLeaseLiabilityPaymentsDueYearFive",
|
| 239 |
+
"FinanceLeaseLiabilityPaymentsDueYearFour",
|
| 240 |
+
"FinanceLeaseLiabilityPaymentsDueYearThree",
|
| 241 |
+
"FinanceLeaseLiabilityPaymentsDueYearTwo",
|
| 242 |
+
"FinanceLeaseLiabilityPaymentsRemainderOfFiscalYear",
|
| 243 |
+
"FinanceLeaseLiabilityUndiscountedExcessAmount",
|
| 244 |
+
"FinanceLeasePrincipalPayments",
|
| 245 |
+
"FinanceLeaseRightOfUseAsset",
|
| 246 |
+
"FinancingReceivableAllowanceForCreditLosses",
|
| 247 |
+
"FiniteLivedIntangibleAssetsNet",
|
| 248 |
+
"FixturesAndEquipmentGross",
|
| 249 |
+
"GainLossOnInvestments",
|
| 250 |
+
"GainLossOnInvestmentsAndDerivativeInstruments",
|
| 251 |
+
"GainLossOnSaleOfBusiness",
|
| 252 |
+
"GainsLossesOnExtinguishmentOfDebt",
|
| 253 |
+
"GeneralAndAdministrativeExpense",
|
| 254 |
+
"Goodwill",
|
| 255 |
+
"GrossProfit",
|
| 256 |
+
"ImpairmentOfIntangibleAssetsExcludingGoodwill",
|
| 257 |
+
"ImpairmentOfIntangibleAssetsIndefinitelivedExcludingGoodwill",
|
| 258 |
+
"IncomeLossFromContinuingOperations",
|
| 259 |
+
"IncomeLossFromContinuingOperationsAttributableToNoncontrollingEntity",
|
| 260 |
+
"IncomeLossFromContinuingOperationsBeforeIncomeTaxesExtraordinaryItemsNoncontrollingInterest",
|
| 261 |
+
"IncomeLossFromContinuingOperationsPerBasicShare",
|
| 262 |
+
"IncomeLossFromContinuingOperationsPerDilutedShare",
|
| 263 |
+
"IncomeTaxExpenseBenefit",
|
| 264 |
+
"IncomeTaxesPaid",
|
| 265 |
+
"IncomeTaxesPaidNet",
|
| 266 |
+
"IncreaseDecreaseInAccountsAndOtherReceivables",
|
| 267 |
+
"IncreaseDecreaseInAccountsPayable",
|
| 268 |
+
"IncreaseDecreaseInAccountsReceivable",
|
| 269 |
+
"IncreaseDecreaseInAccruedIncomeTaxesPayable",
|
| 270 |
+
"IncreaseDecreaseInAccruedLiabilities",
|
| 271 |
+
"IncreaseDecreaseInAccruedTaxesPayable",
|
| 272 |
+
"IncreaseDecreaseInContractWithCustomerLiability",
|
| 273 |
+
"IncreaseDecreaseInDeferredIncomeTaxes",
|
| 274 |
+
"IncreaseDecreaseInInventories",
|
| 275 |
+
"IncreaseDecreaseInOtherCurrentAssets",
|
| 276 |
+
"IncreaseDecreaseInOtherCurrentLiabilities",
|
| 277 |
+
"IncreaseDecreaseInOtherNoncurrentAssets",
|
| 278 |
+
"IncreaseDecreaseInOtherNoncurrentLiabilities",
|
| 279 |
+
"IncreaseDecreaseInPensionPlanObligations",
|
| 280 |
+
"IncrementalCommonSharesAttributableToShareBasedPaymentArrangements",
|
| 281 |
+
"InterestAndDebtExpense",
|
| 282 |
+
"InterestExpenseDebt",
|
| 283 |
+
"InterestIncomeExpenseNet",
|
| 284 |
+
"InterestPaid",
|
| 285 |
+
"InterestPaidNet",
|
| 286 |
+
"InventoryNet",
|
| 287 |
+
"InvestmentIncomeInterest",
|
| 288 |
+
"Land",
|
| 289 |
+
"LeaseAndRentalExpense",
|
| 290 |
+
"LesseeOperatingLeaseLiabilityPaymentsDue",
|
| 291 |
+
"LesseeOperatingLeaseLiabilityPaymentsDueAfterYearFive",
|
| 292 |
+
"LesseeOperatingLeaseLiabilityPaymentsDueNextTwelveMonths",
|
| 293 |
+
"LesseeOperatingLeaseLiabilityPaymentsDueYearFive",
|
| 294 |
+
"LesseeOperatingLeaseLiabilityPaymentsDueYearFour",
|
| 295 |
+
"LesseeOperatingLeaseLiabilityPaymentsDueYearThree",
|
| 296 |
+
"LesseeOperatingLeaseLiabilityPaymentsDueYearTwo",
|
| 297 |
+
"LesseeOperatingLeaseLiabilityPaymentsRemainderOfFiscalYear",
|
| 298 |
+
"LettersOfCreditOutstandingAmount",
|
| 299 |
+
"Liabilities",
|
| 300 |
+
"LiabilitiesAndStockholdersEquity",
|
| 301 |
+
"LiabilitiesCurrent",
|
| 302 |
+
"LineOfCredit",
|
| 303 |
+
"LineOfCreditFacilityMaximumBorrowingCapacity",
|
| 304 |
+
"LongTermDebt",
|
| 305 |
+
"LongTermDebtCurrent",
|
| 306 |
+
"LongTermDebtMaturitiesRepaymentsOfPrincipalAfterYearFive",
|
| 307 |
+
"LongTermDebtMaturitiesRepaymentsOfPrincipalInNextTwelveMonths",
|
| 308 |
+
"LongTermDebtMaturitiesRepaymentsOfPrincipalInYearFive",
|
| 309 |
+
"LongTermDebtMaturitiesRepaymentsOfPrincipalInYearFour",
|
| 310 |
+
"LongTermDebtMaturitiesRepaymentsOfPrincipalInYearThree",
|
| 311 |
+
"LongTermDebtMaturitiesRepaymentsOfPrincipalInYearTwo",
|
| 312 |
+
"LongTermDebtMaturitiesRepaymentsOfPrincipalRemainderOfFiscalYear",
|
| 313 |
+
"LongTermDebtNoncurrent",
|
| 314 |
+
"LongTermInvestments",
|
| 315 |
+
"LossContingencyEstimateOfPossibleLoss",
|
| 316 |
+
"MachineryAndEquipmentGross",
|
| 317 |
+
"MarketableSecuritiesCurrent",
|
| 318 |
+
"MarketableSecuritiesNoncurrent",
|
| 319 |
+
"MinorityInterest",
|
| 320 |
+
"NetCashProvidedByUsedInFinancingActivities",
|
| 321 |
+
"NetCashProvidedByUsedInInvestingActivities",
|
| 322 |
+
"NetCashProvidedByUsedInOperatingActivities",
|
| 323 |
+
"NetIncomeLoss",
|
| 324 |
+
"NetIncomeLossAttributableToNoncontrollingInterest",
|
| 325 |
+
"NetIncomeLossAttributableToNonredeemableNoncontrollingInterest",
|
| 326 |
+
"NetIncomeLossAttributableToRedeemableNoncontrollingInterest",
|
| 327 |
+
"NoncurrentAssets",
|
| 328 |
+
"NoncurrentAssets",
|
| 329 |
+
"NoninterestIncome",
|
| 330 |
+
"NonoperatingIncomeExpense",
|
| 331 |
+
"NotesReceivableNet",
|
| 332 |
+
"OperatingExpenses",
|
| 333 |
+
"OperatingIncomeLoss",
|
| 334 |
+
"OperatingLeaseCost",
|
| 335 |
+
"OperatingLeaseLiability",
|
| 336 |
+
"OperatingLeaseLiabilityCurrent",
|
| 337 |
+
"OperatingLeaseLiabilityNoncurrent",
|
| 338 |
+
"OperatingLeaseRightOfUseAsset",
|
| 339 |
+
"OtherAccruedLiabilitiesCurrent",
|
| 340 |
+
"OtherAssetsCurrent",
|
| 341 |
+
"OtherAssetsNoncurrent",
|
| 342 |
+
"OtherComprehensiveIncomeLossAvailableForSaleSecuritiesAdjustmentNetOfTax",
|
| 343 |
+
"OtherComprehensiveIncomeLossCashFlowHedgeGainLossAfterReclassificationAndTax",
|
| 344 |
+
"OtherComprehensiveIncomeLossDerivativeInstrumentGainLossafterReclassificationandTax",
|
| 345 |
+
"OtherComprehensiveIncomeLossDerivativeInstrumentGainLossbeforeReclassificationafterTax",
|
| 346 |
+
"OtherComprehensiveIncomeLossForeignCurrencyTransactionAndTranslationAdjustmentNetOfTax",
|
| 347 |
+
"OtherComprehensiveIncomeLossNetOfTax",
|
| 348 |
+
"OtherComprehensiveIncomeLossNetOfTaxPortionAttributableToParent",
|
| 349 |
+
"OtherComprehensiveIncomeUnrealizedHoldingGainLossOnSecuritiesArisingDuringPeriodNetOfTax",
|
| 350 |
+
"OtherIncome",
|
| 351 |
+
"OtherLiabilitiesCurrent",
|
| 352 |
+
"OtherLiabilitiesNoncurrent",
|
| 353 |
+
"OtherLongTermDebt",
|
| 354 |
+
"OtherNoncashIncomeExpense",
|
| 355 |
+
"PaymentsForCapitalImprovements",
|
| 356 |
+
"PaymentsForProceedsFromBusinessesAndInterestInAffiliates",
|
| 357 |
+
"PaymentsForProceedsFromOtherInvestingActivities",
|
| 358 |
+
"PaymentsForRent",
|
| 359 |
+
"PaymentsForRepurchaseOfCommonStock",
|
| 360 |
+
"PaymentsOfDebtExtinguishmentCosts",
|
| 361 |
+
"PaymentsOfDividends",
|
| 362 |
+
"PaymentsOfDividendsMinorityInterest",
|
| 363 |
+
"PaymentsToAcquireInvestments",
|
| 364 |
+
"PaymentsToAcquirePropertyPlantAndEquipment",
|
| 365 |
+
"PreferredStockSharesOutstanding",
|
| 366 |
+
"PreferredStockValue",
|
| 367 |
+
"PrepaidExpenseAndOtherAssetsCurrent",
|
| 368 |
+
"PrepaidExpenseCurrent",
|
| 369 |
+
"ProceedsFromDebtMaturingInMoreThanThreeMonths",
|
| 370 |
+
"ProceedsFromDebtNetOfIssuanceCosts",
|
| 371 |
+
"ProceedsFromDivestitureOfBusinesses",
|
| 372 |
+
"ProceedsFromInvestments",
|
| 373 |
+
"ProceedsFromIssuanceOfCommonStock",
|
| 374 |
+
"ProceedsFromIssuanceOfDebt",
|
| 375 |
+
"ProceedsFromIssuanceOfLongTermDebt",
|
| 376 |
+
"ProceedsFromIssuanceOfUnsecuredDebt",
|
| 377 |
+
"ProceedsFromIssuanceOrSaleOfEquity",
|
| 378 |
+
"ProceedsFromMaturitiesPrepaymentsAndCallsOfAvailableForSaleSecurities",
|
| 379 |
+
"ProceedsFromPaymentsForOtherFinancingActivities",
|
| 380 |
+
"ProceedsFromPaymentsToMinorityShareholders",
|
| 381 |
+
"ProceedsFromRepaymentsOfShortTermDebt",
|
| 382 |
+
"ProceedsFromRepaymentsOfShortTermDebtMaturingInThreeMonthsOrLess",
|
| 383 |
+
"ProceedsFromSaleOfPropertyPlantAndEquipment",
|
| 384 |
+
"ProceedsFromStockOptionsExercised",
|
| 385 |
+
"ProfitLoss",
|
| 386 |
+
"PropertyPlantAndEquipmentGross",
|
| 387 |
+
"PropertyPlantAndEquipmentNet",
|
| 388 |
+
"ReceivablesNetCurrent",
|
| 389 |
+
"RedeemableNoncontrollingInterestEquityCarryingAmount",
|
| 390 |
+
"RepaymentsOfDebtMaturingInMoreThanThreeMonths",
|
| 391 |
+
"RepaymentsOfLongTermDebt",
|
| 392 |
+
"ResearchAndDevelopmentExpense",
|
| 393 |
+
"RestrictedCash",
|
| 394 |
+
"RestrictedCashAndCashEquivalents",
|
| 395 |
+
"RestrictedStockExpense",
|
| 396 |
+
"RestructuringCharges",
|
| 397 |
+
"RetainedEarningsAccumulatedDeficit",
|
| 398 |
+
"RevenueFromContractWithCustomerExcludingAssessedTax",
|
| 399 |
+
"Revenues",
|
| 400 |
+
"SecuredLongTermDebt",
|
| 401 |
+
"SellingAndMarketingExpense",
|
| 402 |
+
"SellingGeneralAndAdministrativeExpense",
|
| 403 |
+
"ShareBasedCompensation",
|
| 404 |
+
"ShortTermBorrowings",
|
| 405 |
+
"ShortTermInvestments",
|
| 406 |
+
"StockIssuedDuringPeriodValueNewIssues",
|
| 407 |
+
"StockOptionPlanExpense",
|
| 408 |
+
"StockRedeemedOrCalledDuringPeriodValue",
|
| 409 |
+
"StockRepurchasedAndRetiredDuringPeriodValue",
|
| 410 |
+
"StockRepurchasedDuringPeriodValue",
|
| 411 |
+
"StockholdersEquity",
|
| 412 |
+
"StockholdersEquityIncludingPortionAttributableToNoncontrollingInterest",
|
| 413 |
+
"StockholdersEquityOther",
|
| 414 |
+
"TaxesPayableCurrent",
|
| 415 |
+
"TradingSecuritiesDebt",
|
| 416 |
+
"TreasuryStockAcquiredAverageCostPerShare",
|
| 417 |
+
"TreasuryStockSharesAcquired",
|
| 418 |
+
"UnrealizedGainLossOnInvestments",
|
| 419 |
+
"UnrecognizedTaxBenefits",
|
| 420 |
+
"UnsecuredDebt",
|
| 421 |
+
"VariableLeaseCost",
|
| 422 |
+
"WeightedAverageNumberDilutedSharesOutstandingAdjustment",
|
| 423 |
+
"WeightedAverageNumberOfDilutedSharesOutstanding",
|
| 424 |
+
"WeightedAverageNumberOfSharesOutstandingBasic",
|
| 425 |
+
],
|
| 426 |
+
}
|
| 427 |
+
},
|
| 428 |
+
"fiscal_period": {
|
| 429 |
+
"sec": {
|
| 430 |
+
"multiple_items_allowed": False,
|
| 431 |
+
"choices": ["fy", "q1", "q2", "q3", "q4"],
|
| 432 |
+
}
|
| 433 |
+
},
|
| 434 |
+
},
|
| 435 |
+
)
|
| 436 |
+
)
|
| 437 |
+
|
| 438 |
+
@exception_handler
|
| 439 |
+
@validate
|
| 440 |
+
def peers(
|
| 441 |
+
self,
|
| 442 |
+
symbol: Annotated[str, OpenBBField(description="Symbol to get data for.")],
|
| 443 |
+
provider: Annotated[
|
| 444 |
+
Optional[Literal["fmp"]],
|
| 445 |
+
OpenBBField(
|
| 446 |
+
description="The provider to use, by default None. If None, the priority list configured in the settings is used. Default priority: fmp."
|
| 447 |
+
),
|
| 448 |
+
] = None,
|
| 449 |
+
**kwargs
|
| 450 |
+
) -> OBBject:
|
| 451 |
+
"""Get the closest peers for a given company.
|
| 452 |
+
|
| 453 |
+
Peers consist of companies trading on the same exchange, operating within the same sector
|
| 454 |
+
and with comparable market capitalizations.
|
| 455 |
+
|
| 456 |
+
|
| 457 |
+
Parameters
|
| 458 |
+
----------
|
| 459 |
+
provider : str
|
| 460 |
+
The provider to use, by default None. If None, the priority list configured in the settings is used. Default priority: fmp.
|
| 461 |
+
symbol : str
|
| 462 |
+
Symbol to get data for.
|
| 463 |
+
|
| 464 |
+
Returns
|
| 465 |
+
-------
|
| 466 |
+
OBBject
|
| 467 |
+
results : EquityPeers
|
| 468 |
+
Serializable results.
|
| 469 |
+
provider : Optional[str]
|
| 470 |
+
Provider name.
|
| 471 |
+
warnings : Optional[list[Warning_]]
|
| 472 |
+
list of warnings.
|
| 473 |
+
chart : Optional[Chart]
|
| 474 |
+
Chart object.
|
| 475 |
+
extra : Dict[str, Any]
|
| 476 |
+
Extra info.
|
| 477 |
+
|
| 478 |
+
EquityPeers
|
| 479 |
+
-----------
|
| 480 |
+
peers_list : list[str]
|
| 481 |
+
A list of equity peers based on sector, exchange and market cap.
|
| 482 |
+
|
| 483 |
+
Examples
|
| 484 |
+
--------
|
| 485 |
+
>>> from openbb import obb
|
| 486 |
+
>>> obb.equity.compare.peers(symbol='AAPL', provider='fmp')
|
| 487 |
+
""" # noqa: E501
|
| 488 |
+
|
| 489 |
+
return self._run(
|
| 490 |
+
"/equity/compare/peers",
|
| 491 |
+
**filter_inputs(
|
| 492 |
+
provider_choices={
|
| 493 |
+
"provider": self._get_provider(
|
| 494 |
+
provider,
|
| 495 |
+
"equity.compare.peers",
|
| 496 |
+
("fmp",),
|
| 497 |
+
)
|
| 498 |
+
},
|
| 499 |
+
standard_params={
|
| 500 |
+
"symbol": symbol,
|
| 501 |
+
},
|
| 502 |
+
extra_params=kwargs,
|
| 503 |
+
)
|
| 504 |
+
)
|
openbb_platform/openbb/package/equity_discovery.py
ADDED
|
@@ -0,0 +1,1102 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|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
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
### THIS FILE IS AUTO-GENERATED. DO NOT EDIT. ###
|
| 2 |
+
|
| 3 |
+
import datetime
|
| 4 |
+
from typing import Literal, Optional, Union
|
| 5 |
+
|
| 6 |
+
from openbb_core.app.model.field import OpenBBField
|
| 7 |
+
from openbb_core.app.model.obbject import OBBject
|
| 8 |
+
from openbb_core.app.static.container import Container
|
| 9 |
+
from openbb_core.app.static.utils.decorators import exception_handler, validate
|
| 10 |
+
from openbb_core.app.static.utils.filters import filter_inputs
|
| 11 |
+
from typing_extensions import Annotated
|
| 12 |
+
|
| 13 |
+
|
| 14 |
+
class ROUTER_equity_discovery(Container):
|
| 15 |
+
"""/equity/discovery
|
| 16 |
+
active
|
| 17 |
+
aggressive_small_caps
|
| 18 |
+
filings
|
| 19 |
+
gainers
|
| 20 |
+
growth_tech
|
| 21 |
+
latest_financial_reports
|
| 22 |
+
losers
|
| 23 |
+
undervalued_growth
|
| 24 |
+
undervalued_large_caps
|
| 25 |
+
"""
|
| 26 |
+
|
| 27 |
+
def __repr__(self) -> str:
|
| 28 |
+
return self.__doc__ or ""
|
| 29 |
+
|
| 30 |
+
@exception_handler
|
| 31 |
+
@validate
|
| 32 |
+
def active(
|
| 33 |
+
self,
|
| 34 |
+
sort: Annotated[
|
| 35 |
+
Literal["asc", "desc"],
|
| 36 |
+
OpenBBField(
|
| 37 |
+
description="Sort order. Possible values: 'asc', 'desc'. Default: 'desc'."
|
| 38 |
+
),
|
| 39 |
+
] = "desc",
|
| 40 |
+
provider: Annotated[
|
| 41 |
+
Optional[Literal["yfinance"]],
|
| 42 |
+
OpenBBField(
|
| 43 |
+
description="The provider to use, by default None. If None, the priority list configured in the settings is used. Default priority: yfinance."
|
| 44 |
+
),
|
| 45 |
+
] = None,
|
| 46 |
+
**kwargs
|
| 47 |
+
) -> OBBject:
|
| 48 |
+
"""Get the most actively traded stocks based on volume.
|
| 49 |
+
|
| 50 |
+
Parameters
|
| 51 |
+
----------
|
| 52 |
+
provider : str
|
| 53 |
+
The provider to use, by default None. If None, the priority list configured in the settings is used. Default priority: yfinance.
|
| 54 |
+
sort : Literal['asc', 'desc']
|
| 55 |
+
Sort order. Possible values: 'asc', 'desc'. Default: 'desc'.
|
| 56 |
+
limit : Optional[int]
|
| 57 |
+
Limit the number of results. (provider: yfinance)
|
| 58 |
+
|
| 59 |
+
Returns
|
| 60 |
+
-------
|
| 61 |
+
OBBject
|
| 62 |
+
results : list[EquityActive]
|
| 63 |
+
Serializable results.
|
| 64 |
+
provider : Optional[str]
|
| 65 |
+
Provider name.
|
| 66 |
+
warnings : Optional[list[Warning_]]
|
| 67 |
+
list of warnings.
|
| 68 |
+
chart : Optional[Chart]
|
| 69 |
+
Chart object.
|
| 70 |
+
extra : Dict[str, Any]
|
| 71 |
+
Extra info.
|
| 72 |
+
|
| 73 |
+
EquityActive
|
| 74 |
+
------------
|
| 75 |
+
symbol : str
|
| 76 |
+
Symbol representing the entity requested in the data.
|
| 77 |
+
name : Optional[str]
|
| 78 |
+
Name of the entity.
|
| 79 |
+
price : float
|
| 80 |
+
Last price.
|
| 81 |
+
change : float
|
| 82 |
+
Change in price.
|
| 83 |
+
percent_change : float
|
| 84 |
+
Percent change.
|
| 85 |
+
volume : Union[int, float]
|
| 86 |
+
The trading volume.
|
| 87 |
+
open : Optional[float]
|
| 88 |
+
Open price for the day. (provider: yfinance)
|
| 89 |
+
high : Optional[float]
|
| 90 |
+
High price for the day. (provider: yfinance)
|
| 91 |
+
low : Optional[float]
|
| 92 |
+
Low price for the day. (provider: yfinance)
|
| 93 |
+
previous_close : Optional[float]
|
| 94 |
+
Previous close price. (provider: yfinance)
|
| 95 |
+
ma50 : Optional[float]
|
| 96 |
+
50-day moving average. (provider: yfinance)
|
| 97 |
+
ma200 : Optional[float]
|
| 98 |
+
200-day moving average. (provider: yfinance)
|
| 99 |
+
year_high : Optional[float]
|
| 100 |
+
52-week high. (provider: yfinance)
|
| 101 |
+
year_low : Optional[float]
|
| 102 |
+
52-week low. (provider: yfinance)
|
| 103 |
+
market_cap : Optional[float]
|
| 104 |
+
Market Cap. (provider: yfinance)
|
| 105 |
+
shares_outstanding : Optional[float]
|
| 106 |
+
Shares outstanding. (provider: yfinance)
|
| 107 |
+
book_value : Optional[float]
|
| 108 |
+
Book value per share. (provider: yfinance)
|
| 109 |
+
price_to_book : Optional[float]
|
| 110 |
+
Price to book ratio. (provider: yfinance)
|
| 111 |
+
eps_ttm : Optional[float]
|
| 112 |
+
Earnings per share over the trailing twelve months. (provider: yfinance)
|
| 113 |
+
eps_forward : Optional[float]
|
| 114 |
+
Forward earnings per share. (provider: yfinance)
|
| 115 |
+
pe_forward : Optional[float]
|
| 116 |
+
Forward price-to-earnings ratio. (provider: yfinance)
|
| 117 |
+
dividend_yield : Optional[float]
|
| 118 |
+
Trailing twelve month dividend yield. (provider: yfinance)
|
| 119 |
+
exchange : Optional[str]
|
| 120 |
+
Exchange where the stock is listed. (provider: yfinance)
|
| 121 |
+
exchange_timezone : Optional[str]
|
| 122 |
+
Timezone of the exchange. (provider: yfinance)
|
| 123 |
+
earnings_date : Optional[datetime]
|
| 124 |
+
Most recent earnings date. (provider: yfinance)
|
| 125 |
+
currency : Optional[str]
|
| 126 |
+
Currency of the price data. (provider: yfinance)
|
| 127 |
+
|
| 128 |
+
Examples
|
| 129 |
+
--------
|
| 130 |
+
>>> from openbb import obb
|
| 131 |
+
>>> obb.equity.discovery.active(provider='yfinance')
|
| 132 |
+
>>> obb.equity.discovery.active(sort='desc', provider='yfinance')
|
| 133 |
+
""" # noqa: E501
|
| 134 |
+
|
| 135 |
+
return self._run(
|
| 136 |
+
"/equity/discovery/active",
|
| 137 |
+
**filter_inputs(
|
| 138 |
+
provider_choices={
|
| 139 |
+
"provider": self._get_provider(
|
| 140 |
+
provider,
|
| 141 |
+
"equity.discovery.active",
|
| 142 |
+
("yfinance",),
|
| 143 |
+
)
|
| 144 |
+
},
|
| 145 |
+
standard_params={
|
| 146 |
+
"sort": sort,
|
| 147 |
+
},
|
| 148 |
+
extra_params=kwargs,
|
| 149 |
+
)
|
| 150 |
+
)
|
| 151 |
+
|
| 152 |
+
@exception_handler
|
| 153 |
+
@validate
|
| 154 |
+
def aggressive_small_caps(
|
| 155 |
+
self,
|
| 156 |
+
sort: Annotated[
|
| 157 |
+
Literal["asc", "desc"],
|
| 158 |
+
OpenBBField(
|
| 159 |
+
description="Sort order. Possible values: 'asc', 'desc'. Default: 'desc'."
|
| 160 |
+
),
|
| 161 |
+
] = "desc",
|
| 162 |
+
provider: Annotated[
|
| 163 |
+
Optional[Literal["yfinance"]],
|
| 164 |
+
OpenBBField(
|
| 165 |
+
description="The provider to use, by default None. If None, the priority list configured in the settings is used. Default priority: yfinance."
|
| 166 |
+
),
|
| 167 |
+
] = None,
|
| 168 |
+
**kwargs
|
| 169 |
+
) -> OBBject:
|
| 170 |
+
"""Get top small cap stocks based on earnings growth.
|
| 171 |
+
|
| 172 |
+
Parameters
|
| 173 |
+
----------
|
| 174 |
+
provider : str
|
| 175 |
+
The provider to use, by default None. If None, the priority list configured in the settings is used. Default priority: yfinance.
|
| 176 |
+
sort : Literal['asc', 'desc']
|
| 177 |
+
Sort order. Possible values: 'asc', 'desc'. Default: 'desc'.
|
| 178 |
+
limit : Optional[int]
|
| 179 |
+
Limit the number of results. Default is all. (provider: yfinance)
|
| 180 |
+
|
| 181 |
+
Returns
|
| 182 |
+
-------
|
| 183 |
+
OBBject
|
| 184 |
+
results : list[EquityAggressiveSmallCaps]
|
| 185 |
+
Serializable results.
|
| 186 |
+
provider : Optional[str]
|
| 187 |
+
Provider name.
|
| 188 |
+
warnings : Optional[list[Warning_]]
|
| 189 |
+
list of warnings.
|
| 190 |
+
chart : Optional[Chart]
|
| 191 |
+
Chart object.
|
| 192 |
+
extra : Dict[str, Any]
|
| 193 |
+
Extra info.
|
| 194 |
+
|
| 195 |
+
EquityAggressiveSmallCaps
|
| 196 |
+
-------------------------
|
| 197 |
+
symbol : str
|
| 198 |
+
Symbol representing the entity requested in the data.
|
| 199 |
+
name : Optional[str]
|
| 200 |
+
Name of the entity.
|
| 201 |
+
price : float
|
| 202 |
+
Last price.
|
| 203 |
+
change : float
|
| 204 |
+
Change in price.
|
| 205 |
+
percent_change : float
|
| 206 |
+
Percent change.
|
| 207 |
+
volume : Union[int, float]
|
| 208 |
+
The trading volume.
|
| 209 |
+
open : Optional[float]
|
| 210 |
+
Open price for the day. (provider: yfinance)
|
| 211 |
+
high : Optional[float]
|
| 212 |
+
High price for the day. (provider: yfinance)
|
| 213 |
+
low : Optional[float]
|
| 214 |
+
Low price for the day. (provider: yfinance)
|
| 215 |
+
previous_close : Optional[float]
|
| 216 |
+
Previous close price. (provider: yfinance)
|
| 217 |
+
ma50 : Optional[float]
|
| 218 |
+
50-day moving average. (provider: yfinance)
|
| 219 |
+
ma200 : Optional[float]
|
| 220 |
+
200-day moving average. (provider: yfinance)
|
| 221 |
+
year_high : Optional[float]
|
| 222 |
+
52-week high. (provider: yfinance)
|
| 223 |
+
year_low : Optional[float]
|
| 224 |
+
52-week low. (provider: yfinance)
|
| 225 |
+
market_cap : Optional[float]
|
| 226 |
+
Market Cap. (provider: yfinance)
|
| 227 |
+
shares_outstanding : Optional[float]
|
| 228 |
+
Shares outstanding. (provider: yfinance)
|
| 229 |
+
book_value : Optional[float]
|
| 230 |
+
Book value per share. (provider: yfinance)
|
| 231 |
+
price_to_book : Optional[float]
|
| 232 |
+
Price to book ratio. (provider: yfinance)
|
| 233 |
+
eps_ttm : Optional[float]
|
| 234 |
+
Earnings per share over the trailing twelve months. (provider: yfinance)
|
| 235 |
+
eps_forward : Optional[float]
|
| 236 |
+
Forward earnings per share. (provider: yfinance)
|
| 237 |
+
pe_forward : Optional[float]
|
| 238 |
+
Forward price-to-earnings ratio. (provider: yfinance)
|
| 239 |
+
dividend_yield : Optional[float]
|
| 240 |
+
Trailing twelve month dividend yield. (provider: yfinance)
|
| 241 |
+
exchange : Optional[str]
|
| 242 |
+
Exchange where the stock is listed. (provider: yfinance)
|
| 243 |
+
exchange_timezone : Optional[str]
|
| 244 |
+
Timezone of the exchange. (provider: yfinance)
|
| 245 |
+
earnings_date : Optional[datetime]
|
| 246 |
+
Most recent earnings date. (provider: yfinance)
|
| 247 |
+
currency : Optional[str]
|
| 248 |
+
Currency of the price data. (provider: yfinance)
|
| 249 |
+
|
| 250 |
+
Examples
|
| 251 |
+
--------
|
| 252 |
+
>>> from openbb import obb
|
| 253 |
+
>>> obb.equity.discovery.aggressive_small_caps(provider='yfinance')
|
| 254 |
+
>>> obb.equity.discovery.aggressive_small_caps(sort='desc', provider='yfinance')
|
| 255 |
+
""" # noqa: E501
|
| 256 |
+
|
| 257 |
+
return self._run(
|
| 258 |
+
"/equity/discovery/aggressive_small_caps",
|
| 259 |
+
**filter_inputs(
|
| 260 |
+
provider_choices={
|
| 261 |
+
"provider": self._get_provider(
|
| 262 |
+
provider,
|
| 263 |
+
"equity.discovery.aggressive_small_caps",
|
| 264 |
+
("yfinance",),
|
| 265 |
+
)
|
| 266 |
+
},
|
| 267 |
+
standard_params={
|
| 268 |
+
"sort": sort,
|
| 269 |
+
},
|
| 270 |
+
extra_params=kwargs,
|
| 271 |
+
)
|
| 272 |
+
)
|
| 273 |
+
|
| 274 |
+
@exception_handler
|
| 275 |
+
@validate
|
| 276 |
+
def filings(
|
| 277 |
+
self,
|
| 278 |
+
start_date: Annotated[
|
| 279 |
+
Union[datetime.date, None, str],
|
| 280 |
+
OpenBBField(description="Start date of the data, in YYYY-MM-DD format."),
|
| 281 |
+
] = None,
|
| 282 |
+
end_date: Annotated[
|
| 283 |
+
Union[datetime.date, None, str],
|
| 284 |
+
OpenBBField(description="End date of the data, in YYYY-MM-DD format."),
|
| 285 |
+
] = None,
|
| 286 |
+
form_type: Annotated[
|
| 287 |
+
Optional[str],
|
| 288 |
+
OpenBBField(
|
| 289 |
+
description="Filter by form type. Visit https://www.sec.gov/forms for a list of supported form types."
|
| 290 |
+
),
|
| 291 |
+
] = None,
|
| 292 |
+
limit: Annotated[
|
| 293 |
+
int, OpenBBField(description="The number of data entries to return.")
|
| 294 |
+
] = 100,
|
| 295 |
+
provider: Annotated[
|
| 296 |
+
Optional[Literal["fmp"]],
|
| 297 |
+
OpenBBField(
|
| 298 |
+
description="The provider to use, by default None. If None, the priority list configured in the settings is used. Default priority: fmp."
|
| 299 |
+
),
|
| 300 |
+
] = None,
|
| 301 |
+
**kwargs
|
| 302 |
+
) -> OBBject:
|
| 303 |
+
"""Get the URLs to SEC filings reported to EDGAR database, such as 10-K, 10-Q, 8-K, and more.
|
| 304 |
+
|
| 305 |
+
SEC filings include Form 10-K, Form 10-Q, Form 8-K, the proxy statement, Forms 3, 4, and 5, Schedule 13, Form 114,
|
| 306 |
+
Foreign Investment Disclosures and others. The annual 10-K report is required to be
|
| 307 |
+
filed annually and includes the company's financial statements, management discussion and analysis,
|
| 308 |
+
and audited financial statements.
|
| 309 |
+
|
| 310 |
+
|
| 311 |
+
Parameters
|
| 312 |
+
----------
|
| 313 |
+
provider : str
|
| 314 |
+
The provider to use, by default None. If None, the priority list configured in the settings is used. Default priority: fmp.
|
| 315 |
+
start_date : Union[date, None, str]
|
| 316 |
+
Start date of the data, in YYYY-MM-DD format.
|
| 317 |
+
end_date : Union[date, None, str]
|
| 318 |
+
End date of the data, in YYYY-MM-DD format.
|
| 319 |
+
form_type : Optional[str]
|
| 320 |
+
Filter by form type. Visit https://www.sec.gov/forms for a list of supported form types.
|
| 321 |
+
limit : int
|
| 322 |
+
The number of data entries to return.
|
| 323 |
+
is_done : Optional[bool]
|
| 324 |
+
Flag for whether or not the filing is done. (provider: fmp)
|
| 325 |
+
|
| 326 |
+
Returns
|
| 327 |
+
-------
|
| 328 |
+
OBBject
|
| 329 |
+
results : list[DiscoveryFilings]
|
| 330 |
+
Serializable results.
|
| 331 |
+
provider : Optional[str]
|
| 332 |
+
Provider name.
|
| 333 |
+
warnings : Optional[list[Warning_]]
|
| 334 |
+
list of warnings.
|
| 335 |
+
chart : Optional[Chart]
|
| 336 |
+
Chart object.
|
| 337 |
+
extra : Dict[str, Any]
|
| 338 |
+
Extra info.
|
| 339 |
+
|
| 340 |
+
DiscoveryFilings
|
| 341 |
+
----------------
|
| 342 |
+
symbol : str
|
| 343 |
+
Symbol representing the entity requested in the data.
|
| 344 |
+
cik : str
|
| 345 |
+
Central Index Key (CIK) for the requested entity.
|
| 346 |
+
title : str
|
| 347 |
+
Title of the filing.
|
| 348 |
+
date : datetime
|
| 349 |
+
The date of the data.
|
| 350 |
+
form_type : str
|
| 351 |
+
The form type of the filing
|
| 352 |
+
link : str
|
| 353 |
+
URL to the filing page on the SEC site.
|
| 354 |
+
|
| 355 |
+
Examples
|
| 356 |
+
--------
|
| 357 |
+
>>> from openbb import obb
|
| 358 |
+
>>> obb.equity.discovery.filings(provider='fmp')
|
| 359 |
+
>>> # Get filings for the year 2023, limited to 100 results
|
| 360 |
+
>>> obb.equity.discovery.filings(start_date='2023-01-01', end_date='2023-12-31', limit=100, provider='fmp')
|
| 361 |
+
""" # noqa: E501
|
| 362 |
+
|
| 363 |
+
return self._run(
|
| 364 |
+
"/equity/discovery/filings",
|
| 365 |
+
**filter_inputs(
|
| 366 |
+
provider_choices={
|
| 367 |
+
"provider": self._get_provider(
|
| 368 |
+
provider,
|
| 369 |
+
"equity.discovery.filings",
|
| 370 |
+
("fmp",),
|
| 371 |
+
)
|
| 372 |
+
},
|
| 373 |
+
standard_params={
|
| 374 |
+
"start_date": start_date,
|
| 375 |
+
"end_date": end_date,
|
| 376 |
+
"form_type": form_type,
|
| 377 |
+
"limit": limit,
|
| 378 |
+
},
|
| 379 |
+
extra_params=kwargs,
|
| 380 |
+
)
|
| 381 |
+
)
|
| 382 |
+
|
| 383 |
+
@exception_handler
|
| 384 |
+
@validate
|
| 385 |
+
def gainers(
|
| 386 |
+
self,
|
| 387 |
+
sort: Annotated[
|
| 388 |
+
Literal["asc", "desc"],
|
| 389 |
+
OpenBBField(
|
| 390 |
+
description="Sort order. Possible values: 'asc', 'desc'. Default: 'desc'."
|
| 391 |
+
),
|
| 392 |
+
] = "desc",
|
| 393 |
+
provider: Annotated[
|
| 394 |
+
Optional[Literal["yfinance"]],
|
| 395 |
+
OpenBBField(
|
| 396 |
+
description="The provider to use, by default None. If None, the priority list configured in the settings is used. Default priority: yfinance."
|
| 397 |
+
),
|
| 398 |
+
] = None,
|
| 399 |
+
**kwargs
|
| 400 |
+
) -> OBBject:
|
| 401 |
+
"""Get the top price gainers in the stock market.
|
| 402 |
+
|
| 403 |
+
Parameters
|
| 404 |
+
----------
|
| 405 |
+
provider : str
|
| 406 |
+
The provider to use, by default None. If None, the priority list configured in the settings is used. Default priority: yfinance.
|
| 407 |
+
sort : Literal['asc', 'desc']
|
| 408 |
+
Sort order. Possible values: 'asc', 'desc'. Default: 'desc'.
|
| 409 |
+
limit : Optional[int]
|
| 410 |
+
Limit the number of results. (provider: yfinance)
|
| 411 |
+
|
| 412 |
+
Returns
|
| 413 |
+
-------
|
| 414 |
+
OBBject
|
| 415 |
+
results : list[EquityGainers]
|
| 416 |
+
Serializable results.
|
| 417 |
+
provider : Optional[str]
|
| 418 |
+
Provider name.
|
| 419 |
+
warnings : Optional[list[Warning_]]
|
| 420 |
+
list of warnings.
|
| 421 |
+
chart : Optional[Chart]
|
| 422 |
+
Chart object.
|
| 423 |
+
extra : Dict[str, Any]
|
| 424 |
+
Extra info.
|
| 425 |
+
|
| 426 |
+
EquityGainers
|
| 427 |
+
-------------
|
| 428 |
+
symbol : str
|
| 429 |
+
Symbol representing the entity requested in the data.
|
| 430 |
+
name : Optional[str]
|
| 431 |
+
Name of the entity.
|
| 432 |
+
price : float
|
| 433 |
+
Last price.
|
| 434 |
+
change : float
|
| 435 |
+
Change in price.
|
| 436 |
+
percent_change : float
|
| 437 |
+
Percent change.
|
| 438 |
+
volume : Union[int, float]
|
| 439 |
+
The trading volume.
|
| 440 |
+
open : Optional[float]
|
| 441 |
+
Open price for the day. (provider: yfinance)
|
| 442 |
+
high : Optional[float]
|
| 443 |
+
High price for the day. (provider: yfinance)
|
| 444 |
+
low : Optional[float]
|
| 445 |
+
Low price for the day. (provider: yfinance)
|
| 446 |
+
previous_close : Optional[float]
|
| 447 |
+
Previous close price. (provider: yfinance)
|
| 448 |
+
ma50 : Optional[float]
|
| 449 |
+
50-day moving average. (provider: yfinance)
|
| 450 |
+
ma200 : Optional[float]
|
| 451 |
+
200-day moving average. (provider: yfinance)
|
| 452 |
+
year_high : Optional[float]
|
| 453 |
+
52-week high. (provider: yfinance)
|
| 454 |
+
year_low : Optional[float]
|
| 455 |
+
52-week low. (provider: yfinance)
|
| 456 |
+
market_cap : Optional[float]
|
| 457 |
+
Market Cap. (provider: yfinance)
|
| 458 |
+
shares_outstanding : Optional[float]
|
| 459 |
+
Shares outstanding. (provider: yfinance)
|
| 460 |
+
book_value : Optional[float]
|
| 461 |
+
Book value per share. (provider: yfinance)
|
| 462 |
+
price_to_book : Optional[float]
|
| 463 |
+
Price to book ratio. (provider: yfinance)
|
| 464 |
+
eps_ttm : Optional[float]
|
| 465 |
+
Earnings per share over the trailing twelve months. (provider: yfinance)
|
| 466 |
+
eps_forward : Optional[float]
|
| 467 |
+
Forward earnings per share. (provider: yfinance)
|
| 468 |
+
pe_forward : Optional[float]
|
| 469 |
+
Forward price-to-earnings ratio. (provider: yfinance)
|
| 470 |
+
dividend_yield : Optional[float]
|
| 471 |
+
Trailing twelve month dividend yield. (provider: yfinance)
|
| 472 |
+
exchange : Optional[str]
|
| 473 |
+
Exchange where the stock is listed. (provider: yfinance)
|
| 474 |
+
exchange_timezone : Optional[str]
|
| 475 |
+
Timezone of the exchange. (provider: yfinance)
|
| 476 |
+
earnings_date : Optional[datetime]
|
| 477 |
+
Most recent earnings date. (provider: yfinance)
|
| 478 |
+
currency : Optional[str]
|
| 479 |
+
Currency of the price data. (provider: yfinance)
|
| 480 |
+
|
| 481 |
+
Examples
|
| 482 |
+
--------
|
| 483 |
+
>>> from openbb import obb
|
| 484 |
+
>>> obb.equity.discovery.gainers(provider='yfinance')
|
| 485 |
+
>>> obb.equity.discovery.gainers(sort='desc', provider='yfinance')
|
| 486 |
+
""" # noqa: E501
|
| 487 |
+
|
| 488 |
+
return self._run(
|
| 489 |
+
"/equity/discovery/gainers",
|
| 490 |
+
**filter_inputs(
|
| 491 |
+
provider_choices={
|
| 492 |
+
"provider": self._get_provider(
|
| 493 |
+
provider,
|
| 494 |
+
"equity.discovery.gainers",
|
| 495 |
+
("yfinance",),
|
| 496 |
+
)
|
| 497 |
+
},
|
| 498 |
+
standard_params={
|
| 499 |
+
"sort": sort,
|
| 500 |
+
},
|
| 501 |
+
extra_params=kwargs,
|
| 502 |
+
)
|
| 503 |
+
)
|
| 504 |
+
|
| 505 |
+
@exception_handler
|
| 506 |
+
@validate
|
| 507 |
+
def growth_tech(
|
| 508 |
+
self,
|
| 509 |
+
sort: Annotated[
|
| 510 |
+
Literal["asc", "desc"],
|
| 511 |
+
OpenBBField(
|
| 512 |
+
description="Sort order. Possible values: 'asc', 'desc'. Default: 'desc'."
|
| 513 |
+
),
|
| 514 |
+
] = "desc",
|
| 515 |
+
provider: Annotated[
|
| 516 |
+
Optional[Literal["yfinance"]],
|
| 517 |
+
OpenBBField(
|
| 518 |
+
description="The provider to use, by default None. If None, the priority list configured in the settings is used. Default priority: yfinance."
|
| 519 |
+
),
|
| 520 |
+
] = None,
|
| 521 |
+
**kwargs
|
| 522 |
+
) -> OBBject:
|
| 523 |
+
"""Get top tech stocks based on revenue and earnings growth.
|
| 524 |
+
|
| 525 |
+
Parameters
|
| 526 |
+
----------
|
| 527 |
+
provider : str
|
| 528 |
+
The provider to use, by default None. If None, the priority list configured in the settings is used. Default priority: yfinance.
|
| 529 |
+
sort : Literal['asc', 'desc']
|
| 530 |
+
Sort order. Possible values: 'asc', 'desc'. Default: 'desc'.
|
| 531 |
+
limit : Optional[int]
|
| 532 |
+
Limit the number of results. (provider: yfinance)
|
| 533 |
+
|
| 534 |
+
Returns
|
| 535 |
+
-------
|
| 536 |
+
OBBject
|
| 537 |
+
results : list[GrowthTechEquities]
|
| 538 |
+
Serializable results.
|
| 539 |
+
provider : Optional[str]
|
| 540 |
+
Provider name.
|
| 541 |
+
warnings : Optional[list[Warning_]]
|
| 542 |
+
list of warnings.
|
| 543 |
+
chart : Optional[Chart]
|
| 544 |
+
Chart object.
|
| 545 |
+
extra : Dict[str, Any]
|
| 546 |
+
Extra info.
|
| 547 |
+
|
| 548 |
+
GrowthTechEquities
|
| 549 |
+
------------------
|
| 550 |
+
symbol : str
|
| 551 |
+
Symbol representing the entity requested in the data.
|
| 552 |
+
name : Optional[str]
|
| 553 |
+
Name of the entity.
|
| 554 |
+
price : float
|
| 555 |
+
Last price.
|
| 556 |
+
change : float
|
| 557 |
+
Change in price.
|
| 558 |
+
percent_change : float
|
| 559 |
+
Percent change.
|
| 560 |
+
volume : Union[int, float]
|
| 561 |
+
The trading volume.
|
| 562 |
+
open : Optional[float]
|
| 563 |
+
Open price for the day. (provider: yfinance)
|
| 564 |
+
high : Optional[float]
|
| 565 |
+
High price for the day. (provider: yfinance)
|
| 566 |
+
low : Optional[float]
|
| 567 |
+
Low price for the day. (provider: yfinance)
|
| 568 |
+
previous_close : Optional[float]
|
| 569 |
+
Previous close price. (provider: yfinance)
|
| 570 |
+
ma50 : Optional[float]
|
| 571 |
+
50-day moving average. (provider: yfinance)
|
| 572 |
+
ma200 : Optional[float]
|
| 573 |
+
200-day moving average. (provider: yfinance)
|
| 574 |
+
year_high : Optional[float]
|
| 575 |
+
52-week high. (provider: yfinance)
|
| 576 |
+
year_low : Optional[float]
|
| 577 |
+
52-week low. (provider: yfinance)
|
| 578 |
+
market_cap : Optional[float]
|
| 579 |
+
Market Cap. (provider: yfinance)
|
| 580 |
+
shares_outstanding : Optional[float]
|
| 581 |
+
Shares outstanding. (provider: yfinance)
|
| 582 |
+
book_value : Optional[float]
|
| 583 |
+
Book value per share. (provider: yfinance)
|
| 584 |
+
price_to_book : Optional[float]
|
| 585 |
+
Price to book ratio. (provider: yfinance)
|
| 586 |
+
eps_ttm : Optional[float]
|
| 587 |
+
Earnings per share over the trailing twelve months. (provider: yfinance)
|
| 588 |
+
eps_forward : Optional[float]
|
| 589 |
+
Forward earnings per share. (provider: yfinance)
|
| 590 |
+
pe_forward : Optional[float]
|
| 591 |
+
Forward price-to-earnings ratio. (provider: yfinance)
|
| 592 |
+
dividend_yield : Optional[float]
|
| 593 |
+
Trailing twelve month dividend yield. (provider: yfinance)
|
| 594 |
+
exchange : Optional[str]
|
| 595 |
+
Exchange where the stock is listed. (provider: yfinance)
|
| 596 |
+
exchange_timezone : Optional[str]
|
| 597 |
+
Timezone of the exchange. (provider: yfinance)
|
| 598 |
+
earnings_date : Optional[datetime]
|
| 599 |
+
Most recent earnings date. (provider: yfinance)
|
| 600 |
+
currency : Optional[str]
|
| 601 |
+
Currency of the price data. (provider: yfinance)
|
| 602 |
+
|
| 603 |
+
Examples
|
| 604 |
+
--------
|
| 605 |
+
>>> from openbb import obb
|
| 606 |
+
>>> obb.equity.discovery.growth_tech(provider='yfinance')
|
| 607 |
+
>>> obb.equity.discovery.growth_tech(sort='desc', provider='yfinance')
|
| 608 |
+
""" # noqa: E501
|
| 609 |
+
|
| 610 |
+
return self._run(
|
| 611 |
+
"/equity/discovery/growth_tech",
|
| 612 |
+
**filter_inputs(
|
| 613 |
+
provider_choices={
|
| 614 |
+
"provider": self._get_provider(
|
| 615 |
+
provider,
|
| 616 |
+
"equity.discovery.growth_tech",
|
| 617 |
+
("yfinance",),
|
| 618 |
+
)
|
| 619 |
+
},
|
| 620 |
+
standard_params={
|
| 621 |
+
"sort": sort,
|
| 622 |
+
},
|
| 623 |
+
extra_params=kwargs,
|
| 624 |
+
)
|
| 625 |
+
)
|
| 626 |
+
|
| 627 |
+
@exception_handler
|
| 628 |
+
@validate
|
| 629 |
+
def latest_financial_reports(
|
| 630 |
+
self,
|
| 631 |
+
provider: Annotated[
|
| 632 |
+
Optional[Literal["sec"]],
|
| 633 |
+
OpenBBField(
|
| 634 |
+
description="The provider to use, by default None. If None, the priority list configured in the settings is used. Default priority: sec."
|
| 635 |
+
),
|
| 636 |
+
] = None,
|
| 637 |
+
**kwargs
|
| 638 |
+
) -> OBBject:
|
| 639 |
+
"""Get the newest quarterly, annual, and current reports for all companies.
|
| 640 |
+
|
| 641 |
+
Parameters
|
| 642 |
+
----------
|
| 643 |
+
provider : str
|
| 644 |
+
The provider to use, by default None. If None, the priority list configured in the settings is used. Default priority: sec.
|
| 645 |
+
date : Optional[date]
|
| 646 |
+
A specific date to get data for. Defaults to today. (provider: sec)
|
| 647 |
+
report_type : Optional[str]
|
| 648 |
+
Return only a specific form type. Default is all quarterly, annual, and current reports. Choices: 1-K, 1-SA, 1-U, 10-D, 10-K, 10-KT, 10-Q, 10-QT, 20-F, 40-F, 6-K, 8-K. Multiple comma separated items allowed. (provider: sec)
|
| 649 |
+
|
| 650 |
+
Returns
|
| 651 |
+
-------
|
| 652 |
+
OBBject
|
| 653 |
+
results : list[LatestFinancialReports]
|
| 654 |
+
Serializable results.
|
| 655 |
+
provider : Optional[str]
|
| 656 |
+
Provider name.
|
| 657 |
+
warnings : Optional[list[Warning_]]
|
| 658 |
+
list of warnings.
|
| 659 |
+
chart : Optional[Chart]
|
| 660 |
+
Chart object.
|
| 661 |
+
extra : Dict[str, Any]
|
| 662 |
+
Extra info.
|
| 663 |
+
|
| 664 |
+
LatestFinancialReports
|
| 665 |
+
----------------------
|
| 666 |
+
filing_date : date
|
| 667 |
+
The date of the filing.
|
| 668 |
+
period_ending : Optional[date]
|
| 669 |
+
Report for the period ending.
|
| 670 |
+
symbol : Optional[str]
|
| 671 |
+
Symbol representing the entity requested in the data.
|
| 672 |
+
name : Optional[str]
|
| 673 |
+
Name of the company.
|
| 674 |
+
cik : Optional[str]
|
| 675 |
+
Central Index Key (CIK) for the requested entity.
|
| 676 |
+
sic : Optional[str]
|
| 677 |
+
Standard Industrial Classification code.
|
| 678 |
+
report_type : Optional[str]
|
| 679 |
+
Type of filing.
|
| 680 |
+
description : Optional[str]
|
| 681 |
+
Description of the report.
|
| 682 |
+
url : str
|
| 683 |
+
URL to the filing page.
|
| 684 |
+
items : Optional[str]
|
| 685 |
+
Item codes associated with the filing. (provider: sec)
|
| 686 |
+
index_headers : Optional[str]
|
| 687 |
+
URL to the index headers file. (provider: sec)
|
| 688 |
+
complete_submission : Optional[str]
|
| 689 |
+
URL to the complete submission text file. (provider: sec)
|
| 690 |
+
metadata : Optional[str]
|
| 691 |
+
URL to the MetaLinks.json file, if available. (provider: sec)
|
| 692 |
+
financial_report : Optional[str]
|
| 693 |
+
URL to the Financial_Report.xlsx file, if available. (provider: sec)
|
| 694 |
+
|
| 695 |
+
Examples
|
| 696 |
+
--------
|
| 697 |
+
>>> from openbb import obb
|
| 698 |
+
>>> obb.equity.discovery.latest_financial_reports(provider='sec')
|
| 699 |
+
>>> obb.equity.discovery.latest_financial_reports(provider='sec', date='2024-09-30')
|
| 700 |
+
""" # noqa: E501
|
| 701 |
+
|
| 702 |
+
return self._run(
|
| 703 |
+
"/equity/discovery/latest_financial_reports",
|
| 704 |
+
**filter_inputs(
|
| 705 |
+
provider_choices={
|
| 706 |
+
"provider": self._get_provider(
|
| 707 |
+
provider,
|
| 708 |
+
"equity.discovery.latest_financial_reports",
|
| 709 |
+
("sec",),
|
| 710 |
+
)
|
| 711 |
+
},
|
| 712 |
+
standard_params={},
|
| 713 |
+
extra_params=kwargs,
|
| 714 |
+
info={
|
| 715 |
+
"report_type": {
|
| 716 |
+
"sec": {
|
| 717 |
+
"multiple_items_allowed": True,
|
| 718 |
+
"choices": [
|
| 719 |
+
"1-K",
|
| 720 |
+
"1-SA",
|
| 721 |
+
"1-U",
|
| 722 |
+
"10-D",
|
| 723 |
+
"10-K",
|
| 724 |
+
"10-KT",
|
| 725 |
+
"10-Q",
|
| 726 |
+
"10-QT",
|
| 727 |
+
"20-F",
|
| 728 |
+
"40-F",
|
| 729 |
+
"6-K",
|
| 730 |
+
"8-K",
|
| 731 |
+
],
|
| 732 |
+
}
|
| 733 |
+
}
|
| 734 |
+
},
|
| 735 |
+
)
|
| 736 |
+
)
|
| 737 |
+
|
| 738 |
+
@exception_handler
|
| 739 |
+
@validate
|
| 740 |
+
def losers(
|
| 741 |
+
self,
|
| 742 |
+
sort: Annotated[
|
| 743 |
+
Literal["asc", "desc"],
|
| 744 |
+
OpenBBField(
|
| 745 |
+
description="Sort order. Possible values: 'asc', 'desc'. Default: 'desc'."
|
| 746 |
+
),
|
| 747 |
+
] = "desc",
|
| 748 |
+
provider: Annotated[
|
| 749 |
+
Optional[Literal["yfinance"]],
|
| 750 |
+
OpenBBField(
|
| 751 |
+
description="The provider to use, by default None. If None, the priority list configured in the settings is used. Default priority: yfinance."
|
| 752 |
+
),
|
| 753 |
+
] = None,
|
| 754 |
+
**kwargs
|
| 755 |
+
) -> OBBject:
|
| 756 |
+
"""Get the top price losers in the stock market.
|
| 757 |
+
|
| 758 |
+
Parameters
|
| 759 |
+
----------
|
| 760 |
+
provider : str
|
| 761 |
+
The provider to use, by default None. If None, the priority list configured in the settings is used. Default priority: yfinance.
|
| 762 |
+
sort : Literal['asc', 'desc']
|
| 763 |
+
Sort order. Possible values: 'asc', 'desc'. Default: 'desc'.
|
| 764 |
+
limit : Optional[int]
|
| 765 |
+
Limit the number of results. (provider: yfinance)
|
| 766 |
+
|
| 767 |
+
Returns
|
| 768 |
+
-------
|
| 769 |
+
OBBject
|
| 770 |
+
results : list[EquityLosers]
|
| 771 |
+
Serializable results.
|
| 772 |
+
provider : Optional[str]
|
| 773 |
+
Provider name.
|
| 774 |
+
warnings : Optional[list[Warning_]]
|
| 775 |
+
list of warnings.
|
| 776 |
+
chart : Optional[Chart]
|
| 777 |
+
Chart object.
|
| 778 |
+
extra : Dict[str, Any]
|
| 779 |
+
Extra info.
|
| 780 |
+
|
| 781 |
+
EquityLosers
|
| 782 |
+
------------
|
| 783 |
+
symbol : str
|
| 784 |
+
Symbol representing the entity requested in the data.
|
| 785 |
+
name : Optional[str]
|
| 786 |
+
Name of the entity.
|
| 787 |
+
price : float
|
| 788 |
+
Last price.
|
| 789 |
+
change : float
|
| 790 |
+
Change in price.
|
| 791 |
+
percent_change : float
|
| 792 |
+
Percent change.
|
| 793 |
+
volume : Union[int, float]
|
| 794 |
+
The trading volume.
|
| 795 |
+
open : Optional[float]
|
| 796 |
+
Open price for the day. (provider: yfinance)
|
| 797 |
+
high : Optional[float]
|
| 798 |
+
High price for the day. (provider: yfinance)
|
| 799 |
+
low : Optional[float]
|
| 800 |
+
Low price for the day. (provider: yfinance)
|
| 801 |
+
previous_close : Optional[float]
|
| 802 |
+
Previous close price. (provider: yfinance)
|
| 803 |
+
ma50 : Optional[float]
|
| 804 |
+
50-day moving average. (provider: yfinance)
|
| 805 |
+
ma200 : Optional[float]
|
| 806 |
+
200-day moving average. (provider: yfinance)
|
| 807 |
+
year_high : Optional[float]
|
| 808 |
+
52-week high. (provider: yfinance)
|
| 809 |
+
year_low : Optional[float]
|
| 810 |
+
52-week low. (provider: yfinance)
|
| 811 |
+
market_cap : Optional[float]
|
| 812 |
+
Market Cap. (provider: yfinance)
|
| 813 |
+
shares_outstanding : Optional[float]
|
| 814 |
+
Shares outstanding. (provider: yfinance)
|
| 815 |
+
book_value : Optional[float]
|
| 816 |
+
Book value per share. (provider: yfinance)
|
| 817 |
+
price_to_book : Optional[float]
|
| 818 |
+
Price to book ratio. (provider: yfinance)
|
| 819 |
+
eps_ttm : Optional[float]
|
| 820 |
+
Earnings per share over the trailing twelve months. (provider: yfinance)
|
| 821 |
+
eps_forward : Optional[float]
|
| 822 |
+
Forward earnings per share. (provider: yfinance)
|
| 823 |
+
pe_forward : Optional[float]
|
| 824 |
+
Forward price-to-earnings ratio. (provider: yfinance)
|
| 825 |
+
dividend_yield : Optional[float]
|
| 826 |
+
Trailing twelve month dividend yield. (provider: yfinance)
|
| 827 |
+
exchange : Optional[str]
|
| 828 |
+
Exchange where the stock is listed. (provider: yfinance)
|
| 829 |
+
exchange_timezone : Optional[str]
|
| 830 |
+
Timezone of the exchange. (provider: yfinance)
|
| 831 |
+
earnings_date : Optional[datetime]
|
| 832 |
+
Most recent earnings date. (provider: yfinance)
|
| 833 |
+
currency : Optional[str]
|
| 834 |
+
Currency of the price data. (provider: yfinance)
|
| 835 |
+
|
| 836 |
+
Examples
|
| 837 |
+
--------
|
| 838 |
+
>>> from openbb import obb
|
| 839 |
+
>>> obb.equity.discovery.losers(provider='yfinance')
|
| 840 |
+
>>> obb.equity.discovery.losers(sort='desc', provider='yfinance')
|
| 841 |
+
""" # noqa: E501
|
| 842 |
+
|
| 843 |
+
return self._run(
|
| 844 |
+
"/equity/discovery/losers",
|
| 845 |
+
**filter_inputs(
|
| 846 |
+
provider_choices={
|
| 847 |
+
"provider": self._get_provider(
|
| 848 |
+
provider,
|
| 849 |
+
"equity.discovery.losers",
|
| 850 |
+
("yfinance",),
|
| 851 |
+
)
|
| 852 |
+
},
|
| 853 |
+
standard_params={
|
| 854 |
+
"sort": sort,
|
| 855 |
+
},
|
| 856 |
+
extra_params=kwargs,
|
| 857 |
+
)
|
| 858 |
+
)
|
| 859 |
+
|
| 860 |
+
@exception_handler
|
| 861 |
+
@validate
|
| 862 |
+
def undervalued_growth(
|
| 863 |
+
self,
|
| 864 |
+
sort: Annotated[
|
| 865 |
+
Literal["asc", "desc"],
|
| 866 |
+
OpenBBField(
|
| 867 |
+
description="Sort order. Possible values: 'asc', 'desc'. Default: 'desc'."
|
| 868 |
+
),
|
| 869 |
+
] = "desc",
|
| 870 |
+
provider: Annotated[
|
| 871 |
+
Optional[Literal["yfinance"]],
|
| 872 |
+
OpenBBField(
|
| 873 |
+
description="The provider to use, by default None. If None, the priority list configured in the settings is used. Default priority: yfinance."
|
| 874 |
+
),
|
| 875 |
+
] = None,
|
| 876 |
+
**kwargs
|
| 877 |
+
) -> OBBject:
|
| 878 |
+
"""Get potentially undervalued growth stocks.
|
| 879 |
+
|
| 880 |
+
Parameters
|
| 881 |
+
----------
|
| 882 |
+
provider : str
|
| 883 |
+
The provider to use, by default None. If None, the priority list configured in the settings is used. Default priority: yfinance.
|
| 884 |
+
sort : Literal['asc', 'desc']
|
| 885 |
+
Sort order. Possible values: 'asc', 'desc'. Default: 'desc'.
|
| 886 |
+
limit : Optional[int]
|
| 887 |
+
Limit the number of results. (provider: yfinance)
|
| 888 |
+
|
| 889 |
+
Returns
|
| 890 |
+
-------
|
| 891 |
+
OBBject
|
| 892 |
+
results : list[EquityUndervaluedGrowth]
|
| 893 |
+
Serializable results.
|
| 894 |
+
provider : Optional[str]
|
| 895 |
+
Provider name.
|
| 896 |
+
warnings : Optional[list[Warning_]]
|
| 897 |
+
list of warnings.
|
| 898 |
+
chart : Optional[Chart]
|
| 899 |
+
Chart object.
|
| 900 |
+
extra : Dict[str, Any]
|
| 901 |
+
Extra info.
|
| 902 |
+
|
| 903 |
+
EquityUndervaluedGrowth
|
| 904 |
+
-----------------------
|
| 905 |
+
symbol : str
|
| 906 |
+
Symbol representing the entity requested in the data.
|
| 907 |
+
name : Optional[str]
|
| 908 |
+
Name of the entity.
|
| 909 |
+
price : float
|
| 910 |
+
Last price.
|
| 911 |
+
change : float
|
| 912 |
+
Change in price.
|
| 913 |
+
percent_change : float
|
| 914 |
+
Percent change.
|
| 915 |
+
volume : Union[int, float]
|
| 916 |
+
The trading volume.
|
| 917 |
+
open : Optional[float]
|
| 918 |
+
Open price for the day. (provider: yfinance)
|
| 919 |
+
high : Optional[float]
|
| 920 |
+
High price for the day. (provider: yfinance)
|
| 921 |
+
low : Optional[float]
|
| 922 |
+
Low price for the day. (provider: yfinance)
|
| 923 |
+
previous_close : Optional[float]
|
| 924 |
+
Previous close price. (provider: yfinance)
|
| 925 |
+
ma50 : Optional[float]
|
| 926 |
+
50-day moving average. (provider: yfinance)
|
| 927 |
+
ma200 : Optional[float]
|
| 928 |
+
200-day moving average. (provider: yfinance)
|
| 929 |
+
year_high : Optional[float]
|
| 930 |
+
52-week high. (provider: yfinance)
|
| 931 |
+
year_low : Optional[float]
|
| 932 |
+
52-week low. (provider: yfinance)
|
| 933 |
+
market_cap : Optional[float]
|
| 934 |
+
Market Cap. (provider: yfinance)
|
| 935 |
+
shares_outstanding : Optional[float]
|
| 936 |
+
Shares outstanding. (provider: yfinance)
|
| 937 |
+
book_value : Optional[float]
|
| 938 |
+
Book value per share. (provider: yfinance)
|
| 939 |
+
price_to_book : Optional[float]
|
| 940 |
+
Price to book ratio. (provider: yfinance)
|
| 941 |
+
eps_ttm : Optional[float]
|
| 942 |
+
Earnings per share over the trailing twelve months. (provider: yfinance)
|
| 943 |
+
eps_forward : Optional[float]
|
| 944 |
+
Forward earnings per share. (provider: yfinance)
|
| 945 |
+
pe_forward : Optional[float]
|
| 946 |
+
Forward price-to-earnings ratio. (provider: yfinance)
|
| 947 |
+
dividend_yield : Optional[float]
|
| 948 |
+
Trailing twelve month dividend yield. (provider: yfinance)
|
| 949 |
+
exchange : Optional[str]
|
| 950 |
+
Exchange where the stock is listed. (provider: yfinance)
|
| 951 |
+
exchange_timezone : Optional[str]
|
| 952 |
+
Timezone of the exchange. (provider: yfinance)
|
| 953 |
+
earnings_date : Optional[datetime]
|
| 954 |
+
Most recent earnings date. (provider: yfinance)
|
| 955 |
+
currency : Optional[str]
|
| 956 |
+
Currency of the price data. (provider: yfinance)
|
| 957 |
+
|
| 958 |
+
Examples
|
| 959 |
+
--------
|
| 960 |
+
>>> from openbb import obb
|
| 961 |
+
>>> obb.equity.discovery.undervalued_growth(provider='yfinance')
|
| 962 |
+
>>> obb.equity.discovery.undervalued_growth(sort='desc', provider='yfinance')
|
| 963 |
+
""" # noqa: E501
|
| 964 |
+
|
| 965 |
+
return self._run(
|
| 966 |
+
"/equity/discovery/undervalued_growth",
|
| 967 |
+
**filter_inputs(
|
| 968 |
+
provider_choices={
|
| 969 |
+
"provider": self._get_provider(
|
| 970 |
+
provider,
|
| 971 |
+
"equity.discovery.undervalued_growth",
|
| 972 |
+
("yfinance",),
|
| 973 |
+
)
|
| 974 |
+
},
|
| 975 |
+
standard_params={
|
| 976 |
+
"sort": sort,
|
| 977 |
+
},
|
| 978 |
+
extra_params=kwargs,
|
| 979 |
+
)
|
| 980 |
+
)
|
| 981 |
+
|
| 982 |
+
@exception_handler
|
| 983 |
+
@validate
|
| 984 |
+
def undervalued_large_caps(
|
| 985 |
+
self,
|
| 986 |
+
sort: Annotated[
|
| 987 |
+
Literal["asc", "desc"],
|
| 988 |
+
OpenBBField(
|
| 989 |
+
description="Sort order. Possible values: 'asc', 'desc'. Default: 'desc'."
|
| 990 |
+
),
|
| 991 |
+
] = "desc",
|
| 992 |
+
provider: Annotated[
|
| 993 |
+
Optional[Literal["yfinance"]],
|
| 994 |
+
OpenBBField(
|
| 995 |
+
description="The provider to use, by default None. If None, the priority list configured in the settings is used. Default priority: yfinance."
|
| 996 |
+
),
|
| 997 |
+
] = None,
|
| 998 |
+
**kwargs
|
| 999 |
+
) -> OBBject:
|
| 1000 |
+
"""Get potentially undervalued large cap stocks.
|
| 1001 |
+
|
| 1002 |
+
Parameters
|
| 1003 |
+
----------
|
| 1004 |
+
provider : str
|
| 1005 |
+
The provider to use, by default None. If None, the priority list configured in the settings is used. Default priority: yfinance.
|
| 1006 |
+
sort : Literal['asc', 'desc']
|
| 1007 |
+
Sort order. Possible values: 'asc', 'desc'. Default: 'desc'.
|
| 1008 |
+
limit : Optional[int]
|
| 1009 |
+
Limit the number of results. (provider: yfinance)
|
| 1010 |
+
|
| 1011 |
+
Returns
|
| 1012 |
+
-------
|
| 1013 |
+
OBBject
|
| 1014 |
+
results : list[EquityUndervaluedLargeCaps]
|
| 1015 |
+
Serializable results.
|
| 1016 |
+
provider : Optional[str]
|
| 1017 |
+
Provider name.
|
| 1018 |
+
warnings : Optional[list[Warning_]]
|
| 1019 |
+
list of warnings.
|
| 1020 |
+
chart : Optional[Chart]
|
| 1021 |
+
Chart object.
|
| 1022 |
+
extra : Dict[str, Any]
|
| 1023 |
+
Extra info.
|
| 1024 |
+
|
| 1025 |
+
EquityUndervaluedLargeCaps
|
| 1026 |
+
--------------------------
|
| 1027 |
+
symbol : str
|
| 1028 |
+
Symbol representing the entity requested in the data.
|
| 1029 |
+
name : Optional[str]
|
| 1030 |
+
Name of the entity.
|
| 1031 |
+
price : float
|
| 1032 |
+
Last price.
|
| 1033 |
+
change : float
|
| 1034 |
+
Change in price.
|
| 1035 |
+
percent_change : float
|
| 1036 |
+
Percent change.
|
| 1037 |
+
volume : Union[int, float]
|
| 1038 |
+
The trading volume.
|
| 1039 |
+
open : Optional[float]
|
| 1040 |
+
Open price for the day. (provider: yfinance)
|
| 1041 |
+
high : Optional[float]
|
| 1042 |
+
High price for the day. (provider: yfinance)
|
| 1043 |
+
low : Optional[float]
|
| 1044 |
+
Low price for the day. (provider: yfinance)
|
| 1045 |
+
previous_close : Optional[float]
|
| 1046 |
+
Previous close price. (provider: yfinance)
|
| 1047 |
+
ma50 : Optional[float]
|
| 1048 |
+
50-day moving average. (provider: yfinance)
|
| 1049 |
+
ma200 : Optional[float]
|
| 1050 |
+
200-day moving average. (provider: yfinance)
|
| 1051 |
+
year_high : Optional[float]
|
| 1052 |
+
52-week high. (provider: yfinance)
|
| 1053 |
+
year_low : Optional[float]
|
| 1054 |
+
52-week low. (provider: yfinance)
|
| 1055 |
+
market_cap : Optional[float]
|
| 1056 |
+
Market Cap. (provider: yfinance)
|
| 1057 |
+
shares_outstanding : Optional[float]
|
| 1058 |
+
Shares outstanding. (provider: yfinance)
|
| 1059 |
+
book_value : Optional[float]
|
| 1060 |
+
Book value per share. (provider: yfinance)
|
| 1061 |
+
price_to_book : Optional[float]
|
| 1062 |
+
Price to book ratio. (provider: yfinance)
|
| 1063 |
+
eps_ttm : Optional[float]
|
| 1064 |
+
Earnings per share over the trailing twelve months. (provider: yfinance)
|
| 1065 |
+
eps_forward : Optional[float]
|
| 1066 |
+
Forward earnings per share. (provider: yfinance)
|
| 1067 |
+
pe_forward : Optional[float]
|
| 1068 |
+
Forward price-to-earnings ratio. (provider: yfinance)
|
| 1069 |
+
dividend_yield : Optional[float]
|
| 1070 |
+
Trailing twelve month dividend yield. (provider: yfinance)
|
| 1071 |
+
exchange : Optional[str]
|
| 1072 |
+
Exchange where the stock is listed. (provider: yfinance)
|
| 1073 |
+
exchange_timezone : Optional[str]
|
| 1074 |
+
Timezone of the exchange. (provider: yfinance)
|
| 1075 |
+
earnings_date : Optional[datetime]
|
| 1076 |
+
Most recent earnings date. (provider: yfinance)
|
| 1077 |
+
currency : Optional[str]
|
| 1078 |
+
Currency of the price data. (provider: yfinance)
|
| 1079 |
+
|
| 1080 |
+
Examples
|
| 1081 |
+
--------
|
| 1082 |
+
>>> from openbb import obb
|
| 1083 |
+
>>> obb.equity.discovery.undervalued_large_caps(provider='yfinance')
|
| 1084 |
+
>>> obb.equity.discovery.undervalued_large_caps(sort='desc', provider='yfinance')
|
| 1085 |
+
""" # noqa: E501
|
| 1086 |
+
|
| 1087 |
+
return self._run(
|
| 1088 |
+
"/equity/discovery/undervalued_large_caps",
|
| 1089 |
+
**filter_inputs(
|
| 1090 |
+
provider_choices={
|
| 1091 |
+
"provider": self._get_provider(
|
| 1092 |
+
provider,
|
| 1093 |
+
"equity.discovery.undervalued_large_caps",
|
| 1094 |
+
("yfinance",),
|
| 1095 |
+
)
|
| 1096 |
+
},
|
| 1097 |
+
standard_params={
|
| 1098 |
+
"sort": sort,
|
| 1099 |
+
},
|
| 1100 |
+
extra_params=kwargs,
|
| 1101 |
+
)
|
| 1102 |
+
)
|
openbb_platform/openbb/package/equity_estimates.py
ADDED
|
@@ -0,0 +1,1111 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|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
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
### THIS FILE IS AUTO-GENERATED. DO NOT EDIT. ###
|
| 2 |
+
|
| 3 |
+
from typing import Literal, Optional, Union
|
| 4 |
+
|
| 5 |
+
from openbb_core.app.model.field import OpenBBField
|
| 6 |
+
from openbb_core.app.model.obbject import OBBject
|
| 7 |
+
from openbb_core.app.static.container import Container
|
| 8 |
+
from openbb_core.app.static.utils.decorators import exception_handler, validate
|
| 9 |
+
from openbb_core.app.static.utils.filters import filter_inputs
|
| 10 |
+
from typing_extensions import Annotated
|
| 11 |
+
|
| 12 |
+
|
| 13 |
+
class ROUTER_equity_estimates(Container):
|
| 14 |
+
"""/equity/estimates
|
| 15 |
+
analyst_search
|
| 16 |
+
consensus
|
| 17 |
+
forward_ebitda
|
| 18 |
+
forward_eps
|
| 19 |
+
forward_pe
|
| 20 |
+
forward_sales
|
| 21 |
+
historical
|
| 22 |
+
price_target
|
| 23 |
+
"""
|
| 24 |
+
|
| 25 |
+
def __repr__(self) -> str:
|
| 26 |
+
return self.__doc__ or ""
|
| 27 |
+
|
| 28 |
+
@exception_handler
|
| 29 |
+
@validate
|
| 30 |
+
def analyst_search(
|
| 31 |
+
self,
|
| 32 |
+
analyst_name: Annotated[
|
| 33 |
+
Union[str, None, list[Optional[str]]],
|
| 34 |
+
OpenBBField(
|
| 35 |
+
description="Analyst names to return. Omitting will return all available analysts. Multiple comma separated items allowed for provider(s): benzinga."
|
| 36 |
+
),
|
| 37 |
+
] = None,
|
| 38 |
+
firm_name: Annotated[
|
| 39 |
+
Union[str, None, list[Optional[str]]],
|
| 40 |
+
OpenBBField(
|
| 41 |
+
description="Firm names to return. Omitting will return all available firms. Multiple comma separated items allowed for provider(s): benzinga."
|
| 42 |
+
),
|
| 43 |
+
] = None,
|
| 44 |
+
provider: Annotated[
|
| 45 |
+
Optional[Literal["benzinga"]],
|
| 46 |
+
OpenBBField(
|
| 47 |
+
description="The provider to use, by default None. If None, the priority list configured in the settings is used. Default priority: benzinga."
|
| 48 |
+
),
|
| 49 |
+
] = None,
|
| 50 |
+
**kwargs
|
| 51 |
+
) -> OBBject:
|
| 52 |
+
"""Search for specific analysts and get their forecast track record.
|
| 53 |
+
|
| 54 |
+
Parameters
|
| 55 |
+
----------
|
| 56 |
+
provider : str
|
| 57 |
+
The provider to use, by default None. If None, the priority list configured in the settings is used. Default priority: benzinga.
|
| 58 |
+
analyst_name : Union[str, None, list[Optional[str]]]
|
| 59 |
+
Analyst names to return. Omitting will return all available analysts. Multiple comma separated items allowed for provider(s): benzinga.
|
| 60 |
+
firm_name : Union[str, None, list[Optional[str]]]
|
| 61 |
+
Firm names to return. Omitting will return all available firms. Multiple comma separated items allowed for provider(s): benzinga.
|
| 62 |
+
analyst_ids : Optional[str]
|
| 63 |
+
list of analyst IDs to return. Multiple comma separated items allowed. (provider: benzinga)
|
| 64 |
+
firm_ids : Optional[str]
|
| 65 |
+
Firm IDs to return. Multiple comma separated items allowed. (provider: benzinga)
|
| 66 |
+
limit : Optional[int]
|
| 67 |
+
Number of results returned. Limit 1000. (provider: benzinga)
|
| 68 |
+
page : Optional[int]
|
| 69 |
+
Page offset. For optimization, performance and technical reasons, page offsets are limited from 0 - 100000. Limit the query results by other parameters such as date. (provider: benzinga)
|
| 70 |
+
fields : Optional[str]
|
| 71 |
+
Fields to include in the response. See https://docs.benzinga.io/benzinga-apis/calendar/get-ratings to learn about the available fields. Multiple comma separated items allowed. (provider: benzinga)
|
| 72 |
+
|
| 73 |
+
Returns
|
| 74 |
+
-------
|
| 75 |
+
OBBject
|
| 76 |
+
results : list[AnalystSearch]
|
| 77 |
+
Serializable results.
|
| 78 |
+
provider : Optional[str]
|
| 79 |
+
Provider name.
|
| 80 |
+
warnings : Optional[list[Warning_]]
|
| 81 |
+
list of warnings.
|
| 82 |
+
chart : Optional[Chart]
|
| 83 |
+
Chart object.
|
| 84 |
+
extra : Dict[str, Any]
|
| 85 |
+
Extra info.
|
| 86 |
+
|
| 87 |
+
AnalystSearch
|
| 88 |
+
-------------
|
| 89 |
+
last_updated : Optional[datetime]
|
| 90 |
+
Date of the last update.
|
| 91 |
+
firm_name : Optional[str]
|
| 92 |
+
Firm name of the analyst.
|
| 93 |
+
name_first : Optional[str]
|
| 94 |
+
Analyst first name.
|
| 95 |
+
name_last : Optional[str]
|
| 96 |
+
Analyst last name.
|
| 97 |
+
name_full : str
|
| 98 |
+
Analyst full name.
|
| 99 |
+
analyst_id : Optional[str]
|
| 100 |
+
ID of the analyst. (provider: benzinga)
|
| 101 |
+
firm_id : Optional[str]
|
| 102 |
+
ID of the analyst firm. (provider: benzinga)
|
| 103 |
+
smart_score : Optional[float]
|
| 104 |
+
A weighted average of the total_ratings_percentile, overall_avg_return_percentile, and overall_success_rate (provider: benzinga)
|
| 105 |
+
overall_success_rate : Optional[float]
|
| 106 |
+
The percentage (normalized) of gain/loss ratings that resulted in a gain overall. (provider: benzinga)
|
| 107 |
+
overall_avg_return_percentile : Optional[float]
|
| 108 |
+
The percentile (normalized) of this analyst's overall average return per rating in comparison to other analysts' overall average returns per rating. (provider: benzinga)
|
| 109 |
+
total_ratings_percentile : Optional[float]
|
| 110 |
+
The percentile (normalized) of this analyst's total number of ratings in comparison to the total number of ratings published by all other analysts (provider: benzinga)
|
| 111 |
+
total_ratings : Optional[int]
|
| 112 |
+
Number of recommendations made by this analyst. (provider: benzinga)
|
| 113 |
+
overall_gain_count : Optional[int]
|
| 114 |
+
The number of ratings that have gained value since the date of recommendation (provider: benzinga)
|
| 115 |
+
overall_loss_count : Optional[int]
|
| 116 |
+
The number of ratings that have lost value since the date of recommendation (provider: benzinga)
|
| 117 |
+
overall_average_return : Optional[float]
|
| 118 |
+
The average percent (normalized) price difference per rating since the date of recommendation (provider: benzinga)
|
| 119 |
+
overall_std_dev : Optional[float]
|
| 120 |
+
The standard deviation in percent (normalized) price difference in the analyst's ratings since the date of recommendation (provider: benzinga)
|
| 121 |
+
gain_count_1m : Optional[int]
|
| 122 |
+
The number of ratings that have gained value over the last month (provider: benzinga)
|
| 123 |
+
loss_count_1m : Optional[int]
|
| 124 |
+
The number of ratings that have lost value over the last month (provider: benzinga)
|
| 125 |
+
average_return_1m : Optional[float]
|
| 126 |
+
The average percent (normalized) price difference per rating over the last month (provider: benzinga)
|
| 127 |
+
std_dev_1m : Optional[float]
|
| 128 |
+
The standard deviation in percent (normalized) price difference in the analyst's ratings over the last month (provider: benzinga)
|
| 129 |
+
smart_score_1m : Optional[float]
|
| 130 |
+
A weighted average smart score over the last month. (provider: benzinga)
|
| 131 |
+
success_rate_1m : Optional[float]
|
| 132 |
+
The percentage (normalized) of gain/loss ratings that resulted in a gain over the last month (provider: benzinga)
|
| 133 |
+
gain_count_3m : Optional[int]
|
| 134 |
+
The number of ratings that have gained value over the last 3 months (provider: benzinga)
|
| 135 |
+
loss_count_3m : Optional[int]
|
| 136 |
+
The number of ratings that have lost value over the last 3 months (provider: benzinga)
|
| 137 |
+
average_return_3m : Optional[float]
|
| 138 |
+
The average percent (normalized) price difference per rating over the last 3 months (provider: benzinga)
|
| 139 |
+
std_dev_3m : Optional[float]
|
| 140 |
+
The standard deviation in percent (normalized) price difference in the analyst's ratings over the last 3 months (provider: benzinga)
|
| 141 |
+
smart_score_3m : Optional[float]
|
| 142 |
+
A weighted average smart score over the last 3 months. (provider: benzinga)
|
| 143 |
+
success_rate_3m : Optional[float]
|
| 144 |
+
The percentage (normalized) of gain/loss ratings that resulted in a gain over the last 3 months (provider: benzinga)
|
| 145 |
+
gain_count_6m : Optional[int]
|
| 146 |
+
The number of ratings that have gained value over the last 6 months (provider: benzinga)
|
| 147 |
+
loss_count_6m : Optional[int]
|
| 148 |
+
The number of ratings that have lost value over the last 6 months (provider: benzinga)
|
| 149 |
+
average_return_6m : Optional[float]
|
| 150 |
+
The average percent (normalized) price difference per rating over the last 6 months (provider: benzinga)
|
| 151 |
+
std_dev_6m : Optional[float]
|
| 152 |
+
The standard deviation in percent (normalized) price difference in the analyst's ratings over the last 6 months (provider: benzinga)
|
| 153 |
+
gain_count_9m : Optional[int]
|
| 154 |
+
The number of ratings that have gained value over the last 9 months (provider: benzinga)
|
| 155 |
+
loss_count_9m : Optional[int]
|
| 156 |
+
The number of ratings that have lost value over the last 9 months (provider: benzinga)
|
| 157 |
+
average_return_9m : Optional[float]
|
| 158 |
+
The average percent (normalized) price difference per rating over the last 9 months (provider: benzinga)
|
| 159 |
+
std_dev_9m : Optional[float]
|
| 160 |
+
The standard deviation in percent (normalized) price difference in the analyst's ratings over the last 9 months (provider: benzinga)
|
| 161 |
+
smart_score_9m : Optional[float]
|
| 162 |
+
A weighted average smart score over the last 9 months. (provider: benzinga)
|
| 163 |
+
success_rate_9m : Optional[float]
|
| 164 |
+
The percentage (normalized) of gain/loss ratings that resulted in a gain over the last 9 months (provider: benzinga)
|
| 165 |
+
gain_count_1y : Optional[int]
|
| 166 |
+
The number of ratings that have gained value over the last 1 year (provider: benzinga)
|
| 167 |
+
loss_count_1y : Optional[int]
|
| 168 |
+
The number of ratings that have lost value over the last 1 year (provider: benzinga)
|
| 169 |
+
average_return_1y : Optional[float]
|
| 170 |
+
The average percent (normalized) price difference per rating over the last 1 year (provider: benzinga)
|
| 171 |
+
std_dev_1y : Optional[float]
|
| 172 |
+
The standard deviation in percent (normalized) price difference in the analyst's ratings over the last 1 year (provider: benzinga)
|
| 173 |
+
smart_score_1y : Optional[float]
|
| 174 |
+
A weighted average smart score over the last 1 year. (provider: benzinga)
|
| 175 |
+
success_rate_1y : Optional[float]
|
| 176 |
+
The percentage (normalized) of gain/loss ratings that resulted in a gain over the last 1 year (provider: benzinga)
|
| 177 |
+
gain_count_2y : Optional[int]
|
| 178 |
+
The number of ratings that have gained value over the last 2 years (provider: benzinga)
|
| 179 |
+
loss_count_2y : Optional[int]
|
| 180 |
+
The number of ratings that have lost value over the last 2 years (provider: benzinga)
|
| 181 |
+
average_return_2y : Optional[float]
|
| 182 |
+
The average percent (normalized) price difference per rating over the last 2 years (provider: benzinga)
|
| 183 |
+
std_dev_2y : Optional[float]
|
| 184 |
+
The standard deviation in percent (normalized) price difference in the analyst's ratings over the last 2 years (provider: benzinga)
|
| 185 |
+
smart_score_2y : Optional[float]
|
| 186 |
+
A weighted average smart score over the last 3 years. (provider: benzinga)
|
| 187 |
+
success_rate_2y : Optional[float]
|
| 188 |
+
The percentage (normalized) of gain/loss ratings that resulted in a gain over the last 2 years (provider: benzinga)
|
| 189 |
+
gain_count_3y : Optional[int]
|
| 190 |
+
The number of ratings that have gained value over the last 3 years (provider: benzinga)
|
| 191 |
+
loss_count_3y : Optional[int]
|
| 192 |
+
The number of ratings that have lost value over the last 3 years (provider: benzinga)
|
| 193 |
+
average_return_3y : Optional[float]
|
| 194 |
+
The average percent (normalized) price difference per rating over the last 3 years (provider: benzinga)
|
| 195 |
+
std_dev_3y : Optional[float]
|
| 196 |
+
The standard deviation in percent (normalized) price difference in the analyst's ratings over the last 3 years (provider: benzinga)
|
| 197 |
+
smart_score_3y : Optional[float]
|
| 198 |
+
A weighted average smart score over the last 3 years. (provider: benzinga)
|
| 199 |
+
success_rate_3y : Optional[float]
|
| 200 |
+
The percentage (normalized) of gain/loss ratings that resulted in a gain over the last 3 years (provider: benzinga)
|
| 201 |
+
|
| 202 |
+
Examples
|
| 203 |
+
--------
|
| 204 |
+
>>> from openbb import obb
|
| 205 |
+
>>> obb.equity.estimates.analyst_search(provider='benzinga')
|
| 206 |
+
>>> obb.equity.estimates.analyst_search(firm_name='Wedbush', provider='benzinga')
|
| 207 |
+
""" # noqa: E501
|
| 208 |
+
|
| 209 |
+
return self._run(
|
| 210 |
+
"/equity/estimates/analyst_search",
|
| 211 |
+
**filter_inputs(
|
| 212 |
+
provider_choices={
|
| 213 |
+
"provider": self._get_provider(
|
| 214 |
+
provider,
|
| 215 |
+
"equity.estimates.analyst_search",
|
| 216 |
+
("benzinga",),
|
| 217 |
+
)
|
| 218 |
+
},
|
| 219 |
+
standard_params={
|
| 220 |
+
"analyst_name": analyst_name,
|
| 221 |
+
"firm_name": firm_name,
|
| 222 |
+
},
|
| 223 |
+
extra_params=kwargs,
|
| 224 |
+
info={
|
| 225 |
+
"analyst_name": {
|
| 226 |
+
"benzinga": {"multiple_items_allowed": True, "choices": None}
|
| 227 |
+
},
|
| 228 |
+
"firm_name": {
|
| 229 |
+
"benzinga": {"multiple_items_allowed": True, "choices": None}
|
| 230 |
+
},
|
| 231 |
+
"analyst_ids": {
|
| 232 |
+
"benzinga": {"multiple_items_allowed": True, "choices": None}
|
| 233 |
+
},
|
| 234 |
+
"firm_ids": {
|
| 235 |
+
"benzinga": {"multiple_items_allowed": True, "choices": None}
|
| 236 |
+
},
|
| 237 |
+
"fields": {
|
| 238 |
+
"benzinga": {"multiple_items_allowed": True, "choices": None}
|
| 239 |
+
},
|
| 240 |
+
},
|
| 241 |
+
)
|
| 242 |
+
)
|
| 243 |
+
|
| 244 |
+
@exception_handler
|
| 245 |
+
@validate
|
| 246 |
+
def consensus(
|
| 247 |
+
self,
|
| 248 |
+
symbol: Annotated[
|
| 249 |
+
Union[str, None, list[Optional[str]]],
|
| 250 |
+
OpenBBField(
|
| 251 |
+
description="Symbol to get data for. Multiple comma separated items allowed for provider(s): fmp, intrinio, yfinance."
|
| 252 |
+
),
|
| 253 |
+
] = None,
|
| 254 |
+
provider: Annotated[
|
| 255 |
+
Optional[Literal["fmp", "intrinio", "yfinance"]],
|
| 256 |
+
OpenBBField(
|
| 257 |
+
description="The provider to use, by default None. If None, the priority list configured in the settings is used. Default priority: fmp, intrinio, yfinance."
|
| 258 |
+
),
|
| 259 |
+
] = None,
|
| 260 |
+
**kwargs
|
| 261 |
+
) -> OBBject:
|
| 262 |
+
"""Get consensus price target and recommendation.
|
| 263 |
+
|
| 264 |
+
Parameters
|
| 265 |
+
----------
|
| 266 |
+
provider : str
|
| 267 |
+
The provider to use, by default None. If None, the priority list configured in the settings is used. Default priority: fmp, intrinio, yfinance.
|
| 268 |
+
symbol : Union[str, None, list[Optional[str]]]
|
| 269 |
+
Symbol to get data for. Multiple comma separated items allowed for provider(s): fmp, intrinio, yfinance.
|
| 270 |
+
industry_group_number : Optional[int]
|
| 271 |
+
The Zacks industry group number. (provider: intrinio)
|
| 272 |
+
|
| 273 |
+
Returns
|
| 274 |
+
-------
|
| 275 |
+
OBBject
|
| 276 |
+
results : list[PriceTargetConsensus]
|
| 277 |
+
Serializable results.
|
| 278 |
+
provider : Optional[str]
|
| 279 |
+
Provider name.
|
| 280 |
+
warnings : Optional[list[Warning_]]
|
| 281 |
+
list of warnings.
|
| 282 |
+
chart : Optional[Chart]
|
| 283 |
+
Chart object.
|
| 284 |
+
extra : Dict[str, Any]
|
| 285 |
+
Extra info.
|
| 286 |
+
|
| 287 |
+
PriceTargetConsensus
|
| 288 |
+
--------------------
|
| 289 |
+
symbol : str
|
| 290 |
+
Symbol representing the entity requested in the data.
|
| 291 |
+
name : Optional[str]
|
| 292 |
+
The company name
|
| 293 |
+
target_high : Optional[float]
|
| 294 |
+
High target of the price target consensus.
|
| 295 |
+
target_low : Optional[float]
|
| 296 |
+
Low target of the price target consensus.
|
| 297 |
+
target_consensus : Optional[float]
|
| 298 |
+
Consensus target of the price target consensus.
|
| 299 |
+
target_median : Optional[float]
|
| 300 |
+
Median target of the price target consensus.
|
| 301 |
+
standard_deviation : Optional[float]
|
| 302 |
+
The standard deviation of target price estimates. (provider: intrinio)
|
| 303 |
+
total_anaylsts : Optional[int]
|
| 304 |
+
The total number of target price estimates in consensus. (provider: intrinio)
|
| 305 |
+
raised : Optional[int]
|
| 306 |
+
The number of analysts that have raised their target price estimates. (provider: intrinio)
|
| 307 |
+
lowered : Optional[int]
|
| 308 |
+
The number of analysts that have lowered their target price estimates. (provider: intrinio)
|
| 309 |
+
most_recent_date : Optional[date]
|
| 310 |
+
The date of the most recent estimate. (provider: intrinio)
|
| 311 |
+
industry_group_number : Optional[int]
|
| 312 |
+
The Zacks industry group number. (provider: intrinio)
|
| 313 |
+
recommendation : Optional[str]
|
| 314 |
+
Recommendation - buy, sell, etc. (provider: yfinance)
|
| 315 |
+
recommendation_mean : Optional[float]
|
| 316 |
+
Mean recommendation score where 1 is strong buy and 5 is strong sell. (provider: yfinance)
|
| 317 |
+
number_of_analysts : Optional[int]
|
| 318 |
+
Number of analysts providing opinions. (provider: yfinance)
|
| 319 |
+
current_price : Optional[float]
|
| 320 |
+
Current price of the stock. (provider: yfinance)
|
| 321 |
+
currency : Optional[str]
|
| 322 |
+
Currency the stock is priced in. (provider: yfinance)
|
| 323 |
+
|
| 324 |
+
Examples
|
| 325 |
+
--------
|
| 326 |
+
>>> from openbb import obb
|
| 327 |
+
>>> obb.equity.estimates.consensus(symbol='AAPL', provider='fmp')
|
| 328 |
+
>>> obb.equity.estimates.consensus(symbol='AAPL,MSFT', provider='yfinance')
|
| 329 |
+
""" # noqa: E501
|
| 330 |
+
|
| 331 |
+
return self._run(
|
| 332 |
+
"/equity/estimates/consensus",
|
| 333 |
+
**filter_inputs(
|
| 334 |
+
provider_choices={
|
| 335 |
+
"provider": self._get_provider(
|
| 336 |
+
provider,
|
| 337 |
+
"equity.estimates.consensus",
|
| 338 |
+
("fmp", "intrinio", "yfinance"),
|
| 339 |
+
)
|
| 340 |
+
},
|
| 341 |
+
standard_params={
|
| 342 |
+
"symbol": symbol,
|
| 343 |
+
},
|
| 344 |
+
extra_params=kwargs,
|
| 345 |
+
info={
|
| 346 |
+
"symbol": {
|
| 347 |
+
"fmp": {"multiple_items_allowed": True, "choices": None},
|
| 348 |
+
"intrinio": {"multiple_items_allowed": True, "choices": None},
|
| 349 |
+
"yfinance": {"multiple_items_allowed": True, "choices": None},
|
| 350 |
+
}
|
| 351 |
+
},
|
| 352 |
+
)
|
| 353 |
+
)
|
| 354 |
+
|
| 355 |
+
@exception_handler
|
| 356 |
+
@validate
|
| 357 |
+
def forward_ebitda(
|
| 358 |
+
self,
|
| 359 |
+
symbol: Annotated[
|
| 360 |
+
Union[str, None, list[Optional[str]]],
|
| 361 |
+
OpenBBField(
|
| 362 |
+
description="Symbol to get data for. Multiple comma separated items allowed for provider(s): fmp, intrinio."
|
| 363 |
+
),
|
| 364 |
+
] = None,
|
| 365 |
+
provider: Annotated[
|
| 366 |
+
Optional[Literal["fmp", "intrinio"]],
|
| 367 |
+
OpenBBField(
|
| 368 |
+
description="The provider to use, by default None. If None, the priority list configured in the settings is used. Default priority: fmp, intrinio."
|
| 369 |
+
),
|
| 370 |
+
] = None,
|
| 371 |
+
**kwargs
|
| 372 |
+
) -> OBBject:
|
| 373 |
+
"""Get forward EBITDA estimates.
|
| 374 |
+
|
| 375 |
+
Parameters
|
| 376 |
+
----------
|
| 377 |
+
provider : str
|
| 378 |
+
The provider to use, by default None. If None, the priority list configured in the settings is used. Default priority: fmp, intrinio.
|
| 379 |
+
symbol : Union[str, None, list[Optional[str]]]
|
| 380 |
+
Symbol to get data for. Multiple comma separated items allowed for provider(s): fmp, intrinio.
|
| 381 |
+
fiscal_period : Optional[Literal['annual', 'quarter']]
|
| 382 |
+
The future fiscal period to retrieve estimates for. (provider: fmp)
|
| 383 |
+
limit : Optional[int]
|
| 384 |
+
The number of data entries to return. (provider: fmp)
|
| 385 |
+
include_historical : bool
|
| 386 |
+
If True, the data will include all past data and the limit will be ignored. (provider: fmp)
|
| 387 |
+
estimate_type : Optional[Literal['ebitda', 'ebit', 'enterprise_value', 'cash_flow_per_share', 'pretax_income']]
|
| 388 |
+
Limit the EBITDA estimates to this type. (provider: intrinio)
|
| 389 |
+
|
| 390 |
+
Returns
|
| 391 |
+
-------
|
| 392 |
+
OBBject
|
| 393 |
+
results : list[ForwardEbitdaEstimates]
|
| 394 |
+
Serializable results.
|
| 395 |
+
provider : Optional[str]
|
| 396 |
+
Provider name.
|
| 397 |
+
warnings : Optional[list[Warning_]]
|
| 398 |
+
list of warnings.
|
| 399 |
+
chart : Optional[Chart]
|
| 400 |
+
Chart object.
|
| 401 |
+
extra : Dict[str, Any]
|
| 402 |
+
Extra info.
|
| 403 |
+
|
| 404 |
+
ForwardEbitdaEstimates
|
| 405 |
+
----------------------
|
| 406 |
+
symbol : str
|
| 407 |
+
Symbol representing the entity requested in the data.
|
| 408 |
+
name : Optional[str]
|
| 409 |
+
Name of the entity.
|
| 410 |
+
last_updated : Optional[date]
|
| 411 |
+
The date of the last update.
|
| 412 |
+
period_ending : Optional[date]
|
| 413 |
+
The end date of the reporting period.
|
| 414 |
+
fiscal_year : Optional[int]
|
| 415 |
+
Fiscal year for the estimate.
|
| 416 |
+
fiscal_period : Optional[str]
|
| 417 |
+
Fiscal quarter for the estimate.
|
| 418 |
+
calendar_year : Optional[int]
|
| 419 |
+
Calendar year for the estimate.
|
| 420 |
+
calendar_period : Optional[Union[int, str]]
|
| 421 |
+
Calendar quarter for the estimate.
|
| 422 |
+
low_estimate : Optional[int]
|
| 423 |
+
The EBITDA estimate low for the period.
|
| 424 |
+
high_estimate : Optional[int]
|
| 425 |
+
The EBITDA estimate high for the period.
|
| 426 |
+
mean : Optional[int]
|
| 427 |
+
The EBITDA estimate mean for the period.
|
| 428 |
+
median : Optional[int]
|
| 429 |
+
The EBITDA estimate median for the period.
|
| 430 |
+
standard_deviation : Optional[int]
|
| 431 |
+
The EBITDA estimate standard deviation for the period.
|
| 432 |
+
number_of_analysts : Optional[int]
|
| 433 |
+
Number of analysts providing estimates for the period.
|
| 434 |
+
conensus_type : Optional[Literal['ebitda', 'ebit', 'enterprise_value', 'cash_flow_per_share', 'pretax_income']]
|
| 435 |
+
The type of estimate. (provider: intrinio)
|
| 436 |
+
|
| 437 |
+
Examples
|
| 438 |
+
--------
|
| 439 |
+
>>> from openbb import obb
|
| 440 |
+
>>> obb.equity.estimates.forward_ebitda(provider='intrinio')
|
| 441 |
+
>>> obb.equity.estimates.forward_ebitda(symbol='AAPL', fiscal_period='annual', provider='intrinio')
|
| 442 |
+
>>> obb.equity.estimates.forward_ebitda(symbol='AAPL,MSFT', fiscal_period='quarter', provider='fmp')
|
| 443 |
+
""" # noqa: E501
|
| 444 |
+
|
| 445 |
+
return self._run(
|
| 446 |
+
"/equity/estimates/forward_ebitda",
|
| 447 |
+
**filter_inputs(
|
| 448 |
+
provider_choices={
|
| 449 |
+
"provider": self._get_provider(
|
| 450 |
+
provider,
|
| 451 |
+
"equity.estimates.forward_ebitda",
|
| 452 |
+
("fmp", "intrinio"),
|
| 453 |
+
)
|
| 454 |
+
},
|
| 455 |
+
standard_params={
|
| 456 |
+
"symbol": symbol,
|
| 457 |
+
},
|
| 458 |
+
extra_params=kwargs,
|
| 459 |
+
info={
|
| 460 |
+
"symbol": {
|
| 461 |
+
"fmp": {"multiple_items_allowed": True, "choices": None},
|
| 462 |
+
"intrinio": {"multiple_items_allowed": True, "choices": None},
|
| 463 |
+
}
|
| 464 |
+
},
|
| 465 |
+
)
|
| 466 |
+
)
|
| 467 |
+
|
| 468 |
+
@exception_handler
|
| 469 |
+
@validate
|
| 470 |
+
def forward_eps(
|
| 471 |
+
self,
|
| 472 |
+
symbol: Annotated[
|
| 473 |
+
Union[str, None, list[Optional[str]]],
|
| 474 |
+
OpenBBField(
|
| 475 |
+
description="Symbol to get data for. Multiple comma separated items allowed for provider(s): fmp, intrinio."
|
| 476 |
+
),
|
| 477 |
+
] = None,
|
| 478 |
+
provider: Annotated[
|
| 479 |
+
Optional[Literal["fmp", "intrinio"]],
|
| 480 |
+
OpenBBField(
|
| 481 |
+
description="The provider to use, by default None. If None, the priority list configured in the settings is used. Default priority: fmp, intrinio."
|
| 482 |
+
),
|
| 483 |
+
] = None,
|
| 484 |
+
**kwargs
|
| 485 |
+
) -> OBBject:
|
| 486 |
+
"""Get forward EPS estimates.
|
| 487 |
+
|
| 488 |
+
Parameters
|
| 489 |
+
----------
|
| 490 |
+
provider : str
|
| 491 |
+
The provider to use, by default None. If None, the priority list configured in the settings is used. Default priority: fmp, intrinio.
|
| 492 |
+
symbol : Union[str, None, list[Optional[str]]]
|
| 493 |
+
Symbol to get data for. Multiple comma separated items allowed for provider(s): fmp, intrinio.
|
| 494 |
+
fiscal_period : str
|
| 495 |
+
The future fiscal period to retrieve estimates for. (provider: fmp, intrinio)
|
| 496 |
+
Choices for fmp: 'annual', 'quarter'
|
| 497 |
+
limit : Optional[int]
|
| 498 |
+
The number of data entries to return. (provider: fmp)
|
| 499 |
+
include_historical : bool
|
| 500 |
+
If True, the data will include all past data and the limit will be ignored. (provider: fmp)
|
| 501 |
+
fiscal_year : Optional[int]
|
| 502 |
+
The future fiscal year to retrieve estimates for. When no symbol and year is supplied the current calendar year is used. (provider: intrinio)
|
| 503 |
+
calendar_year : Optional[int]
|
| 504 |
+
The future calendar year to retrieve estimates for. When no symbol and year is supplied the current calendar year is used. (provider: intrinio)
|
| 505 |
+
calendar_period : Optional[Literal['q1', 'q2', 'q3', 'q4']]
|
| 506 |
+
The future calendar period to retrieve estimates for. (provider: intrinio)
|
| 507 |
+
|
| 508 |
+
Returns
|
| 509 |
+
-------
|
| 510 |
+
OBBject
|
| 511 |
+
results : list[ForwardEpsEstimates]
|
| 512 |
+
Serializable results.
|
| 513 |
+
provider : Optional[str]
|
| 514 |
+
Provider name.
|
| 515 |
+
warnings : Optional[list[Warning_]]
|
| 516 |
+
list of warnings.
|
| 517 |
+
chart : Optional[Chart]
|
| 518 |
+
Chart object.
|
| 519 |
+
extra : Dict[str, Any]
|
| 520 |
+
Extra info.
|
| 521 |
+
|
| 522 |
+
ForwardEpsEstimates
|
| 523 |
+
-------------------
|
| 524 |
+
symbol : str
|
| 525 |
+
Symbol representing the entity requested in the data.
|
| 526 |
+
name : Optional[str]
|
| 527 |
+
Name of the entity.
|
| 528 |
+
date : date
|
| 529 |
+
The date of the data.
|
| 530 |
+
fiscal_year : Optional[int]
|
| 531 |
+
Fiscal year for the estimate.
|
| 532 |
+
fiscal_period : Optional[str]
|
| 533 |
+
Fiscal quarter for the estimate.
|
| 534 |
+
calendar_year : Optional[int]
|
| 535 |
+
Calendar year for the estimate.
|
| 536 |
+
calendar_period : Optional[str]
|
| 537 |
+
Calendar quarter for the estimate.
|
| 538 |
+
low_estimate : Optional[float]
|
| 539 |
+
Estimated EPS low for the period.
|
| 540 |
+
high_estimate : Optional[float]
|
| 541 |
+
Estimated EPS high for the period.
|
| 542 |
+
mean : Optional[float]
|
| 543 |
+
Estimated EPS mean for the period.
|
| 544 |
+
median : Optional[float]
|
| 545 |
+
Estimated EPS median for the period.
|
| 546 |
+
standard_deviation : Optional[float]
|
| 547 |
+
Estimated EPS standard deviation for the period.
|
| 548 |
+
number_of_analysts : Optional[int]
|
| 549 |
+
Number of analysts providing estimates for the period.
|
| 550 |
+
revisions_change_percent : Optional[float]
|
| 551 |
+
The earnings per share (EPS) percent change in estimate for the period. (provider: intrinio)
|
| 552 |
+
mean_1w : Optional[float]
|
| 553 |
+
The mean estimate for the period one week ago. (provider: intrinio)
|
| 554 |
+
mean_1m : Optional[float]
|
| 555 |
+
The mean estimate for the period one month ago. (provider: intrinio)
|
| 556 |
+
mean_2m : Optional[float]
|
| 557 |
+
The mean estimate for the period two months ago. (provider: intrinio)
|
| 558 |
+
mean_3m : Optional[float]
|
| 559 |
+
The mean estimate for the period three months ago. (provider: intrinio)
|
| 560 |
+
|
| 561 |
+
Examples
|
| 562 |
+
--------
|
| 563 |
+
>>> from openbb import obb
|
| 564 |
+
>>> obb.equity.estimates.forward_eps(symbol='AAPL', provider='intrinio')
|
| 565 |
+
>>> obb.equity.estimates.forward_eps(fiscal_year=2025, fiscal_period='fy', provider='intrinio')
|
| 566 |
+
""" # noqa: E501
|
| 567 |
+
|
| 568 |
+
return self._run(
|
| 569 |
+
"/equity/estimates/forward_eps",
|
| 570 |
+
**filter_inputs(
|
| 571 |
+
provider_choices={
|
| 572 |
+
"provider": self._get_provider(
|
| 573 |
+
provider,
|
| 574 |
+
"equity.estimates.forward_eps",
|
| 575 |
+
("fmp", "intrinio"),
|
| 576 |
+
)
|
| 577 |
+
},
|
| 578 |
+
standard_params={
|
| 579 |
+
"symbol": symbol,
|
| 580 |
+
},
|
| 581 |
+
extra_params=kwargs,
|
| 582 |
+
info={
|
| 583 |
+
"symbol": {
|
| 584 |
+
"fmp": {"multiple_items_allowed": True, "choices": None},
|
| 585 |
+
"intrinio": {"multiple_items_allowed": True, "choices": None},
|
| 586 |
+
}
|
| 587 |
+
},
|
| 588 |
+
)
|
| 589 |
+
)
|
| 590 |
+
|
| 591 |
+
@exception_handler
|
| 592 |
+
@validate
|
| 593 |
+
def forward_pe(
|
| 594 |
+
self,
|
| 595 |
+
symbol: Annotated[
|
| 596 |
+
Union[str, None, list[Optional[str]]],
|
| 597 |
+
OpenBBField(
|
| 598 |
+
description="Symbol to get data for. Multiple comma separated items allowed for provider(s): intrinio."
|
| 599 |
+
),
|
| 600 |
+
] = None,
|
| 601 |
+
provider: Annotated[
|
| 602 |
+
Optional[Literal["intrinio"]],
|
| 603 |
+
OpenBBField(
|
| 604 |
+
description="The provider to use, by default None. If None, the priority list configured in the settings is used. Default priority: intrinio."
|
| 605 |
+
),
|
| 606 |
+
] = None,
|
| 607 |
+
**kwargs
|
| 608 |
+
) -> OBBject:
|
| 609 |
+
"""Get forward PE estimates.
|
| 610 |
+
|
| 611 |
+
Parameters
|
| 612 |
+
----------
|
| 613 |
+
provider : str
|
| 614 |
+
The provider to use, by default None. If None, the priority list configured in the settings is used. Default priority: intrinio.
|
| 615 |
+
symbol : Union[str, None, list[Optional[str]]]
|
| 616 |
+
Symbol to get data for. Multiple comma separated items allowed for provider(s): intrinio.
|
| 617 |
+
|
| 618 |
+
Returns
|
| 619 |
+
-------
|
| 620 |
+
OBBject
|
| 621 |
+
results : list[ForwardPeEstimates]
|
| 622 |
+
Serializable results.
|
| 623 |
+
provider : Optional[str]
|
| 624 |
+
Provider name.
|
| 625 |
+
warnings : Optional[list[Warning_]]
|
| 626 |
+
list of warnings.
|
| 627 |
+
chart : Optional[Chart]
|
| 628 |
+
Chart object.
|
| 629 |
+
extra : Dict[str, Any]
|
| 630 |
+
Extra info.
|
| 631 |
+
|
| 632 |
+
ForwardPeEstimates
|
| 633 |
+
------------------
|
| 634 |
+
symbol : str
|
| 635 |
+
Symbol representing the entity requested in the data.
|
| 636 |
+
name : Optional[str]
|
| 637 |
+
Name of the entity.
|
| 638 |
+
year1 : Optional[float]
|
| 639 |
+
Estimated PE ratio for the next fiscal year.
|
| 640 |
+
year2 : Optional[float]
|
| 641 |
+
Estimated PE ratio two fiscal years from now.
|
| 642 |
+
year3 : Optional[float]
|
| 643 |
+
Estimated PE ratio three fiscal years from now.
|
| 644 |
+
year4 : Optional[float]
|
| 645 |
+
Estimated PE ratio four fiscal years from now.
|
| 646 |
+
year5 : Optional[float]
|
| 647 |
+
Estimated PE ratio five fiscal years from now.
|
| 648 |
+
peg_ratio_year1 : Optional[float]
|
| 649 |
+
Estimated Forward PEG ratio for the next fiscal year. (provider: intrinio)
|
| 650 |
+
eps_ttm : Optional[float]
|
| 651 |
+
The latest trailing twelve months earnings per share. (provider: intrinio)
|
| 652 |
+
last_updated : Optional[date]
|
| 653 |
+
The date the data was last updated. (provider: intrinio)
|
| 654 |
+
|
| 655 |
+
Examples
|
| 656 |
+
--------
|
| 657 |
+
>>> from openbb import obb
|
| 658 |
+
>>> obb.equity.estimates.forward_pe(provider='intrinio')
|
| 659 |
+
>>> obb.equity.estimates.forward_pe(symbol='AAPL,MSFT,GOOG', provider='intrinio')
|
| 660 |
+
""" # noqa: E501
|
| 661 |
+
|
| 662 |
+
return self._run(
|
| 663 |
+
"/equity/estimates/forward_pe",
|
| 664 |
+
**filter_inputs(
|
| 665 |
+
provider_choices={
|
| 666 |
+
"provider": self._get_provider(
|
| 667 |
+
provider,
|
| 668 |
+
"equity.estimates.forward_pe",
|
| 669 |
+
("intrinio",),
|
| 670 |
+
)
|
| 671 |
+
},
|
| 672 |
+
standard_params={
|
| 673 |
+
"symbol": symbol,
|
| 674 |
+
},
|
| 675 |
+
extra_params=kwargs,
|
| 676 |
+
info={
|
| 677 |
+
"symbol": {
|
| 678 |
+
"intrinio": {"multiple_items_allowed": True, "choices": None}
|
| 679 |
+
}
|
| 680 |
+
},
|
| 681 |
+
)
|
| 682 |
+
)
|
| 683 |
+
|
| 684 |
+
@exception_handler
|
| 685 |
+
@validate
|
| 686 |
+
def forward_sales(
|
| 687 |
+
self,
|
| 688 |
+
symbol: Annotated[
|
| 689 |
+
Union[str, None, list[Optional[str]]],
|
| 690 |
+
OpenBBField(
|
| 691 |
+
description="Symbol to get data for. Multiple comma separated items allowed for provider(s): intrinio."
|
| 692 |
+
),
|
| 693 |
+
] = None,
|
| 694 |
+
provider: Annotated[
|
| 695 |
+
Optional[Literal["intrinio"]],
|
| 696 |
+
OpenBBField(
|
| 697 |
+
description="The provider to use, by default None. If None, the priority list configured in the settings is used. Default priority: intrinio."
|
| 698 |
+
),
|
| 699 |
+
] = None,
|
| 700 |
+
**kwargs
|
| 701 |
+
) -> OBBject:
|
| 702 |
+
"""Get forward sales estimates.
|
| 703 |
+
|
| 704 |
+
Parameters
|
| 705 |
+
----------
|
| 706 |
+
provider : str
|
| 707 |
+
The provider to use, by default None. If None, the priority list configured in the settings is used. Default priority: intrinio.
|
| 708 |
+
symbol : Union[str, None, list[Optional[str]]]
|
| 709 |
+
Symbol to get data for. Multiple comma separated items allowed for provider(s): intrinio.
|
| 710 |
+
fiscal_year : Optional[int]
|
| 711 |
+
The future fiscal year to retrieve estimates for. When no symbol and year is supplied the current calendar year is used. (provider: intrinio)
|
| 712 |
+
fiscal_period : Optional[Literal['fy', 'q1', 'q2', 'q3', 'q4']]
|
| 713 |
+
The future fiscal period to retrieve estimates for. (provider: intrinio)
|
| 714 |
+
calendar_year : Optional[int]
|
| 715 |
+
The future calendar year to retrieve estimates for. When no symbol and year is supplied the current calendar year is used. (provider: intrinio)
|
| 716 |
+
calendar_period : Optional[Literal['q1', 'q2', 'q3', 'q4']]
|
| 717 |
+
The future calendar period to retrieve estimates for. (provider: intrinio)
|
| 718 |
+
|
| 719 |
+
Returns
|
| 720 |
+
-------
|
| 721 |
+
OBBject
|
| 722 |
+
results : list[ForwardSalesEstimates]
|
| 723 |
+
Serializable results.
|
| 724 |
+
provider : Optional[str]
|
| 725 |
+
Provider name.
|
| 726 |
+
warnings : Optional[list[Warning_]]
|
| 727 |
+
list of warnings.
|
| 728 |
+
chart : Optional[Chart]
|
| 729 |
+
Chart object.
|
| 730 |
+
extra : Dict[str, Any]
|
| 731 |
+
Extra info.
|
| 732 |
+
|
| 733 |
+
ForwardSalesEstimates
|
| 734 |
+
---------------------
|
| 735 |
+
symbol : str
|
| 736 |
+
Symbol representing the entity requested in the data.
|
| 737 |
+
name : Optional[str]
|
| 738 |
+
Name of the entity.
|
| 739 |
+
date : date
|
| 740 |
+
The date of the data.
|
| 741 |
+
fiscal_year : Optional[int]
|
| 742 |
+
Fiscal year for the estimate.
|
| 743 |
+
fiscal_period : Optional[str]
|
| 744 |
+
Fiscal quarter for the estimate.
|
| 745 |
+
calendar_year : Optional[int]
|
| 746 |
+
Calendar year for the estimate.
|
| 747 |
+
calendar_period : Optional[str]
|
| 748 |
+
Calendar quarter for the estimate.
|
| 749 |
+
low_estimate : Optional[int]
|
| 750 |
+
The sales estimate low for the period.
|
| 751 |
+
high_estimate : Optional[int]
|
| 752 |
+
The sales estimate high for the period.
|
| 753 |
+
mean : Optional[int]
|
| 754 |
+
The sales estimate mean for the period.
|
| 755 |
+
median : Optional[int]
|
| 756 |
+
The sales estimate median for the period.
|
| 757 |
+
standard_deviation : Optional[int]
|
| 758 |
+
The sales estimate standard deviation for the period.
|
| 759 |
+
number_of_analysts : Optional[int]
|
| 760 |
+
Number of analysts providing estimates for the period.
|
| 761 |
+
revisions_1w_up : Optional[int]
|
| 762 |
+
Number of revisions up in the last week. (provider: intrinio)
|
| 763 |
+
revisions_1w_down : Optional[int]
|
| 764 |
+
Number of revisions down in the last week. (provider: intrinio)
|
| 765 |
+
revisions_1w_change_percent : Optional[float]
|
| 766 |
+
The analyst revisions percent change in estimate for the period of 1 week. (provider: intrinio)
|
| 767 |
+
revisions_1m_up : Optional[int]
|
| 768 |
+
Number of revisions up in the last month. (provider: intrinio)
|
| 769 |
+
revisions_1m_down : Optional[int]
|
| 770 |
+
Number of revisions down in the last month. (provider: intrinio)
|
| 771 |
+
revisions_1m_change_percent : Optional[float]
|
| 772 |
+
The analyst revisions percent change in estimate for the period of 1 month. (provider: intrinio)
|
| 773 |
+
revisions_3m_up : Optional[int]
|
| 774 |
+
Number of revisions up in the last 3 months. (provider: intrinio)
|
| 775 |
+
revisions_3m_down : Optional[int]
|
| 776 |
+
Number of revisions down in the last 3 months. (provider: intrinio)
|
| 777 |
+
revisions_3m_change_percent : Optional[float]
|
| 778 |
+
The analyst revisions percent change in estimate for the period of 3 months. (provider: intrinio)
|
| 779 |
+
|
| 780 |
+
Examples
|
| 781 |
+
--------
|
| 782 |
+
>>> from openbb import obb
|
| 783 |
+
>>> obb.equity.estimates.forward_sales(symbol='AAPL', provider='intrinio')
|
| 784 |
+
>>> obb.equity.estimates.forward_sales(fiscal_year=2025, fiscal_period='fy', provider='intrinio')
|
| 785 |
+
""" # noqa: E501
|
| 786 |
+
|
| 787 |
+
return self._run(
|
| 788 |
+
"/equity/estimates/forward_sales",
|
| 789 |
+
**filter_inputs(
|
| 790 |
+
provider_choices={
|
| 791 |
+
"provider": self._get_provider(
|
| 792 |
+
provider,
|
| 793 |
+
"equity.estimates.forward_sales",
|
| 794 |
+
("intrinio",),
|
| 795 |
+
)
|
| 796 |
+
},
|
| 797 |
+
standard_params={
|
| 798 |
+
"symbol": symbol,
|
| 799 |
+
},
|
| 800 |
+
extra_params=kwargs,
|
| 801 |
+
info={
|
| 802 |
+
"symbol": {
|
| 803 |
+
"intrinio": {"multiple_items_allowed": True, "choices": None}
|
| 804 |
+
}
|
| 805 |
+
},
|
| 806 |
+
)
|
| 807 |
+
)
|
| 808 |
+
|
| 809 |
+
@exception_handler
|
| 810 |
+
@validate
|
| 811 |
+
def historical(
|
| 812 |
+
self,
|
| 813 |
+
symbol: Annotated[
|
| 814 |
+
Union[str, list[str]],
|
| 815 |
+
OpenBBField(
|
| 816 |
+
description="Symbol to get data for. Multiple comma separated items allowed for provider(s): fmp."
|
| 817 |
+
),
|
| 818 |
+
],
|
| 819 |
+
provider: Annotated[
|
| 820 |
+
Optional[Literal["fmp"]],
|
| 821 |
+
OpenBBField(
|
| 822 |
+
description="The provider to use, by default None. If None, the priority list configured in the settings is used. Default priority: fmp."
|
| 823 |
+
),
|
| 824 |
+
] = None,
|
| 825 |
+
**kwargs
|
| 826 |
+
) -> OBBject:
|
| 827 |
+
"""Get historical analyst estimates for earnings and revenue.
|
| 828 |
+
|
| 829 |
+
Parameters
|
| 830 |
+
----------
|
| 831 |
+
provider : str
|
| 832 |
+
The provider to use, by default None. If None, the priority list configured in the settings is used. Default priority: fmp.
|
| 833 |
+
symbol : Union[str, list[str]]
|
| 834 |
+
Symbol to get data for. Multiple comma separated items allowed for provider(s): fmp.
|
| 835 |
+
period : Literal['quarter', 'annual']
|
| 836 |
+
Time period of the data to return. (provider: fmp)
|
| 837 |
+
limit : Optional[int]
|
| 838 |
+
The number of data entries to return. (provider: fmp)
|
| 839 |
+
|
| 840 |
+
Returns
|
| 841 |
+
-------
|
| 842 |
+
OBBject
|
| 843 |
+
results : list[AnalystEstimates]
|
| 844 |
+
Serializable results.
|
| 845 |
+
provider : Optional[str]
|
| 846 |
+
Provider name.
|
| 847 |
+
warnings : Optional[list[Warning_]]
|
| 848 |
+
list of warnings.
|
| 849 |
+
chart : Optional[Chart]
|
| 850 |
+
Chart object.
|
| 851 |
+
extra : Dict[str, Any]
|
| 852 |
+
Extra info.
|
| 853 |
+
|
| 854 |
+
AnalystEstimates
|
| 855 |
+
----------------
|
| 856 |
+
symbol : str
|
| 857 |
+
Symbol representing the entity requested in the data.
|
| 858 |
+
date : date
|
| 859 |
+
The date of the data.
|
| 860 |
+
estimated_revenue_low : Optional[int]
|
| 861 |
+
Estimated revenue low.
|
| 862 |
+
estimated_revenue_high : Optional[int]
|
| 863 |
+
Estimated revenue high.
|
| 864 |
+
estimated_revenue_avg : Optional[int]
|
| 865 |
+
Estimated revenue average.
|
| 866 |
+
estimated_sga_expense_low : Optional[int]
|
| 867 |
+
Estimated SGA expense low.
|
| 868 |
+
estimated_sga_expense_high : Optional[int]
|
| 869 |
+
Estimated SGA expense high.
|
| 870 |
+
estimated_sga_expense_avg : Optional[int]
|
| 871 |
+
Estimated SGA expense average.
|
| 872 |
+
estimated_ebitda_low : Optional[int]
|
| 873 |
+
Estimated EBITDA low.
|
| 874 |
+
estimated_ebitda_high : Optional[int]
|
| 875 |
+
Estimated EBITDA high.
|
| 876 |
+
estimated_ebitda_avg : Optional[int]
|
| 877 |
+
Estimated EBITDA average.
|
| 878 |
+
estimated_ebit_low : Optional[int]
|
| 879 |
+
Estimated EBIT low.
|
| 880 |
+
estimated_ebit_high : Optional[int]
|
| 881 |
+
Estimated EBIT high.
|
| 882 |
+
estimated_ebit_avg : Optional[int]
|
| 883 |
+
Estimated EBIT average.
|
| 884 |
+
estimated_net_income_low : Optional[int]
|
| 885 |
+
Estimated net income low.
|
| 886 |
+
estimated_net_income_high : Optional[int]
|
| 887 |
+
Estimated net income high.
|
| 888 |
+
estimated_net_income_avg : Optional[int]
|
| 889 |
+
Estimated net income average.
|
| 890 |
+
estimated_eps_avg : Optional[float]
|
| 891 |
+
Estimated EPS average.
|
| 892 |
+
estimated_eps_high : Optional[float]
|
| 893 |
+
Estimated EPS high.
|
| 894 |
+
estimated_eps_low : Optional[float]
|
| 895 |
+
Estimated EPS low.
|
| 896 |
+
number_analyst_estimated_revenue : Optional[int]
|
| 897 |
+
Number of analysts who estimated revenue.
|
| 898 |
+
number_analysts_estimated_eps : Optional[int]
|
| 899 |
+
Number of analysts who estimated EPS.
|
| 900 |
+
|
| 901 |
+
Examples
|
| 902 |
+
--------
|
| 903 |
+
>>> from openbb import obb
|
| 904 |
+
>>> obb.equity.estimates.historical(symbol='AAPL', provider='fmp')
|
| 905 |
+
""" # noqa: E501
|
| 906 |
+
|
| 907 |
+
return self._run(
|
| 908 |
+
"/equity/estimates/historical",
|
| 909 |
+
**filter_inputs(
|
| 910 |
+
provider_choices={
|
| 911 |
+
"provider": self._get_provider(
|
| 912 |
+
provider,
|
| 913 |
+
"equity.estimates.historical",
|
| 914 |
+
("fmp",),
|
| 915 |
+
)
|
| 916 |
+
},
|
| 917 |
+
standard_params={
|
| 918 |
+
"symbol": symbol,
|
| 919 |
+
},
|
| 920 |
+
extra_params=kwargs,
|
| 921 |
+
info={
|
| 922 |
+
"symbol": {"fmp": {"multiple_items_allowed": True, "choices": None}}
|
| 923 |
+
},
|
| 924 |
+
)
|
| 925 |
+
)
|
| 926 |
+
|
| 927 |
+
@exception_handler
|
| 928 |
+
@validate
|
| 929 |
+
def price_target(
|
| 930 |
+
self,
|
| 931 |
+
symbol: Annotated[
|
| 932 |
+
Union[str, None, list[Optional[str]]],
|
| 933 |
+
OpenBBField(
|
| 934 |
+
description="Symbol to get data for. Multiple comma separated items allowed for provider(s): benzinga, fmp."
|
| 935 |
+
),
|
| 936 |
+
] = None,
|
| 937 |
+
limit: Annotated[
|
| 938 |
+
int, OpenBBField(description="The number of data entries to return.")
|
| 939 |
+
] = 200,
|
| 940 |
+
provider: Annotated[
|
| 941 |
+
Optional[Literal["benzinga", "fmp"]],
|
| 942 |
+
OpenBBField(
|
| 943 |
+
description="The provider to use, by default None. If None, the priority list configured in the settings is used. Default priority: benzinga, fmp."
|
| 944 |
+
),
|
| 945 |
+
] = None,
|
| 946 |
+
**kwargs
|
| 947 |
+
) -> OBBject:
|
| 948 |
+
"""Get analyst price targets by company.
|
| 949 |
+
|
| 950 |
+
Parameters
|
| 951 |
+
----------
|
| 952 |
+
provider : str
|
| 953 |
+
The provider to use, by default None. If None, the priority list configured in the settings is used. Default priority: benzinga, fmp.
|
| 954 |
+
symbol : Union[str, None, list[Optional[str]]]
|
| 955 |
+
Symbol to get data for. Multiple comma separated items allowed for provider(s): benzinga, fmp.
|
| 956 |
+
limit : int
|
| 957 |
+
The number of data entries to return.
|
| 958 |
+
page : Optional[int]
|
| 959 |
+
Page offset. For optimization, performance and technical reasons, page offsets are limited from 0 - 100000. Limit the query results by other parameters such as date. Used in conjunction with the limit and date parameters. (provider: benzinga)
|
| 960 |
+
date : Optional[date]
|
| 961 |
+
Date for calendar data, shorthand for date_from and date_to. (provider: benzinga)
|
| 962 |
+
start_date : Optional[date]
|
| 963 |
+
Start date of the data, in YYYY-MM-DD format. (provider: benzinga)
|
| 964 |
+
end_date : Optional[date]
|
| 965 |
+
End date of the data, in YYYY-MM-DD format. (provider: benzinga)
|
| 966 |
+
updated : Union[date, int, None]
|
| 967 |
+
Records last Updated Unix timestamp (UTC). This will force the sort order to be Greater Than or Equal to the timestamp indicated. The date can be a date string or a Unix timestamp. The date string must be in the format of YYYY-MM-DD. (provider: benzinga)
|
| 968 |
+
importance : Optional[int]
|
| 969 |
+
Importance level to filter by. Uses Greater Than or Equal To the importance indicated (provider: benzinga)
|
| 970 |
+
action : Optional[Literal['downgrades', 'maintains', 'reinstates', 'reiterates', 'upgrades', 'assumes', 'initiates', 'terminates', 'removes', 'suspends', 'firm_dissolved']]
|
| 971 |
+
Filter by a specific action_company. (provider: benzinga)
|
| 972 |
+
analyst_ids : Union[str, list[str], None]
|
| 973 |
+
Comma-separated list of analyst (person) IDs. Omitting will bring back all available analysts. Multiple comma separated items allowed. (provider: benzinga)
|
| 974 |
+
firm_ids : Union[str, list[str], None]
|
| 975 |
+
Comma-separated list of firm IDs. Multiple comma separated items allowed. (provider: benzinga)
|
| 976 |
+
fields : Union[str, list[str], None]
|
| 977 |
+
Comma-separated list of fields to include in the response. See https://docs.benzinga.io/benzinga-apis/calendar/get-ratings to learn about the available fields. Multiple comma separated items allowed. (provider: benzinga)
|
| 978 |
+
with_grade : bool
|
| 979 |
+
Include upgrades and downgrades in the response. (provider: fmp)
|
| 980 |
+
|
| 981 |
+
Returns
|
| 982 |
+
-------
|
| 983 |
+
OBBject
|
| 984 |
+
results : list[PriceTarget]
|
| 985 |
+
Serializable results.
|
| 986 |
+
provider : Optional[str]
|
| 987 |
+
Provider name.
|
| 988 |
+
warnings : Optional[list[Warning_]]
|
| 989 |
+
list of warnings.
|
| 990 |
+
chart : Optional[Chart]
|
| 991 |
+
Chart object.
|
| 992 |
+
extra : Dict[str, Any]
|
| 993 |
+
Extra info.
|
| 994 |
+
|
| 995 |
+
PriceTarget
|
| 996 |
+
-----------
|
| 997 |
+
published_date : Union[date, datetime]
|
| 998 |
+
Published date of the price target.
|
| 999 |
+
published_time : Optional[datetime.time]
|
| 1000 |
+
Time of the original rating, UTC.
|
| 1001 |
+
symbol : str
|
| 1002 |
+
Symbol representing the entity requested in the data.
|
| 1003 |
+
exchange : Optional[str]
|
| 1004 |
+
Exchange where the company is traded.
|
| 1005 |
+
company_name : Optional[str]
|
| 1006 |
+
Name of company that is the subject of rating.
|
| 1007 |
+
analyst_name : Optional[str]
|
| 1008 |
+
Analyst name.
|
| 1009 |
+
analyst_firm : Optional[str]
|
| 1010 |
+
Name of the analyst firm that published the price target.
|
| 1011 |
+
currency : Optional[str]
|
| 1012 |
+
Currency the data is denominated in.
|
| 1013 |
+
price_target : Optional[float]
|
| 1014 |
+
The current price target.
|
| 1015 |
+
adj_price_target : Optional[float]
|
| 1016 |
+
Adjusted price target for splits and stock dividends.
|
| 1017 |
+
price_target_previous : Optional[float]
|
| 1018 |
+
Previous price target.
|
| 1019 |
+
previous_adj_price_target : Optional[float]
|
| 1020 |
+
Previous adjusted price target.
|
| 1021 |
+
price_when_posted : Optional[float]
|
| 1022 |
+
Price when posted.
|
| 1023 |
+
rating_current : Optional[str]
|
| 1024 |
+
The analyst's rating for the company.
|
| 1025 |
+
rating_previous : Optional[str]
|
| 1026 |
+
Previous analyst rating for the company.
|
| 1027 |
+
action : Optional[str]
|
| 1028 |
+
Description of the change in rating from firm's last rating.
|
| 1029 |
+
action_change : Optional[Literal['Announces', 'Maintains', 'Lowers', 'Raises', 'Removes', 'Adjusts']]
|
| 1030 |
+
Description of the change in price target from firm's last price target. (provider: benzinga)
|
| 1031 |
+
importance : Optional[Literal[0, 1, 2, 3, 4, 5]]
|
| 1032 |
+
Subjective Basis of How Important Event is to Market. 5 = High (provider: benzinga)
|
| 1033 |
+
notes : Optional[str]
|
| 1034 |
+
Notes of the price target. (provider: benzinga)
|
| 1035 |
+
analyst_id : Optional[str]
|
| 1036 |
+
Id of the analyst. (provider: benzinga)
|
| 1037 |
+
url_news : Optional[str]
|
| 1038 |
+
URL for analyst ratings news articles for this ticker on Benzinga.com. (provider: benzinga)
|
| 1039 |
+
url_analyst : Optional[str]
|
| 1040 |
+
URL for analyst ratings page for this ticker on Benzinga.com. (provider: benzinga)
|
| 1041 |
+
id : Optional[str]
|
| 1042 |
+
Unique ID of this entry. (provider: benzinga)
|
| 1043 |
+
last_updated : Optional[datetime]
|
| 1044 |
+
Last updated timestamp, UTC. (provider: benzinga)
|
| 1045 |
+
news_url : Optional[str]
|
| 1046 |
+
News URL of the price target. (provider: fmp)
|
| 1047 |
+
news_title : Optional[str]
|
| 1048 |
+
News title of the price target. (provider: fmp)
|
| 1049 |
+
news_publisher : Optional[str]
|
| 1050 |
+
News publisher of the price target. (provider: fmp)
|
| 1051 |
+
news_base_url : Optional[str]
|
| 1052 |
+
News base URL of the price target. (provider: fmp)
|
| 1053 |
+
|
| 1054 |
+
Examples
|
| 1055 |
+
--------
|
| 1056 |
+
>>> from openbb import obb
|
| 1057 |
+
>>> obb.equity.estimates.price_target(provider='benzinga')
|
| 1058 |
+
>>> # Get price targets for Microsoft using 'benzinga' as provider.
|
| 1059 |
+
>>> obb.equity.estimates.price_target(start_date='2020-01-01', end_date='2024-02-16', limit=10, symbol='msft', provider='benzinga', action='downgrades')
|
| 1060 |
+
""" # noqa: E501
|
| 1061 |
+
|
| 1062 |
+
return self._run(
|
| 1063 |
+
"/equity/estimates/price_target",
|
| 1064 |
+
**filter_inputs(
|
| 1065 |
+
provider_choices={
|
| 1066 |
+
"provider": self._get_provider(
|
| 1067 |
+
provider,
|
| 1068 |
+
"equity.estimates.price_target",
|
| 1069 |
+
("benzinga", "fmp"),
|
| 1070 |
+
)
|
| 1071 |
+
},
|
| 1072 |
+
standard_params={
|
| 1073 |
+
"symbol": symbol,
|
| 1074 |
+
"limit": limit,
|
| 1075 |
+
},
|
| 1076 |
+
extra_params=kwargs,
|
| 1077 |
+
info={
|
| 1078 |
+
"symbol": {
|
| 1079 |
+
"benzinga": {"multiple_items_allowed": True, "choices": None},
|
| 1080 |
+
"fmp": {"multiple_items_allowed": True, "choices": None},
|
| 1081 |
+
},
|
| 1082 |
+
"action": {
|
| 1083 |
+
"benzinga": {
|
| 1084 |
+
"multiple_items_allowed": False,
|
| 1085 |
+
"choices": [
|
| 1086 |
+
"downgrades",
|
| 1087 |
+
"maintains",
|
| 1088 |
+
"reinstates",
|
| 1089 |
+
"reiterates",
|
| 1090 |
+
"upgrades",
|
| 1091 |
+
"assumes",
|
| 1092 |
+
"initiates",
|
| 1093 |
+
"terminates",
|
| 1094 |
+
"removes",
|
| 1095 |
+
"suspends",
|
| 1096 |
+
"firm_dissolved",
|
| 1097 |
+
],
|
| 1098 |
+
}
|
| 1099 |
+
},
|
| 1100 |
+
"analyst_ids": {
|
| 1101 |
+
"benzinga": {"multiple_items_allowed": True, "choices": None}
|
| 1102 |
+
},
|
| 1103 |
+
"firm_ids": {
|
| 1104 |
+
"benzinga": {"multiple_items_allowed": True, "choices": None}
|
| 1105 |
+
},
|
| 1106 |
+
"fields": {
|
| 1107 |
+
"benzinga": {"multiple_items_allowed": True, "choices": None}
|
| 1108 |
+
},
|
| 1109 |
+
},
|
| 1110 |
+
)
|
| 1111 |
+
)
|
openbb_platform/openbb/package/equity_fundamental.py
ADDED
|
The diff for this file is too large to render.
See raw diff
|
|
|
openbb_platform/openbb/package/equity_ownership.py
ADDED
|
@@ -0,0 +1,854 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|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etime
|
| 4 |
+
from typing import Literal, Optional, Union
|
| 5 |
+
|
| 6 |
+
from annotated_types import Ge
|
| 7 |
+
from openbb_core.app.model.field import OpenBBField
|
| 8 |
+
from openbb_core.app.model.obbject import OBBject
|
| 9 |
+
from openbb_core.app.static.container import Container
|
| 10 |
+
from openbb_core.app.static.utils.decorators import exception_handler, validate
|
| 11 |
+
from openbb_core.app.static.utils.filters import filter_inputs
|
| 12 |
+
from typing_extensions import Annotated
|
| 13 |
+
|
| 14 |
+
|
| 15 |
+
class ROUTER_equity_ownership(Container):
|
| 16 |
+
"""/equity/ownership
|
| 17 |
+
form_13f
|
| 18 |
+
government_trades
|
| 19 |
+
insider_trading
|
| 20 |
+
institutional
|
| 21 |
+
major_holders
|
| 22 |
+
share_statistics
|
| 23 |
+
"""
|
| 24 |
+
|
| 25 |
+
def __repr__(self) -> str:
|
| 26 |
+
return self.__doc__ or ""
|
| 27 |
+
|
| 28 |
+
@exception_handler
|
| 29 |
+
@validate
|
| 30 |
+
def form_13f(
|
| 31 |
+
self,
|
| 32 |
+
symbol: Annotated[
|
| 33 |
+
str,
|
| 34 |
+
OpenBBField(
|
| 35 |
+
description="Symbol to get data for. A CIK or Symbol can be used."
|
| 36 |
+
),
|
| 37 |
+
],
|
| 38 |
+
date: Annotated[
|
| 39 |
+
Union[datetime.date, None, str],
|
| 40 |
+
OpenBBField(
|
| 41 |
+
description="A specific date to get data for. The date represents the end of the reporting period. All form 13F-HR filings are based on the calendar year and are reported quarterly. If a date is not supplied, the most recent filing is returned. Submissions beginning 2013-06-30 are supported."
|
| 42 |
+
),
|
| 43 |
+
] = None,
|
| 44 |
+
limit: Annotated[
|
| 45 |
+
Optional[int],
|
| 46 |
+
OpenBBField(
|
| 47 |
+
description="The number of data entries to return. The number of previous filings to return. The date parameter takes priority over this parameter."
|
| 48 |
+
),
|
| 49 |
+
] = 1,
|
| 50 |
+
provider: Annotated[
|
| 51 |
+
Optional[Literal["sec"]],
|
| 52 |
+
OpenBBField(
|
| 53 |
+
description="The provider to use, by default None. If None, the priority list configured in the settings is used. Default priority: sec."
|
| 54 |
+
),
|
| 55 |
+
] = None,
|
| 56 |
+
**kwargs
|
| 57 |
+
) -> OBBject:
|
| 58 |
+
"""Get the form 13F.
|
| 59 |
+
|
| 60 |
+
The Securities and Exchange Commission's (SEC) Form 13F is a quarterly report
|
| 61 |
+
that is required to be filed by all institutional investment managers with at least
|
| 62 |
+
$100 million in assets under management.
|
| 63 |
+
Managers are required to file Form 13F within 45 days after the last day of the calendar quarter.
|
| 64 |
+
Most funds wait until the end of this period in order to conceal
|
| 65 |
+
their investment strategy from competitors and the public.
|
| 66 |
+
|
| 67 |
+
|
| 68 |
+
Parameters
|
| 69 |
+
----------
|
| 70 |
+
provider : str
|
| 71 |
+
The provider to use, by default None. If None, the priority list configured in the settings is used. Default priority: sec.
|
| 72 |
+
symbol : str
|
| 73 |
+
Symbol to get data for. A CIK or Symbol can be used.
|
| 74 |
+
date : Union[date, None, str]
|
| 75 |
+
A specific date to get data for. The date represents the end of the reporting period. All form 13F-HR filings are based on the calendar year and are reported quarterly. If a date is not supplied, the most recent filing is returned. Submissions beginning 2013-06-30 are supported.
|
| 76 |
+
limit : Optional[int]
|
| 77 |
+
The number of data entries to return. The number of previous filings to return. The date parameter takes priority over this parameter.
|
| 78 |
+
|
| 79 |
+
Returns
|
| 80 |
+
-------
|
| 81 |
+
OBBject
|
| 82 |
+
results : list[Form13FHR]
|
| 83 |
+
Serializable results.
|
| 84 |
+
provider : Optional[str]
|
| 85 |
+
Provider name.
|
| 86 |
+
warnings : Optional[list[Warning_]]
|
| 87 |
+
list of warnings.
|
| 88 |
+
chart : Optional[Chart]
|
| 89 |
+
Chart object.
|
| 90 |
+
extra : Dict[str, Any]
|
| 91 |
+
Extra info.
|
| 92 |
+
|
| 93 |
+
Form13FHR
|
| 94 |
+
---------
|
| 95 |
+
period_ending : date
|
| 96 |
+
The end-of-quarter date of the filing.
|
| 97 |
+
issuer : str
|
| 98 |
+
The name of the issuer.
|
| 99 |
+
cusip : str
|
| 100 |
+
The CUSIP of the security.
|
| 101 |
+
asset_class : str
|
| 102 |
+
The title of the asset class for the security.
|
| 103 |
+
security_type : Optional[Literal['SH', 'PRN']]
|
| 104 |
+
Whether the principal amount represents the number of shares or the principal amount of such class. 'SH' for shares. 'PRN' for principal amount. Convertible debt securities are reported as 'PRN'.
|
| 105 |
+
option_type : Optional[Literal['call', 'put']]
|
| 106 |
+
Defined when the holdings being reported are put or call options. Only long positions are reported.
|
| 107 |
+
investment_discretion : Optional[str]
|
| 108 |
+
The investment discretion held by the Manager. Sole, shared-defined (DFN), or shared-other (OTR).
|
| 109 |
+
voting_authority_sole : Optional[int]
|
| 110 |
+
The number of shares for which the Manager exercises sole voting authority.
|
| 111 |
+
voting_authority_shared : Optional[int]
|
| 112 |
+
The number of shares for which the Manager exercises a defined shared voting authority.
|
| 113 |
+
voting_authority_none : Optional[int]
|
| 114 |
+
The number of shares for which the Manager exercises no voting authority.
|
| 115 |
+
principal_amount : int
|
| 116 |
+
The total number of shares of the class of security or the principal amount of such class. Defined by the 'security_type'. Only long positions are reported
|
| 117 |
+
value : int
|
| 118 |
+
The fair market value of the holding of the particular class of security. The value reported for options is the fair market value of the underlying security with respect to the number of shares controlled. Values are rounded to the nearest US dollar and use the closing price of the last trading day of the calendar year or quarter.
|
| 119 |
+
weight : Optional[float]
|
| 120 |
+
The weight of the security relative to the market value of all securities in the filing , as a normalized percent. (provider: sec)
|
| 121 |
+
|
| 122 |
+
Examples
|
| 123 |
+
--------
|
| 124 |
+
>>> from openbb import obb
|
| 125 |
+
>>> obb.equity.ownership.form_13f(symbol='NVDA', provider='sec')
|
| 126 |
+
>>> # Enter a date (calendar quarter ending) for a specific report.
|
| 127 |
+
>>> obb.equity.ownership.form_13f(symbol='BRK-A', date='2016-09-30', provider='sec')
|
| 128 |
+
>>> # Example finding Michael Burry's filings.
|
| 129 |
+
>>> cik = obb.regulators.sec.institutions_search("Scion Asset Management").results[0].cik
|
| 130 |
+
>>> # Use the `limit` parameter to return N number of reports from the most recent.
|
| 131 |
+
>>> obb.equity.ownership.form_13f(cik, limit=2).to_df()
|
| 132 |
+
""" # noqa: E501
|
| 133 |
+
|
| 134 |
+
return self._run(
|
| 135 |
+
"/equity/ownership/form_13f",
|
| 136 |
+
**filter_inputs(
|
| 137 |
+
provider_choices={
|
| 138 |
+
"provider": self._get_provider(
|
| 139 |
+
provider,
|
| 140 |
+
"equity.ownership.form_13f",
|
| 141 |
+
("sec",),
|
| 142 |
+
)
|
| 143 |
+
},
|
| 144 |
+
standard_params={
|
| 145 |
+
"symbol": symbol,
|
| 146 |
+
"date": date,
|
| 147 |
+
"limit": limit,
|
| 148 |
+
},
|
| 149 |
+
extra_params=kwargs,
|
| 150 |
+
)
|
| 151 |
+
)
|
| 152 |
+
|
| 153 |
+
@exception_handler
|
| 154 |
+
@validate
|
| 155 |
+
def government_trades(
|
| 156 |
+
self,
|
| 157 |
+
symbol: Annotated[
|
| 158 |
+
Union[str, None, list[Optional[str]]],
|
| 159 |
+
OpenBBField(
|
| 160 |
+
description="Symbol to get data for. Multiple comma separated items allowed for provider(s): fmp."
|
| 161 |
+
),
|
| 162 |
+
] = None,
|
| 163 |
+
chamber: Annotated[
|
| 164 |
+
Literal["house", "senate", "all"],
|
| 165 |
+
OpenBBField(description="Government Chamber."),
|
| 166 |
+
] = "all",
|
| 167 |
+
limit: Annotated[
|
| 168 |
+
Optional[Annotated[int, Ge(ge=0)]],
|
| 169 |
+
OpenBBField(description="The number of data entries to return."),
|
| 170 |
+
] = 100,
|
| 171 |
+
provider: Annotated[
|
| 172 |
+
Optional[Literal["fmp"]],
|
| 173 |
+
OpenBBField(
|
| 174 |
+
description="The provider to use, by default None. If None, the priority list configured in the settings is used. Default priority: fmp."
|
| 175 |
+
),
|
| 176 |
+
] = None,
|
| 177 |
+
**kwargs
|
| 178 |
+
) -> OBBject:
|
| 179 |
+
"""Obtain government transaction data, including data from the Senate
|
| 180 |
+
and the House of Representatives.
|
| 181 |
+
|
| 182 |
+
|
| 183 |
+
Parameters
|
| 184 |
+
----------
|
| 185 |
+
provider : str
|
| 186 |
+
The provider to use, by default None. If None, the priority list configured in the settings is used. Default priority: fmp.
|
| 187 |
+
symbol : Union[str, None, list[Optional[str]]]
|
| 188 |
+
Symbol to get data for. Multiple comma separated items allowed for provider(s): fmp.
|
| 189 |
+
chamber : Literal['house', 'senate', 'all']
|
| 190 |
+
Government Chamber.
|
| 191 |
+
limit : Optional[Annotated[int, Ge(ge=0)]]
|
| 192 |
+
The number of data entries to return.
|
| 193 |
+
|
| 194 |
+
Returns
|
| 195 |
+
-------
|
| 196 |
+
OBBject
|
| 197 |
+
results : list[GovernmentTrades]
|
| 198 |
+
Serializable results.
|
| 199 |
+
provider : Optional[str]
|
| 200 |
+
Provider name.
|
| 201 |
+
warnings : Optional[list[Warning_]]
|
| 202 |
+
list of warnings.
|
| 203 |
+
chart : Optional[Chart]
|
| 204 |
+
Chart object.
|
| 205 |
+
extra : Dict[str, Any]
|
| 206 |
+
Extra info.
|
| 207 |
+
|
| 208 |
+
GovernmentTrades
|
| 209 |
+
----------------
|
| 210 |
+
symbol : Optional[str]
|
| 211 |
+
Symbol representing the entity requested in the data.
|
| 212 |
+
date : date
|
| 213 |
+
The date of the data.
|
| 214 |
+
transaction_date : Optional[date]
|
| 215 |
+
Date of Transaction.
|
| 216 |
+
representative : Optional[str]
|
| 217 |
+
Name of Representative.
|
| 218 |
+
chamber : Optional[Literal['house', 'senate']]
|
| 219 |
+
Government Chamber - House or Senate. (provider: fmp)
|
| 220 |
+
owner : Optional[str]
|
| 221 |
+
Ownership status (e.g., Spouse, Joint). (provider: fmp)
|
| 222 |
+
asset_type : Optional[str]
|
| 223 |
+
Type of asset involved in the transaction. (provider: fmp)
|
| 224 |
+
asset_description : Optional[str]
|
| 225 |
+
Description of the asset. (provider: fmp)
|
| 226 |
+
transaction_type : Optional[str]
|
| 227 |
+
Type of transaction (e.g., Sale, Purchase). (provider: fmp)
|
| 228 |
+
amount : Optional[str]
|
| 229 |
+
Transaction amount range. (provider: fmp)
|
| 230 |
+
comment : Optional[str]
|
| 231 |
+
Additional comments on the transaction. (provider: fmp)
|
| 232 |
+
url : Optional[str]
|
| 233 |
+
Link to the transaction document. (provider: fmp)
|
| 234 |
+
|
| 235 |
+
Examples
|
| 236 |
+
--------
|
| 237 |
+
>>> from openbb import obb
|
| 238 |
+
>>> obb.equity.ownership.government_trades(symbol='AAPL', chamber='all', provider='fmp')
|
| 239 |
+
>>> obb.equity.ownership.government_trades(limit=500, chamber='all', provider='fmp')
|
| 240 |
+
""" # noqa: E501
|
| 241 |
+
|
| 242 |
+
return self._run(
|
| 243 |
+
"/equity/ownership/government_trades",
|
| 244 |
+
**filter_inputs(
|
| 245 |
+
provider_choices={
|
| 246 |
+
"provider": self._get_provider(
|
| 247 |
+
provider,
|
| 248 |
+
"equity.ownership.government_trades",
|
| 249 |
+
("fmp",),
|
| 250 |
+
)
|
| 251 |
+
},
|
| 252 |
+
standard_params={
|
| 253 |
+
"symbol": symbol,
|
| 254 |
+
"chamber": chamber,
|
| 255 |
+
"limit": limit,
|
| 256 |
+
},
|
| 257 |
+
extra_params=kwargs,
|
| 258 |
+
info={
|
| 259 |
+
"symbol": {"fmp": {"multiple_items_allowed": True, "choices": None}}
|
| 260 |
+
},
|
| 261 |
+
)
|
| 262 |
+
)
|
| 263 |
+
|
| 264 |
+
@exception_handler
|
| 265 |
+
@validate
|
| 266 |
+
def insider_trading(
|
| 267 |
+
self,
|
| 268 |
+
symbol: Annotated[str, OpenBBField(description="Symbol to get data for.")],
|
| 269 |
+
limit: Annotated[
|
| 270 |
+
int, OpenBBField(description="The number of data entries to return.")
|
| 271 |
+
] = 500,
|
| 272 |
+
provider: Annotated[
|
| 273 |
+
Optional[Literal["fmp", "intrinio", "sec"]],
|
| 274 |
+
OpenBBField(
|
| 275 |
+
description="The provider to use, by default None. If None, the priority list configured in the settings is used. Default priority: fmp, intrinio, sec."
|
| 276 |
+
),
|
| 277 |
+
] = None,
|
| 278 |
+
**kwargs
|
| 279 |
+
) -> OBBject:
|
| 280 |
+
"""Get data about trading by a company's management team and board of directors.
|
| 281 |
+
|
| 282 |
+
Parameters
|
| 283 |
+
----------
|
| 284 |
+
provider : str
|
| 285 |
+
The provider to use, by default None. If None, the priority list configured in the settings is used. Default priority: fmp, intrinio, sec.
|
| 286 |
+
symbol : str
|
| 287 |
+
Symbol to get data for.
|
| 288 |
+
limit : int
|
| 289 |
+
The number of data entries to return.
|
| 290 |
+
transaction_type : Optional[Literal['award', 'conversion', 'return', 'expire_short', 'in_kind', 'gift', 'expire_long', 'discretionary', 'other', 'small', 'exempt', 'otm', 'purchase', 'sale', 'tender', 'will', 'itm', 'trust']]
|
| 291 |
+
Type of the transaction. (provider: fmp)
|
| 292 |
+
start_date : Optional[date]
|
| 293 |
+
Start date of the data, in YYYY-MM-DD format. (provider: intrinio)
|
| 294 |
+
end_date : Optional[date]
|
| 295 |
+
End date of the data, in YYYY-MM-DD format. (provider: intrinio, sec)
|
| 296 |
+
ownership_type : Optional[Literal['D', 'I']]
|
| 297 |
+
Type of ownership. (provider: intrinio)
|
| 298 |
+
sort_by : Optional[Literal['filing_date', 'updated_on']]
|
| 299 |
+
Field to sort by. (provider: intrinio)
|
| 300 |
+
use_cache : bool
|
| 301 |
+
Persist the data locally for future use. Default is True. Each form submission is an individual download and the SEC limits the number of concurrent downloads. This prevents the same file from being downloaded multiple times. (provider: sec)
|
| 302 |
+
|
| 303 |
+
Returns
|
| 304 |
+
-------
|
| 305 |
+
OBBject
|
| 306 |
+
results : list[InsiderTrading]
|
| 307 |
+
Serializable results.
|
| 308 |
+
provider : Optional[str]
|
| 309 |
+
Provider name.
|
| 310 |
+
warnings : Optional[list[Warning_]]
|
| 311 |
+
list of warnings.
|
| 312 |
+
chart : Optional[Chart]
|
| 313 |
+
Chart object.
|
| 314 |
+
extra : Dict[str, Any]
|
| 315 |
+
Extra info.
|
| 316 |
+
|
| 317 |
+
InsiderTrading
|
| 318 |
+
--------------
|
| 319 |
+
symbol : Optional[str]
|
| 320 |
+
Symbol representing the entity requested in the data.
|
| 321 |
+
company_cik : Optional[Union[int, str]]
|
| 322 |
+
CIK number of the company.
|
| 323 |
+
filing_date : Optional[Union[date, datetime]]
|
| 324 |
+
Filing date of the trade.
|
| 325 |
+
transaction_date : Optional[date]
|
| 326 |
+
Date of the transaction.
|
| 327 |
+
owner_cik : Optional[Union[int, str]]
|
| 328 |
+
Reporting individual's CIK.
|
| 329 |
+
owner_name : Optional[str]
|
| 330 |
+
Name of the reporting individual.
|
| 331 |
+
owner_title : Optional[str]
|
| 332 |
+
The title held by the reporting individual.
|
| 333 |
+
transaction_type : Optional[str]
|
| 334 |
+
Type of transaction being reported.
|
| 335 |
+
acquisition_or_disposition : Optional[str]
|
| 336 |
+
Acquisition or disposition of the shares.
|
| 337 |
+
security_type : Optional[str]
|
| 338 |
+
The type of security transacted.
|
| 339 |
+
securities_owned : Optional[float]
|
| 340 |
+
Number of securities owned by the reporting individual.
|
| 341 |
+
securities_transacted : Optional[float]
|
| 342 |
+
Number of securities transacted by the reporting individual.
|
| 343 |
+
transaction_price : Optional[float]
|
| 344 |
+
The price of the transaction.
|
| 345 |
+
filing_url : Optional[str]
|
| 346 |
+
Link to the filing.
|
| 347 |
+
form_type : Optional[str]
|
| 348 |
+
Form type of the insider trading. (provider: fmp)
|
| 349 |
+
company_name : Optional[str]
|
| 350 |
+
Name of the company. (provider: intrinio, sec)
|
| 351 |
+
conversion_exercise_price : Optional[float]
|
| 352 |
+
Conversion/Exercise price of the shares. (provider: intrinio);
|
| 353 |
+
Price of conversion or exercise of the securities. (provider: sec)
|
| 354 |
+
deemed_execution_date : Optional[date]
|
| 355 |
+
Deemed execution date of the trade. (provider: intrinio);
|
| 356 |
+
Deemed execution date. (provider: sec)
|
| 357 |
+
exercise_date : Optional[date]
|
| 358 |
+
Exercise date of the trade. (provider: intrinio);
|
| 359 |
+
Date of exercise. (provider: sec)
|
| 360 |
+
expiration_date : Optional[date]
|
| 361 |
+
Expiration date of the derivative. (provider: intrinio);
|
| 362 |
+
Date of expiration for the derivative. (provider: sec)
|
| 363 |
+
underlying_security_title : Optional[str]
|
| 364 |
+
Name of the underlying non-derivative security related to this derivative transaction. (provider: intrinio);
|
| 365 |
+
Title of the underlying security. (provider: sec)
|
| 366 |
+
underlying_shares : Optional[Union[int, float]]
|
| 367 |
+
Number of underlying shares related to this derivative transaction. (provider: intrinio)
|
| 368 |
+
nature_of_ownership : Optional[str]
|
| 369 |
+
Nature of ownership of the insider trading. (provider: intrinio);
|
| 370 |
+
Nature of the ownership. (provider: sec)
|
| 371 |
+
director : Optional[bool]
|
| 372 |
+
Whether the owner is a director. (provider: intrinio, sec)
|
| 373 |
+
officer : Optional[bool]
|
| 374 |
+
Whether the owner is an officer. (provider: intrinio, sec)
|
| 375 |
+
ten_percent_owner : Optional[bool]
|
| 376 |
+
Whether the owner is a 10% owner. (provider: intrinio, sec)
|
| 377 |
+
other_relation : Optional[bool]
|
| 378 |
+
Whether the owner is having another relation. (provider: intrinio)
|
| 379 |
+
derivative_transaction : Optional[bool]
|
| 380 |
+
Whether the owner is having a derivative transaction. (provider: intrinio)
|
| 381 |
+
report_line_number : Optional[int]
|
| 382 |
+
Report line number of the insider trading. (provider: intrinio)
|
| 383 |
+
form : Optional[Union[int, str]]
|
| 384 |
+
Form type. (provider: sec)
|
| 385 |
+
other : Optional[bool]
|
| 386 |
+
Whether the owner is classified as other. (provider: sec)
|
| 387 |
+
other_text : Optional[str]
|
| 388 |
+
Text for other classification. (provider: sec)
|
| 389 |
+
transaction_timeliness : Optional[str]
|
| 390 |
+
Timeliness of the transaction. (provider: sec)
|
| 391 |
+
ownership_type : Optional[str]
|
| 392 |
+
Type of ownership, direct or indirect. (provider: sec)
|
| 393 |
+
underlying_security_shares : Optional[float]
|
| 394 |
+
Number of underlying shares associated with the derivative. (provider: sec)
|
| 395 |
+
underlying_security_value : Optional[float]
|
| 396 |
+
Value of the underlying security. (provider: sec)
|
| 397 |
+
transaction_value : Optional[float]
|
| 398 |
+
Total value of the transaction. (provider: sec)
|
| 399 |
+
value_owned : Optional[float]
|
| 400 |
+
Value of the securities owned after the transaction. (provider: sec)
|
| 401 |
+
footnote : Optional[str]
|
| 402 |
+
Footnote for the transaction. (provider: sec)
|
| 403 |
+
|
| 404 |
+
Examples
|
| 405 |
+
--------
|
| 406 |
+
>>> from openbb import obb
|
| 407 |
+
>>> obb.equity.ownership.insider_trading(symbol='AAPL', provider='fmp')
|
| 408 |
+
>>> obb.equity.ownership.insider_trading(symbol='AAPL', limit=500, provider='intrinio')
|
| 409 |
+
""" # noqa: E501
|
| 410 |
+
|
| 411 |
+
return self._run(
|
| 412 |
+
"/equity/ownership/insider_trading",
|
| 413 |
+
**filter_inputs(
|
| 414 |
+
provider_choices={
|
| 415 |
+
"provider": self._get_provider(
|
| 416 |
+
provider,
|
| 417 |
+
"equity.ownership.insider_trading",
|
| 418 |
+
("fmp", "intrinio", "sec"),
|
| 419 |
+
)
|
| 420 |
+
},
|
| 421 |
+
standard_params={
|
| 422 |
+
"symbol": symbol,
|
| 423 |
+
"limit": limit,
|
| 424 |
+
},
|
| 425 |
+
extra_params=kwargs,
|
| 426 |
+
info={
|
| 427 |
+
"transaction_type": {
|
| 428 |
+
"fmp": {
|
| 429 |
+
"multiple_items_allowed": False,
|
| 430 |
+
"choices": [
|
| 431 |
+
"award",
|
| 432 |
+
"conversion",
|
| 433 |
+
"return",
|
| 434 |
+
"expire_short",
|
| 435 |
+
"in_kind",
|
| 436 |
+
"gift",
|
| 437 |
+
"expire_long",
|
| 438 |
+
"discretionary",
|
| 439 |
+
"other",
|
| 440 |
+
"small",
|
| 441 |
+
"exempt",
|
| 442 |
+
"otm",
|
| 443 |
+
"purchase",
|
| 444 |
+
"sale",
|
| 445 |
+
"tender",
|
| 446 |
+
"will",
|
| 447 |
+
"itm",
|
| 448 |
+
"trust",
|
| 449 |
+
],
|
| 450 |
+
}
|
| 451 |
+
}
|
| 452 |
+
},
|
| 453 |
+
)
|
| 454 |
+
)
|
| 455 |
+
|
| 456 |
+
@exception_handler
|
| 457 |
+
@validate
|
| 458 |
+
def institutional(
|
| 459 |
+
self,
|
| 460 |
+
symbol: Annotated[str, OpenBBField(description="Symbol to get data for.")],
|
| 461 |
+
provider: Annotated[
|
| 462 |
+
Optional[Literal["fmp"]],
|
| 463 |
+
OpenBBField(
|
| 464 |
+
description="The provider to use, by default None. If None, the priority list configured in the settings is used. Default priority: fmp."
|
| 465 |
+
),
|
| 466 |
+
] = None,
|
| 467 |
+
**kwargs
|
| 468 |
+
) -> OBBject:
|
| 469 |
+
"""Get data about institutional ownership for a given company over time.
|
| 470 |
+
|
| 471 |
+
Parameters
|
| 472 |
+
----------
|
| 473 |
+
provider : str
|
| 474 |
+
The provider to use, by default None. If None, the priority list configured in the settings is used. Default priority: fmp.
|
| 475 |
+
symbol : str
|
| 476 |
+
Symbol to get data for.
|
| 477 |
+
include_current_quarter : Optional[bool]
|
| 478 |
+
Include current quarter data. (provider: fmp)
|
| 479 |
+
date : Optional[date]
|
| 480 |
+
A specific date to get data for. (provider: fmp)
|
| 481 |
+
|
| 482 |
+
Returns
|
| 483 |
+
-------
|
| 484 |
+
OBBject
|
| 485 |
+
results : list[InstitutionalOwnership]
|
| 486 |
+
Serializable results.
|
| 487 |
+
provider : Optional[str]
|
| 488 |
+
Provider name.
|
| 489 |
+
warnings : Optional[list[Warning_]]
|
| 490 |
+
list of warnings.
|
| 491 |
+
chart : Optional[Chart]
|
| 492 |
+
Chart object.
|
| 493 |
+
extra : Dict[str, Any]
|
| 494 |
+
Extra info.
|
| 495 |
+
|
| 496 |
+
InstitutionalOwnership
|
| 497 |
+
----------------------
|
| 498 |
+
symbol : str
|
| 499 |
+
Symbol representing the entity requested in the data.
|
| 500 |
+
cik : Optional[str]
|
| 501 |
+
Central Index Key (CIK) for the requested entity.
|
| 502 |
+
date : date
|
| 503 |
+
The date of the data.
|
| 504 |
+
investors_holding : Optional[int]
|
| 505 |
+
Number of investors holding the stock. (provider: fmp)
|
| 506 |
+
last_investors_holding : Optional[int]
|
| 507 |
+
Number of investors holding the stock in the last quarter. (provider: fmp)
|
| 508 |
+
investors_holding_change : Optional[int]
|
| 509 |
+
Change in the number of investors holding the stock. (provider: fmp)
|
| 510 |
+
number_of_13f_shares : Optional[int]
|
| 511 |
+
Number of 13F shares. (provider: fmp)
|
| 512 |
+
last_number_of_13f_shares : Optional[int]
|
| 513 |
+
Number of 13F shares in the last quarter. (provider: fmp)
|
| 514 |
+
number_of_13f_shares_change : Optional[int]
|
| 515 |
+
Change in the number of 13F shares. (provider: fmp)
|
| 516 |
+
total_invested : Optional[float]
|
| 517 |
+
Total amount invested. (provider: fmp)
|
| 518 |
+
last_total_invested : Optional[float]
|
| 519 |
+
Total amount invested in the last quarter. (provider: fmp)
|
| 520 |
+
total_invested_change : Optional[float]
|
| 521 |
+
Change in the total amount invested. (provider: fmp)
|
| 522 |
+
ownership_percent : Optional[float]
|
| 523 |
+
Ownership percent. (provider: fmp)
|
| 524 |
+
last_ownership_percent : Optional[float]
|
| 525 |
+
Ownership percent in the last quarter. (provider: fmp)
|
| 526 |
+
ownership_percent_change : Optional[float]
|
| 527 |
+
Change in the ownership percent. (provider: fmp)
|
| 528 |
+
new_positions : Optional[int]
|
| 529 |
+
Number of new positions. (provider: fmp)
|
| 530 |
+
last_new_positions : Optional[int]
|
| 531 |
+
Number of new positions in the last quarter. (provider: fmp)
|
| 532 |
+
new_positions_change : Optional[int]
|
| 533 |
+
Change in the number of new positions. (provider: fmp)
|
| 534 |
+
increased_positions : Optional[int]
|
| 535 |
+
Number of increased positions. (provider: fmp)
|
| 536 |
+
last_increased_positions : Optional[int]
|
| 537 |
+
Number of increased positions in the last quarter. (provider: fmp)
|
| 538 |
+
increased_positions_change : Optional[int]
|
| 539 |
+
Change in the number of increased positions. (provider: fmp)
|
| 540 |
+
closed_positions : Optional[int]
|
| 541 |
+
Number of closed positions. (provider: fmp)
|
| 542 |
+
last_closed_positions : Optional[int]
|
| 543 |
+
Number of closed positions in the last quarter. (provider: fmp)
|
| 544 |
+
closed_positions_change : Optional[int]
|
| 545 |
+
Change in the number of closed positions. (provider: fmp)
|
| 546 |
+
reduced_positions : Optional[int]
|
| 547 |
+
Number of reduced positions. (provider: fmp)
|
| 548 |
+
last_reduced_positions : Optional[int]
|
| 549 |
+
Number of reduced positions in the last quarter. (provider: fmp)
|
| 550 |
+
reduced_positions_change : Optional[int]
|
| 551 |
+
Change in the number of reduced positions. (provider: fmp)
|
| 552 |
+
total_calls : Optional[int]
|
| 553 |
+
Total number of call options contracts traded for Apple Inc. on the specified date. (provider: fmp)
|
| 554 |
+
last_total_calls : Optional[int]
|
| 555 |
+
Total number of call options contracts traded for Apple Inc. on the previous reporting date. (provider: fmp)
|
| 556 |
+
total_calls_change : Optional[int]
|
| 557 |
+
Change in the total number of call options contracts traded between the current and previous reporting dates. (provider: fmp)
|
| 558 |
+
total_puts : Optional[int]
|
| 559 |
+
Total number of put options contracts traded for Apple Inc. on the specified date. (provider: fmp)
|
| 560 |
+
last_total_puts : Optional[int]
|
| 561 |
+
Total number of put options contracts traded for Apple Inc. on the previous reporting date. (provider: fmp)
|
| 562 |
+
total_puts_change : Optional[int]
|
| 563 |
+
Change in the total number of put options contracts traded between the current and previous reporting dates. (provider: fmp)
|
| 564 |
+
put_call_ratio : Optional[float]
|
| 565 |
+
Put-call ratio, which is the ratio of the total number of put options to call options traded on the specified date. (provider: fmp)
|
| 566 |
+
last_put_call_ratio : Optional[float]
|
| 567 |
+
Put-call ratio on the previous reporting date. (provider: fmp)
|
| 568 |
+
put_call_ratio_change : Optional[float]
|
| 569 |
+
Change in the put-call ratio between the current and previous reporting dates. (provider: fmp)
|
| 570 |
+
|
| 571 |
+
Examples
|
| 572 |
+
--------
|
| 573 |
+
>>> from openbb import obb
|
| 574 |
+
>>> obb.equity.ownership.institutional(symbol='AAPL', provider='fmp')
|
| 575 |
+
""" # noqa: E501
|
| 576 |
+
|
| 577 |
+
return self._run(
|
| 578 |
+
"/equity/ownership/institutional",
|
| 579 |
+
**filter_inputs(
|
| 580 |
+
provider_choices={
|
| 581 |
+
"provider": self._get_provider(
|
| 582 |
+
provider,
|
| 583 |
+
"equity.ownership.institutional",
|
| 584 |
+
("fmp",),
|
| 585 |
+
)
|
| 586 |
+
},
|
| 587 |
+
standard_params={
|
| 588 |
+
"symbol": symbol,
|
| 589 |
+
},
|
| 590 |
+
extra_params=kwargs,
|
| 591 |
+
)
|
| 592 |
+
)
|
| 593 |
+
|
| 594 |
+
@exception_handler
|
| 595 |
+
@validate
|
| 596 |
+
def major_holders(
|
| 597 |
+
self,
|
| 598 |
+
symbol: Annotated[str, OpenBBField(description="Symbol to get data for.")],
|
| 599 |
+
date: Annotated[
|
| 600 |
+
Union[datetime.date, None, str],
|
| 601 |
+
OpenBBField(description="A specific date to get data for."),
|
| 602 |
+
] = None,
|
| 603 |
+
page: Annotated[
|
| 604 |
+
Optional[int], OpenBBField(description="Page number of the data to fetch.")
|
| 605 |
+
] = 0,
|
| 606 |
+
provider: Annotated[
|
| 607 |
+
Optional[Literal["fmp"]],
|
| 608 |
+
OpenBBField(
|
| 609 |
+
description="The provider to use, by default None. If None, the priority list configured in the settings is used. Default priority: fmp."
|
| 610 |
+
),
|
| 611 |
+
] = None,
|
| 612 |
+
**kwargs
|
| 613 |
+
) -> OBBject:
|
| 614 |
+
"""Get data about major holders for a given company over time.
|
| 615 |
+
|
| 616 |
+
Parameters
|
| 617 |
+
----------
|
| 618 |
+
provider : str
|
| 619 |
+
The provider to use, by default None. If None, the priority list configured in the settings is used. Default priority: fmp.
|
| 620 |
+
symbol : str
|
| 621 |
+
Symbol to get data for.
|
| 622 |
+
date : Union[date, None, str]
|
| 623 |
+
A specific date to get data for.
|
| 624 |
+
page : Optional[int]
|
| 625 |
+
Page number of the data to fetch.
|
| 626 |
+
|
| 627 |
+
Returns
|
| 628 |
+
-------
|
| 629 |
+
OBBject
|
| 630 |
+
results : list[EquityOwnership]
|
| 631 |
+
Serializable results.
|
| 632 |
+
provider : Optional[str]
|
| 633 |
+
Provider name.
|
| 634 |
+
warnings : Optional[list[Warning_]]
|
| 635 |
+
list of warnings.
|
| 636 |
+
chart : Optional[Chart]
|
| 637 |
+
Chart object.
|
| 638 |
+
extra : Dict[str, Any]
|
| 639 |
+
Extra info.
|
| 640 |
+
|
| 641 |
+
EquityOwnership
|
| 642 |
+
---------------
|
| 643 |
+
date : date
|
| 644 |
+
The date of the data.
|
| 645 |
+
cik : int
|
| 646 |
+
Central Index Key (CIK) for the requested entity.
|
| 647 |
+
filing_date : date
|
| 648 |
+
Filing date of the stock ownership.
|
| 649 |
+
investor_name : str
|
| 650 |
+
Investor name of the stock ownership.
|
| 651 |
+
symbol : str
|
| 652 |
+
Symbol representing the entity requested in the data.
|
| 653 |
+
security_name : str
|
| 654 |
+
Security name of the stock ownership.
|
| 655 |
+
type_of_security : str
|
| 656 |
+
Type of security of the stock ownership.
|
| 657 |
+
security_cusip : str
|
| 658 |
+
Security cusip of the stock ownership.
|
| 659 |
+
shares_type : str
|
| 660 |
+
Shares type of the stock ownership.
|
| 661 |
+
put_call_share : str
|
| 662 |
+
Put call share of the stock ownership.
|
| 663 |
+
investment_discretion : str
|
| 664 |
+
Investment discretion of the stock ownership.
|
| 665 |
+
industry_title : str
|
| 666 |
+
Industry title of the stock ownership.
|
| 667 |
+
weight : float
|
| 668 |
+
Weight of the stock ownership.
|
| 669 |
+
last_weight : float
|
| 670 |
+
Last weight of the stock ownership.
|
| 671 |
+
change_in_weight : float
|
| 672 |
+
Change in weight of the stock ownership.
|
| 673 |
+
change_in_weight_percentage : float
|
| 674 |
+
Change in weight percentage of the stock ownership.
|
| 675 |
+
market_value : int
|
| 676 |
+
Market value of the stock ownership.
|
| 677 |
+
last_market_value : int
|
| 678 |
+
Last market value of the stock ownership.
|
| 679 |
+
change_in_market_value : int
|
| 680 |
+
Change in market value of the stock ownership.
|
| 681 |
+
change_in_market_value_percentage : float
|
| 682 |
+
Change in market value percentage of the stock ownership.
|
| 683 |
+
shares_number : int
|
| 684 |
+
Shares number of the stock ownership.
|
| 685 |
+
last_shares_number : int
|
| 686 |
+
Last shares number of the stock ownership.
|
| 687 |
+
change_in_shares_number : float
|
| 688 |
+
Change in shares number of the stock ownership.
|
| 689 |
+
change_in_shares_number_percentage : float
|
| 690 |
+
Change in shares number percentage of the stock ownership.
|
| 691 |
+
quarter_end_price : float
|
| 692 |
+
Quarter end price of the stock ownership.
|
| 693 |
+
avg_price_paid : float
|
| 694 |
+
Average price paid of the stock ownership.
|
| 695 |
+
is_new : bool
|
| 696 |
+
Is the stock ownership new.
|
| 697 |
+
is_sold_out : bool
|
| 698 |
+
Is the stock ownership sold out.
|
| 699 |
+
ownership : float
|
| 700 |
+
How much is the ownership.
|
| 701 |
+
last_ownership : float
|
| 702 |
+
Last ownership amount.
|
| 703 |
+
change_in_ownership : float
|
| 704 |
+
Change in ownership amount.
|
| 705 |
+
change_in_ownership_percentage : float
|
| 706 |
+
Change in ownership percentage.
|
| 707 |
+
holding_period : int
|
| 708 |
+
Holding period of the stock ownership.
|
| 709 |
+
first_added : date
|
| 710 |
+
First added date of the stock ownership.
|
| 711 |
+
performance : float
|
| 712 |
+
Performance of the stock ownership.
|
| 713 |
+
performance_percentage : float
|
| 714 |
+
Performance percentage of the stock ownership.
|
| 715 |
+
last_performance : float
|
| 716 |
+
Last performance of the stock ownership.
|
| 717 |
+
change_in_performance : float
|
| 718 |
+
Change in performance of the stock ownership.
|
| 719 |
+
is_counted_for_performance : bool
|
| 720 |
+
Is the stock ownership counted for performance.
|
| 721 |
+
|
| 722 |
+
Examples
|
| 723 |
+
--------
|
| 724 |
+
>>> from openbb import obb
|
| 725 |
+
>>> obb.equity.ownership.major_holders(symbol='AAPL', provider='fmp')
|
| 726 |
+
>>> obb.equity.ownership.major_holders(symbol='AAPL', page=0, provider='fmp')
|
| 727 |
+
""" # noqa: E501
|
| 728 |
+
|
| 729 |
+
return self._run(
|
| 730 |
+
"/equity/ownership/major_holders",
|
| 731 |
+
**filter_inputs(
|
| 732 |
+
provider_choices={
|
| 733 |
+
"provider": self._get_provider(
|
| 734 |
+
provider,
|
| 735 |
+
"equity.ownership.major_holders",
|
| 736 |
+
("fmp",),
|
| 737 |
+
)
|
| 738 |
+
},
|
| 739 |
+
standard_params={
|
| 740 |
+
"symbol": symbol,
|
| 741 |
+
"date": date,
|
| 742 |
+
"page": page,
|
| 743 |
+
},
|
| 744 |
+
extra_params=kwargs,
|
| 745 |
+
)
|
| 746 |
+
)
|
| 747 |
+
|
| 748 |
+
@exception_handler
|
| 749 |
+
@validate
|
| 750 |
+
def share_statistics(
|
| 751 |
+
self,
|
| 752 |
+
symbol: Annotated[
|
| 753 |
+
Union[str, list[str]],
|
| 754 |
+
OpenBBField(
|
| 755 |
+
description="Symbol to get data for. Multiple comma separated items allowed for provider(s): yfinance."
|
| 756 |
+
),
|
| 757 |
+
],
|
| 758 |
+
provider: Annotated[
|
| 759 |
+
Optional[Literal["fmp", "intrinio", "yfinance"]],
|
| 760 |
+
OpenBBField(
|
| 761 |
+
description="The provider to use, by default None. If None, the priority list configured in the settings is used. Default priority: fmp, intrinio, yfinance."
|
| 762 |
+
),
|
| 763 |
+
] = None,
|
| 764 |
+
**kwargs
|
| 765 |
+
) -> OBBject:
|
| 766 |
+
"""Get data about share float for a given company.
|
| 767 |
+
|
| 768 |
+
Parameters
|
| 769 |
+
----------
|
| 770 |
+
provider : str
|
| 771 |
+
The provider to use, by default None. If None, the priority list configured in the settings is used. Default priority: fmp, intrinio, yfinance.
|
| 772 |
+
symbol : Union[str, list[str]]
|
| 773 |
+
Symbol to get data for. Multiple comma separated items allowed for provider(s): yfinance.
|
| 774 |
+
|
| 775 |
+
Returns
|
| 776 |
+
-------
|
| 777 |
+
OBBject
|
| 778 |
+
results : list[ShareStatistics]
|
| 779 |
+
Serializable results.
|
| 780 |
+
provider : Optional[str]
|
| 781 |
+
Provider name.
|
| 782 |
+
warnings : Optional[list[Warning_]]
|
| 783 |
+
list of warnings.
|
| 784 |
+
chart : Optional[Chart]
|
| 785 |
+
Chart object.
|
| 786 |
+
extra : Dict[str, Any]
|
| 787 |
+
Extra info.
|
| 788 |
+
|
| 789 |
+
ShareStatistics
|
| 790 |
+
---------------
|
| 791 |
+
symbol : str
|
| 792 |
+
Symbol representing the entity requested in the data.
|
| 793 |
+
date : Optional[date]
|
| 794 |
+
The date of the data.
|
| 795 |
+
free_float : Optional[float]
|
| 796 |
+
Percentage of unrestricted shares of a publicly-traded company.
|
| 797 |
+
float_shares : Optional[float]
|
| 798 |
+
Number of shares available for trading by the general public.
|
| 799 |
+
outstanding_shares : Optional[float]
|
| 800 |
+
Total number of shares of a publicly-traded company.
|
| 801 |
+
source : Optional[str]
|
| 802 |
+
Source of the received data.
|
| 803 |
+
adjusted_outstanding_shares : Optional[float]
|
| 804 |
+
Total number of shares of a publicly-traded company, adjusted for splits. (provider: intrinio)
|
| 805 |
+
public_float : Optional[float]
|
| 806 |
+
Aggregate market value of the shares of a publicly-traded company. (provider: intrinio)
|
| 807 |
+
implied_shares_outstanding : Optional[int]
|
| 808 |
+
Implied Shares Outstanding of common equity, assuming the conversion of all convertible subsidiary equity into common. (provider: yfinance)
|
| 809 |
+
short_interest : Optional[int]
|
| 810 |
+
Number of shares that are reported short. (provider: yfinance)
|
| 811 |
+
short_percent_of_float : Optional[float]
|
| 812 |
+
Percentage of shares that are reported short, as a normalized percent. (provider: yfinance)
|
| 813 |
+
days_to_cover : Optional[float]
|
| 814 |
+
Number of days to repurchase the shares as a ratio of average daily volume (provider: yfinance)
|
| 815 |
+
short_interest_prev_month : Optional[int]
|
| 816 |
+
Number of shares that were reported short in the previous month. (provider: yfinance)
|
| 817 |
+
short_interest_prev_date : Optional[date]
|
| 818 |
+
Date of the previous month's report. (provider: yfinance)
|
| 819 |
+
insider_ownership : Optional[float]
|
| 820 |
+
Percentage of shares held by insiders, as a normalized percent. (provider: yfinance)
|
| 821 |
+
institution_ownership : Optional[float]
|
| 822 |
+
Percentage of shares held by institutions, as a normalized percent. (provider: yfinance)
|
| 823 |
+
institution_float_ownership : Optional[float]
|
| 824 |
+
Percentage of float held by institutions, as a normalized percent. (provider: yfinance)
|
| 825 |
+
institutions_count : Optional[int]
|
| 826 |
+
Number of institutions holding shares. (provider: yfinance)
|
| 827 |
+
|
| 828 |
+
Examples
|
| 829 |
+
--------
|
| 830 |
+
>>> from openbb import obb
|
| 831 |
+
>>> obb.equity.ownership.share_statistics(symbol='AAPL', provider='fmp')
|
| 832 |
+
""" # noqa: E501
|
| 833 |
+
|
| 834 |
+
return self._run(
|
| 835 |
+
"/equity/ownership/share_statistics",
|
| 836 |
+
**filter_inputs(
|
| 837 |
+
provider_choices={
|
| 838 |
+
"provider": self._get_provider(
|
| 839 |
+
provider,
|
| 840 |
+
"equity.ownership.share_statistics",
|
| 841 |
+
("fmp", "intrinio", "yfinance"),
|
| 842 |
+
)
|
| 843 |
+
},
|
| 844 |
+
standard_params={
|
| 845 |
+
"symbol": symbol,
|
| 846 |
+
},
|
| 847 |
+
extra_params=kwargs,
|
| 848 |
+
info={
|
| 849 |
+
"symbol": {
|
| 850 |
+
"yfinance": {"multiple_items_allowed": True, "choices": None}
|
| 851 |
+
}
|
| 852 |
+
},
|
| 853 |
+
)
|
| 854 |
+
)
|
openbb_platform/openbb/package/equity_price.py
ADDED
|
@@ -0,0 +1,630 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|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
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
### THIS FILE IS AUTO-GENERATED. DO NOT EDIT. ###
|
| 2 |
+
|
| 3 |
+
import datetime
|
| 4 |
+
from typing import Literal, Optional, Union
|
| 5 |
+
|
| 6 |
+
from openbb_core.app.model.field import OpenBBField
|
| 7 |
+
from openbb_core.app.model.obbject import OBBject
|
| 8 |
+
from openbb_core.app.static.container import Container
|
| 9 |
+
from openbb_core.app.static.utils.decorators import exception_handler, validate
|
| 10 |
+
from openbb_core.app.static.utils.filters import filter_inputs
|
| 11 |
+
from typing_extensions import Annotated
|
| 12 |
+
|
| 13 |
+
|
| 14 |
+
class ROUTER_equity_price(Container):
|
| 15 |
+
"""/equity/price
|
| 16 |
+
historical
|
| 17 |
+
nbbo
|
| 18 |
+
performance
|
| 19 |
+
quote
|
| 20 |
+
"""
|
| 21 |
+
|
| 22 |
+
def __repr__(self) -> str:
|
| 23 |
+
return self.__doc__ or ""
|
| 24 |
+
|
| 25 |
+
@exception_handler
|
| 26 |
+
@validate
|
| 27 |
+
def historical(
|
| 28 |
+
self,
|
| 29 |
+
symbol: Annotated[
|
| 30 |
+
Union[str, list[str]],
|
| 31 |
+
OpenBBField(
|
| 32 |
+
description="Symbol to get data for. Multiple comma separated items allowed for provider(s): fmp, polygon, tiingo, yfinance."
|
| 33 |
+
),
|
| 34 |
+
],
|
| 35 |
+
start_date: Annotated[
|
| 36 |
+
Union[datetime.date, None, str],
|
| 37 |
+
OpenBBField(description="Start date of the data, in YYYY-MM-DD format."),
|
| 38 |
+
] = None,
|
| 39 |
+
end_date: Annotated[
|
| 40 |
+
Union[datetime.date, None, str],
|
| 41 |
+
OpenBBField(description="End date of the data, in YYYY-MM-DD format."),
|
| 42 |
+
] = None,
|
| 43 |
+
provider: Annotated[
|
| 44 |
+
Optional[Literal["fmp", "intrinio", "polygon", "tiingo", "yfinance"]],
|
| 45 |
+
OpenBBField(
|
| 46 |
+
description="The provider to use, by default None. If None, the priority list configured in the settings is used. Default priority: fmp, intrinio, polygon, tiingo, yfinance."
|
| 47 |
+
),
|
| 48 |
+
] = None,
|
| 49 |
+
**kwargs
|
| 50 |
+
) -> OBBject:
|
| 51 |
+
"""Get historical price data for a given stock. This includes open, high, low, close, and volume.
|
| 52 |
+
|
| 53 |
+
Parameters
|
| 54 |
+
----------
|
| 55 |
+
provider : str
|
| 56 |
+
The provider to use, by default None. If None, the priority list configured in the settings is used. Default priority: fmp, intrinio, polygon, tiingo, yfinance.
|
| 57 |
+
symbol : Union[str, list[str]]
|
| 58 |
+
Symbol to get data for. Multiple comma separated items allowed for provider(s): fmp, polygon, tiingo, yfinance.
|
| 59 |
+
start_date : Union[date, None, str]
|
| 60 |
+
Start date of the data, in YYYY-MM-DD format.
|
| 61 |
+
end_date : Union[date, None, str]
|
| 62 |
+
End date of the data, in YYYY-MM-DD format.
|
| 63 |
+
interval : str
|
| 64 |
+
Time interval of the data to return. (provider: fmp, intrinio, polygon, tiingo, yfinance)
|
| 65 |
+
Choices for fmp: '1m', '5m', '15m', '30m', '1h', '4h', '1d'
|
| 66 |
+
Choices for intrinio: '1m', '5m', '10m', '15m', '30m', '60m', '1h', '1d', '1W', '1M', '1Q', '1Y'
|
| 67 |
+
Choices for yfinance: '1m', '2m', '5m', '15m', '30m', '60m', '90m', '1h', '1d', '5d', '1W', '1M', '1Q'
|
| 68 |
+
start_time : Optional[datetime.time]
|
| 69 |
+
Return intervals starting at the specified time on the `start_date` formatted as 'HH:MM:SS'. (provider: intrinio)
|
| 70 |
+
end_time : Optional[datetime.time]
|
| 71 |
+
Return intervals stopping at the specified time on the `end_date` formatted as 'HH:MM:SS'. (provider: intrinio)
|
| 72 |
+
timezone : Optional[str]
|
| 73 |
+
Timezone of the data, in the IANA format (Continent/City). (provider: intrinio)
|
| 74 |
+
source : Literal['realtime', 'delayed', 'nasdaq_basic']
|
| 75 |
+
The source of the data. (provider: intrinio)
|
| 76 |
+
adjustment : str
|
| 77 |
+
The adjustment factor to apply. Default is splits only. (provider: polygon, yfinance)
|
| 78 |
+
Choices for polygon: 'splits_only', 'unadjusted'
|
| 79 |
+
Choices for yfinance: 'splits_only', 'splits_and_dividends'
|
| 80 |
+
extended_hours : bool
|
| 81 |
+
Include Pre and Post market data. (provider: polygon, yfinance)
|
| 82 |
+
sort : Literal['asc', 'desc']
|
| 83 |
+
Sort order of the data. This impacts the results in combination with the 'limit' parameter. The results are always returned in ascending order by date. (provider: polygon)
|
| 84 |
+
limit : int
|
| 85 |
+
The number of data entries to return. (provider: polygon)
|
| 86 |
+
include_actions : bool
|
| 87 |
+
Include dividends and stock splits in results. (provider: yfinance)
|
| 88 |
+
|
| 89 |
+
Returns
|
| 90 |
+
-------
|
| 91 |
+
OBBject
|
| 92 |
+
results : list[EquityHistorical]
|
| 93 |
+
Serializable results.
|
| 94 |
+
provider : Optional[str]
|
| 95 |
+
Provider name.
|
| 96 |
+
warnings : Optional[list[Warning_]]
|
| 97 |
+
list of warnings.
|
| 98 |
+
chart : Optional[Chart]
|
| 99 |
+
Chart object.
|
| 100 |
+
extra : Dict[str, Any]
|
| 101 |
+
Extra info.
|
| 102 |
+
|
| 103 |
+
EquityHistorical
|
| 104 |
+
----------------
|
| 105 |
+
date : Union[date, datetime]
|
| 106 |
+
The date of the data.
|
| 107 |
+
open : float
|
| 108 |
+
The open price.
|
| 109 |
+
high : float
|
| 110 |
+
The high price.
|
| 111 |
+
low : float
|
| 112 |
+
The low price.
|
| 113 |
+
close : float
|
| 114 |
+
The close price.
|
| 115 |
+
volume : Optional[Union[int, float]]
|
| 116 |
+
The trading volume.
|
| 117 |
+
vwap : Optional[float]
|
| 118 |
+
Volume Weighted Average Price over the period.
|
| 119 |
+
adj_close : Optional[float]
|
| 120 |
+
The adjusted close price. (provider: fmp, intrinio, tiingo)
|
| 121 |
+
unadjusted_volume : Optional[float]
|
| 122 |
+
Unadjusted volume of the symbol. (provider: fmp)
|
| 123 |
+
change : Optional[float]
|
| 124 |
+
Change in the price from the previous close. (provider: fmp);
|
| 125 |
+
Change in the price of the symbol from the previous day. (provider: intrinio)
|
| 126 |
+
change_percent : Optional[float]
|
| 127 |
+
Change in the price from the previous close, as a normalized percent. (provider: fmp);
|
| 128 |
+
Percent change in the price of the symbol from the previous day. (provider: intrinio)
|
| 129 |
+
average : Optional[float]
|
| 130 |
+
Average trade price of an individual equity during the interval. (provider: intrinio)
|
| 131 |
+
adj_open : Optional[float]
|
| 132 |
+
The adjusted open price. (provider: intrinio, tiingo)
|
| 133 |
+
adj_high : Optional[float]
|
| 134 |
+
The adjusted high price. (provider: intrinio, tiingo)
|
| 135 |
+
adj_low : Optional[float]
|
| 136 |
+
The adjusted low price. (provider: intrinio, tiingo)
|
| 137 |
+
adj_volume : Optional[float]
|
| 138 |
+
The adjusted volume. (provider: intrinio, tiingo)
|
| 139 |
+
fifty_two_week_high : Optional[float]
|
| 140 |
+
52 week high price for the symbol. (provider: intrinio)
|
| 141 |
+
fifty_two_week_low : Optional[float]
|
| 142 |
+
52 week low price for the symbol. (provider: intrinio)
|
| 143 |
+
factor : Optional[float]
|
| 144 |
+
factor by which to multiply equity prices before this date, in order to calculate historically-adjusted equity prices. (provider: intrinio)
|
| 145 |
+
split_ratio : Optional[float]
|
| 146 |
+
Ratio of the equity split, if a split occurred. (provider: intrinio, tiingo, yfinance)
|
| 147 |
+
dividend : Optional[float]
|
| 148 |
+
Dividend amount, if a dividend was paid. (provider: intrinio, tiingo, yfinance)
|
| 149 |
+
close_time : Optional[datetime]
|
| 150 |
+
The timestamp that represents the end of the interval span. (provider: intrinio)
|
| 151 |
+
interval : Optional[str]
|
| 152 |
+
The data time frequency. (provider: intrinio)
|
| 153 |
+
intra_period : Optional[bool]
|
| 154 |
+
If true, the equity price represents an unfinished period (be it day, week, quarter, month, or year), meaning that the close price is the latest price available, not the official close price for the period (provider: intrinio)
|
| 155 |
+
transactions : Optional[Annotated[int, Gt(gt=0)]]
|
| 156 |
+
Number of transactions for the symbol in the time period. (provider: polygon)
|
| 157 |
+
|
| 158 |
+
Examples
|
| 159 |
+
--------
|
| 160 |
+
>>> from openbb import obb
|
| 161 |
+
>>> obb.equity.price.historical(symbol='AAPL', provider='fmp')
|
| 162 |
+
>>> obb.equity.price.historical(symbol='AAPL', interval='1d', provider='intrinio')
|
| 163 |
+
""" # noqa: E501
|
| 164 |
+
|
| 165 |
+
return self._run(
|
| 166 |
+
"/equity/price/historical",
|
| 167 |
+
**filter_inputs(
|
| 168 |
+
provider_choices={
|
| 169 |
+
"provider": self._get_provider(
|
| 170 |
+
provider,
|
| 171 |
+
"equity.price.historical",
|
| 172 |
+
("fmp", "intrinio", "polygon", "tiingo", "yfinance"),
|
| 173 |
+
)
|
| 174 |
+
},
|
| 175 |
+
standard_params={
|
| 176 |
+
"symbol": symbol,
|
| 177 |
+
"start_date": start_date,
|
| 178 |
+
"end_date": end_date,
|
| 179 |
+
},
|
| 180 |
+
extra_params=kwargs,
|
| 181 |
+
info={
|
| 182 |
+
"symbol": {
|
| 183 |
+
"fmp": {"multiple_items_allowed": True, "choices": None},
|
| 184 |
+
"polygon": {"multiple_items_allowed": True, "choices": None},
|
| 185 |
+
"tiingo": {"multiple_items_allowed": True, "choices": None},
|
| 186 |
+
"yfinance": {"multiple_items_allowed": True, "choices": None},
|
| 187 |
+
},
|
| 188 |
+
"interval": {
|
| 189 |
+
"fmp": {
|
| 190 |
+
"multiple_items_allowed": False,
|
| 191 |
+
"choices": ["1m", "5m", "15m", "30m", "1h", "4h", "1d"],
|
| 192 |
+
},
|
| 193 |
+
"intrinio": {
|
| 194 |
+
"multiple_items_allowed": False,
|
| 195 |
+
"choices": [
|
| 196 |
+
"1m",
|
| 197 |
+
"5m",
|
| 198 |
+
"10m",
|
| 199 |
+
"15m",
|
| 200 |
+
"30m",
|
| 201 |
+
"60m",
|
| 202 |
+
"1h",
|
| 203 |
+
"1d",
|
| 204 |
+
"1W",
|
| 205 |
+
"1M",
|
| 206 |
+
"1Q",
|
| 207 |
+
"1Y",
|
| 208 |
+
],
|
| 209 |
+
},
|
| 210 |
+
"tiingo": {
|
| 211 |
+
"multiple_items_allowed": False,
|
| 212 |
+
"choices": [
|
| 213 |
+
"1m",
|
| 214 |
+
"5m",
|
| 215 |
+
"15m",
|
| 216 |
+
"30m",
|
| 217 |
+
"90m",
|
| 218 |
+
"1h",
|
| 219 |
+
"2h",
|
| 220 |
+
"4h",
|
| 221 |
+
"1d",
|
| 222 |
+
"1W",
|
| 223 |
+
"1M",
|
| 224 |
+
"1Y",
|
| 225 |
+
],
|
| 226 |
+
},
|
| 227 |
+
"yfinance": {
|
| 228 |
+
"multiple_items_allowed": False,
|
| 229 |
+
"choices": [
|
| 230 |
+
"1m",
|
| 231 |
+
"2m",
|
| 232 |
+
"5m",
|
| 233 |
+
"15m",
|
| 234 |
+
"30m",
|
| 235 |
+
"60m",
|
| 236 |
+
"90m",
|
| 237 |
+
"1h",
|
| 238 |
+
"1d",
|
| 239 |
+
"5d",
|
| 240 |
+
"1W",
|
| 241 |
+
"1M",
|
| 242 |
+
"1Q",
|
| 243 |
+
],
|
| 244 |
+
},
|
| 245 |
+
},
|
| 246 |
+
},
|
| 247 |
+
)
|
| 248 |
+
)
|
| 249 |
+
|
| 250 |
+
@exception_handler
|
| 251 |
+
@validate
|
| 252 |
+
def nbbo(
|
| 253 |
+
self,
|
| 254 |
+
symbol: Annotated[str, OpenBBField(description="Symbol to get data for.")],
|
| 255 |
+
provider: Annotated[
|
| 256 |
+
Optional[Literal["polygon"]],
|
| 257 |
+
OpenBBField(
|
| 258 |
+
description="The provider to use, by default None. If None, the priority list configured in the settings is used. Default priority: polygon."
|
| 259 |
+
),
|
| 260 |
+
] = None,
|
| 261 |
+
**kwargs
|
| 262 |
+
) -> OBBject:
|
| 263 |
+
"""Get the National Best Bid and Offer for a given stock.
|
| 264 |
+
|
| 265 |
+
Parameters
|
| 266 |
+
----------
|
| 267 |
+
provider : str
|
| 268 |
+
The provider to use, by default None. If None, the priority list configured in the settings is used. Default priority: polygon.
|
| 269 |
+
symbol : str
|
| 270 |
+
Symbol to get data for.
|
| 271 |
+
limit : int
|
| 272 |
+
The number of data entries to return. Up to ten million records will be returned. Pagination occurs in groups of 50,000. Remaining limit values will always return 50,000 more records unless it is the last page. High volume tickers will require multiple max requests for a single day's NBBO records. Expect stocks, like SPY, to approach 1GB in size, per day, as a raw CSV. Splitting large requests into chunks is recommended for full-day requests of high-volume symbols. (provider: polygon)
|
| 273 |
+
date : Optional[date]
|
| 274 |
+
A specific date to get data for. Use bracketed the timestamp parameters to specify exact time ranges. (provider: polygon)
|
| 275 |
+
timestamp_lt : Union[datetime, str, None]
|
| 276 |
+
Query by datetime, less than. Either a date with the format 'YYYY-MM-DD' or a TZ-aware timestamp string, 'YYYY-MM-DDTH:M:S.000000000-04:00'. Include all nanoseconds and the 'T' between the day and hour. (provider: polygon)
|
| 277 |
+
timestamp_gt : Union[datetime, str, None]
|
| 278 |
+
Query by datetime, greater than. Either a date with the format 'YYYY-MM-DD' or a TZ-aware timestamp string, 'YYYY-MM-DDTH:M:S.000000000-04:00'. Include all nanoseconds and the 'T' between the day and hour. (provider: polygon)
|
| 279 |
+
timestamp_lte : Union[datetime, str, None]
|
| 280 |
+
Query by datetime, less than or equal to. Either a date with the format 'YYYY-MM-DD' or a TZ-aware timestamp string, 'YYYY-MM-DDTH:M:S.000000000-04:00'. Include all nanoseconds and the 'T' between the day and hour. (provider: polygon)
|
| 281 |
+
timestamp_gte : Union[datetime, str, None]
|
| 282 |
+
Query by datetime, greater than or equal to. Either a date with the format 'YYYY-MM-DD' or a TZ-aware timestamp string, 'YYYY-MM-DDTH:M:S.000000000-04:00'. Include all nanoseconds and the 'T' between the day and hour. (provider: polygon)
|
| 283 |
+
|
| 284 |
+
Returns
|
| 285 |
+
-------
|
| 286 |
+
OBBject
|
| 287 |
+
results : list[EquityNBBO]
|
| 288 |
+
Serializable results.
|
| 289 |
+
provider : Optional[str]
|
| 290 |
+
Provider name.
|
| 291 |
+
warnings : Optional[list[Warning_]]
|
| 292 |
+
list of warnings.
|
| 293 |
+
chart : Optional[Chart]
|
| 294 |
+
Chart object.
|
| 295 |
+
extra : Dict[str, Any]
|
| 296 |
+
Extra info.
|
| 297 |
+
|
| 298 |
+
EquityNBBO
|
| 299 |
+
----------
|
| 300 |
+
ask_exchange : str
|
| 301 |
+
The exchange ID for the ask.
|
| 302 |
+
ask : float
|
| 303 |
+
The last ask price.
|
| 304 |
+
ask_size : int
|
| 305 |
+
The ask size. This represents the number of round lot orders at the given ask price.
|
| 306 |
+
The normal round lot size is 100 shares.
|
| 307 |
+
An ask size of 2 means there are 200 shares available to purchase at the given ask price.
|
| 308 |
+
bid_size : int
|
| 309 |
+
The bid size in round lots.
|
| 310 |
+
bid : float
|
| 311 |
+
The last bid price.
|
| 312 |
+
bid_exchange : str
|
| 313 |
+
The exchange ID for the bid.
|
| 314 |
+
tape : Optional[str]
|
| 315 |
+
The exchange tape. (provider: polygon)
|
| 316 |
+
conditions : Optional[Union[str, list[int], list[str]]]
|
| 317 |
+
A list of condition codes. (provider: polygon)
|
| 318 |
+
indicators : Optional[list[int]]
|
| 319 |
+
A list of indicator codes. (provider: polygon)
|
| 320 |
+
sequence_num : Optional[int]
|
| 321 |
+
The sequence number represents the sequence in which message events happened. These are increasing and unique per ticker symbol, but will not always be sequential (e.g., 1, 2, 6, 9, 10, 11) (provider: polygon)
|
| 322 |
+
participant_timestamp : Optional[datetime]
|
| 323 |
+
The nanosecond accuracy Participant/Exchange Unix Timestamp. This is the timestamp of when the quote was actually generated at the exchange. (provider: polygon)
|
| 324 |
+
sip_timestamp : Optional[datetime]
|
| 325 |
+
The nanosecond accuracy SIP Unix Timestamp. This is the timestamp of when the SIP received this quote from the exchange which produced it. (provider: polygon)
|
| 326 |
+
trf_timestamp : Optional[datetime]
|
| 327 |
+
The nanosecond accuracy TRF (Trade Reporting Facility) Unix Timestamp. This is the timestamp of when the trade reporting facility received this quote. (provider: polygon)
|
| 328 |
+
|
| 329 |
+
Examples
|
| 330 |
+
--------
|
| 331 |
+
>>> from openbb import obb
|
| 332 |
+
>>> obb.equity.price.nbbo(symbol='AAPL', provider='polygon')
|
| 333 |
+
""" # noqa: E501
|
| 334 |
+
|
| 335 |
+
return self._run(
|
| 336 |
+
"/equity/price/nbbo",
|
| 337 |
+
**filter_inputs(
|
| 338 |
+
provider_choices={
|
| 339 |
+
"provider": self._get_provider(
|
| 340 |
+
provider,
|
| 341 |
+
"equity.price.nbbo",
|
| 342 |
+
("polygon",),
|
| 343 |
+
)
|
| 344 |
+
},
|
| 345 |
+
standard_params={
|
| 346 |
+
"symbol": symbol,
|
| 347 |
+
},
|
| 348 |
+
extra_params=kwargs,
|
| 349 |
+
)
|
| 350 |
+
)
|
| 351 |
+
|
| 352 |
+
@exception_handler
|
| 353 |
+
@validate
|
| 354 |
+
def performance(
|
| 355 |
+
self,
|
| 356 |
+
symbol: Annotated[
|
| 357 |
+
Union[str, list[str]],
|
| 358 |
+
OpenBBField(
|
| 359 |
+
description="Symbol to get data for. Multiple comma separated items allowed for provider(s): fmp."
|
| 360 |
+
),
|
| 361 |
+
],
|
| 362 |
+
provider: Annotated[
|
| 363 |
+
Optional[Literal["fmp"]],
|
| 364 |
+
OpenBBField(
|
| 365 |
+
description="The provider to use, by default None. If None, the priority list configured in the settings is used. Default priority: fmp."
|
| 366 |
+
),
|
| 367 |
+
] = None,
|
| 368 |
+
**kwargs
|
| 369 |
+
) -> OBBject:
|
| 370 |
+
"""Get price performance data for a given stock. This includes price changes for different time periods.
|
| 371 |
+
|
| 372 |
+
Parameters
|
| 373 |
+
----------
|
| 374 |
+
provider : str
|
| 375 |
+
The provider to use, by default None. If None, the priority list configured in the settings is used. Default priority: fmp.
|
| 376 |
+
symbol : Union[str, list[str]]
|
| 377 |
+
Symbol to get data for. Multiple comma separated items allowed for provider(s): fmp.
|
| 378 |
+
|
| 379 |
+
Returns
|
| 380 |
+
-------
|
| 381 |
+
OBBject
|
| 382 |
+
results : list[PricePerformance]
|
| 383 |
+
Serializable results.
|
| 384 |
+
provider : Optional[str]
|
| 385 |
+
Provider name.
|
| 386 |
+
warnings : Optional[list[Warning_]]
|
| 387 |
+
list of warnings.
|
| 388 |
+
chart : Optional[Chart]
|
| 389 |
+
Chart object.
|
| 390 |
+
extra : Dict[str, Any]
|
| 391 |
+
Extra info.
|
| 392 |
+
|
| 393 |
+
PricePerformance
|
| 394 |
+
----------------
|
| 395 |
+
symbol : Optional[str]
|
| 396 |
+
Symbol representing the entity requested in the data.
|
| 397 |
+
one_day : Optional[float]
|
| 398 |
+
One-day return.
|
| 399 |
+
wtd : Optional[float]
|
| 400 |
+
Week to date return.
|
| 401 |
+
one_week : Optional[float]
|
| 402 |
+
One-week return.
|
| 403 |
+
mtd : Optional[float]
|
| 404 |
+
Month to date return.
|
| 405 |
+
one_month : Optional[float]
|
| 406 |
+
One-month return.
|
| 407 |
+
qtd : Optional[float]
|
| 408 |
+
Quarter to date return.
|
| 409 |
+
three_month : Optional[float]
|
| 410 |
+
Three-month return.
|
| 411 |
+
six_month : Optional[float]
|
| 412 |
+
Six-month return.
|
| 413 |
+
ytd : Optional[float]
|
| 414 |
+
Year to date return.
|
| 415 |
+
one_year : Optional[float]
|
| 416 |
+
One-year return.
|
| 417 |
+
two_year : Optional[float]
|
| 418 |
+
Two-year return.
|
| 419 |
+
three_year : Optional[float]
|
| 420 |
+
Three-year return.
|
| 421 |
+
four_year : Optional[float]
|
| 422 |
+
Four-year
|
| 423 |
+
five_year : Optional[float]
|
| 424 |
+
Five-year return.
|
| 425 |
+
ten_year : Optional[float]
|
| 426 |
+
Ten-year return.
|
| 427 |
+
max : Optional[float]
|
| 428 |
+
Return from the beginning of the time series.
|
| 429 |
+
|
| 430 |
+
Examples
|
| 431 |
+
--------
|
| 432 |
+
>>> from openbb import obb
|
| 433 |
+
>>> obb.equity.price.performance(symbol='AAPL', provider='fmp')
|
| 434 |
+
""" # noqa: E501
|
| 435 |
+
|
| 436 |
+
return self._run(
|
| 437 |
+
"/equity/price/performance",
|
| 438 |
+
**filter_inputs(
|
| 439 |
+
provider_choices={
|
| 440 |
+
"provider": self._get_provider(
|
| 441 |
+
provider,
|
| 442 |
+
"equity.price.performance",
|
| 443 |
+
("fmp",),
|
| 444 |
+
)
|
| 445 |
+
},
|
| 446 |
+
standard_params={
|
| 447 |
+
"symbol": symbol,
|
| 448 |
+
},
|
| 449 |
+
extra_params=kwargs,
|
| 450 |
+
info={
|
| 451 |
+
"symbol": {"fmp": {"multiple_items_allowed": True, "choices": None}}
|
| 452 |
+
},
|
| 453 |
+
)
|
| 454 |
+
)
|
| 455 |
+
|
| 456 |
+
@exception_handler
|
| 457 |
+
@validate
|
| 458 |
+
def quote(
|
| 459 |
+
self,
|
| 460 |
+
symbol: Annotated[
|
| 461 |
+
Union[str, list[str]],
|
| 462 |
+
OpenBBField(
|
| 463 |
+
description="Symbol to get data for. Multiple comma separated items allowed for provider(s): fmp, intrinio, yfinance."
|
| 464 |
+
),
|
| 465 |
+
],
|
| 466 |
+
provider: Annotated[
|
| 467 |
+
Optional[Literal["fmp", "intrinio", "yfinance"]],
|
| 468 |
+
OpenBBField(
|
| 469 |
+
description="The provider to use, by default None. If None, the priority list configured in the settings is used. Default priority: fmp, intrinio, yfinance."
|
| 470 |
+
),
|
| 471 |
+
] = None,
|
| 472 |
+
**kwargs
|
| 473 |
+
) -> OBBject:
|
| 474 |
+
"""Get the latest quote for a given stock. Quote includes price, volume, and other data.
|
| 475 |
+
|
| 476 |
+
Parameters
|
| 477 |
+
----------
|
| 478 |
+
provider : str
|
| 479 |
+
The provider to use, by default None. If None, the priority list configured in the settings is used. Default priority: fmp, intrinio, yfinance.
|
| 480 |
+
symbol : Union[str, list[str]]
|
| 481 |
+
Symbol to get data for. Multiple comma separated items allowed for provider(s): fmp, intrinio, yfinance.
|
| 482 |
+
source : Literal['iex', 'bats', 'bats_delayed', 'utp_delayed', 'cta_a_delayed', 'cta_b_delayed', 'intrinio_mx', 'intrinio_mx_plus', 'delayed_sip']
|
| 483 |
+
Source of the data. (provider: intrinio)
|
| 484 |
+
|
| 485 |
+
Returns
|
| 486 |
+
-------
|
| 487 |
+
OBBject
|
| 488 |
+
results : list[EquityQuote]
|
| 489 |
+
Serializable results.
|
| 490 |
+
provider : Optional[str]
|
| 491 |
+
Provider name.
|
| 492 |
+
warnings : Optional[list[Warning_]]
|
| 493 |
+
list of warnings.
|
| 494 |
+
chart : Optional[Chart]
|
| 495 |
+
Chart object.
|
| 496 |
+
extra : Dict[str, Any]
|
| 497 |
+
Extra info.
|
| 498 |
+
|
| 499 |
+
EquityQuote
|
| 500 |
+
-----------
|
| 501 |
+
symbol : str
|
| 502 |
+
Symbol representing the entity requested in the data.
|
| 503 |
+
asset_type : Optional[str]
|
| 504 |
+
Type of asset - i.e, stock, ETF, etc.
|
| 505 |
+
name : Optional[str]
|
| 506 |
+
Name of the company or asset.
|
| 507 |
+
exchange : Optional[str]
|
| 508 |
+
The name or symbol of the venue where the data is from.
|
| 509 |
+
bid : Optional[float]
|
| 510 |
+
Price of the top bid order.
|
| 511 |
+
bid_size : Optional[int]
|
| 512 |
+
This represents the number of round lot orders at the given price. The normal round lot size is 100 shares. A size of 2 means there are 200 shares available at the given price.
|
| 513 |
+
bid_exchange : Optional[str]
|
| 514 |
+
The specific trading venue where the purchase order was placed.
|
| 515 |
+
ask : Optional[float]
|
| 516 |
+
Price of the top ask order.
|
| 517 |
+
ask_size : Optional[int]
|
| 518 |
+
This represents the number of round lot orders at the given price. The normal round lot size is 100 shares. A size of 2 means there are 200 shares available at the given price.
|
| 519 |
+
ask_exchange : Optional[str]
|
| 520 |
+
The specific trading venue where the sale order was placed.
|
| 521 |
+
quote_conditions : Optional[Union[str, int, list[str], list[int]]]
|
| 522 |
+
Conditions or condition codes applicable to the quote.
|
| 523 |
+
quote_indicators : Optional[Union[str, int, list[str], list[int]]]
|
| 524 |
+
Indicators or indicator codes applicable to the participant quote related to the price bands for the issue, or the affect the quote has on the NBBO.
|
| 525 |
+
sales_conditions : Optional[Union[str, int, list[str], list[int]]]
|
| 526 |
+
Conditions or condition codes applicable to the sale.
|
| 527 |
+
sequence_number : Optional[int]
|
| 528 |
+
The sequence number represents the sequence in which message events happened. These are increasing and unique per ticker symbol, but will not always be sequential (e.g., 1, 2, 6, 9, 10, 11).
|
| 529 |
+
market_center : Optional[str]
|
| 530 |
+
The ID of the UTP participant that originated the message.
|
| 531 |
+
participant_timestamp : Optional[datetime]
|
| 532 |
+
Timestamp for when the quote was generated by the exchange.
|
| 533 |
+
trf_timestamp : Optional[datetime]
|
| 534 |
+
Timestamp for when the TRF (Trade Reporting Facility) received the message.
|
| 535 |
+
sip_timestamp : Optional[datetime]
|
| 536 |
+
Timestamp for when the SIP (Security Information Processor) received the message from the exchange.
|
| 537 |
+
last_price : Optional[float]
|
| 538 |
+
Price of the last trade.
|
| 539 |
+
last_tick : Optional[str]
|
| 540 |
+
Whether the last sale was an up or down tick.
|
| 541 |
+
last_size : Optional[int]
|
| 542 |
+
Size of the last trade.
|
| 543 |
+
last_timestamp : Optional[datetime]
|
| 544 |
+
Date and Time when the last price was recorded.
|
| 545 |
+
open : Optional[float]
|
| 546 |
+
The open price.
|
| 547 |
+
high : Optional[float]
|
| 548 |
+
The high price.
|
| 549 |
+
low : Optional[float]
|
| 550 |
+
The low price.
|
| 551 |
+
close : Optional[float]
|
| 552 |
+
The close price.
|
| 553 |
+
volume : Optional[Union[int, float]]
|
| 554 |
+
The trading volume.
|
| 555 |
+
exchange_volume : Optional[Union[int, float]]
|
| 556 |
+
Volume of shares exchanged during the trading day on the specific exchange.
|
| 557 |
+
prev_close : Optional[float]
|
| 558 |
+
The previous close price.
|
| 559 |
+
change : Optional[float]
|
| 560 |
+
Change in price from previous close.
|
| 561 |
+
change_percent : Optional[float]
|
| 562 |
+
Change in price as a normalized percentage.
|
| 563 |
+
year_high : Optional[float]
|
| 564 |
+
The one year high (52W High).
|
| 565 |
+
year_low : Optional[float]
|
| 566 |
+
The one year low (52W Low).
|
| 567 |
+
price_avg50 : Optional[float]
|
| 568 |
+
50 day moving average price. (provider: fmp)
|
| 569 |
+
price_avg200 : Optional[float]
|
| 570 |
+
200 day moving average price. (provider: fmp)
|
| 571 |
+
avg_volume : Optional[int]
|
| 572 |
+
Average volume over the last 10 trading days. (provider: fmp)
|
| 573 |
+
market_cap : Optional[float]
|
| 574 |
+
Market cap of the company. (provider: fmp)
|
| 575 |
+
shares_outstanding : Optional[int]
|
| 576 |
+
Number of shares outstanding. (provider: fmp)
|
| 577 |
+
eps : Optional[float]
|
| 578 |
+
Earnings per share. (provider: fmp)
|
| 579 |
+
pe : Optional[float]
|
| 580 |
+
Price earnings ratio. (provider: fmp)
|
| 581 |
+
earnings_announcement : Optional[datetime]
|
| 582 |
+
Upcoming earnings announcement date. (provider: fmp)
|
| 583 |
+
is_darkpool : Optional[bool]
|
| 584 |
+
Whether or not the current trade is from a darkpool. (provider: intrinio)
|
| 585 |
+
source : Optional[str]
|
| 586 |
+
Source of the Intrinio data. (provider: intrinio)
|
| 587 |
+
updated_on : Optional[datetime]
|
| 588 |
+
Date and Time when the data was last updated. (provider: intrinio)
|
| 589 |
+
security : Optional[IntrinioSecurity]
|
| 590 |
+
Security details related to the quote. (provider: intrinio)
|
| 591 |
+
ma_50d : Optional[float]
|
| 592 |
+
50-day moving average price. (provider: yfinance)
|
| 593 |
+
ma_200d : Optional[float]
|
| 594 |
+
200-day moving average price. (provider: yfinance)
|
| 595 |
+
volume_average : Optional[float]
|
| 596 |
+
Average daily trading volume. (provider: yfinance)
|
| 597 |
+
volume_average_10d : Optional[float]
|
| 598 |
+
Average daily trading volume in the last 10 days. (provider: yfinance)
|
| 599 |
+
currency : Optional[str]
|
| 600 |
+
Currency of the price. (provider: yfinance)
|
| 601 |
+
|
| 602 |
+
Examples
|
| 603 |
+
--------
|
| 604 |
+
>>> from openbb import obb
|
| 605 |
+
>>> obb.equity.price.quote(symbol='AAPL', provider='fmp')
|
| 606 |
+
""" # noqa: E501
|
| 607 |
+
|
| 608 |
+
return self._run(
|
| 609 |
+
"/equity/price/quote",
|
| 610 |
+
**filter_inputs(
|
| 611 |
+
provider_choices={
|
| 612 |
+
"provider": self._get_provider(
|
| 613 |
+
provider,
|
| 614 |
+
"equity.price.quote",
|
| 615 |
+
("fmp", "intrinio", "yfinance"),
|
| 616 |
+
)
|
| 617 |
+
},
|
| 618 |
+
standard_params={
|
| 619 |
+
"symbol": symbol,
|
| 620 |
+
},
|
| 621 |
+
extra_params=kwargs,
|
| 622 |
+
info={
|
| 623 |
+
"symbol": {
|
| 624 |
+
"fmp": {"multiple_items_allowed": True, "choices": None},
|
| 625 |
+
"intrinio": {"multiple_items_allowed": True, "choices": None},
|
| 626 |
+
"yfinance": {"multiple_items_allowed": True, "choices": None},
|
| 627 |
+
}
|
| 628 |
+
},
|
| 629 |
+
)
|
| 630 |
+
)
|
openbb_platform/openbb/package/equity_shorts.py
ADDED
|
@@ -0,0 +1,104 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
### THIS FILE IS AUTO-GENERATED. DO NOT EDIT. ###
|
| 2 |
+
|
| 3 |
+
from typing import Literal, Optional
|
| 4 |
+
|
| 5 |
+
from openbb_core.app.model.field import OpenBBField
|
| 6 |
+
from openbb_core.app.model.obbject import OBBject
|
| 7 |
+
from openbb_core.app.static.container import Container
|
| 8 |
+
from openbb_core.app.static.utils.decorators import exception_handler, validate
|
| 9 |
+
from openbb_core.app.static.utils.filters import filter_inputs
|
| 10 |
+
from typing_extensions import Annotated
|
| 11 |
+
|
| 12 |
+
|
| 13 |
+
class ROUTER_equity_shorts(Container):
|
| 14 |
+
"""/equity/shorts
|
| 15 |
+
fails_to_deliver
|
| 16 |
+
"""
|
| 17 |
+
|
| 18 |
+
def __repr__(self) -> str:
|
| 19 |
+
return self.__doc__ or ""
|
| 20 |
+
|
| 21 |
+
@exception_handler
|
| 22 |
+
@validate
|
| 23 |
+
def fails_to_deliver(
|
| 24 |
+
self,
|
| 25 |
+
symbol: Annotated[str, OpenBBField(description="Symbol to get data for.")],
|
| 26 |
+
provider: Annotated[
|
| 27 |
+
Optional[Literal["sec"]],
|
| 28 |
+
OpenBBField(
|
| 29 |
+
description="The provider to use, by default None. If None, the priority list configured in the settings is used. Default priority: sec."
|
| 30 |
+
),
|
| 31 |
+
] = None,
|
| 32 |
+
**kwargs
|
| 33 |
+
) -> OBBject:
|
| 34 |
+
"""Get reported Fail-to-deliver (FTD) data.
|
| 35 |
+
|
| 36 |
+
Parameters
|
| 37 |
+
----------
|
| 38 |
+
provider : str
|
| 39 |
+
The provider to use, by default None. If None, the priority list configured in the settings is used. Default priority: sec.
|
| 40 |
+
symbol : str
|
| 41 |
+
Symbol to get data for.
|
| 42 |
+
limit : Optional[int]
|
| 43 |
+
|
| 44 |
+
Limit the number of reports to parse, from most recent.
|
| 45 |
+
Approximately 24 reports per year, going back to 2009.
|
| 46 |
+
(provider: sec)
|
| 47 |
+
skip_reports : Optional[int]
|
| 48 |
+
|
| 49 |
+
Skip N number of reports from current. A value of 1 will skip the most recent report.
|
| 50 |
+
(provider: sec)
|
| 51 |
+
use_cache : Optional[bool]
|
| 52 |
+
Whether or not to use cache for the request, default is True. Each reporting period is a separate URL, new reports will be added to the cache. (provider: sec)
|
| 53 |
+
|
| 54 |
+
Returns
|
| 55 |
+
-------
|
| 56 |
+
OBBject
|
| 57 |
+
results : list[EquityFTD]
|
| 58 |
+
Serializable results.
|
| 59 |
+
provider : Optional[str]
|
| 60 |
+
Provider name.
|
| 61 |
+
warnings : Optional[list[Warning_]]
|
| 62 |
+
list of warnings.
|
| 63 |
+
chart : Optional[Chart]
|
| 64 |
+
Chart object.
|
| 65 |
+
extra : Dict[str, Any]
|
| 66 |
+
Extra info.
|
| 67 |
+
|
| 68 |
+
EquityFTD
|
| 69 |
+
---------
|
| 70 |
+
settlement_date : Optional[date]
|
| 71 |
+
The settlement date of the fail.
|
| 72 |
+
symbol : Optional[str]
|
| 73 |
+
Symbol representing the entity requested in the data.
|
| 74 |
+
cusip : Optional[str]
|
| 75 |
+
CUSIP of the Security.
|
| 76 |
+
quantity : Optional[int]
|
| 77 |
+
The number of fails on that settlement date.
|
| 78 |
+
price : Optional[float]
|
| 79 |
+
The price at the previous closing price from the settlement date.
|
| 80 |
+
description : Optional[str]
|
| 81 |
+
The description of the Security.
|
| 82 |
+
|
| 83 |
+
Examples
|
| 84 |
+
--------
|
| 85 |
+
>>> from openbb import obb
|
| 86 |
+
>>> obb.equity.shorts.fails_to_deliver(symbol='AAPL', provider='sec')
|
| 87 |
+
""" # noqa: E501
|
| 88 |
+
|
| 89 |
+
return self._run(
|
| 90 |
+
"/equity/shorts/fails_to_deliver",
|
| 91 |
+
**filter_inputs(
|
| 92 |
+
provider_choices={
|
| 93 |
+
"provider": self._get_provider(
|
| 94 |
+
provider,
|
| 95 |
+
"equity.shorts.fails_to_deliver",
|
| 96 |
+
("sec",),
|
| 97 |
+
)
|
| 98 |
+
},
|
| 99 |
+
standard_params={
|
| 100 |
+
"symbol": symbol,
|
| 101 |
+
},
|
| 102 |
+
extra_params=kwargs,
|
| 103 |
+
)
|
| 104 |
+
)
|
openbb_platform/openbb/package/etf.py
ADDED
|
@@ -0,0 +1,1461 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
### THIS FILE IS AUTO-GENERATED. DO NOT EDIT. ###
|
| 2 |
+
|
| 3 |
+
import datetime
|
| 4 |
+
from typing import Literal, Optional, Union
|
| 5 |
+
|
| 6 |
+
from openbb_core.app.model.field import OpenBBField
|
| 7 |
+
from openbb_core.app.model.obbject import OBBject
|
| 8 |
+
from openbb_core.app.static.container import Container
|
| 9 |
+
from openbb_core.app.static.utils.decorators import exception_handler, validate
|
| 10 |
+
from openbb_core.app.static.utils.filters import filter_inputs
|
| 11 |
+
from typing_extensions import Annotated
|
| 12 |
+
|
| 13 |
+
|
| 14 |
+
class ROUTER_etf(Container):
|
| 15 |
+
"""/etf
|
| 16 |
+
countries
|
| 17 |
+
equity_exposure
|
| 18 |
+
historical
|
| 19 |
+
holdings
|
| 20 |
+
holdings_date
|
| 21 |
+
info
|
| 22 |
+
price_performance
|
| 23 |
+
search
|
| 24 |
+
sectors
|
| 25 |
+
"""
|
| 26 |
+
|
| 27 |
+
def __repr__(self) -> str:
|
| 28 |
+
return self.__doc__ or ""
|
| 29 |
+
|
| 30 |
+
@exception_handler
|
| 31 |
+
@validate
|
| 32 |
+
def countries(
|
| 33 |
+
self,
|
| 34 |
+
symbol: Annotated[
|
| 35 |
+
Union[str, list[str]],
|
| 36 |
+
OpenBBField(
|
| 37 |
+
description="Symbol to get data for. (ETF) Multiple comma separated items allowed for provider(s): fmp."
|
| 38 |
+
),
|
| 39 |
+
],
|
| 40 |
+
provider: Annotated[
|
| 41 |
+
Optional[Literal["fmp"]],
|
| 42 |
+
OpenBBField(
|
| 43 |
+
description="The provider to use, by default None. If None, the priority list configured in the settings is used. Default priority: fmp."
|
| 44 |
+
),
|
| 45 |
+
] = None,
|
| 46 |
+
**kwargs
|
| 47 |
+
) -> OBBject:
|
| 48 |
+
"""ETF Country weighting.
|
| 49 |
+
|
| 50 |
+
Parameters
|
| 51 |
+
----------
|
| 52 |
+
provider : str
|
| 53 |
+
The provider to use, by default None. If None, the priority list configured in the settings is used. Default priority: fmp.
|
| 54 |
+
symbol : Union[str, list[str]]
|
| 55 |
+
Symbol to get data for. (ETF) Multiple comma separated items allowed for provider(s): fmp.
|
| 56 |
+
|
| 57 |
+
Returns
|
| 58 |
+
-------
|
| 59 |
+
OBBject
|
| 60 |
+
results : list[EtfCountries]
|
| 61 |
+
Serializable results.
|
| 62 |
+
provider : Optional[str]
|
| 63 |
+
Provider name.
|
| 64 |
+
warnings : Optional[list[Warning_]]
|
| 65 |
+
list of warnings.
|
| 66 |
+
chart : Optional[Chart]
|
| 67 |
+
Chart object.
|
| 68 |
+
extra : Dict[str, Any]
|
| 69 |
+
Extra info.
|
| 70 |
+
|
| 71 |
+
EtfCountries
|
| 72 |
+
------------
|
| 73 |
+
country : str
|
| 74 |
+
The country of the exposure. Corresponding values are normalized percentage points.
|
| 75 |
+
|
| 76 |
+
Examples
|
| 77 |
+
--------
|
| 78 |
+
>>> from openbb import obb
|
| 79 |
+
>>> obb.etf.countries(symbol='VT', provider='fmp')
|
| 80 |
+
""" # noqa: E501
|
| 81 |
+
|
| 82 |
+
return self._run(
|
| 83 |
+
"/etf/countries",
|
| 84 |
+
**filter_inputs(
|
| 85 |
+
provider_choices={
|
| 86 |
+
"provider": self._get_provider(
|
| 87 |
+
provider,
|
| 88 |
+
"etf.countries",
|
| 89 |
+
("fmp",),
|
| 90 |
+
)
|
| 91 |
+
},
|
| 92 |
+
standard_params={
|
| 93 |
+
"symbol": symbol,
|
| 94 |
+
},
|
| 95 |
+
extra_params=kwargs,
|
| 96 |
+
info={
|
| 97 |
+
"symbol": {"fmp": {"multiple_items_allowed": True, "choices": None}}
|
| 98 |
+
},
|
| 99 |
+
)
|
| 100 |
+
)
|
| 101 |
+
|
| 102 |
+
@exception_handler
|
| 103 |
+
@validate
|
| 104 |
+
def equity_exposure(
|
| 105 |
+
self,
|
| 106 |
+
symbol: Annotated[
|
| 107 |
+
Union[str, list[str]],
|
| 108 |
+
OpenBBField(
|
| 109 |
+
description="Symbol to get data for. (Stock) Multiple comma separated items allowed for provider(s): fmp."
|
| 110 |
+
),
|
| 111 |
+
],
|
| 112 |
+
provider: Annotated[
|
| 113 |
+
Optional[Literal["fmp"]],
|
| 114 |
+
OpenBBField(
|
| 115 |
+
description="The provider to use, by default None. If None, the priority list configured in the settings is used. Default priority: fmp."
|
| 116 |
+
),
|
| 117 |
+
] = None,
|
| 118 |
+
**kwargs
|
| 119 |
+
) -> OBBject:
|
| 120 |
+
"""Get the exposure to ETFs for a specific stock.
|
| 121 |
+
|
| 122 |
+
Parameters
|
| 123 |
+
----------
|
| 124 |
+
provider : str
|
| 125 |
+
The provider to use, by default None. If None, the priority list configured in the settings is used. Default priority: fmp.
|
| 126 |
+
symbol : Union[str, list[str]]
|
| 127 |
+
Symbol to get data for. (Stock) Multiple comma separated items allowed for provider(s): fmp.
|
| 128 |
+
|
| 129 |
+
Returns
|
| 130 |
+
-------
|
| 131 |
+
OBBject
|
| 132 |
+
results : list[EtfEquityExposure]
|
| 133 |
+
Serializable results.
|
| 134 |
+
provider : Optional[str]
|
| 135 |
+
Provider name.
|
| 136 |
+
warnings : Optional[list[Warning_]]
|
| 137 |
+
list of warnings.
|
| 138 |
+
chart : Optional[Chart]
|
| 139 |
+
Chart object.
|
| 140 |
+
extra : Dict[str, Any]
|
| 141 |
+
Extra info.
|
| 142 |
+
|
| 143 |
+
EtfEquityExposure
|
| 144 |
+
-----------------
|
| 145 |
+
equity_symbol : str
|
| 146 |
+
The symbol of the equity requested.
|
| 147 |
+
etf_symbol : str
|
| 148 |
+
The symbol of the ETF with exposure to the requested equity.
|
| 149 |
+
shares : Optional[float]
|
| 150 |
+
The number of shares held in the ETF.
|
| 151 |
+
weight : Optional[float]
|
| 152 |
+
The weight of the equity in the ETF, as a normalized percent.
|
| 153 |
+
market_value : Optional[Union[int, float]]
|
| 154 |
+
The market value of the equity position in the ETF.
|
| 155 |
+
|
| 156 |
+
Examples
|
| 157 |
+
--------
|
| 158 |
+
>>> from openbb import obb
|
| 159 |
+
>>> obb.etf.equity_exposure(symbol='MSFT', provider='fmp')
|
| 160 |
+
>>> # This function accepts multiple tickers.
|
| 161 |
+
>>> obb.etf.equity_exposure(symbol='MSFT,AAPL', provider='fmp')
|
| 162 |
+
""" # noqa: E501
|
| 163 |
+
|
| 164 |
+
return self._run(
|
| 165 |
+
"/etf/equity_exposure",
|
| 166 |
+
**filter_inputs(
|
| 167 |
+
provider_choices={
|
| 168 |
+
"provider": self._get_provider(
|
| 169 |
+
provider,
|
| 170 |
+
"etf.equity_exposure",
|
| 171 |
+
("fmp",),
|
| 172 |
+
)
|
| 173 |
+
},
|
| 174 |
+
standard_params={
|
| 175 |
+
"symbol": symbol,
|
| 176 |
+
},
|
| 177 |
+
extra_params=kwargs,
|
| 178 |
+
info={
|
| 179 |
+
"symbol": {"fmp": {"multiple_items_allowed": True, "choices": None}}
|
| 180 |
+
},
|
| 181 |
+
)
|
| 182 |
+
)
|
| 183 |
+
|
| 184 |
+
@exception_handler
|
| 185 |
+
@validate
|
| 186 |
+
def historical(
|
| 187 |
+
self,
|
| 188 |
+
symbol: Annotated[
|
| 189 |
+
Union[str, list[str]],
|
| 190 |
+
OpenBBField(
|
| 191 |
+
description="Symbol to get data for. Multiple comma separated items allowed for provider(s): fmp, polygon, tiingo, yfinance."
|
| 192 |
+
),
|
| 193 |
+
],
|
| 194 |
+
start_date: Annotated[
|
| 195 |
+
Union[datetime.date, None, str],
|
| 196 |
+
OpenBBField(description="Start date of the data, in YYYY-MM-DD format."),
|
| 197 |
+
] = None,
|
| 198 |
+
end_date: Annotated[
|
| 199 |
+
Union[datetime.date, None, str],
|
| 200 |
+
OpenBBField(description="End date of the data, in YYYY-MM-DD format."),
|
| 201 |
+
] = None,
|
| 202 |
+
provider: Annotated[
|
| 203 |
+
Optional[Literal["fmp", "intrinio", "polygon", "tiingo", "yfinance"]],
|
| 204 |
+
OpenBBField(
|
| 205 |
+
description="The provider to use, by default None. If None, the priority list configured in the settings is used. Default priority: fmp, intrinio, polygon, tiingo, yfinance."
|
| 206 |
+
),
|
| 207 |
+
] = None,
|
| 208 |
+
**kwargs
|
| 209 |
+
) -> OBBject:
|
| 210 |
+
"""ETF Historical Market Price.
|
| 211 |
+
|
| 212 |
+
Parameters
|
| 213 |
+
----------
|
| 214 |
+
provider : str
|
| 215 |
+
The provider to use, by default None. If None, the priority list configured in the settings is used. Default priority: fmp, intrinio, polygon, tiingo, yfinance.
|
| 216 |
+
symbol : Union[str, list[str]]
|
| 217 |
+
Symbol to get data for. Multiple comma separated items allowed for provider(s): fmp, polygon, tiingo, yfinance.
|
| 218 |
+
start_date : Union[date, None, str]
|
| 219 |
+
Start date of the data, in YYYY-MM-DD format.
|
| 220 |
+
end_date : Union[date, None, str]
|
| 221 |
+
End date of the data, in YYYY-MM-DD format.
|
| 222 |
+
interval : str
|
| 223 |
+
Time interval of the data to return. (provider: fmp, intrinio, polygon, tiingo, yfinance)
|
| 224 |
+
Choices for fmp: '1m', '5m', '15m', '30m', '1h', '4h', '1d'
|
| 225 |
+
Choices for intrinio: '1m', '5m', '10m', '15m', '30m', '60m', '1h', '1d', '1W', '1M', '1Q', '1Y'
|
| 226 |
+
Choices for yfinance: '1m', '2m', '5m', '15m', '30m', '60m', '90m', '1h', '1d', '5d', '1W', '1M', '1Q'
|
| 227 |
+
start_time : Optional[datetime.time]
|
| 228 |
+
Return intervals starting at the specified time on the `start_date` formatted as 'HH:MM:SS'. (provider: intrinio)
|
| 229 |
+
end_time : Optional[datetime.time]
|
| 230 |
+
Return intervals stopping at the specified time on the `end_date` formatted as 'HH:MM:SS'. (provider: intrinio)
|
| 231 |
+
timezone : Optional[str]
|
| 232 |
+
Timezone of the data, in the IANA format (Continent/City). (provider: intrinio)
|
| 233 |
+
source : Literal['realtime', 'delayed', 'nasdaq_basic']
|
| 234 |
+
The source of the data. (provider: intrinio)
|
| 235 |
+
adjustment : str
|
| 236 |
+
The adjustment factor to apply. Default is splits only. (provider: polygon, yfinance)
|
| 237 |
+
Choices for polygon: 'splits_only', 'unadjusted'
|
| 238 |
+
Choices for yfinance: 'splits_only', 'splits_and_dividends'
|
| 239 |
+
extended_hours : bool
|
| 240 |
+
Include Pre and Post market data. (provider: polygon, yfinance)
|
| 241 |
+
sort : Literal['asc', 'desc']
|
| 242 |
+
Sort order of the data. This impacts the results in combination with the 'limit' parameter. The results are always returned in ascending order by date. (provider: polygon)
|
| 243 |
+
limit : int
|
| 244 |
+
The number of data entries to return. (provider: polygon)
|
| 245 |
+
include_actions : bool
|
| 246 |
+
Include dividends and stock splits in results. (provider: yfinance)
|
| 247 |
+
|
| 248 |
+
Returns
|
| 249 |
+
-------
|
| 250 |
+
OBBject
|
| 251 |
+
results : list[EtfHistorical]
|
| 252 |
+
Serializable results.
|
| 253 |
+
provider : Optional[str]
|
| 254 |
+
Provider name.
|
| 255 |
+
warnings : Optional[list[Warning_]]
|
| 256 |
+
list of warnings.
|
| 257 |
+
chart : Optional[Chart]
|
| 258 |
+
Chart object.
|
| 259 |
+
extra : Dict[str, Any]
|
| 260 |
+
Extra info.
|
| 261 |
+
|
| 262 |
+
EtfHistorical
|
| 263 |
+
-------------
|
| 264 |
+
date : Union[date, datetime]
|
| 265 |
+
The date of the data.
|
| 266 |
+
open : float
|
| 267 |
+
The open price.
|
| 268 |
+
high : float
|
| 269 |
+
The high price.
|
| 270 |
+
low : float
|
| 271 |
+
The low price.
|
| 272 |
+
close : float
|
| 273 |
+
The close price.
|
| 274 |
+
volume : Optional[Union[int, float]]
|
| 275 |
+
The trading volume.
|
| 276 |
+
vwap : Optional[float]
|
| 277 |
+
Volume Weighted Average Price over the period.
|
| 278 |
+
adj_close : Optional[float]
|
| 279 |
+
The adjusted close price. (provider: fmp, intrinio, tiingo)
|
| 280 |
+
unadjusted_volume : Optional[float]
|
| 281 |
+
Unadjusted volume of the symbol. (provider: fmp)
|
| 282 |
+
change : Optional[float]
|
| 283 |
+
Change in the price from the previous close. (provider: fmp);
|
| 284 |
+
Change in the price of the symbol from the previous day. (provider: intrinio)
|
| 285 |
+
change_percent : Optional[float]
|
| 286 |
+
Change in the price from the previous close, as a normalized percent. (provider: fmp);
|
| 287 |
+
Percent change in the price of the symbol from the previous day. (provider: intrinio)
|
| 288 |
+
average : Optional[float]
|
| 289 |
+
Average trade price of an individual equity during the interval. (provider: intrinio)
|
| 290 |
+
adj_open : Optional[float]
|
| 291 |
+
The adjusted open price. (provider: intrinio, tiingo)
|
| 292 |
+
adj_high : Optional[float]
|
| 293 |
+
The adjusted high price. (provider: intrinio, tiingo)
|
| 294 |
+
adj_low : Optional[float]
|
| 295 |
+
The adjusted low price. (provider: intrinio, tiingo)
|
| 296 |
+
adj_volume : Optional[float]
|
| 297 |
+
The adjusted volume. (provider: intrinio, tiingo)
|
| 298 |
+
fifty_two_week_high : Optional[float]
|
| 299 |
+
52 week high price for the symbol. (provider: intrinio)
|
| 300 |
+
fifty_two_week_low : Optional[float]
|
| 301 |
+
52 week low price for the symbol. (provider: intrinio)
|
| 302 |
+
factor : Optional[float]
|
| 303 |
+
factor by which to multiply equity prices before this date, in order to calculate historically-adjusted equity prices. (provider: intrinio)
|
| 304 |
+
split_ratio : Optional[float]
|
| 305 |
+
Ratio of the equity split, if a split occurred. (provider: intrinio, tiingo, yfinance)
|
| 306 |
+
dividend : Optional[float]
|
| 307 |
+
Dividend amount, if a dividend was paid. (provider: intrinio, tiingo, yfinance)
|
| 308 |
+
close_time : Optional[datetime]
|
| 309 |
+
The timestamp that represents the end of the interval span. (provider: intrinio)
|
| 310 |
+
interval : Optional[str]
|
| 311 |
+
The data time frequency. (provider: intrinio)
|
| 312 |
+
intra_period : Optional[bool]
|
| 313 |
+
If true, the equity price represents an unfinished period (be it day, week, quarter, month, or year), meaning that the close price is the latest price available, not the official close price for the period (provider: intrinio)
|
| 314 |
+
transactions : Optional[Annotated[int, Gt(gt=0)]]
|
| 315 |
+
Number of transactions for the symbol in the time period. (provider: polygon)
|
| 316 |
+
|
| 317 |
+
Examples
|
| 318 |
+
--------
|
| 319 |
+
>>> from openbb import obb
|
| 320 |
+
>>> obb.etf.historical(symbol='SPY', provider='fmp')
|
| 321 |
+
>>> obb.etf.historical(symbol='SPY', provider='yfinance')
|
| 322 |
+
>>> # This function accepts multiple tickers.
|
| 323 |
+
>>> obb.etf.historical(symbol='SPY,IWM,QQQ,DJIA', provider='yfinance')
|
| 324 |
+
""" # noqa: E501
|
| 325 |
+
|
| 326 |
+
return self._run(
|
| 327 |
+
"/etf/historical",
|
| 328 |
+
**filter_inputs(
|
| 329 |
+
provider_choices={
|
| 330 |
+
"provider": self._get_provider(
|
| 331 |
+
provider,
|
| 332 |
+
"etf.historical",
|
| 333 |
+
("fmp", "intrinio", "polygon", "tiingo", "yfinance"),
|
| 334 |
+
)
|
| 335 |
+
},
|
| 336 |
+
standard_params={
|
| 337 |
+
"symbol": symbol,
|
| 338 |
+
"start_date": start_date,
|
| 339 |
+
"end_date": end_date,
|
| 340 |
+
},
|
| 341 |
+
extra_params=kwargs,
|
| 342 |
+
info={
|
| 343 |
+
"symbol": {
|
| 344 |
+
"fmp": {"multiple_items_allowed": True, "choices": None},
|
| 345 |
+
"polygon": {"multiple_items_allowed": True, "choices": None},
|
| 346 |
+
"tiingo": {"multiple_items_allowed": True, "choices": None},
|
| 347 |
+
"yfinance": {"multiple_items_allowed": True, "choices": None},
|
| 348 |
+
},
|
| 349 |
+
"interval": {
|
| 350 |
+
"fmp": {
|
| 351 |
+
"multiple_items_allowed": False,
|
| 352 |
+
"choices": ["1m", "5m", "15m", "30m", "1h", "4h", "1d"],
|
| 353 |
+
},
|
| 354 |
+
"intrinio": {
|
| 355 |
+
"multiple_items_allowed": False,
|
| 356 |
+
"choices": [
|
| 357 |
+
"1m",
|
| 358 |
+
"5m",
|
| 359 |
+
"10m",
|
| 360 |
+
"15m",
|
| 361 |
+
"30m",
|
| 362 |
+
"60m",
|
| 363 |
+
"1h",
|
| 364 |
+
"1d",
|
| 365 |
+
"1W",
|
| 366 |
+
"1M",
|
| 367 |
+
"1Q",
|
| 368 |
+
"1Y",
|
| 369 |
+
],
|
| 370 |
+
},
|
| 371 |
+
"tiingo": {
|
| 372 |
+
"multiple_items_allowed": False,
|
| 373 |
+
"choices": [
|
| 374 |
+
"1m",
|
| 375 |
+
"5m",
|
| 376 |
+
"15m",
|
| 377 |
+
"30m",
|
| 378 |
+
"90m",
|
| 379 |
+
"1h",
|
| 380 |
+
"2h",
|
| 381 |
+
"4h",
|
| 382 |
+
"1d",
|
| 383 |
+
"1W",
|
| 384 |
+
"1M",
|
| 385 |
+
"1Y",
|
| 386 |
+
],
|
| 387 |
+
},
|
| 388 |
+
"yfinance": {
|
| 389 |
+
"multiple_items_allowed": False,
|
| 390 |
+
"choices": [
|
| 391 |
+
"1m",
|
| 392 |
+
"2m",
|
| 393 |
+
"5m",
|
| 394 |
+
"15m",
|
| 395 |
+
"30m",
|
| 396 |
+
"60m",
|
| 397 |
+
"90m",
|
| 398 |
+
"1h",
|
| 399 |
+
"1d",
|
| 400 |
+
"5d",
|
| 401 |
+
"1W",
|
| 402 |
+
"1M",
|
| 403 |
+
"1Q",
|
| 404 |
+
],
|
| 405 |
+
},
|
| 406 |
+
},
|
| 407 |
+
},
|
| 408 |
+
)
|
| 409 |
+
)
|
| 410 |
+
|
| 411 |
+
@exception_handler
|
| 412 |
+
@validate
|
| 413 |
+
def holdings(
|
| 414 |
+
self,
|
| 415 |
+
symbol: Annotated[
|
| 416 |
+
str, OpenBBField(description="Symbol to get data for. (ETF)")
|
| 417 |
+
],
|
| 418 |
+
provider: Annotated[
|
| 419 |
+
Optional[Literal["fmp", "intrinio", "sec"]],
|
| 420 |
+
OpenBBField(
|
| 421 |
+
description="The provider to use, by default None. If None, the priority list configured in the settings is used. Default priority: fmp, intrinio, sec."
|
| 422 |
+
),
|
| 423 |
+
] = None,
|
| 424 |
+
**kwargs
|
| 425 |
+
) -> OBBject:
|
| 426 |
+
"""Get the holdings for an individual ETF.
|
| 427 |
+
|
| 428 |
+
Parameters
|
| 429 |
+
----------
|
| 430 |
+
provider : str
|
| 431 |
+
The provider to use, by default None. If None, the priority list configured in the settings is used. Default priority: fmp, intrinio, sec.
|
| 432 |
+
symbol : str
|
| 433 |
+
Symbol to get data for. (ETF)
|
| 434 |
+
date : Union[date, str, None]
|
| 435 |
+
A specific date to get data for. Entering a date will attempt to return the NPORT-P filing for the entered date. This needs to be _exactly_ the date of the filing. Use the holdings_date command/endpoint to find available filing dates for the ETF. (provider: fmp);
|
| 436 |
+
The date represents the period ending. The date entered will return the closest filing. (provider: sec)
|
| 437 |
+
cik : Optional[str]
|
| 438 |
+
The CIK of the filing entity. Overrides symbol. (provider: fmp)
|
| 439 |
+
use_cache : bool
|
| 440 |
+
Whether or not to use cache for the request. (provider: sec)
|
| 441 |
+
|
| 442 |
+
Returns
|
| 443 |
+
-------
|
| 444 |
+
OBBject
|
| 445 |
+
results : list[EtfHoldings]
|
| 446 |
+
Serializable results.
|
| 447 |
+
provider : Optional[str]
|
| 448 |
+
Provider name.
|
| 449 |
+
warnings : Optional[list[Warning_]]
|
| 450 |
+
list of warnings.
|
| 451 |
+
chart : Optional[Chart]
|
| 452 |
+
Chart object.
|
| 453 |
+
extra : Dict[str, Any]
|
| 454 |
+
Extra info.
|
| 455 |
+
|
| 456 |
+
EtfHoldings
|
| 457 |
+
-----------
|
| 458 |
+
symbol : Optional[str]
|
| 459 |
+
Symbol representing the entity requested in the data. (ETF)
|
| 460 |
+
name : Optional[str]
|
| 461 |
+
Name of the ETF holding.
|
| 462 |
+
lei : Optional[str]
|
| 463 |
+
The LEI of the holding. (provider: fmp, sec)
|
| 464 |
+
title : Optional[str]
|
| 465 |
+
The title of the holding. (provider: fmp)
|
| 466 |
+
cusip : Optional[str]
|
| 467 |
+
The CUSIP of the holding. (provider: fmp, sec)
|
| 468 |
+
isin : Optional[str]
|
| 469 |
+
The ISIN of the holding. (provider: fmp, intrinio, sec)
|
| 470 |
+
balance : Optional[int]
|
| 471 |
+
The balance of the holding, in shares or units. (provider: fmp);
|
| 472 |
+
The number of units of the security held, if available. (provider: intrinio);
|
| 473 |
+
The balance of the holding. (provider: sec)
|
| 474 |
+
units : Optional[Union[str, float]]
|
| 475 |
+
The type of units. (provider: fmp);
|
| 476 |
+
The units of the holding. (provider: sec)
|
| 477 |
+
currency : Optional[str]
|
| 478 |
+
The currency of the holding. (provider: fmp, sec)
|
| 479 |
+
value : Optional[float]
|
| 480 |
+
The value of the holding, in dollars. (provider: fmp, intrinio, sec)
|
| 481 |
+
weight : Optional[float]
|
| 482 |
+
The weight of the holding, as a normalized percent. (provider: fmp, intrinio);
|
| 483 |
+
The weight of the holding in ETF in %. (provider: sec)
|
| 484 |
+
payoff_profile : Optional[str]
|
| 485 |
+
The payoff profile of the holding. (provider: fmp, sec)
|
| 486 |
+
asset_category : Optional[str]
|
| 487 |
+
The asset category of the holding. (provider: fmp, sec)
|
| 488 |
+
issuer_category : Optional[str]
|
| 489 |
+
The issuer category of the holding. (provider: fmp, sec)
|
| 490 |
+
country : Optional[str]
|
| 491 |
+
The country of the holding. (provider: fmp, intrinio, sec)
|
| 492 |
+
is_restricted : Optional[str]
|
| 493 |
+
Whether the holding is restricted. (provider: fmp, sec)
|
| 494 |
+
fair_value_level : Optional[int]
|
| 495 |
+
The fair value level of the holding. (provider: fmp, sec)
|
| 496 |
+
is_cash_collateral : Optional[str]
|
| 497 |
+
Whether the holding is cash collateral. (provider: fmp, sec)
|
| 498 |
+
is_non_cash_collateral : Optional[str]
|
| 499 |
+
Whether the holding is non-cash collateral. (provider: fmp, sec)
|
| 500 |
+
is_loan_by_fund : Optional[str]
|
| 501 |
+
Whether the holding is loan by fund. (provider: fmp, sec)
|
| 502 |
+
cik : Optional[str]
|
| 503 |
+
The CIK of the filing. (provider: fmp)
|
| 504 |
+
acceptance_datetime : Optional[str]
|
| 505 |
+
The acceptance datetime of the filing. (provider: fmp)
|
| 506 |
+
updated : Optional[Union[date, datetime]]
|
| 507 |
+
The date the data was updated. (provider: fmp);
|
| 508 |
+
The 'as_of' date for the holding. (provider: intrinio)
|
| 509 |
+
security_type : Optional[str]
|
| 510 |
+
The type of instrument for this holding. Examples(Bond='BOND', Equity='EQUI') (provider: intrinio)
|
| 511 |
+
ric : Optional[str]
|
| 512 |
+
The Reuters Instrument Code. (provider: intrinio)
|
| 513 |
+
sedol : Optional[str]
|
| 514 |
+
The Stock Exchange Daily Official list. (provider: intrinio)
|
| 515 |
+
share_class_figi : Optional[str]
|
| 516 |
+
The OpenFIGI symbol for the holding. (provider: intrinio)
|
| 517 |
+
maturity_date : Optional[date]
|
| 518 |
+
The maturity date for the debt security, if available. (provider: intrinio, sec)
|
| 519 |
+
contract_expiry_date : Optional[date]
|
| 520 |
+
Expiry date for the futures contract held, if available. (provider: intrinio)
|
| 521 |
+
coupon : Optional[float]
|
| 522 |
+
The coupon rate of the debt security, if available. (provider: intrinio)
|
| 523 |
+
unit : Optional[str]
|
| 524 |
+
The units of the 'balance' field. (provider: intrinio)
|
| 525 |
+
units_per_share : Optional[float]
|
| 526 |
+
Number of units of the security held per share outstanding of the ETF, if available. (provider: intrinio)
|
| 527 |
+
face_value : Optional[float]
|
| 528 |
+
The face value of the debt security, if available. (provider: intrinio)
|
| 529 |
+
derivatives_value : Optional[float]
|
| 530 |
+
The notional value of derivatives contracts held. (provider: intrinio)
|
| 531 |
+
other_id : Optional[str]
|
| 532 |
+
Internal identifier for the holding. (provider: sec)
|
| 533 |
+
loan_value : Optional[float]
|
| 534 |
+
The loan value of the holding. (provider: sec)
|
| 535 |
+
issuer_conditional : Optional[str]
|
| 536 |
+
The issuer conditions of the holding. (provider: sec)
|
| 537 |
+
asset_conditional : Optional[str]
|
| 538 |
+
The asset conditions of the holding. (provider: sec)
|
| 539 |
+
coupon_kind : Optional[str]
|
| 540 |
+
The type of coupon for the debt security. (provider: sec)
|
| 541 |
+
rate_type : Optional[str]
|
| 542 |
+
The type of rate for the debt security, floating or fixed. (provider: sec)
|
| 543 |
+
annualized_return : Optional[float]
|
| 544 |
+
The annualized return on the debt security. (provider: sec)
|
| 545 |
+
is_default : Optional[str]
|
| 546 |
+
If the debt security is defaulted. (provider: sec)
|
| 547 |
+
in_arrears : Optional[str]
|
| 548 |
+
If the debt security is in arrears. (provider: sec)
|
| 549 |
+
is_paid_kind : Optional[str]
|
| 550 |
+
If the debt security payments are paid in kind. (provider: sec)
|
| 551 |
+
derivative_category : Optional[str]
|
| 552 |
+
The derivative category of the holding. (provider: sec)
|
| 553 |
+
counterparty : Optional[str]
|
| 554 |
+
The counterparty of the derivative. (provider: sec)
|
| 555 |
+
underlying_name : Optional[str]
|
| 556 |
+
The name of the underlying asset associated with the derivative. (provider: sec)
|
| 557 |
+
option_type : Optional[str]
|
| 558 |
+
The type of option. (provider: sec)
|
| 559 |
+
derivative_payoff : Optional[str]
|
| 560 |
+
The payoff profile of the derivative. (provider: sec)
|
| 561 |
+
expiry_date : Optional[date]
|
| 562 |
+
The expiry or termination date of the derivative. (provider: sec)
|
| 563 |
+
exercise_price : Optional[float]
|
| 564 |
+
The exercise price of the option. (provider: sec)
|
| 565 |
+
exercise_currency : Optional[str]
|
| 566 |
+
The currency of the option exercise price. (provider: sec)
|
| 567 |
+
shares_per_contract : Optional[float]
|
| 568 |
+
The number of shares per contract. (provider: sec)
|
| 569 |
+
delta : Optional[Union[str, float]]
|
| 570 |
+
The delta of the option. (provider: sec)
|
| 571 |
+
rate_type_rec : Optional[str]
|
| 572 |
+
The type of rate for receivable portion of the swap. (provider: sec)
|
| 573 |
+
receive_currency : Optional[str]
|
| 574 |
+
The receive currency of the swap. (provider: sec)
|
| 575 |
+
upfront_receive : Optional[float]
|
| 576 |
+
The upfront amount received of the swap. (provider: sec)
|
| 577 |
+
floating_rate_index_rec : Optional[str]
|
| 578 |
+
The floating rate index for receivable portion of the swap. (provider: sec)
|
| 579 |
+
floating_rate_spread_rec : Optional[float]
|
| 580 |
+
The floating rate spread for reveivable portion of the swap. (provider: sec)
|
| 581 |
+
rate_tenor_rec : Optional[str]
|
| 582 |
+
The rate tenor for receivable portion of the swap. (provider: sec)
|
| 583 |
+
rate_tenor_unit_rec : Optional[Union[int, str]]
|
| 584 |
+
The rate tenor unit for receivable portion of the swap. (provider: sec)
|
| 585 |
+
reset_date_rec : Optional[str]
|
| 586 |
+
The reset date for receivable portion of the swap. (provider: sec)
|
| 587 |
+
reset_date_unit_rec : Optional[Union[int, str]]
|
| 588 |
+
The reset date unit for receivable portion of the swap. (provider: sec)
|
| 589 |
+
rate_type_pmnt : Optional[str]
|
| 590 |
+
The type of rate for payment portion of the swap. (provider: sec)
|
| 591 |
+
payment_currency : Optional[str]
|
| 592 |
+
The payment currency of the swap. (provider: sec)
|
| 593 |
+
upfront_payment : Optional[float]
|
| 594 |
+
The upfront amount received of the swap. (provider: sec)
|
| 595 |
+
floating_rate_index_pmnt : Optional[str]
|
| 596 |
+
The floating rate index for payment portion of the swap. (provider: sec)
|
| 597 |
+
floating_rate_spread_pmnt : Optional[float]
|
| 598 |
+
The floating rate spread for payment portion of the swap. (provider: sec)
|
| 599 |
+
rate_tenor_pmnt : Optional[str]
|
| 600 |
+
The rate tenor for payment portion of the swap. (provider: sec)
|
| 601 |
+
rate_tenor_unit_pmnt : Optional[Union[int, str]]
|
| 602 |
+
The rate tenor unit for payment portion of the swap. (provider: sec)
|
| 603 |
+
reset_date_pmnt : Optional[str]
|
| 604 |
+
The reset date for payment portion of the swap. (provider: sec)
|
| 605 |
+
reset_date_unit_pmnt : Optional[Union[int, str]]
|
| 606 |
+
The reset date unit for payment portion of the swap. (provider: sec)
|
| 607 |
+
repo_type : Optional[str]
|
| 608 |
+
The type of repo. (provider: sec)
|
| 609 |
+
is_cleared : Optional[str]
|
| 610 |
+
If the repo is cleared. (provider: sec)
|
| 611 |
+
is_tri_party : Optional[str]
|
| 612 |
+
If the repo is tri party. (provider: sec)
|
| 613 |
+
principal_amount : Optional[float]
|
| 614 |
+
The principal amount of the repo. (provider: sec)
|
| 615 |
+
principal_currency : Optional[str]
|
| 616 |
+
The currency of the principal amount. (provider: sec)
|
| 617 |
+
collateral_type : Optional[str]
|
| 618 |
+
The collateral type of the repo. (provider: sec)
|
| 619 |
+
collateral_amount : Optional[float]
|
| 620 |
+
The collateral amount of the repo. (provider: sec)
|
| 621 |
+
collateral_currency : Optional[str]
|
| 622 |
+
The currency of the collateral amount. (provider: sec)
|
| 623 |
+
exchange_currency : Optional[str]
|
| 624 |
+
The currency of the exchange rate. (provider: sec)
|
| 625 |
+
exchange_rate : Optional[float]
|
| 626 |
+
The exchange rate. (provider: sec)
|
| 627 |
+
currency_sold : Optional[str]
|
| 628 |
+
The currency sold in a Forward Derivative. (provider: sec)
|
| 629 |
+
currency_amount_sold : Optional[float]
|
| 630 |
+
The amount of currency sold in a Forward Derivative. (provider: sec)
|
| 631 |
+
currency_bought : Optional[str]
|
| 632 |
+
The currency bought in a Forward Derivative. (provider: sec)
|
| 633 |
+
currency_amount_bought : Optional[float]
|
| 634 |
+
The amount of currency bought in a Forward Derivative. (provider: sec)
|
| 635 |
+
notional_amount : Optional[float]
|
| 636 |
+
The notional amount of the derivative. (provider: sec)
|
| 637 |
+
notional_currency : Optional[str]
|
| 638 |
+
The currency of the derivative's notional amount. (provider: sec)
|
| 639 |
+
unrealized_gain : Optional[float]
|
| 640 |
+
The unrealized gain or loss on the derivative. (provider: sec)
|
| 641 |
+
|
| 642 |
+
Examples
|
| 643 |
+
--------
|
| 644 |
+
>>> from openbb import obb
|
| 645 |
+
>>> obb.etf.holdings(symbol='XLK', provider='fmp')
|
| 646 |
+
>>> # Including a date (FMP, SEC) will return the holdings as per NPORT-P filings.
|
| 647 |
+
>>> obb.etf.holdings(symbol='XLK', date='2022-03-31', provider='fmp')
|
| 648 |
+
>>> # The same data can be returned from the SEC directly.
|
| 649 |
+
>>> obb.etf.holdings(symbol='XLK', date='2022-03-31', provider='sec')
|
| 650 |
+
""" # noqa: E501
|
| 651 |
+
|
| 652 |
+
return self._run(
|
| 653 |
+
"/etf/holdings",
|
| 654 |
+
**filter_inputs(
|
| 655 |
+
provider_choices={
|
| 656 |
+
"provider": self._get_provider(
|
| 657 |
+
provider,
|
| 658 |
+
"etf.holdings",
|
| 659 |
+
("fmp", "intrinio", "sec"),
|
| 660 |
+
)
|
| 661 |
+
},
|
| 662 |
+
standard_params={
|
| 663 |
+
"symbol": symbol,
|
| 664 |
+
},
|
| 665 |
+
extra_params=kwargs,
|
| 666 |
+
)
|
| 667 |
+
)
|
| 668 |
+
|
| 669 |
+
@exception_handler
|
| 670 |
+
@validate
|
| 671 |
+
def holdings_date(
|
| 672 |
+
self,
|
| 673 |
+
symbol: Annotated[
|
| 674 |
+
str, OpenBBField(description="Symbol to get data for. (ETF)")
|
| 675 |
+
],
|
| 676 |
+
provider: Annotated[
|
| 677 |
+
Optional[Literal["fmp"]],
|
| 678 |
+
OpenBBField(
|
| 679 |
+
description="The provider to use, by default None. If None, the priority list configured in the settings is used. Default priority: fmp."
|
| 680 |
+
),
|
| 681 |
+
] = None,
|
| 682 |
+
**kwargs
|
| 683 |
+
) -> OBBject:
|
| 684 |
+
"""Use this function to get the holdings dates, if available.
|
| 685 |
+
|
| 686 |
+
Parameters
|
| 687 |
+
----------
|
| 688 |
+
provider : str
|
| 689 |
+
The provider to use, by default None. If None, the priority list configured in the settings is used. Default priority: fmp.
|
| 690 |
+
symbol : str
|
| 691 |
+
Symbol to get data for. (ETF)
|
| 692 |
+
cik : Optional[str]
|
| 693 |
+
The CIK of the filing entity. Overrides symbol. (provider: fmp)
|
| 694 |
+
|
| 695 |
+
Returns
|
| 696 |
+
-------
|
| 697 |
+
OBBject
|
| 698 |
+
results : list[EtfHoldingsDate]
|
| 699 |
+
Serializable results.
|
| 700 |
+
provider : Optional[str]
|
| 701 |
+
Provider name.
|
| 702 |
+
warnings : Optional[list[Warning_]]
|
| 703 |
+
list of warnings.
|
| 704 |
+
chart : Optional[Chart]
|
| 705 |
+
Chart object.
|
| 706 |
+
extra : Dict[str, Any]
|
| 707 |
+
Extra info.
|
| 708 |
+
|
| 709 |
+
EtfHoldingsDate
|
| 710 |
+
---------------
|
| 711 |
+
date : date
|
| 712 |
+
The date of the data.
|
| 713 |
+
|
| 714 |
+
Examples
|
| 715 |
+
--------
|
| 716 |
+
>>> from openbb import obb
|
| 717 |
+
>>> obb.etf.holdings_date(symbol='XLK', provider='fmp')
|
| 718 |
+
""" # noqa: E501
|
| 719 |
+
|
| 720 |
+
return self._run(
|
| 721 |
+
"/etf/holdings_date",
|
| 722 |
+
**filter_inputs(
|
| 723 |
+
provider_choices={
|
| 724 |
+
"provider": self._get_provider(
|
| 725 |
+
provider,
|
| 726 |
+
"etf.holdings_date",
|
| 727 |
+
("fmp",),
|
| 728 |
+
)
|
| 729 |
+
},
|
| 730 |
+
standard_params={
|
| 731 |
+
"symbol": symbol,
|
| 732 |
+
},
|
| 733 |
+
extra_params=kwargs,
|
| 734 |
+
)
|
| 735 |
+
)
|
| 736 |
+
|
| 737 |
+
@exception_handler
|
| 738 |
+
@validate
|
| 739 |
+
def info(
|
| 740 |
+
self,
|
| 741 |
+
symbol: Annotated[
|
| 742 |
+
Union[str, list[str]],
|
| 743 |
+
OpenBBField(
|
| 744 |
+
description="Symbol to get data for. (ETF) Multiple comma separated items allowed for provider(s): fmp, intrinio, yfinance."
|
| 745 |
+
),
|
| 746 |
+
],
|
| 747 |
+
provider: Annotated[
|
| 748 |
+
Optional[Literal["fmp", "intrinio", "yfinance"]],
|
| 749 |
+
OpenBBField(
|
| 750 |
+
description="The provider to use, by default None. If None, the priority list configured in the settings is used. Default priority: fmp, intrinio, yfinance."
|
| 751 |
+
),
|
| 752 |
+
] = None,
|
| 753 |
+
**kwargs
|
| 754 |
+
) -> OBBject:
|
| 755 |
+
"""ETF Information Overview.
|
| 756 |
+
|
| 757 |
+
Parameters
|
| 758 |
+
----------
|
| 759 |
+
provider : str
|
| 760 |
+
The provider to use, by default None. If None, the priority list configured in the settings is used. Default priority: fmp, intrinio, yfinance.
|
| 761 |
+
symbol : Union[str, list[str]]
|
| 762 |
+
Symbol to get data for. (ETF) Multiple comma separated items allowed for provider(s): fmp, intrinio, yfinance.
|
| 763 |
+
|
| 764 |
+
Returns
|
| 765 |
+
-------
|
| 766 |
+
OBBject
|
| 767 |
+
results : list[EtfInfo]
|
| 768 |
+
Serializable results.
|
| 769 |
+
provider : Optional[str]
|
| 770 |
+
Provider name.
|
| 771 |
+
warnings : Optional[list[Warning_]]
|
| 772 |
+
list of warnings.
|
| 773 |
+
chart : Optional[Chart]
|
| 774 |
+
Chart object.
|
| 775 |
+
extra : Dict[str, Any]
|
| 776 |
+
Extra info.
|
| 777 |
+
|
| 778 |
+
EtfInfo
|
| 779 |
+
-------
|
| 780 |
+
symbol : str
|
| 781 |
+
Symbol representing the entity requested in the data. (ETF)
|
| 782 |
+
name : Optional[str]
|
| 783 |
+
Name of the ETF.
|
| 784 |
+
description : Optional[str]
|
| 785 |
+
Description of the fund.
|
| 786 |
+
inception_date : Optional[str]
|
| 787 |
+
Inception date of the ETF.
|
| 788 |
+
issuer : Optional[str]
|
| 789 |
+
Company of the ETF. (provider: fmp);
|
| 790 |
+
Issuer of the ETF. (provider: intrinio)
|
| 791 |
+
cusip : Optional[str]
|
| 792 |
+
CUSIP of the ETF. (provider: fmp)
|
| 793 |
+
isin : Optional[str]
|
| 794 |
+
ISIN of the ETF. (provider: fmp);
|
| 795 |
+
International Securities Identification Number (ISIN). (provider: intrinio)
|
| 796 |
+
domicile : Optional[str]
|
| 797 |
+
Domicile of the ETF. (provider: fmp);
|
| 798 |
+
2 letter ISO country code for the country where the ETP is domiciled. (provider: intrinio)
|
| 799 |
+
asset_class : Optional[str]
|
| 800 |
+
Asset class of the ETF. (provider: fmp);
|
| 801 |
+
Captures the underlying nature of the securities in the Exchanged Traded Product (ETP). (provider: intrinio)
|
| 802 |
+
aum : Optional[float]
|
| 803 |
+
Assets under management. (provider: fmp)
|
| 804 |
+
nav : Optional[float]
|
| 805 |
+
Net asset value of the ETF. (provider: fmp)
|
| 806 |
+
nav_currency : Optional[str]
|
| 807 |
+
Currency of the ETF's net asset value. (provider: fmp)
|
| 808 |
+
expense_ratio : Optional[float]
|
| 809 |
+
The expense ratio, as a normalized percent. (provider: fmp)
|
| 810 |
+
holdings_count : Optional[int]
|
| 811 |
+
Number of holdings. (provider: fmp)
|
| 812 |
+
avg_volume : Optional[float]
|
| 813 |
+
Average daily trading volume. (provider: fmp)
|
| 814 |
+
website : Optional[str]
|
| 815 |
+
Website of the issuer. (provider: fmp)
|
| 816 |
+
fund_listing_date : Optional[date]
|
| 817 |
+
The date on which the Exchange Traded Product (ETP) or share class of the ETP is listed on a specific exchange. (provider: intrinio)
|
| 818 |
+
data_change_date : Optional[date]
|
| 819 |
+
The last date on which there was a change in a classifications data field for this ETF. (provider: intrinio)
|
| 820 |
+
etn_maturity_date : Optional[date]
|
| 821 |
+
If the product is an ETN, this field identifies the maturity date for the ETN. (provider: intrinio)
|
| 822 |
+
is_listed : Optional[bool]
|
| 823 |
+
If true, the ETF is still listed on an exchange. (provider: intrinio)
|
| 824 |
+
close_date : Optional[date]
|
| 825 |
+
The date on which the ETF was de-listed if it is no longer listed. (provider: intrinio)
|
| 826 |
+
exchange : Optional[str]
|
| 827 |
+
The exchange Market Identifier Code (MIC). (provider: intrinio);
|
| 828 |
+
The exchange the fund is listed on. (provider: yfinance)
|
| 829 |
+
ric : Optional[str]
|
| 830 |
+
Reuters Instrument Code (RIC). (provider: intrinio)
|
| 831 |
+
sedol : Optional[str]
|
| 832 |
+
Stock Exchange Daily Official list (SEDOL). (provider: intrinio)
|
| 833 |
+
figi_symbol : Optional[str]
|
| 834 |
+
Financial Instrument Global Identifier (FIGI) symbol. (provider: intrinio)
|
| 835 |
+
share_class_figi : Optional[str]
|
| 836 |
+
Financial Instrument Global Identifier (FIGI). (provider: intrinio)
|
| 837 |
+
firstbridge_id : Optional[str]
|
| 838 |
+
The FirstBridge unique identifier for the Exchange Traded Fund (ETF). (provider: intrinio)
|
| 839 |
+
firstbridge_parent_id : Optional[str]
|
| 840 |
+
The FirstBridge unique identifier for the parent Exchange Traded Fund (ETF), if applicable. (provider: intrinio)
|
| 841 |
+
intrinio_id : Optional[str]
|
| 842 |
+
Intrinio unique identifier for the security. (provider: intrinio)
|
| 843 |
+
intraday_nav_symbol : Optional[str]
|
| 844 |
+
Intraday Net Asset Value (NAV) symbol. (provider: intrinio)
|
| 845 |
+
primary_symbol : Optional[str]
|
| 846 |
+
The primary ticker field is used for Exchange Traded Products (ETPs) that have multiple listings and share classes. If an ETP has multiple listings or share classes, the same primary ticker is assigned to all the listings and share classes. (provider: intrinio)
|
| 847 |
+
etp_structure_type : Optional[str]
|
| 848 |
+
Classifies Exchange Traded Products (ETPs) into very broad categories based on its legal structure. (provider: intrinio)
|
| 849 |
+
legal_structure : Optional[str]
|
| 850 |
+
Legal structure of the fund. (provider: intrinio)
|
| 851 |
+
etn_issuing_bank : Optional[str]
|
| 852 |
+
If the product is an Exchange Traded Note (ETN), this field identifies the issuing bank. (provider: intrinio)
|
| 853 |
+
fund_family : Optional[str]
|
| 854 |
+
This field identifies the fund family to which the ETF belongs, as categorized by the ETF Sponsor. (provider: intrinio);
|
| 855 |
+
The fund family. (provider: yfinance)
|
| 856 |
+
investment_style : Optional[str]
|
| 857 |
+
Investment style of the ETF. (provider: intrinio)
|
| 858 |
+
derivatives_based : Optional[str]
|
| 859 |
+
This field is populated if the ETF holds either listed or over-the-counter derivatives in its portfolio. (provider: intrinio)
|
| 860 |
+
income_category : Optional[str]
|
| 861 |
+
Identifies if an Exchange Traded Fund (ETF) falls into a category that is specifically designed to provide a high yield or income (provider: intrinio)
|
| 862 |
+
other_asset_types : Optional[str]
|
| 863 |
+
If 'asset_class' field is classified as 'Other Asset Types' this field captures the specific category of the underlying assets. (provider: intrinio)
|
| 864 |
+
single_category_designation : Optional[str]
|
| 865 |
+
This categorization is created for those users who want every ETF to be 'forced' into a single bucket, so that the assets for all categories will always sum to the total market. (provider: intrinio)
|
| 866 |
+
beta_type : Optional[str]
|
| 867 |
+
This field identifies whether an ETF provides 'Traditional' beta exposure or 'Smart' beta exposure. ETFs that are active (i.e. non-indexed), leveraged / inverse or have a proprietary quant model (i.e. that don't provide indexed exposure to a targeted factor) are classified separately. (provider: intrinio)
|
| 868 |
+
beta_details : Optional[str]
|
| 869 |
+
This field provides further detail within the traditional and smart beta categories. (provider: intrinio)
|
| 870 |
+
market_cap_range : Optional[str]
|
| 871 |
+
Equity ETFs are classified as falling into categories based on the description of their investment strategy in the prospectus. Examples ('Mega Cap', 'Large Cap', 'Mid Cap', etc.) (provider: intrinio)
|
| 872 |
+
market_cap_weighting_type : Optional[str]
|
| 873 |
+
For ETFs that take the value 'Market Cap Weighted' in the 'index_weighting_scheme' field, this field provides detail on the market cap weighting type. (provider: intrinio)
|
| 874 |
+
index_weighting_scheme : Optional[str]
|
| 875 |
+
For ETFs that track an underlying index, this field provides detail on the index weighting type. (provider: intrinio)
|
| 876 |
+
index_linked : Optional[str]
|
| 877 |
+
This field identifies whether an ETF is index linked or active. (provider: intrinio)
|
| 878 |
+
index_name : Optional[str]
|
| 879 |
+
This field identifies the name of the underlying index tracked by the ETF, if applicable. (provider: intrinio)
|
| 880 |
+
index_symbol : Optional[str]
|
| 881 |
+
This field identifies the OpenFIGI ticker for the Index underlying the ETF. (provider: intrinio)
|
| 882 |
+
parent_index : Optional[str]
|
| 883 |
+
This field identifies the name of the parent index, which represents the broader universe from which the index underlying the ETF is created, if applicable. (provider: intrinio)
|
| 884 |
+
index_family : Optional[str]
|
| 885 |
+
This field identifies the index family to which the index underlying the ETF belongs. The index family is represented as categorized by the index provider. (provider: intrinio)
|
| 886 |
+
broader_index_family : Optional[str]
|
| 887 |
+
This field identifies the broader index family to which the index underlying the ETF belongs. The broader index family is represented as categorized by the index provider. (provider: intrinio)
|
| 888 |
+
index_provider : Optional[str]
|
| 889 |
+
This field identifies the Index provider for the index underlying the ETF, if applicable. (provider: intrinio)
|
| 890 |
+
index_provider_code : Optional[str]
|
| 891 |
+
This field provides the First Bridge code for each Index provider, corresponding to the index underlying the ETF if applicable. (provider: intrinio)
|
| 892 |
+
replication_structure : Optional[str]
|
| 893 |
+
The replication structure of the Exchange Traded Product (ETP). (provider: intrinio)
|
| 894 |
+
growth_value_tilt : Optional[str]
|
| 895 |
+
Classifies equity ETFs as either 'Growth' or Value' based on the stated style tilt in the ETF prospectus. Equity ETFs that do not have a stated style tilt are classified as 'Core / Blend'. (provider: intrinio)
|
| 896 |
+
growth_type : Optional[str]
|
| 897 |
+
For ETFs that are classified as 'Growth' in 'growth_value_tilt', this field further identifies those where the stocks in the ETF are both selected and weighted based on their growth (style factor) scores. (provider: intrinio)
|
| 898 |
+
value_type : Optional[str]
|
| 899 |
+
For ETFs that are classified as 'Value' in 'growth_value_tilt', this field further identifies those where the stocks in the ETF are both selected and weighted based on their value (style factor) scores. (provider: intrinio)
|
| 900 |
+
sector : Optional[str]
|
| 901 |
+
For equity ETFs that aim to provide targeted exposure to a sector or industry, this field identifies the Sector that it provides the exposure to. (provider: intrinio)
|
| 902 |
+
industry : Optional[str]
|
| 903 |
+
For equity ETFs that aim to provide targeted exposure to an industry, this field identifies the Industry that it provides the exposure to. (provider: intrinio)
|
| 904 |
+
industry_group : Optional[str]
|
| 905 |
+
For equity ETFs that aim to provide targeted exposure to a sub-industry, this field identifies the sub-Industry that it provides the exposure to. (provider: intrinio)
|
| 906 |
+
cross_sector_theme : Optional[str]
|
| 907 |
+
For equity ETFs that aim to provide targeted exposure to a specific investment theme that cuts across GICS sectors, this field identifies the specific cross-sector theme. Examples ('Agri-business', 'Natural Resources', 'Green Investing', etc.) (provider: intrinio)
|
| 908 |
+
natural_resources_type : Optional[str]
|
| 909 |
+
For ETFs that are classified as 'Natural Resources' in the 'cross_sector_theme' field, this field provides further detail on the type of Natural Resources exposure. (provider: intrinio)
|
| 910 |
+
us_or_excludes_us : Optional[str]
|
| 911 |
+
Takes the value of 'Domestic' for US exposure, 'International' for non-US exposure and 'Global' for exposure that includes all regions including the US. (provider: intrinio)
|
| 912 |
+
developed_emerging : Optional[str]
|
| 913 |
+
This field identifies the stage of development of the markets that the ETF provides exposure to. (provider: intrinio)
|
| 914 |
+
specialized_region : Optional[str]
|
| 915 |
+
This field is populated if the ETF provides targeted exposure to a specific type of geography-based grouping that does not fall into a specific country or continent grouping. Examples ('BRIC', 'Chindia', etc.) (provider: intrinio)
|
| 916 |
+
continent : Optional[str]
|
| 917 |
+
This field is populated if the ETF provides targeted exposure to a specific continent or country within that Continent. (provider: intrinio)
|
| 918 |
+
latin_america_sub_group : Optional[str]
|
| 919 |
+
For ETFs that are classified as 'Latin America' in the 'continent' field, this field provides further detail on the type of regional exposure. (provider: intrinio)
|
| 920 |
+
europe_sub_group : Optional[str]
|
| 921 |
+
For ETFs that are classified as 'Europe' in the 'continent' field, this field provides further detail on the type of regional exposure. (provider: intrinio)
|
| 922 |
+
asia_sub_group : Optional[str]
|
| 923 |
+
For ETFs that are classified as 'Asia' in the 'continent' field, this field provides further detail on the type of regional exposure. (provider: intrinio)
|
| 924 |
+
specific_country : Optional[str]
|
| 925 |
+
This field is populated if the ETF provides targeted exposure to a specific country. (provider: intrinio)
|
| 926 |
+
china_listing_location : Optional[str]
|
| 927 |
+
For ETFs that are classified as 'China' in the 'country' field, this field provides further detail on the type of exposure in the underlying securities. (provider: intrinio)
|
| 928 |
+
us_state : Optional[str]
|
| 929 |
+
Takes the value of a US state if the ETF provides targeted exposure to the municipal bonds or equities of companies. (provider: intrinio)
|
| 930 |
+
real_estate : Optional[str]
|
| 931 |
+
For ETFs that provide targeted real estate exposure, this field is populated if the ETF provides targeted exposure to a specific segment of the real estate market. (provider: intrinio)
|
| 932 |
+
fundamental_weighting_type : Optional[str]
|
| 933 |
+
For ETFs that take the value 'Fundamental Weighted' in the 'index_weighting_scheme' field, this field provides detail on the fundamental weighting methodology. (provider: intrinio)
|
| 934 |
+
dividend_weighting_type : Optional[str]
|
| 935 |
+
For ETFs that take the value 'Dividend Weighted' in the 'index_weighting_scheme' field, this field provides detail on the dividend weighting methodology. (provider: intrinio)
|
| 936 |
+
bond_type : Optional[str]
|
| 937 |
+
For ETFs where 'asset_class_type' is 'Bonds', this field provides detail on the type of bonds held in the ETF. (provider: intrinio)
|
| 938 |
+
government_bond_types : Optional[str]
|
| 939 |
+
For bond ETFs that take the value 'Treasury & Government' in 'bond_type', this field provides detail on the exposure. (provider: intrinio)
|
| 940 |
+
municipal_bond_region : Optional[str]
|
| 941 |
+
For bond ETFs that take the value 'Municipal' in 'bond_type', this field provides additional detail on the geographic exposure. (provider: intrinio)
|
| 942 |
+
municipal_vrdo : Optional[bool]
|
| 943 |
+
For bond ETFs that take the value 'Municipal' in 'bond_type', this field identifies those ETFs that specifically provide exposure to Variable Rate Demand Obligations. (provider: intrinio)
|
| 944 |
+
mortgage_bond_types : Optional[str]
|
| 945 |
+
For bond ETFs that take the value 'Mortgage' in 'bond_type', this field provides additional detail on the type of underlying securities. (provider: intrinio)
|
| 946 |
+
bond_tax_status : Optional[str]
|
| 947 |
+
For all US bond ETFs, this field provides additional detail on the tax treatment of the underlying securities. (provider: intrinio)
|
| 948 |
+
credit_quality : Optional[str]
|
| 949 |
+
For all bond ETFs, this field helps to identify if the ETF provides targeted exposure to securities of a specific credit quality range. (provider: intrinio)
|
| 950 |
+
average_maturity : Optional[str]
|
| 951 |
+
For all bond ETFs, this field helps to identify if the ETF provides targeted exposure to securities of a specific maturity range. (provider: intrinio)
|
| 952 |
+
specific_maturity_year : Optional[int]
|
| 953 |
+
For all bond ETFs that take the value 'Specific Maturity Year' in the 'average_maturity' field, this field specifies the calendar year. (provider: intrinio)
|
| 954 |
+
commodity_types : Optional[str]
|
| 955 |
+
For ETFs where 'asset_class_type' is 'Commodities', this field provides detail on the type of commodities held in the ETF. (provider: intrinio)
|
| 956 |
+
energy_type : Optional[str]
|
| 957 |
+
For ETFs where 'commodity_type' is 'Energy', this field provides detail on the type of energy exposure provided by the ETF. (provider: intrinio)
|
| 958 |
+
agricultural_type : Optional[str]
|
| 959 |
+
For ETFs where 'commodity_type' is 'Agricultural', this field provides detail on the type of agricultural exposure provided by the ETF. (provider: intrinio)
|
| 960 |
+
livestock_type : Optional[str]
|
| 961 |
+
For ETFs where 'commodity_type' is 'Livestock', this field provides detail on the type of livestock exposure provided by the ETF. (provider: intrinio)
|
| 962 |
+
metal_type : Optional[str]
|
| 963 |
+
For ETFs where 'commodity_type' is 'Gold & Metals', this field provides detail on the type of exposure provided by the ETF. (provider: intrinio)
|
| 964 |
+
inverse_leveraged : Optional[str]
|
| 965 |
+
This field is populated if the ETF provides inverse or leveraged exposure. (provider: intrinio)
|
| 966 |
+
target_date_multi_asset_type : Optional[str]
|
| 967 |
+
For ETFs where 'asset_class_type' is 'Target Date / MultiAsset', this field provides detail on the type of commodities held in the ETF. (provider: intrinio)
|
| 968 |
+
currency_pair : Optional[str]
|
| 969 |
+
This field is populated if the ETF's strategy involves providing exposure to the movements of a currency or involves hedging currency exposure. (provider: intrinio)
|
| 970 |
+
social_environmental_type : Optional[str]
|
| 971 |
+
This field is populated if the ETF's strategy involves providing exposure to a specific social or environmental theme. (provider: intrinio)
|
| 972 |
+
clean_energy_type : Optional[str]
|
| 973 |
+
This field is populated if the ETF has a value of 'Clean Energy' in the 'social_environmental_type' field. (provider: intrinio)
|
| 974 |
+
dividend_type : Optional[str]
|
| 975 |
+
This field is populated if the ETF has an intended investment objective of holding dividend-oriented stocks as stated in the prospectus. (provider: intrinio)
|
| 976 |
+
regular_dividend_payor_type : Optional[str]
|
| 977 |
+
This field is populated if the ETF has a value of'Dividend - Regular Payors' in the 'dividend_type' field. (provider: intrinio)
|
| 978 |
+
quant_strategies_type : Optional[str]
|
| 979 |
+
This field is populated if the ETF has either an index-linked or active strategy that is based on a proprietary quantitative strategy. (provider: intrinio)
|
| 980 |
+
other_quant_models : Optional[str]
|
| 981 |
+
For ETFs where 'quant_strategies_type' is 'Other Quant Model', this field provides the name of the specific proprietary quant model used as the underlying strategy for the ETF. (provider: intrinio)
|
| 982 |
+
hedge_fund_type : Optional[str]
|
| 983 |
+
For ETFs where 'other_asset_types' is 'Hedge Fund Replication', this field provides detail on the type of hedge fund replication strategy. (provider: intrinio)
|
| 984 |
+
excludes_financials : Optional[bool]
|
| 985 |
+
For equity ETFs, identifies those ETFs where the underlying fund holdings will not hold financials stocks, based on the funds intended objective. (provider: intrinio)
|
| 986 |
+
excludes_technology : Optional[bool]
|
| 987 |
+
For equity ETFs, identifies those ETFs where the underlying fund holdings will not hold technology stocks, based on the funds intended objective. (provider: intrinio)
|
| 988 |
+
holds_only_nyse_stocks : Optional[bool]
|
| 989 |
+
If true, the ETF is an equity ETF and holds only stocks listed on NYSE. (provider: intrinio)
|
| 990 |
+
holds_only_nasdaq_stocks : Optional[bool]
|
| 991 |
+
If true, the ETF is an equity ETF and holds only stocks listed on Nasdaq. (provider: intrinio)
|
| 992 |
+
holds_mlp : Optional[bool]
|
| 993 |
+
If true, the ETF's investment objective explicitly specifies that it holds MLPs as an intended part of its investment strategy. (provider: intrinio)
|
| 994 |
+
holds_preferred_stock : Optional[bool]
|
| 995 |
+
If true, the ETF's investment objective explicitly specifies that it holds preferred stock as an intended part of its investment strategy. (provider: intrinio)
|
| 996 |
+
holds_closed_end_funds : Optional[bool]
|
| 997 |
+
If true, the ETF's investment objective explicitly specifies that it holds closed end funds as an intended part of its investment strategy. (provider: intrinio)
|
| 998 |
+
holds_adr : Optional[bool]
|
| 999 |
+
If true, he ETF's investment objective explicitly specifies that it holds American Depositary Receipts (ADRs) as an intended part of its investment strategy. (provider: intrinio)
|
| 1000 |
+
laddered : Optional[bool]
|
| 1001 |
+
For bond ETFs, this field identifies those ETFs that specifically hold bonds in a laddered structure, where the bonds are scheduled to mature in an annual, sequential structure. (provider: intrinio)
|
| 1002 |
+
zero_coupon : Optional[bool]
|
| 1003 |
+
For bond ETFs, this field identifies those ETFs that specifically hold zero coupon Treasury Bills. (provider: intrinio)
|
| 1004 |
+
floating_rate : Optional[bool]
|
| 1005 |
+
For bond ETFs, this field identifies those ETFs that specifically hold floating rate bonds. (provider: intrinio)
|
| 1006 |
+
build_america_bonds : Optional[bool]
|
| 1007 |
+
For municipal bond ETFs, this field identifies those ETFs that specifically hold Build America Bonds. (provider: intrinio)
|
| 1008 |
+
dynamic_futures_roll : Optional[bool]
|
| 1009 |
+
If the product holds futures contracts, this field identifies those products where the roll strategy is dynamic (rather than entirely rules based), so as to minimize roll costs. (provider: intrinio)
|
| 1010 |
+
currency_hedged : Optional[bool]
|
| 1011 |
+
This field is populated if the ETF's strategy involves hedging currency exposure. (provider: intrinio)
|
| 1012 |
+
includes_short_exposure : Optional[bool]
|
| 1013 |
+
This field is populated if the ETF has short exposure in any of its holdings e.g. in a long/short or inverse ETF. (provider: intrinio)
|
| 1014 |
+
ucits : Optional[bool]
|
| 1015 |
+
If true, the Exchange Traded Product (ETP) is Undertakings for the Collective Investment in Transferable Securities (UCITS) compliant (provider: intrinio)
|
| 1016 |
+
registered_countries : Optional[str]
|
| 1017 |
+
The list of countries where the ETF is legally registered for sale. This may differ from where the ETF is domiciled or traded, particularly in Europe. (provider: intrinio)
|
| 1018 |
+
issuer_country : Optional[str]
|
| 1019 |
+
2 letter ISO country code for the country where the issuer is located. (provider: intrinio)
|
| 1020 |
+
listing_country : Optional[str]
|
| 1021 |
+
2 letter ISO country code for the country of the primary listing. (provider: intrinio)
|
| 1022 |
+
listing_region : Optional[str]
|
| 1023 |
+
Geographic region in the country of the primary listing falls. (provider: intrinio)
|
| 1024 |
+
bond_currency_denomination : Optional[str]
|
| 1025 |
+
For all bond ETFs, this field provides additional detail on the currency denomination of the underlying securities. (provider: intrinio)
|
| 1026 |
+
base_currency : Optional[str]
|
| 1027 |
+
Base currency in which NAV is reported. (provider: intrinio)
|
| 1028 |
+
listing_currency : Optional[str]
|
| 1029 |
+
listing currency of the Exchange Traded Product (ETP) in which it is traded. Reported using the 3-digit ISO currency code. (provider: intrinio)
|
| 1030 |
+
number_of_holdings : Optional[int]
|
| 1031 |
+
The number of holdings in the ETF. (provider: intrinio)
|
| 1032 |
+
month_end_assets : Optional[float]
|
| 1033 |
+
Net assets in millions of dollars as of the most recent month end. (provider: intrinio)
|
| 1034 |
+
net_expense_ratio : Optional[float]
|
| 1035 |
+
Gross expense net of Fee Waivers, as a percentage of net assets as published by the ETF issuer. (provider: intrinio)
|
| 1036 |
+
etf_portfolio_turnover : Optional[float]
|
| 1037 |
+
The percentage of positions turned over in the last 12 months. (provider: intrinio)
|
| 1038 |
+
fund_type : Optional[str]
|
| 1039 |
+
The legal type of fund. (provider: yfinance)
|
| 1040 |
+
category : Optional[str]
|
| 1041 |
+
The fund category. (provider: yfinance)
|
| 1042 |
+
exchange_timezone : Optional[str]
|
| 1043 |
+
The timezone of the exchange. (provider: yfinance)
|
| 1044 |
+
currency : Optional[str]
|
| 1045 |
+
The currency in which the fund is listed. (provider: yfinance)
|
| 1046 |
+
nav_price : Optional[float]
|
| 1047 |
+
The net asset value per unit of the fund. (provider: yfinance)
|
| 1048 |
+
total_assets : Optional[int]
|
| 1049 |
+
The total value of assets held by the fund. (provider: yfinance)
|
| 1050 |
+
trailing_pe : Optional[float]
|
| 1051 |
+
The trailing twelve month P/E ratio of the fund's assets. (provider: yfinance)
|
| 1052 |
+
dividend_yield : Optional[float]
|
| 1053 |
+
The dividend yield of the fund, as a normalized percent. (provider: yfinance)
|
| 1054 |
+
dividend_rate_ttm : Optional[float]
|
| 1055 |
+
The trailing twelve month annual dividend rate of the fund, in currency units. (provider: yfinance)
|
| 1056 |
+
dividend_yield_ttm : Optional[float]
|
| 1057 |
+
The trailing twelve month annual dividend yield of the fund, as a normalized percent. (provider: yfinance)
|
| 1058 |
+
year_high : Optional[float]
|
| 1059 |
+
The fifty-two week high price. (provider: yfinance)
|
| 1060 |
+
year_low : Optional[float]
|
| 1061 |
+
The fifty-two week low price. (provider: yfinance)
|
| 1062 |
+
ma_50d : Optional[float]
|
| 1063 |
+
50-day moving average price. (provider: yfinance)
|
| 1064 |
+
ma_200d : Optional[float]
|
| 1065 |
+
200-day moving average price. (provider: yfinance)
|
| 1066 |
+
return_ytd : Optional[float]
|
| 1067 |
+
The year-to-date return of the fund, as a normalized percent. (provider: yfinance)
|
| 1068 |
+
return_3y_avg : Optional[float]
|
| 1069 |
+
The three year average return of the fund, as a normalized percent. (provider: yfinance)
|
| 1070 |
+
return_5y_avg : Optional[float]
|
| 1071 |
+
The five year average return of the fund, as a normalized percent. (provider: yfinance)
|
| 1072 |
+
beta_3y_avg : Optional[float]
|
| 1073 |
+
The three year average beta of the fund. (provider: yfinance)
|
| 1074 |
+
volume_avg : Optional[float]
|
| 1075 |
+
The average daily trading volume of the fund. (provider: yfinance)
|
| 1076 |
+
volume_avg_10d : Optional[float]
|
| 1077 |
+
The average daily trading volume of the fund over the past ten days. (provider: yfinance)
|
| 1078 |
+
bid : Optional[float]
|
| 1079 |
+
The current bid price. (provider: yfinance)
|
| 1080 |
+
bid_size : Optional[float]
|
| 1081 |
+
The current bid size. (provider: yfinance)
|
| 1082 |
+
ask : Optional[float]
|
| 1083 |
+
The current ask price. (provider: yfinance)
|
| 1084 |
+
ask_size : Optional[float]
|
| 1085 |
+
The current ask size. (provider: yfinance)
|
| 1086 |
+
open : Optional[float]
|
| 1087 |
+
The open price of the most recent trading session. (provider: yfinance)
|
| 1088 |
+
high : Optional[float]
|
| 1089 |
+
The highest price of the most recent trading session. (provider: yfinance)
|
| 1090 |
+
low : Optional[float]
|
| 1091 |
+
The lowest price of the most recent trading session. (provider: yfinance)
|
| 1092 |
+
volume : Optional[int]
|
| 1093 |
+
The trading volume of the most recent trading session. (provider: yfinance)
|
| 1094 |
+
prev_close : Optional[float]
|
| 1095 |
+
The previous closing price. (provider: yfinance)
|
| 1096 |
+
|
| 1097 |
+
Examples
|
| 1098 |
+
--------
|
| 1099 |
+
>>> from openbb import obb
|
| 1100 |
+
>>> obb.etf.info(symbol='SPY', provider='fmp')
|
| 1101 |
+
>>> # This function accepts multiple tickers.
|
| 1102 |
+
>>> obb.etf.info(symbol='SPY,IWM,QQQ,DJIA', provider='fmp')
|
| 1103 |
+
""" # noqa: E501
|
| 1104 |
+
|
| 1105 |
+
return self._run(
|
| 1106 |
+
"/etf/info",
|
| 1107 |
+
**filter_inputs(
|
| 1108 |
+
provider_choices={
|
| 1109 |
+
"provider": self._get_provider(
|
| 1110 |
+
provider,
|
| 1111 |
+
"etf.info",
|
| 1112 |
+
("fmp", "intrinio", "yfinance"),
|
| 1113 |
+
)
|
| 1114 |
+
},
|
| 1115 |
+
standard_params={
|
| 1116 |
+
"symbol": symbol,
|
| 1117 |
+
},
|
| 1118 |
+
extra_params=kwargs,
|
| 1119 |
+
info={
|
| 1120 |
+
"symbol": {
|
| 1121 |
+
"fmp": {"multiple_items_allowed": True, "choices": None},
|
| 1122 |
+
"intrinio": {"multiple_items_allowed": True, "choices": None},
|
| 1123 |
+
"yfinance": {"multiple_items_allowed": True, "choices": None},
|
| 1124 |
+
}
|
| 1125 |
+
},
|
| 1126 |
+
)
|
| 1127 |
+
)
|
| 1128 |
+
|
| 1129 |
+
@exception_handler
|
| 1130 |
+
@validate
|
| 1131 |
+
def price_performance(
|
| 1132 |
+
self,
|
| 1133 |
+
symbol: Annotated[
|
| 1134 |
+
Union[str, list[str]],
|
| 1135 |
+
OpenBBField(
|
| 1136 |
+
description="Symbol to get data for. Multiple comma separated items allowed for provider(s): fmp, intrinio."
|
| 1137 |
+
),
|
| 1138 |
+
],
|
| 1139 |
+
provider: Annotated[
|
| 1140 |
+
Optional[Literal["fmp", "intrinio"]],
|
| 1141 |
+
OpenBBField(
|
| 1142 |
+
description="The provider to use, by default None. If None, the priority list configured in the settings is used. Default priority: fmp, intrinio."
|
| 1143 |
+
),
|
| 1144 |
+
] = None,
|
| 1145 |
+
**kwargs
|
| 1146 |
+
) -> OBBject:
|
| 1147 |
+
"""Price performance as a return, over different periods.
|
| 1148 |
+
|
| 1149 |
+
Parameters
|
| 1150 |
+
----------
|
| 1151 |
+
provider : str
|
| 1152 |
+
The provider to use, by default None. If None, the priority list configured in the settings is used. Default priority: fmp, intrinio.
|
| 1153 |
+
symbol : Union[str, list[str]]
|
| 1154 |
+
Symbol to get data for. Multiple comma separated items allowed for provider(s): fmp, intrinio.
|
| 1155 |
+
return_type : Literal['trailing', 'calendar']
|
| 1156 |
+
The type of returns to return, a trailing or calendar window. (provider: intrinio)
|
| 1157 |
+
adjustment : Literal['splits_only', 'splits_and_dividends']
|
| 1158 |
+
The adjustment factor, 'splits_only' will return pure price performance. (provider: intrinio)
|
| 1159 |
+
|
| 1160 |
+
Returns
|
| 1161 |
+
-------
|
| 1162 |
+
OBBject
|
| 1163 |
+
results : list[EtfPricePerformance]
|
| 1164 |
+
Serializable results.
|
| 1165 |
+
provider : Optional[str]
|
| 1166 |
+
Provider name.
|
| 1167 |
+
warnings : Optional[list[Warning_]]
|
| 1168 |
+
list of warnings.
|
| 1169 |
+
chart : Optional[Chart]
|
| 1170 |
+
Chart object.
|
| 1171 |
+
extra : Dict[str, Any]
|
| 1172 |
+
Extra info.
|
| 1173 |
+
|
| 1174 |
+
EtfPricePerformance
|
| 1175 |
+
-------------------
|
| 1176 |
+
symbol : Optional[str]
|
| 1177 |
+
Symbol representing the entity requested in the data.
|
| 1178 |
+
one_day : Optional[float]
|
| 1179 |
+
One-day return.
|
| 1180 |
+
wtd : Optional[float]
|
| 1181 |
+
Week to date return.
|
| 1182 |
+
one_week : Optional[float]
|
| 1183 |
+
One-week return.
|
| 1184 |
+
mtd : Optional[float]
|
| 1185 |
+
Month to date return.
|
| 1186 |
+
one_month : Optional[float]
|
| 1187 |
+
One-month return.
|
| 1188 |
+
qtd : Optional[float]
|
| 1189 |
+
Quarter to date return.
|
| 1190 |
+
three_month : Optional[float]
|
| 1191 |
+
Three-month return.
|
| 1192 |
+
six_month : Optional[float]
|
| 1193 |
+
Six-month return.
|
| 1194 |
+
ytd : Optional[float]
|
| 1195 |
+
Year to date return.
|
| 1196 |
+
one_year : Optional[float]
|
| 1197 |
+
One-year return.
|
| 1198 |
+
two_year : Optional[float]
|
| 1199 |
+
Two-year return.
|
| 1200 |
+
three_year : Optional[float]
|
| 1201 |
+
Three-year return.
|
| 1202 |
+
four_year : Optional[float]
|
| 1203 |
+
Four-year
|
| 1204 |
+
five_year : Optional[float]
|
| 1205 |
+
Five-year return.
|
| 1206 |
+
ten_year : Optional[float]
|
| 1207 |
+
Ten-year return.
|
| 1208 |
+
max : Optional[float]
|
| 1209 |
+
Return from the beginning of the time series.
|
| 1210 |
+
max_annualized : Optional[float]
|
| 1211 |
+
Annualized rate of return from inception. (provider: intrinio)
|
| 1212 |
+
volatility_one_year : Optional[float]
|
| 1213 |
+
Trailing one-year annualized volatility. (provider: intrinio)
|
| 1214 |
+
volatility_three_year : Optional[float]
|
| 1215 |
+
Trailing three-year annualized volatility. (provider: intrinio)
|
| 1216 |
+
volatility_five_year : Optional[float]
|
| 1217 |
+
Trailing five-year annualized volatility. (provider: intrinio)
|
| 1218 |
+
volume : Optional[int]
|
| 1219 |
+
The trading volume. (provider: intrinio)
|
| 1220 |
+
volume_avg_30 : Optional[float]
|
| 1221 |
+
The one-month average daily volume. (provider: intrinio)
|
| 1222 |
+
volume_avg_90 : Optional[float]
|
| 1223 |
+
The three-month average daily volume. (provider: intrinio)
|
| 1224 |
+
volume_avg_180 : Optional[float]
|
| 1225 |
+
The six-month average daily volume. (provider: intrinio)
|
| 1226 |
+
beta : Optional[float]
|
| 1227 |
+
Beta compared to the S&P 500. (provider: intrinio)
|
| 1228 |
+
nav : Optional[float]
|
| 1229 |
+
Net asset value per share. (provider: intrinio)
|
| 1230 |
+
year_high : Optional[float]
|
| 1231 |
+
The 52-week high price. (provider: intrinio)
|
| 1232 |
+
year_low : Optional[float]
|
| 1233 |
+
The 52-week low price. (provider: intrinio)
|
| 1234 |
+
market_cap : Optional[float]
|
| 1235 |
+
The market capitalization. (provider: intrinio)
|
| 1236 |
+
shares_outstanding : Optional[int]
|
| 1237 |
+
The number of shares outstanding. (provider: intrinio)
|
| 1238 |
+
updated : Optional[date]
|
| 1239 |
+
The date of the data. (provider: intrinio)
|
| 1240 |
+
|
| 1241 |
+
Examples
|
| 1242 |
+
--------
|
| 1243 |
+
>>> from openbb import obb
|
| 1244 |
+
>>> obb.etf.price_performance(symbol='QQQ', provider='fmp')
|
| 1245 |
+
>>> obb.etf.price_performance(symbol='SPY,QQQ,IWM,DJIA', provider='fmp')
|
| 1246 |
+
""" # noqa: E501
|
| 1247 |
+
|
| 1248 |
+
return self._run(
|
| 1249 |
+
"/etf/price_performance",
|
| 1250 |
+
**filter_inputs(
|
| 1251 |
+
provider_choices={
|
| 1252 |
+
"provider": self._get_provider(
|
| 1253 |
+
provider,
|
| 1254 |
+
"etf.price_performance",
|
| 1255 |
+
("fmp", "intrinio"),
|
| 1256 |
+
)
|
| 1257 |
+
},
|
| 1258 |
+
standard_params={
|
| 1259 |
+
"symbol": symbol,
|
| 1260 |
+
},
|
| 1261 |
+
extra_params=kwargs,
|
| 1262 |
+
info={
|
| 1263 |
+
"symbol": {
|
| 1264 |
+
"fmp": {"multiple_items_allowed": True, "choices": None},
|
| 1265 |
+
"intrinio": {"multiple_items_allowed": True, "choices": None},
|
| 1266 |
+
}
|
| 1267 |
+
},
|
| 1268 |
+
)
|
| 1269 |
+
)
|
| 1270 |
+
|
| 1271 |
+
@exception_handler
|
| 1272 |
+
@validate
|
| 1273 |
+
def search(
|
| 1274 |
+
self,
|
| 1275 |
+
query: Annotated[Optional[str], OpenBBField(description="Search query.")] = "",
|
| 1276 |
+
provider: Annotated[
|
| 1277 |
+
Optional[Literal["fmp", "intrinio"]],
|
| 1278 |
+
OpenBBField(
|
| 1279 |
+
description="The provider to use, by default None. If None, the priority list configured in the settings is used. Default priority: fmp, intrinio."
|
| 1280 |
+
),
|
| 1281 |
+
] = None,
|
| 1282 |
+
**kwargs
|
| 1283 |
+
) -> OBBject:
|
| 1284 |
+
"""Search for ETFs.
|
| 1285 |
+
|
| 1286 |
+
An empty query returns the full list of ETFs from the provider.
|
| 1287 |
+
|
| 1288 |
+
|
| 1289 |
+
Parameters
|
| 1290 |
+
----------
|
| 1291 |
+
provider : str
|
| 1292 |
+
The provider to use, by default None. If None, the priority list configured in the settings is used. Default priority: fmp, intrinio.
|
| 1293 |
+
query : Optional[str]
|
| 1294 |
+
Search query.
|
| 1295 |
+
exchange : str
|
| 1296 |
+
The exchange code the ETF trades on. (provider: fmp)
|
| 1297 |
+
is_active : Optional[Literal[True, False]]
|
| 1298 |
+
Whether the ETF is actively trading. (provider: fmp)
|
| 1299 |
+
|
| 1300 |
+
Returns
|
| 1301 |
+
-------
|
| 1302 |
+
OBBject
|
| 1303 |
+
results : list[EtfSearch]
|
| 1304 |
+
Serializable results.
|
| 1305 |
+
provider : Optional[str]
|
| 1306 |
+
Provider name.
|
| 1307 |
+
warnings : Optional[list[Warning_]]
|
| 1308 |
+
list of warnings.
|
| 1309 |
+
chart : Optional[Chart]
|
| 1310 |
+
Chart object.
|
| 1311 |
+
extra : Dict[str, Any]
|
| 1312 |
+
Extra info.
|
| 1313 |
+
|
| 1314 |
+
EtfSearch
|
| 1315 |
+
---------
|
| 1316 |
+
symbol : str
|
| 1317 |
+
Symbol representing the entity requested in the data.(ETF)
|
| 1318 |
+
name : Optional[str]
|
| 1319 |
+
Name of the ETF.
|
| 1320 |
+
market_cap : Optional[float]
|
| 1321 |
+
The market cap of the ETF. (provider: fmp)
|
| 1322 |
+
sector : Optional[str]
|
| 1323 |
+
The sector of the ETF. (provider: fmp)
|
| 1324 |
+
industry : Optional[str]
|
| 1325 |
+
The industry of the ETF. (provider: fmp)
|
| 1326 |
+
beta : Optional[float]
|
| 1327 |
+
The beta of the ETF. (provider: fmp)
|
| 1328 |
+
price : Optional[float]
|
| 1329 |
+
The current price of the ETF. (provider: fmp)
|
| 1330 |
+
last_annual_dividend : Optional[float]
|
| 1331 |
+
The last annual dividend paid. (provider: fmp)
|
| 1332 |
+
volume : Optional[float]
|
| 1333 |
+
The current trading volume of the ETF. (provider: fmp)
|
| 1334 |
+
exchange : Optional[str]
|
| 1335 |
+
The exchange code the ETF trades on. (provider: fmp);
|
| 1336 |
+
The exchange MIC code. (provider: intrinio)
|
| 1337 |
+
exchange_name : Optional[str]
|
| 1338 |
+
The full name of the exchange the ETF trades on. (provider: fmp)
|
| 1339 |
+
country : Optional[str]
|
| 1340 |
+
The country the ETF is registered in. (provider: fmp)
|
| 1341 |
+
actively_trading : Optional[Literal[True, False]]
|
| 1342 |
+
Whether the ETF is actively trading. (provider: fmp)
|
| 1343 |
+
figi_ticker : Optional[str]
|
| 1344 |
+
The OpenFIGI ticker. (provider: intrinio)
|
| 1345 |
+
ric : Optional[str]
|
| 1346 |
+
The Reuters Instrument Code. (provider: intrinio)
|
| 1347 |
+
isin : Optional[str]
|
| 1348 |
+
The International Securities Identification Number. (provider: intrinio)
|
| 1349 |
+
sedol : Optional[str]
|
| 1350 |
+
The Stock Exchange Daily Official list. (provider: intrinio)
|
| 1351 |
+
intrinio_id : Optional[str]
|
| 1352 |
+
The unique Intrinio ID for the security. (provider: intrinio)
|
| 1353 |
+
|
| 1354 |
+
Examples
|
| 1355 |
+
--------
|
| 1356 |
+
>>> from openbb import obb
|
| 1357 |
+
>>> # An empty query returns the full list of ETFs from the provider.
|
| 1358 |
+
>>> obb.etf.search(provider='fmp')
|
| 1359 |
+
>>> # The query will return results from text-based fields containing the term.
|
| 1360 |
+
>>> obb.etf.search(query='commercial real estate', provider='fmp')
|
| 1361 |
+
""" # noqa: E501
|
| 1362 |
+
|
| 1363 |
+
return self._run(
|
| 1364 |
+
"/etf/search",
|
| 1365 |
+
**filter_inputs(
|
| 1366 |
+
provider_choices={
|
| 1367 |
+
"provider": self._get_provider(
|
| 1368 |
+
provider,
|
| 1369 |
+
"etf.search",
|
| 1370 |
+
("fmp", "intrinio"),
|
| 1371 |
+
)
|
| 1372 |
+
},
|
| 1373 |
+
standard_params={
|
| 1374 |
+
"query": query,
|
| 1375 |
+
},
|
| 1376 |
+
extra_params=kwargs,
|
| 1377 |
+
info={
|
| 1378 |
+
"exchange": {
|
| 1379 |
+
"fmp": {
|
| 1380 |
+
"multiple_items_allowed": False,
|
| 1381 |
+
"choices": [
|
| 1382 |
+
"AMEX",
|
| 1383 |
+
"NYSE",
|
| 1384 |
+
"NASDAQ",
|
| 1385 |
+
"ETF",
|
| 1386 |
+
"TSX",
|
| 1387 |
+
"EURONEXT",
|
| 1388 |
+
],
|
| 1389 |
+
}
|
| 1390 |
+
}
|
| 1391 |
+
},
|
| 1392 |
+
)
|
| 1393 |
+
)
|
| 1394 |
+
|
| 1395 |
+
@exception_handler
|
| 1396 |
+
@validate
|
| 1397 |
+
def sectors(
|
| 1398 |
+
self,
|
| 1399 |
+
symbol: Annotated[
|
| 1400 |
+
str, OpenBBField(description="Symbol to get data for. (ETF)")
|
| 1401 |
+
],
|
| 1402 |
+
provider: Annotated[
|
| 1403 |
+
Optional[Literal["fmp"]],
|
| 1404 |
+
OpenBBField(
|
| 1405 |
+
description="The provider to use, by default None. If None, the priority list configured in the settings is used. Default priority: fmp."
|
| 1406 |
+
),
|
| 1407 |
+
] = None,
|
| 1408 |
+
**kwargs
|
| 1409 |
+
) -> OBBject:
|
| 1410 |
+
"""ETF Sector weighting.
|
| 1411 |
+
|
| 1412 |
+
Parameters
|
| 1413 |
+
----------
|
| 1414 |
+
provider : str
|
| 1415 |
+
The provider to use, by default None. If None, the priority list configured in the settings is used. Default priority: fmp.
|
| 1416 |
+
symbol : str
|
| 1417 |
+
Symbol to get data for. (ETF)
|
| 1418 |
+
|
| 1419 |
+
Returns
|
| 1420 |
+
-------
|
| 1421 |
+
OBBject
|
| 1422 |
+
results : list[EtfSectors]
|
| 1423 |
+
Serializable results.
|
| 1424 |
+
provider : Optional[str]
|
| 1425 |
+
Provider name.
|
| 1426 |
+
warnings : Optional[list[Warning_]]
|
| 1427 |
+
list of warnings.
|
| 1428 |
+
chart : Optional[Chart]
|
| 1429 |
+
Chart object.
|
| 1430 |
+
extra : Dict[str, Any]
|
| 1431 |
+
Extra info.
|
| 1432 |
+
|
| 1433 |
+
EtfSectors
|
| 1434 |
+
----------
|
| 1435 |
+
sector : str
|
| 1436 |
+
Sector of exposure.
|
| 1437 |
+
weight : Optional[float]
|
| 1438 |
+
Exposure of the ETF to the sector in normalized percentage points.
|
| 1439 |
+
|
| 1440 |
+
Examples
|
| 1441 |
+
--------
|
| 1442 |
+
>>> from openbb import obb
|
| 1443 |
+
>>> obb.etf.sectors(symbol='SPY', provider='fmp')
|
| 1444 |
+
""" # noqa: E501
|
| 1445 |
+
|
| 1446 |
+
return self._run(
|
| 1447 |
+
"/etf/sectors",
|
| 1448 |
+
**filter_inputs(
|
| 1449 |
+
provider_choices={
|
| 1450 |
+
"provider": self._get_provider(
|
| 1451 |
+
provider,
|
| 1452 |
+
"etf.sectors",
|
| 1453 |
+
("fmp",),
|
| 1454 |
+
)
|
| 1455 |
+
},
|
| 1456 |
+
standard_params={
|
| 1457 |
+
"symbol": symbol,
|
| 1458 |
+
},
|
| 1459 |
+
extra_params=kwargs,
|
| 1460 |
+
)
|
| 1461 |
+
)
|
openbb_platform/openbb/package/fixedincome.py
ADDED
|
@@ -0,0 +1,566 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|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
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
### THIS FILE IS AUTO-GENERATED. DO NOT EDIT. ###
|
| 2 |
+
|
| 3 |
+
import datetime
|
| 4 |
+
from typing import Literal, Optional, Union
|
| 5 |
+
from warnings import simplefilter, warn
|
| 6 |
+
|
| 7 |
+
from openbb_core.app.deprecation import OpenBBDeprecationWarning
|
| 8 |
+
from openbb_core.app.model.field import OpenBBField
|
| 9 |
+
from openbb_core.app.model.obbject import OBBject
|
| 10 |
+
from openbb_core.app.static.container import Container
|
| 11 |
+
from openbb_core.app.static.utils.decorators import exception_handler, validate
|
| 12 |
+
from openbb_core.app.static.utils.filters import filter_inputs
|
| 13 |
+
from typing_extensions import Annotated, deprecated
|
| 14 |
+
|
| 15 |
+
|
| 16 |
+
class ROUTER_fixedincome(Container):
|
| 17 |
+
"""/fixedincome
|
| 18 |
+
bond_indices
|
| 19 |
+
/corporate
|
| 20 |
+
/government
|
| 21 |
+
mortgage_indices
|
| 22 |
+
/rate
|
| 23 |
+
sofr
|
| 24 |
+
/spreads
|
| 25 |
+
"""
|
| 26 |
+
|
| 27 |
+
def __repr__(self) -> str:
|
| 28 |
+
return self.__doc__ or ""
|
| 29 |
+
|
| 30 |
+
@exception_handler
|
| 31 |
+
@validate
|
| 32 |
+
def bond_indices(
|
| 33 |
+
self,
|
| 34 |
+
start_date: Annotated[
|
| 35 |
+
Union[datetime.date, None, str],
|
| 36 |
+
OpenBBField(description="Start date of the data, in YYYY-MM-DD format."),
|
| 37 |
+
] = None,
|
| 38 |
+
end_date: Annotated[
|
| 39 |
+
Union[datetime.date, None, str],
|
| 40 |
+
OpenBBField(description="End date of the data, in YYYY-MM-DD format."),
|
| 41 |
+
] = None,
|
| 42 |
+
index_type: Annotated[
|
| 43 |
+
Literal["yield", "yield_to_worst", "total_return", "oas"],
|
| 44 |
+
OpenBBField(
|
| 45 |
+
description="The type of series. OAS is the option-adjusted spread. Default is yield."
|
| 46 |
+
),
|
| 47 |
+
] = "yield",
|
| 48 |
+
provider: Annotated[
|
| 49 |
+
Optional[Literal["fred"]],
|
| 50 |
+
OpenBBField(
|
| 51 |
+
description="The provider to use, by default None. If None, the priority list configured in the settings is used. Default priority: fred."
|
| 52 |
+
),
|
| 53 |
+
] = None,
|
| 54 |
+
**kwargs
|
| 55 |
+
) -> OBBject:
|
| 56 |
+
"""Bond Indices.
|
| 57 |
+
|
| 58 |
+
Parameters
|
| 59 |
+
----------
|
| 60 |
+
provider : str
|
| 61 |
+
The provider to use, by default None. If None, the priority list configured in the settings is used. Default priority: fred.
|
| 62 |
+
start_date : Union[date, None, str]
|
| 63 |
+
Start date of the data, in YYYY-MM-DD format.
|
| 64 |
+
end_date : Union[date, None, str]
|
| 65 |
+
End date of the data, in YYYY-MM-DD format.
|
| 66 |
+
index_type : Literal['yield', 'yield_to_worst', 'total_return', 'oas']
|
| 67 |
+
The type of series. OAS is the option-adjusted spread. Default is yield.
|
| 68 |
+
category : Literal['high_yield', 'us', 'emerging_markets']
|
| 69 |
+
The type of index category. Used in conjunction with 'index', default is 'us'. (provider: fred)
|
| 70 |
+
index : str
|
| 71 |
+
The specific index to query. Used in conjunction with 'category' and 'index_type', default is 'yield_curve'.
|
| 72 |
+
Possible values are:
|
| 73 |
+
corporate
|
| 74 |
+
seasoned_corporate
|
| 75 |
+
liquid_corporate
|
| 76 |
+
yield_curve
|
| 77 |
+
crossover
|
| 78 |
+
public_sector
|
| 79 |
+
private_sector
|
| 80 |
+
non_financial
|
| 81 |
+
high_grade
|
| 82 |
+
high_yield
|
| 83 |
+
liquid_emea
|
| 84 |
+
emea
|
| 85 |
+
liquid_asia
|
| 86 |
+
asia
|
| 87 |
+
liquid_latam
|
| 88 |
+
latam
|
| 89 |
+
liquid_aaa
|
| 90 |
+
liquid_bbb
|
| 91 |
+
aaa
|
| 92 |
+
aa
|
| 93 |
+
a
|
| 94 |
+
bbb
|
| 95 |
+
bb
|
| 96 |
+
b
|
| 97 |
+
ccc
|
| 98 |
+
|
| 99 |
+
Multiple comma separated items allowed. (provider: fred)
|
| 100 |
+
frequency : Optional[Literal['a', 'q', 'm', 'w', 'd', 'wef', 'weth', 'wew', 'wetu', 'wem', 'wesu', 'wesa', 'bwew', 'bwem']]
|
| 101 |
+
|
| 102 |
+
Frequency aggregation to convert daily data to lower frequency.
|
| 103 |
+
None = No change
|
| 104 |
+
a = Annual
|
| 105 |
+
q = Quarterly
|
| 106 |
+
m = Monthly
|
| 107 |
+
w = Weekly
|
| 108 |
+
d = Daily
|
| 109 |
+
wef = Weekly, Ending Friday
|
| 110 |
+
weth = Weekly, Ending Thursday
|
| 111 |
+
wew = Weekly, Ending Wednesday
|
| 112 |
+
wetu = Weekly, Ending Tuesday
|
| 113 |
+
wem = Weekly, Ending Monday
|
| 114 |
+
wesu = Weekly, Ending Sunday
|
| 115 |
+
wesa = Weekly, Ending Saturday
|
| 116 |
+
bwew = Biweekly, Ending Wednesday
|
| 117 |
+
bwem = Biweekly, Ending Monday
|
| 118 |
+
(provider: fred)
|
| 119 |
+
aggregation_method : Literal['avg', 'sum', 'eop']
|
| 120 |
+
|
| 121 |
+
A key that indicates the aggregation method used for frequency aggregation.
|
| 122 |
+
This parameter has no affect if the frequency parameter is not set, default is 'avg'.
|
| 123 |
+
avg = Average
|
| 124 |
+
sum = Sum
|
| 125 |
+
eop = End of Period
|
| 126 |
+
(provider: fred)
|
| 127 |
+
transform : Optional[Literal['chg', 'ch1', 'pch', 'pc1', 'pca', 'cch', 'cca', 'log']]
|
| 128 |
+
|
| 129 |
+
Transformation type
|
| 130 |
+
None = No transformation
|
| 131 |
+
chg = Change
|
| 132 |
+
ch1 = Change from Year Ago
|
| 133 |
+
pch = Percent Change
|
| 134 |
+
pc1 = Percent Change from Year Ago
|
| 135 |
+
pca = Compounded Annual Rate of Change
|
| 136 |
+
cch = Continuously Compounded Rate of Change
|
| 137 |
+
cca = Continuously Compounded Annual Rate of Change
|
| 138 |
+
log = Natural Log
|
| 139 |
+
(provider: fred)
|
| 140 |
+
|
| 141 |
+
Returns
|
| 142 |
+
-------
|
| 143 |
+
OBBject
|
| 144 |
+
results : list[BondIndices]
|
| 145 |
+
Serializable results.
|
| 146 |
+
provider : Optional[str]
|
| 147 |
+
Provider name.
|
| 148 |
+
warnings : Optional[list[Warning_]]
|
| 149 |
+
list of warnings.
|
| 150 |
+
chart : Optional[Chart]
|
| 151 |
+
Chart object.
|
| 152 |
+
extra : Dict[str, Any]
|
| 153 |
+
Extra info.
|
| 154 |
+
|
| 155 |
+
BondIndices
|
| 156 |
+
-----------
|
| 157 |
+
date : date
|
| 158 |
+
The date of the data.
|
| 159 |
+
symbol : Optional[str]
|
| 160 |
+
Symbol representing the entity requested in the data.
|
| 161 |
+
value : float
|
| 162 |
+
Index values.
|
| 163 |
+
maturity : Optional[str]
|
| 164 |
+
The maturity range of the bond index. Only applicable when 'index' is 'yield_curve'. (provider: fred)
|
| 165 |
+
title : Optional[str]
|
| 166 |
+
The title of the index. (provider: fred)
|
| 167 |
+
|
| 168 |
+
Examples
|
| 169 |
+
--------
|
| 170 |
+
>>> from openbb import obb
|
| 171 |
+
>>> # The default state for FRED are series for constructing the US Corporate Bond Yield Curve.
|
| 172 |
+
>>> obb.fixedincome.bond_indices(provider='fred')
|
| 173 |
+
>>> # Multiple indices, from within the same 'category', can be requested.
|
| 174 |
+
>>> obb.fixedincome.bond_indices(category='high_yield', index='us,europe,emerging', index_type='total_return', provider='fred')
|
| 175 |
+
>>> # From FRED, there are three main categories, 'high_yield', 'us', and 'emerging_markets'. Emerging markets is a broad category.
|
| 176 |
+
>>> obb.fixedincome.bond_indices(category='emerging_markets', index='corporate,private_sector,public_sector', provider='fred')
|
| 177 |
+
""" # noqa: E501
|
| 178 |
+
|
| 179 |
+
return self._run(
|
| 180 |
+
"/fixedincome/bond_indices",
|
| 181 |
+
**filter_inputs(
|
| 182 |
+
provider_choices={
|
| 183 |
+
"provider": self._get_provider(
|
| 184 |
+
provider,
|
| 185 |
+
"fixedincome.bond_indices",
|
| 186 |
+
("fred",),
|
| 187 |
+
)
|
| 188 |
+
},
|
| 189 |
+
standard_params={
|
| 190 |
+
"start_date": start_date,
|
| 191 |
+
"end_date": end_date,
|
| 192 |
+
"index_type": index_type,
|
| 193 |
+
},
|
| 194 |
+
extra_params=kwargs,
|
| 195 |
+
info={
|
| 196 |
+
"index": {
|
| 197 |
+
"fred": {
|
| 198 |
+
"multiple_items_allowed": True,
|
| 199 |
+
"choices": [
|
| 200 |
+
"a",
|
| 201 |
+
"aa",
|
| 202 |
+
"aaa",
|
| 203 |
+
"asia",
|
| 204 |
+
"b",
|
| 205 |
+
"bb",
|
| 206 |
+
"bbb",
|
| 207 |
+
"ccc",
|
| 208 |
+
"corporate",
|
| 209 |
+
"crossover",
|
| 210 |
+
"emea",
|
| 211 |
+
"high_grade",
|
| 212 |
+
"high_yield",
|
| 213 |
+
"latam",
|
| 214 |
+
"liquid_aaa",
|
| 215 |
+
"liquid_asia",
|
| 216 |
+
"liquid_bbb",
|
| 217 |
+
"liquid_corporate",
|
| 218 |
+
"liquid_emea",
|
| 219 |
+
"liquid_latam",
|
| 220 |
+
"non_financial",
|
| 221 |
+
"private_sector",
|
| 222 |
+
"public_sector",
|
| 223 |
+
"seasoned_corporate",
|
| 224 |
+
"yield_curve",
|
| 225 |
+
],
|
| 226 |
+
}
|
| 227 |
+
}
|
| 228 |
+
},
|
| 229 |
+
)
|
| 230 |
+
)
|
| 231 |
+
|
| 232 |
+
@property
|
| 233 |
+
def corporate(self):
|
| 234 |
+
# pylint: disable=import-outside-toplevel
|
| 235 |
+
from . import fixedincome_corporate
|
| 236 |
+
|
| 237 |
+
return fixedincome_corporate.ROUTER_fixedincome_corporate(
|
| 238 |
+
command_runner=self._command_runner
|
| 239 |
+
)
|
| 240 |
+
|
| 241 |
+
@property
|
| 242 |
+
def government(self):
|
| 243 |
+
# pylint: disable=import-outside-toplevel
|
| 244 |
+
from . import fixedincome_government
|
| 245 |
+
|
| 246 |
+
return fixedincome_government.ROUTER_fixedincome_government(
|
| 247 |
+
command_runner=self._command_runner
|
| 248 |
+
)
|
| 249 |
+
|
| 250 |
+
@exception_handler
|
| 251 |
+
@validate
|
| 252 |
+
def mortgage_indices(
|
| 253 |
+
self,
|
| 254 |
+
start_date: Annotated[
|
| 255 |
+
Union[datetime.date, None, str],
|
| 256 |
+
OpenBBField(description="Start date of the data, in YYYY-MM-DD format."),
|
| 257 |
+
] = None,
|
| 258 |
+
end_date: Annotated[
|
| 259 |
+
Union[datetime.date, None, str],
|
| 260 |
+
OpenBBField(description="End date of the data, in YYYY-MM-DD format."),
|
| 261 |
+
] = None,
|
| 262 |
+
provider: Annotated[
|
| 263 |
+
Optional[Literal["fred"]],
|
| 264 |
+
OpenBBField(
|
| 265 |
+
description="The provider to use, by default None. If None, the priority list configured in the settings is used. Default priority: fred."
|
| 266 |
+
),
|
| 267 |
+
] = None,
|
| 268 |
+
**kwargs
|
| 269 |
+
) -> OBBject:
|
| 270 |
+
"""Mortgage Indices.
|
| 271 |
+
|
| 272 |
+
Parameters
|
| 273 |
+
----------
|
| 274 |
+
provider : str
|
| 275 |
+
The provider to use, by default None. If None, the priority list configured in the settings is used. Default priority: fred.
|
| 276 |
+
start_date : Union[date, None, str]
|
| 277 |
+
Start date of the data, in YYYY-MM-DD format.
|
| 278 |
+
end_date : Union[date, None, str]
|
| 279 |
+
End date of the data, in YYYY-MM-DD format.
|
| 280 |
+
index : Union[Literal['primary', 'ltv_lte_80', 'ltv_gt_80', 'conforming_30y', 'conforming_30y_na', 'jumbo_30y', 'fha_30y', 'va_30y', 'usda_30y', 'conforming_15y', 'ltv_lte80_fico_ge740', 'ltv_lte80_fico_a720b739', 'ltv_lte80_fico_a700b719', 'ltv_lte80_fico_a680b699', 'ltv_lte80_fico_lt680', 'ltv_gt80_fico_ge740', 'ltv_gt80_fico_a720b739', 'ltv_gt80_fico_a700b719', 'ltv_gt80_fico_a680b699', 'ltv_gt80_fico_lt680'], str]
|
| 281 |
+
The specific index, or index group, to query. Default is the 'primary' group. Multiple comma separated items allowed. (provider: fred)
|
| 282 |
+
frequency : Optional[Literal['a', 'q', 'm', 'w', 'd', 'wef', 'weth', 'wew', 'wetu', 'wem', 'wesu', 'wesa', 'bwew', 'bwem']]
|
| 283 |
+
|
| 284 |
+
Frequency aggregation to convert daily data to lower frequency.
|
| 285 |
+
None = No change
|
| 286 |
+
a = Annual
|
| 287 |
+
q = Quarterly
|
| 288 |
+
m = Monthly
|
| 289 |
+
w = Weekly
|
| 290 |
+
d = Daily
|
| 291 |
+
wef = Weekly, Ending Friday
|
| 292 |
+
weth = Weekly, Ending Thursday
|
| 293 |
+
wew = Weekly, Ending Wednesday
|
| 294 |
+
wetu = Weekly, Ending Tuesday
|
| 295 |
+
wem = Weekly, Ending Monday
|
| 296 |
+
wesu = Weekly, Ending Sunday
|
| 297 |
+
wesa = Weekly, Ending Saturday
|
| 298 |
+
bwew = Biweekly, Ending Wednesday
|
| 299 |
+
bwem = Biweekly, Ending Monday
|
| 300 |
+
(provider: fred)
|
| 301 |
+
aggregation_method : Literal['avg', 'sum', 'eop']
|
| 302 |
+
|
| 303 |
+
A key that indicates the aggregation method used for frequency aggregation.
|
| 304 |
+
This parameter has no affect if the frequency parameter is not set, default is 'avg'.
|
| 305 |
+
avg = Average
|
| 306 |
+
sum = Sum
|
| 307 |
+
eop = End of Period
|
| 308 |
+
(provider: fred)
|
| 309 |
+
transform : Optional[Literal['chg', 'ch1', 'pch', 'pc1', 'pca', 'cch', 'cca', 'log']]
|
| 310 |
+
|
| 311 |
+
Transformation type
|
| 312 |
+
None = No transformation
|
| 313 |
+
chg = Change
|
| 314 |
+
ch1 = Change from Year Ago
|
| 315 |
+
pch = Percent Change
|
| 316 |
+
pc1 = Percent Change from Year Ago
|
| 317 |
+
pca = Compounded Annual Rate of Change
|
| 318 |
+
cch = Continuously Compounded Rate of Change
|
| 319 |
+
cca = Continuously Compounded Annual Rate of Change
|
| 320 |
+
log = Natural Log
|
| 321 |
+
(provider: fred)
|
| 322 |
+
|
| 323 |
+
Returns
|
| 324 |
+
-------
|
| 325 |
+
OBBject
|
| 326 |
+
results : list[MortgageIndices]
|
| 327 |
+
Serializable results.
|
| 328 |
+
provider : Optional[str]
|
| 329 |
+
Provider name.
|
| 330 |
+
warnings : Optional[list[Warning_]]
|
| 331 |
+
list of warnings.
|
| 332 |
+
chart : Optional[Chart]
|
| 333 |
+
Chart object.
|
| 334 |
+
extra : Dict[str, Any]
|
| 335 |
+
Extra info.
|
| 336 |
+
|
| 337 |
+
MortgageIndices
|
| 338 |
+
---------------
|
| 339 |
+
date : date
|
| 340 |
+
The date of the data.
|
| 341 |
+
symbol : Optional[str]
|
| 342 |
+
Symbol representing the entity requested in the data.
|
| 343 |
+
name : Optional[str]
|
| 344 |
+
Name of the index.
|
| 345 |
+
rate : float
|
| 346 |
+
Mortgage rate.
|
| 347 |
+
|
| 348 |
+
Examples
|
| 349 |
+
--------
|
| 350 |
+
>>> from openbb import obb
|
| 351 |
+
>>> # The default state for FRED are the primary mortgage indices from Optimal Blue.
|
| 352 |
+
>>> obb.fixedincome.mortgage_indices(provider='fred')
|
| 353 |
+
>>> # Multiple indices can be requested.
|
| 354 |
+
>>> obb.fixedincome.mortgage_indices(index='jumbo_30y,conforming_30y,conforming_15y', provider='fred')
|
| 355 |
+
""" # noqa: E501
|
| 356 |
+
|
| 357 |
+
return self._run(
|
| 358 |
+
"/fixedincome/mortgage_indices",
|
| 359 |
+
**filter_inputs(
|
| 360 |
+
provider_choices={
|
| 361 |
+
"provider": self._get_provider(
|
| 362 |
+
provider,
|
| 363 |
+
"fixedincome.mortgage_indices",
|
| 364 |
+
("fred",),
|
| 365 |
+
)
|
| 366 |
+
},
|
| 367 |
+
standard_params={
|
| 368 |
+
"start_date": start_date,
|
| 369 |
+
"end_date": end_date,
|
| 370 |
+
},
|
| 371 |
+
extra_params=kwargs,
|
| 372 |
+
info={
|
| 373 |
+
"index": {
|
| 374 |
+
"fred": {
|
| 375 |
+
"multiple_items_allowed": True,
|
| 376 |
+
"choices": [
|
| 377 |
+
"primary",
|
| 378 |
+
"ltv_lte_80",
|
| 379 |
+
"ltv_gt_80",
|
| 380 |
+
"conforming_30y",
|
| 381 |
+
"conforming_30y_na",
|
| 382 |
+
"jumbo_30y",
|
| 383 |
+
"fha_30y",
|
| 384 |
+
"va_30y",
|
| 385 |
+
"usda_30y",
|
| 386 |
+
"conforming_15y",
|
| 387 |
+
"ltv_lte80_fico_ge740",
|
| 388 |
+
"ltv_lte80_fico_a720b739",
|
| 389 |
+
"ltv_lte80_fico_a700b719",
|
| 390 |
+
"ltv_lte80_fico_a680b699",
|
| 391 |
+
"ltv_lte80_fico_lt680",
|
| 392 |
+
"ltv_gt80_fico_ge740",
|
| 393 |
+
"ltv_gt80_fico_a720b739",
|
| 394 |
+
"ltv_gt80_fico_a700b719",
|
| 395 |
+
"ltv_gt80_fico_a680b699",
|
| 396 |
+
"ltv_gt80_fico_lt680",
|
| 397 |
+
],
|
| 398 |
+
}
|
| 399 |
+
}
|
| 400 |
+
},
|
| 401 |
+
)
|
| 402 |
+
)
|
| 403 |
+
|
| 404 |
+
@property
|
| 405 |
+
def rate(self):
|
| 406 |
+
# pylint: disable=import-outside-toplevel
|
| 407 |
+
from . import fixedincome_rate
|
| 408 |
+
|
| 409 |
+
return fixedincome_rate.ROUTER_fixedincome_rate(
|
| 410 |
+
command_runner=self._command_runner
|
| 411 |
+
)
|
| 412 |
+
|
| 413 |
+
@exception_handler
|
| 414 |
+
@validate
|
| 415 |
+
@deprecated(
|
| 416 |
+
"This endpoint is deprecated; use `/fixedincome/rate/sofr` instead. Deprecated in OpenBB Platform V4.2 to be removed in V4.5.",
|
| 417 |
+
category=OpenBBDeprecationWarning,
|
| 418 |
+
)
|
| 419 |
+
def sofr(
|
| 420 |
+
self,
|
| 421 |
+
start_date: Annotated[
|
| 422 |
+
Union[datetime.date, None, str],
|
| 423 |
+
OpenBBField(description="Start date of the data, in YYYY-MM-DD format."),
|
| 424 |
+
] = None,
|
| 425 |
+
end_date: Annotated[
|
| 426 |
+
Union[datetime.date, None, str],
|
| 427 |
+
OpenBBField(description="End date of the data, in YYYY-MM-DD format."),
|
| 428 |
+
] = None,
|
| 429 |
+
provider: Annotated[
|
| 430 |
+
Optional[Literal["federal_reserve", "fred"]],
|
| 431 |
+
OpenBBField(
|
| 432 |
+
description="The provider to use, by default None. If None, the priority list configured in the settings is used. Default priority: federal_reserve, fred."
|
| 433 |
+
),
|
| 434 |
+
] = None,
|
| 435 |
+
**kwargs
|
| 436 |
+
) -> OBBject:
|
| 437 |
+
"""Secured Overnight Financing Rate.
|
| 438 |
+
|
| 439 |
+
The Secured Overnight Financing Rate (SOFR) is a broad measure of the cost of
|
| 440 |
+
borrowing cash overnight collateralizing by Treasury securities.
|
| 441 |
+
|
| 442 |
+
|
| 443 |
+
Parameters
|
| 444 |
+
----------
|
| 445 |
+
provider : str
|
| 446 |
+
The provider to use, by default None. If None, the priority list configured in the settings is used. Default priority: federal_reserve, fred.
|
| 447 |
+
start_date : Union[date, None, str]
|
| 448 |
+
Start date of the data, in YYYY-MM-DD format.
|
| 449 |
+
end_date : Union[date, None, str]
|
| 450 |
+
End date of the data, in YYYY-MM-DD format.
|
| 451 |
+
frequency : Optional[Literal['a', 'q', 'm', 'w', 'wef', 'weth', 'wew', 'wetu', 'wem', 'wesu', 'wesa', 'bwew', 'bwem']]
|
| 452 |
+
|
| 453 |
+
Frequency aggregation to convert daily data to lower frequency.
|
| 454 |
+
a = Annual
|
| 455 |
+
q = Quarterly
|
| 456 |
+
m = Monthly
|
| 457 |
+
w = Weekly
|
| 458 |
+
wef = Weekly, Ending Friday
|
| 459 |
+
weth = Weekly, Ending Thursday
|
| 460 |
+
wew = Weekly, Ending Wednesday
|
| 461 |
+
wetu = Weekly, Ending Tuesday
|
| 462 |
+
wem = Weekly, Ending Monday
|
| 463 |
+
wesu = Weekly, Ending Sunday
|
| 464 |
+
wesa = Weekly, Ending Saturday
|
| 465 |
+
bwew = Biweekly, Ending Wednesday
|
| 466 |
+
bwem = Biweekly, Ending Monday
|
| 467 |
+
(provider: fred)
|
| 468 |
+
aggregation_method : Optional[Literal['avg', 'sum', 'eop']]
|
| 469 |
+
|
| 470 |
+
A key that indicates the aggregation method used for frequency aggregation.
|
| 471 |
+
avg = Average
|
| 472 |
+
sum = Sum
|
| 473 |
+
eop = End of Period
|
| 474 |
+
(provider: fred)
|
| 475 |
+
transform : Optional[Literal['chg', 'ch1', 'pch', 'pc1', 'pca', 'cch', 'cca', 'log']]
|
| 476 |
+
|
| 477 |
+
Transformation type
|
| 478 |
+
None = No transformation
|
| 479 |
+
chg = Change
|
| 480 |
+
ch1 = Change from Year Ago
|
| 481 |
+
pch = Percent Change
|
| 482 |
+
pc1 = Percent Change from Year Ago
|
| 483 |
+
pca = Compounded Annual Rate of Change
|
| 484 |
+
cch = Continuously Compounded Rate of Change
|
| 485 |
+
cca = Continuously Compounded Annual Rate of Change
|
| 486 |
+
log = Natural Log
|
| 487 |
+
(provider: fred)
|
| 488 |
+
|
| 489 |
+
Returns
|
| 490 |
+
-------
|
| 491 |
+
OBBject
|
| 492 |
+
results : list[SOFR]
|
| 493 |
+
Serializable results.
|
| 494 |
+
provider : Optional[str]
|
| 495 |
+
Provider name.
|
| 496 |
+
warnings : Optional[list[Warning_]]
|
| 497 |
+
list of warnings.
|
| 498 |
+
chart : Optional[Chart]
|
| 499 |
+
Chart object.
|
| 500 |
+
extra : Dict[str, Any]
|
| 501 |
+
Extra info.
|
| 502 |
+
|
| 503 |
+
SOFR
|
| 504 |
+
----
|
| 505 |
+
date : date
|
| 506 |
+
The date of the data.
|
| 507 |
+
rate : float
|
| 508 |
+
Effective federal funds rate.
|
| 509 |
+
percentile_1 : Optional[float]
|
| 510 |
+
1st percentile of the distribution.
|
| 511 |
+
percentile_25 : Optional[float]
|
| 512 |
+
25th percentile of the distribution.
|
| 513 |
+
percentile_75 : Optional[float]
|
| 514 |
+
75th percentile of the distribution.
|
| 515 |
+
percentile_99 : Optional[float]
|
| 516 |
+
99th percentile of the distribution.
|
| 517 |
+
volume : Optional[float]
|
| 518 |
+
The trading volume.The notional volume of transactions (Billions of $).
|
| 519 |
+
average_30d : Optional[float]
|
| 520 |
+
30-Day Average SOFR (provider: fred)
|
| 521 |
+
average_90d : Optional[float]
|
| 522 |
+
90-Day Average SOFR (provider: fred)
|
| 523 |
+
average_180d : Optional[float]
|
| 524 |
+
180-Day Average SOFR (provider: fred)
|
| 525 |
+
index : Optional[float]
|
| 526 |
+
SOFR index as 2018-04-02 = 1 (provider: fred)
|
| 527 |
+
|
| 528 |
+
Examples
|
| 529 |
+
--------
|
| 530 |
+
>>> from openbb import obb
|
| 531 |
+
>>> obb.fixedincome.sofr(provider='fred')
|
| 532 |
+
""" # noqa: E501
|
| 533 |
+
|
| 534 |
+
simplefilter("always", DeprecationWarning)
|
| 535 |
+
warn(
|
| 536 |
+
"This endpoint is deprecated; use `/fixedincome/rate/sofr` instead. Deprecated in OpenBB Platform V4.2 to be removed in V4.5.",
|
| 537 |
+
category=DeprecationWarning,
|
| 538 |
+
stacklevel=2,
|
| 539 |
+
)
|
| 540 |
+
|
| 541 |
+
return self._run(
|
| 542 |
+
"/fixedincome/sofr",
|
| 543 |
+
**filter_inputs(
|
| 544 |
+
provider_choices={
|
| 545 |
+
"provider": self._get_provider(
|
| 546 |
+
provider,
|
| 547 |
+
"fixedincome.sofr",
|
| 548 |
+
("federal_reserve", "fred"),
|
| 549 |
+
)
|
| 550 |
+
},
|
| 551 |
+
standard_params={
|
| 552 |
+
"start_date": start_date,
|
| 553 |
+
"end_date": end_date,
|
| 554 |
+
},
|
| 555 |
+
extra_params=kwargs,
|
| 556 |
+
)
|
| 557 |
+
)
|
| 558 |
+
|
| 559 |
+
@property
|
| 560 |
+
def spreads(self):
|
| 561 |
+
# pylint: disable=import-outside-toplevel
|
| 562 |
+
from . import fixedincome_spreads
|
| 563 |
+
|
| 564 |
+
return fixedincome_spreads.ROUT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
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
### THIS FILE IS AUTO-GENERATED. DO NOT EDIT. ###
|
| 2 |
+
|
| 3 |
+
import datetime
|
| 4 |
+
from typing import Literal, Optional, Union
|
| 5 |
+
from warnings import simplefilter, warn
|
| 6 |
+
|
| 7 |
+
from openbb_core.app.deprecation import OpenBBDeprecationWarning
|
| 8 |
+
from openbb_core.app.model.field import OpenBBField
|
| 9 |
+
from openbb_core.app.model.obbject import OBBject
|
| 10 |
+
from openbb_core.app.static.container import Container
|
| 11 |
+
from openbb_core.app.static.utils.decorators import exception_handler, validate
|
| 12 |
+
from openbb_core.app.static.utils.filters import filter_inputs
|
| 13 |
+
from typing_extensions import Annotated, deprecated
|
| 14 |
+
|
| 15 |
+
|
| 16 |
+
class ROUTER_fixedincome_corporate(Container):
|
| 17 |
+
"""/fixedincome/corporate
|
| 18 |
+
commercial_paper
|
| 19 |
+
hqm
|
| 20 |
+
ice_bofa
|
| 21 |
+
moody
|
| 22 |
+
spot_rates
|
| 23 |
+
"""
|
| 24 |
+
|
| 25 |
+
def __repr__(self) -> str:
|
| 26 |
+
return self.__doc__ or ""
|
| 27 |
+
|
| 28 |
+
@exception_handler
|
| 29 |
+
@validate
|
| 30 |
+
def commercial_paper(
|
| 31 |
+
self,
|
| 32 |
+
start_date: Annotated[
|
| 33 |
+
Union[datetime.date, None, str],
|
| 34 |
+
OpenBBField(description="Start date of the data, in YYYY-MM-DD format."),
|
| 35 |
+
] = None,
|
| 36 |
+
end_date: Annotated[
|
| 37 |
+
Union[datetime.date, None, str],
|
| 38 |
+
OpenBBField(description="End date of the data, in YYYY-MM-DD format."),
|
| 39 |
+
] = None,
|
| 40 |
+
provider: Annotated[
|
| 41 |
+
Optional[Literal["fred"]],
|
| 42 |
+
OpenBBField(
|
| 43 |
+
description="The provider to use, by default None. If None, the priority list configured in the settings is used. Default priority: fred."
|
| 44 |
+
),
|
| 45 |
+
] = None,
|
| 46 |
+
**kwargs
|
| 47 |
+
) -> OBBject:
|
| 48 |
+
"""Commercial Paper.
|
| 49 |
+
|
| 50 |
+
Commercial paper (CP) consists of short-term, promissory notes issued primarily by corporations.
|
| 51 |
+
Maturities range up to 270 days but average about 30 days.
|
| 52 |
+
Many companies use CP to raise cash needed for current transactions,
|
| 53 |
+
and many find it to be a lower-cost alternative to bank loans.
|
| 54 |
+
|
| 55 |
+
|
| 56 |
+
Parameters
|
| 57 |
+
----------
|
| 58 |
+
provider : str
|
| 59 |
+
The provider to use, by default None. If None, the priority list configured in the settings is used. Default priority: fred.
|
| 60 |
+
start_date : Union[date, None, str]
|
| 61 |
+
Start date of the data, in YYYY-MM-DD format.
|
| 62 |
+
end_date : Union[date, None, str]
|
| 63 |
+
End date of the data, in YYYY-MM-DD format.
|
| 64 |
+
maturity : Union[str, Literal['all', 'overnight', '7d', '15d', '30d', '60d', '90d']]
|
| 65 |
+
A target maturity. Multiple comma separated items allowed. (provider: fred)
|
| 66 |
+
category : Union[str, Literal['all', 'asset_backed', 'financial', 'nonfinancial', 'a2p2']]
|
| 67 |
+
The category of asset. Multiple comma separated items allowed. (provider: fred)
|
| 68 |
+
frequency : Optional[Literal['a', 'q', 'm', 'w', 'wef', 'weth', 'wew', 'wetu', 'wem', 'wesu', 'wesa', 'bwew', 'bwem']]
|
| 69 |
+
|
| 70 |
+
Frequency aggregation to convert daily data to lower frequency.
|
| 71 |
+
a = Annual
|
| 72 |
+
q = Quarterly
|
| 73 |
+
m = Monthly
|
| 74 |
+
w = Weekly
|
| 75 |
+
wef = Weekly, Ending Friday
|
| 76 |
+
weth = Weekly, Ending Thursday
|
| 77 |
+
wew = Weekly, Ending Wednesday
|
| 78 |
+
wetu = Weekly, Ending Tuesday
|
| 79 |
+
wem = Weekly, Ending Monday
|
| 80 |
+
wesu = Weekly, Ending Sunday
|
| 81 |
+
wesa = Weekly, Ending Saturday
|
| 82 |
+
bwew = Biweekly, Ending Wednesday
|
| 83 |
+
bwem = Biweekly, Ending Monday
|
| 84 |
+
(provider: fred)
|
| 85 |
+
aggregation_method : Optional[Literal['avg', 'sum', 'eop']]
|
| 86 |
+
|
| 87 |
+
A key that indicates the aggregation method used for frequency aggregation.
|
| 88 |
+
avg = Average
|
| 89 |
+
sum = Sum
|
| 90 |
+
eop = End of Period
|
| 91 |
+
(provider: fred)
|
| 92 |
+
transform : Optional[Literal['chg', 'ch1', 'pch', 'pc1', 'pca', 'cch', 'cca', 'log']]
|
| 93 |
+
|
| 94 |
+
Transformation type
|
| 95 |
+
None = No transformation
|
| 96 |
+
chg = Change
|
| 97 |
+
ch1 = Change from Year Ago
|
| 98 |
+
pch = Percent Change
|
| 99 |
+
pc1 = Percent Change from Year Ago
|
| 100 |
+
pca = Compounded Annual Rate of Change
|
| 101 |
+
cch = Continuously Compounded Rate of Change
|
| 102 |
+
cca = Continuously Compounded Annual Rate of Change
|
| 103 |
+
log = Natural Log
|
| 104 |
+
(provider: fred)
|
| 105 |
+
|
| 106 |
+
Returns
|
| 107 |
+
-------
|
| 108 |
+
OBBject
|
| 109 |
+
results : list[CommercialPaper]
|
| 110 |
+
Serializable results.
|
| 111 |
+
provider : Optional[str]
|
| 112 |
+
Provider name.
|
| 113 |
+
warnings : Optional[list[Warning_]]
|
| 114 |
+
list of warnings.
|
| 115 |
+
chart : Optional[Chart]
|
| 116 |
+
Chart object.
|
| 117 |
+
extra : Dict[str, Any]
|
| 118 |
+
Extra info.
|
| 119 |
+
|
| 120 |
+
CommercialPaper
|
| 121 |
+
---------------
|
| 122 |
+
date : date
|
| 123 |
+
The date of the data.
|
| 124 |
+
symbol : Optional[str]
|
| 125 |
+
Symbol representing the entity requested in the data.
|
| 126 |
+
maturity : str
|
| 127 |
+
Maturity length of the item.
|
| 128 |
+
rate : float
|
| 129 |
+
Interest rate.
|
| 130 |
+
title : Optional[str]
|
| 131 |
+
Title of the series.
|
| 132 |
+
asset_type : Optional[Literal['asset_backed', 'financial', 'nonfinancial', 'a2p2']]
|
| 133 |
+
The category of asset. (provider: fred)
|
| 134 |
+
|
| 135 |
+
Examples
|
| 136 |
+
--------
|
| 137 |
+
>>> from openbb import obb
|
| 138 |
+
>>> obb.fixedincome.corporate.commercial_paper(provider='fred')
|
| 139 |
+
>>> obb.fixedincome.corporate.commercial_paper(category='all', maturity='15d', provider='fred')
|
| 140 |
+
""" # noqa: E501
|
| 141 |
+
|
| 142 |
+
return self._run(
|
| 143 |
+
"/fixedincome/corporate/commercial_paper",
|
| 144 |
+
**filter_inputs(
|
| 145 |
+
provider_choices={
|
| 146 |
+
"provider": self._get_provider(
|
| 147 |
+
provider,
|
| 148 |
+
"fixedincome.corporate.commercial_paper",
|
| 149 |
+
("fred",),
|
| 150 |
+
)
|
| 151 |
+
},
|
| 152 |
+
standard_params={
|
| 153 |
+
"start_date": start_date,
|
| 154 |
+
"end_date": end_date,
|
| 155 |
+
},
|
| 156 |
+
extra_params=kwargs,
|
| 157 |
+
info={
|
| 158 |
+
"maturity": {
|
| 159 |
+
"fred": {
|
| 160 |
+
"multiple_items_allowed": True,
|
| 161 |
+
"choices": [
|
| 162 |
+
"all",
|
| 163 |
+
"overnight",
|
| 164 |
+
"7d",
|
| 165 |
+
"15d",
|
| 166 |
+
"30d",
|
| 167 |
+
"60d",
|
| 168 |
+
"90d",
|
| 169 |
+
],
|
| 170 |
+
}
|
| 171 |
+
},
|
| 172 |
+
"category": {
|
| 173 |
+
"fred": {
|
| 174 |
+
"multiple_items_allowed": True,
|
| 175 |
+
"choices": [
|
| 176 |
+
"all",
|
| 177 |
+
"asset_backed",
|
| 178 |
+
"financial",
|
| 179 |
+
"nonfinancial",
|
| 180 |
+
"a2p2",
|
| 181 |
+
],
|
| 182 |
+
}
|
| 183 |
+
},
|
| 184 |
+
},
|
| 185 |
+
)
|
| 186 |
+
)
|
| 187 |
+
|
| 188 |
+
@exception_handler
|
| 189 |
+
@validate
|
| 190 |
+
def hqm(
|
| 191 |
+
self,
|
| 192 |
+
date: Annotated[
|
| 193 |
+
Union[datetime.date, str, None, list[Union[datetime.date, str, None]]],
|
| 194 |
+
OpenBBField(
|
| 195 |
+
description="A specific date to get data for. Multiple comma separated items allowed for provider(s): fred."
|
| 196 |
+
),
|
| 197 |
+
] = None,
|
| 198 |
+
provider: Annotated[
|
| 199 |
+
Optional[Literal["fred"]],
|
| 200 |
+
OpenBBField(
|
| 201 |
+
description="The provider to use, by default None. If None, the priority list configured in the settings is used. Default priority: fred."
|
| 202 |
+
),
|
| 203 |
+
] = None,
|
| 204 |
+
**kwargs
|
| 205 |
+
) -> OBBject:
|
| 206 |
+
"""High Quality Market Corporate Bond.
|
| 207 |
+
|
| 208 |
+
The HQM yield curve represents the high quality corporate bond market, i.e.,
|
| 209 |
+
corporate bonds rated AAA, AA, or A. The HQM curve contains two regression terms.
|
| 210 |
+
These terms are adjustment factors that blend AAA, AA, and A bonds into a single HQM yield curve
|
| 211 |
+
that is the market-weighted average (MWA) quality of high quality bonds.
|
| 212 |
+
|
| 213 |
+
|
| 214 |
+
Parameters
|
| 215 |
+
----------
|
| 216 |
+
provider : str
|
| 217 |
+
The provider to use, by default None. If None, the priority list configured in the settings is used. Default priority: fred.
|
| 218 |
+
date : Union[date, str, None, list[Union[date, str, None]]]
|
| 219 |
+
A specific date to get data for. Multiple comma separated items allowed for provider(s): fred.
|
| 220 |
+
yield_curve : Literal['spot', 'par']
|
| 221 |
+
The yield curve type. (provider: fred)
|
| 222 |
+
|
| 223 |
+
Returns
|
| 224 |
+
-------
|
| 225 |
+
OBBject
|
| 226 |
+
results : list[HighQualityMarketCorporateBond]
|
| 227 |
+
Serializable results.
|
| 228 |
+
provider : Optional[str]
|
| 229 |
+
Provider name.
|
| 230 |
+
warnings : Optional[list[Warning_]]
|
| 231 |
+
list of warnings.
|
| 232 |
+
chart : Optional[Chart]
|
| 233 |
+
Chart object.
|
| 234 |
+
extra : Dict[str, Any]
|
| 235 |
+
Extra info.
|
| 236 |
+
|
| 237 |
+
HighQualityMarketCorporateBond
|
| 238 |
+
------------------------------
|
| 239 |
+
date : date
|
| 240 |
+
The date of the data.
|
| 241 |
+
rate : float
|
| 242 |
+
Interest rate.
|
| 243 |
+
maturity : str
|
| 244 |
+
Maturity.
|
| 245 |
+
|
| 246 |
+
Examples
|
| 247 |
+
--------
|
| 248 |
+
>>> from openbb import obb
|
| 249 |
+
>>> obb.fixedincome.corporate.hqm(provider='fred')
|
| 250 |
+
>>> obb.fixedincome.corporate.hqm(yield_curve='par', provider='fred')
|
| 251 |
+
""" # noqa: E501
|
| 252 |
+
|
| 253 |
+
return self._run(
|
| 254 |
+
"/fixedincome/corporate/hqm",
|
| 255 |
+
**filter_inputs(
|
| 256 |
+
provider_choices={
|
| 257 |
+
"provider": self._get_provider(
|
| 258 |
+
provider,
|
| 259 |
+
"fixedincome.corporate.hqm",
|
| 260 |
+
("fred",),
|
| 261 |
+
)
|
| 262 |
+
},
|
| 263 |
+
standard_params={
|
| 264 |
+
"date": date,
|
| 265 |
+
},
|
| 266 |
+
extra_params=kwargs,
|
| 267 |
+
info={
|
| 268 |
+
"date": {"fred": {"multiple_items_allowed": True, "choices": None}}
|
| 269 |
+
},
|
| 270 |
+
)
|
| 271 |
+
)
|
| 272 |
+
|
| 273 |
+
@exception_handler
|
| 274 |
+
@validate
|
| 275 |
+
@deprecated(
|
| 276 |
+
"This endpoint is deprecated; use `/fixedincome/bond_indices` instead. Deprecated in OpenBB Platform V4.2 to be removed in V4.5.",
|
| 277 |
+
category=OpenBBDeprecationWarning,
|
| 278 |
+
)
|
| 279 |
+
def ice_bofa(
|
| 280 |
+
self,
|
| 281 |
+
start_date: Annotated[
|
| 282 |
+
Union[datetime.date, None, str],
|
| 283 |
+
OpenBBField(description="Start date of the data, in YYYY-MM-DD format."),
|
| 284 |
+
] = None,
|
| 285 |
+
end_date: Annotated[
|
| 286 |
+
Union[datetime.date, None, str],
|
| 287 |
+
OpenBBField(description="End date of the data, in YYYY-MM-DD format."),
|
| 288 |
+
] = None,
|
| 289 |
+
index_type: Annotated[
|
| 290 |
+
Literal["yield", "yield_to_worst", "total_return", "spread"],
|
| 291 |
+
OpenBBField(description="The type of series."),
|
| 292 |
+
] = "yield",
|
| 293 |
+
provider: Annotated[
|
| 294 |
+
Optional[Literal["fred"]],
|
| 295 |
+
OpenBBField(
|
| 296 |
+
description="The provider to use, by default None. If None, the priority list configured in the settings is used. Default priority: fred."
|
| 297 |
+
),
|
| 298 |
+
] = None,
|
| 299 |
+
**kwargs
|
| 300 |
+
) -> OBBject:
|
| 301 |
+
"""ICE BofA US Corporate Bond Indices.
|
| 302 |
+
|
| 303 |
+
The ICE BofA US Corporate Index tracks the performance of US dollar denominated investment grade corporate debt
|
| 304 |
+
publicly issued in the US domestic market. Qualifying securities must have an investment grade rating (based on an
|
| 305 |
+
average of Moody’s, S&P and Fitch), at least 18 months to final maturity at the time of issuance, at least one year
|
| 306 |
+
remaining term to final maturity as of the rebalance date, a fixed coupon schedule and a minimum amount
|
| 307 |
+
outstanding of $250 million. The ICE BofA US Corporate Index is a component of the US Corporate Master Index.
|
| 308 |
+
|
| 309 |
+
|
| 310 |
+
Parameters
|
| 311 |
+
----------
|
| 312 |
+
provider : str
|
| 313 |
+
The provider to use, by default None. If None, the priority list configured in the settings is used. Default priority: fred.
|
| 314 |
+
start_date : Union[date, None, str]
|
| 315 |
+
Start date of the data, in YYYY-MM-DD format.
|
| 316 |
+
end_date : Union[date, None, str]
|
| 317 |
+
End date of the data, in YYYY-MM-DD format.
|
| 318 |
+
index_type : Literal['yield', 'yield_to_worst', 'total_return', 'spread']
|
| 319 |
+
The type of series.
|
| 320 |
+
category : Literal['all', 'duration', 'eur', 'usd']
|
| 321 |
+
The type of category. (provider: fred)
|
| 322 |
+
area : Literal['asia', 'emea', 'eu', 'ex_g10', 'latin_america', 'us']
|
| 323 |
+
The type of area. (provider: fred)
|
| 324 |
+
grade : Literal['a', 'aa', 'aaa', 'b', 'bb', 'bbb', 'ccc', 'crossover', 'high_grade', 'high_yield', 'non_financial', 'non_sovereign', 'private_sector', 'public_sector']
|
| 325 |
+
The type of grade. (provider: fred)
|
| 326 |
+
options : bool
|
| 327 |
+
Whether to include options in the results. (provider: fred)
|
| 328 |
+
|
| 329 |
+
Returns
|
| 330 |
+
-------
|
| 331 |
+
OBBject
|
| 332 |
+
results : list[ICEBofA]
|
| 333 |
+
Serializable results.
|
| 334 |
+
provider : Optional[str]
|
| 335 |
+
Provider name.
|
| 336 |
+
warnings : Optional[list[Warning_]]
|
| 337 |
+
list of warnings.
|
| 338 |
+
chart : Optional[Chart]
|
| 339 |
+
Chart object.
|
| 340 |
+
extra : Dict[str, Any]
|
| 341 |
+
Extra info.
|
| 342 |
+
|
| 343 |
+
ICEBofA
|
| 344 |
+
-------
|
| 345 |
+
date : date
|
| 346 |
+
The date of the data.
|
| 347 |
+
rate : Optional[float]
|
| 348 |
+
ICE BofA US Corporate Bond Indices Rate.
|
| 349 |
+
|
| 350 |
+
Examples
|
| 351 |
+
--------
|
| 352 |
+
>>> from openbb import obb
|
| 353 |
+
>>> obb.fixedincome.corporate.ice_bofa(provider='fred')
|
| 354 |
+
>>> obb.fixedincome.corporate.ice_bofa(index_type='yield_to_worst', provider='fred')
|
| 355 |
+
""" # noqa: E501
|
| 356 |
+
|
| 357 |
+
simplefilter("always", DeprecationWarning)
|
| 358 |
+
warn(
|
| 359 |
+
"This endpoint is deprecated; use `/fixedincome/bond_indices` instead. Deprecated in OpenBB Platform V4.2 to be removed in V4.5.",
|
| 360 |
+
category=DeprecationWarning,
|
| 361 |
+
stacklevel=2,
|
| 362 |
+
)
|
| 363 |
+
|
| 364 |
+
return self._run(
|
| 365 |
+
"/fixedincome/corporate/ice_bofa",
|
| 366 |
+
**filter_inputs(
|
| 367 |
+
provider_choices={
|
| 368 |
+
"provider": self._get_provider(
|
| 369 |
+
provider,
|
| 370 |
+
"fixedincome.corporate.ice_bofa",
|
| 371 |
+
("fred",),
|
| 372 |
+
)
|
| 373 |
+
},
|
| 374 |
+
standard_params={
|
| 375 |
+
"start_date": start_date,
|
| 376 |
+
"end_date": end_date,
|
| 377 |
+
"index_type": index_type,
|
| 378 |
+
},
|
| 379 |
+
extra_params=kwargs,
|
| 380 |
+
)
|
| 381 |
+
)
|
| 382 |
+
|
| 383 |
+
@exception_handler
|
| 384 |
+
@validate
|
| 385 |
+
@deprecated(
|
| 386 |
+
"This endpoint is deprecated; use `/fixedincome/bond_indices` instead. Set `category` to `us` and `index` to `seasoned_corporate`. Deprecated in OpenBB Platform V4.2 to be removed in V4.5.",
|
| 387 |
+
category=OpenBBDeprecationWarning,
|
| 388 |
+
)
|
| 389 |
+
def moody(
|
| 390 |
+
self,
|
| 391 |
+
start_date: Annotated[
|
| 392 |
+
Union[datetime.date, None, str],
|
| 393 |
+
OpenBBField(description="Start date of the data, in YYYY-MM-DD format."),
|
| 394 |
+
] = None,
|
| 395 |
+
end_date: Annotated[
|
| 396 |
+
Union[datetime.date, None, str],
|
| 397 |
+
OpenBBField(description="End date of the data, in YYYY-MM-DD format."),
|
| 398 |
+
] = None,
|
| 399 |
+
index_type: Annotated[
|
| 400 |
+
Literal["aaa", "baa"], OpenBBField(description="The type of series.")
|
| 401 |
+
] = "aaa",
|
| 402 |
+
provider: Annotated[
|
| 403 |
+
Optional[Literal["fred"]],
|
| 404 |
+
OpenBBField(
|
| 405 |
+
description="The provider to use, by default None. If None, the priority list configured in the settings is used. Default priority: fred."
|
| 406 |
+
),
|
| 407 |
+
] = None,
|
| 408 |
+
**kwargs
|
| 409 |
+
) -> OBBject:
|
| 410 |
+
"""Moody Corporate Bond Index.
|
| 411 |
+
|
| 412 |
+
Moody's Aaa and Baa are investment bonds that acts as an index of
|
| 413 |
+
the performance of all bonds given an Aaa or Baa rating by Moody's Investors Service respectively.
|
| 414 |
+
These corporate bonds often are used in macroeconomics as an alternative to the federal ten-year
|
| 415 |
+
Treasury Bill as an indicator of the interest rate.
|
| 416 |
+
|
| 417 |
+
|
| 418 |
+
Parameters
|
| 419 |
+
----------
|
| 420 |
+
provider : str
|
| 421 |
+
The provider to use, by default None. If None, the priority list configured in the settings is used. Default priority: fred.
|
| 422 |
+
start_date : Union[date, None, str]
|
| 423 |
+
Start date of the data, in YYYY-MM-DD format.
|
| 424 |
+
end_date : Union[date, None, str]
|
| 425 |
+
End date of the data, in YYYY-MM-DD format.
|
| 426 |
+
index_type : Literal['aaa', 'baa']
|
| 427 |
+
The type of series.
|
| 428 |
+
spread : Optional[Literal['treasury', 'fed_funds']]
|
| 429 |
+
The type of spread. (provider: fred)
|
| 430 |
+
|
| 431 |
+
Returns
|
| 432 |
+
-------
|
| 433 |
+
OBBject
|
| 434 |
+
results : list[MoodyCorporateBondIndex]
|
| 435 |
+
Serializable results.
|
| 436 |
+
provider : Optional[str]
|
| 437 |
+
Provider name.
|
| 438 |
+
warnings : Optional[list[Warning_]]
|
| 439 |
+
list of warnings.
|
| 440 |
+
chart : Optional[Chart]
|
| 441 |
+
Chart object.
|
| 442 |
+
extra : Dict[str, Any]
|
| 443 |
+
Extra info.
|
| 444 |
+
|
| 445 |
+
MoodyCorporateBondIndex
|
| 446 |
+
-----------------------
|
| 447 |
+
date : date
|
| 448 |
+
The date of the data.
|
| 449 |
+
rate : Optional[float]
|
| 450 |
+
Moody Corporate Bond Index Rate.
|
| 451 |
+
|
| 452 |
+
Examples
|
| 453 |
+
--------
|
| 454 |
+
>>> from openbb import obb
|
| 455 |
+
>>> obb.fixedincome.corporate.moody(provider='fred')
|
| 456 |
+
>>> obb.fixedincome.corporate.moody(index_type='baa', provider='fred')
|
| 457 |
+
""" # noqa: E501
|
| 458 |
+
|
| 459 |
+
simplefilter("always", DeprecationWarning)
|
| 460 |
+
warn(
|
| 461 |
+
"This endpoint is deprecated; use `/fixedincome/bond_indices` instead. Set `category` to `us` and `index` to `seasoned_corporate`. Deprecated in OpenBB Platform V4.2 to be removed in V4.5.",
|
| 462 |
+
category=DeprecationWarning,
|
| 463 |
+
stacklevel=2,
|
| 464 |
+
)
|
| 465 |
+
|
| 466 |
+
return self._run(
|
| 467 |
+
"/fixedincome/corporate/moody",
|
| 468 |
+
**filter_inputs(
|
| 469 |
+
provider_choices={
|
| 470 |
+
"provider": self._get_provider(
|
| 471 |
+
provider,
|
| 472 |
+
"fixedincome.corporate.moody",
|
| 473 |
+
("fred",),
|
| 474 |
+
)
|
| 475 |
+
},
|
| 476 |
+
standard_params={
|
| 477 |
+
"start_date": start_date,
|
| 478 |
+
"end_date": end_date,
|
| 479 |
+
"index_type": index_type,
|
| 480 |
+
},
|
| 481 |
+
extra_params=kwargs,
|
| 482 |
+
)
|
| 483 |
+
)
|
| 484 |
+
|
| 485 |
+
@exception_handler
|
| 486 |
+
@validate
|
| 487 |
+
def spot_rates(
|
| 488 |
+
self,
|
| 489 |
+
start_date: Annotated[
|
| 490 |
+
Union[datetime.date, None, str],
|
| 491 |
+
OpenBBField(description="Start date of the data, in YYYY-MM-DD format."),
|
| 492 |
+
] = None,
|
| 493 |
+
end_date: Annotated[
|
| 494 |
+
Union[datetime.date, None, str],
|
| 495 |
+
OpenBBField(description="End date of the data, in YYYY-MM-DD format."),
|
| 496 |
+
] = None,
|
| 497 |
+
maturity: Annotated[
|
| 498 |
+
Union[float, str, list[Union[float, str]]],
|
| 499 |
+
OpenBBField(
|
| 500 |
+
description="Maturities in years. Multiple comma separated items allowed for provider(s): fred."
|
| 501 |
+
),
|
| 502 |
+
] = 10.0,
|
| 503 |
+
category: Annotated[
|
| 504 |
+
Union[str, list[str]],
|
| 505 |
+
OpenBBField(
|
| 506 |
+
description="Rate category. Options: spot_rate, par_yield. Multiple comma separated items allowed for provider(s): fred.\nChoices for fred: 'par_yield', 'spot_rate'"
|
| 507 |
+
),
|
| 508 |
+
] = "spot_rate",
|
| 509 |
+
provider: Annotated[
|
| 510 |
+
Optional[Literal["fred"]],
|
| 511 |
+
OpenBBField(
|
| 512 |
+
description="The provider to use, by default None. If None, the priority list configured in the settings is used. Default priority: fred."
|
| 513 |
+
),
|
| 514 |
+
] = None,
|
| 515 |
+
**kwargs
|
| 516 |
+
) -> OBBject:
|
| 517 |
+
"""Spot Rates.
|
| 518 |
+
|
| 519 |
+
The spot rates for any maturity is the yield on a bond that provides a single payment at that maturity.
|
| 520 |
+
This is a zero coupon bond.
|
| 521 |
+
Because each spot rate pertains to a single cashflow, it is the relevant interest rate
|
| 522 |
+
concept for discounting a pension liability at the same maturity.
|
| 523 |
+
|
| 524 |
+
|
| 525 |
+
Parameters
|
| 526 |
+
----------
|
| 527 |
+
provider : str
|
| 528 |
+
The provider to use, by default None. If None, the priority list configured in the settings is used. Default priority: fred.
|
| 529 |
+
start_date : Union[date, None, str]
|
| 530 |
+
Start date of the data, in YYYY-MM-DD format.
|
| 531 |
+
end_date : Union[date, None, str]
|
| 532 |
+
End date of the data, in YYYY-MM-DD format.
|
| 533 |
+
maturity : Union[float, str, list[Union[float, str]]]
|
| 534 |
+
Maturities in years. Multiple comma separated items allowed for provider(s): fred.
|
| 535 |
+
category : Union[str, list[str]]
|
| 536 |
+
Rate category. Options: spot_rate, par_yield. Multiple comma separated items allowed for provider(s): fred.
|
| 537 |
+
Choices for fred: 'par_yield', 'spot_rate'
|
| 538 |
+
|
| 539 |
+
Returns
|
| 540 |
+
-------
|
| 541 |
+
OBBject
|
| 542 |
+
results : list[SpotRate]
|
| 543 |
+
Serializable results.
|
| 544 |
+
provider : Optional[str]
|
| 545 |
+
Provider name.
|
| 546 |
+
warnings : Optional[list[Warning_]]
|
| 547 |
+
list of warnings.
|
| 548 |
+
chart : Optional[Chart]
|
| 549 |
+
Chart object.
|
| 550 |
+
extra : Dict[str, Any]
|
| 551 |
+
Extra info.
|
| 552 |
+
|
| 553 |
+
SpotRate
|
| 554 |
+
--------
|
| 555 |
+
date : date
|
| 556 |
+
The date of the data.
|
| 557 |
+
rate : Optional[float]
|
| 558 |
+
Spot Rate.
|
| 559 |
+
|
| 560 |
+
Examples
|
| 561 |
+
--------
|
| 562 |
+
>>> from openbb import obb
|
| 563 |
+
>>> obb.fixedincome.corporate.spot_rates(provider='fred')
|
| 564 |
+
>>> obb.fixedincome.corporate.spot_rates(maturity='10,20,30,50', provider='fred')
|
| 565 |
+
""" # noqa: E501
|
| 566 |
+
|
| 567 |
+
return self._run(
|
| 568 |
+
"/fixedincome/corporate/spot_rates",
|
| 569 |
+
**filter_inputs(
|
| 570 |
+
provider_choices={
|
| 571 |
+
"provider": self._get_provider(
|
| 572 |
+
provider,
|
| 573 |
+
"fixedincome.corporate.spot_rates",
|
| 574 |
+
("fred",),
|
| 575 |
+
)
|
| 576 |
+
},
|
| 577 |
+
standard_params={
|
| 578 |
+
"start_date": start_date,
|
| 579 |
+
"end_date": end_date,
|
| 580 |
+
"maturity": maturity,
|
| 581 |
+
"category": category,
|
| 582 |
+
},
|
| 583 |
+
extra_params=kwargs,
|
| 584 |
+
info={
|
| 585 |
+
"maturity": {
|
| 586 |
+
"fred": {"multiple_items_allowed": True, "choices": None}
|
| 587 |
+
},
|
| 588 |
+
"category": {
|
| 589 |
+
"fred": {
|
| 590 |
+
"multiple_items_allowed": True,
|
| 591 |
+
"choices": ["par_yield", "spot_rate"],
|
| 592 |
+
}
|
| 593 |
+
},
|
| 594 |
+
},
|
| 595 |
+
)
|
| 596 |
+
)
|
openbb_platform/openbb/package/fixedincome_government.py
ADDED
|
@@ -0,0 +1,360 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
### THIS FILE IS AUTO-GENERATED. DO NOT EDIT. ###
|
| 2 |
+
|
| 3 |
+
import datetime
|
| 4 |
+
from typing import Literal, Optional, Union
|
| 5 |
+
|
| 6 |
+
from openbb_core.app.model.field import OpenBBField
|
| 7 |
+
from openbb_core.app.model.obbject import OBBject
|
| 8 |
+
from openbb_core.app.static.container import Container
|
| 9 |
+
from openbb_core.app.static.utils.decorators import exception_handler, validate
|
| 10 |
+
from openbb_core.app.static.utils.filters import filter_inputs
|
| 11 |
+
from typing_extensions import Annotated
|
| 12 |
+
|
| 13 |
+
|
| 14 |
+
class ROUTER_fixedincome_government(Container):
|
| 15 |
+
"""/fixedincome/government
|
| 16 |
+
tips_yields
|
| 17 |
+
treasury_rates
|
| 18 |
+
yield_curve
|
| 19 |
+
"""
|
| 20 |
+
|
| 21 |
+
def __repr__(self) -> str:
|
| 22 |
+
return self.__doc__ or ""
|
| 23 |
+
|
| 24 |
+
@exception_handler
|
| 25 |
+
@validate
|
| 26 |
+
def tips_yields(
|
| 27 |
+
self,
|
| 28 |
+
start_date: Annotated[
|
| 29 |
+
Union[datetime.date, None, str],
|
| 30 |
+
OpenBBField(description="Start date of the data, in YYYY-MM-DD format."),
|
| 31 |
+
] = None,
|
| 32 |
+
end_date: Annotated[
|
| 33 |
+
Union[datetime.date, None, str],
|
| 34 |
+
OpenBBField(description="End date of the data, in YYYY-MM-DD format."),
|
| 35 |
+
] = None,
|
| 36 |
+
provider: Annotated[
|
| 37 |
+
Optional[Literal["fred"]],
|
| 38 |
+
OpenBBField(
|
| 39 |
+
description="The provider to use, by default None. If None, the priority list configured in the settings is used. Default priority: fred."
|
| 40 |
+
),
|
| 41 |
+
] = None,
|
| 42 |
+
**kwargs
|
| 43 |
+
) -> OBBject:
|
| 44 |
+
"""Get current Treasury inflation-protected securities yields.
|
| 45 |
+
|
| 46 |
+
Parameters
|
| 47 |
+
----------
|
| 48 |
+
provider : str
|
| 49 |
+
The provider to use, by default None. If None, the priority list configured in the settings is used. Default priority: fred.
|
| 50 |
+
start_date : Union[date, None, str]
|
| 51 |
+
Start date of the data, in YYYY-MM-DD format.
|
| 52 |
+
end_date : Union[date, None, str]
|
| 53 |
+
End date of the data, in YYYY-MM-DD format.
|
| 54 |
+
maturity : Optional[Literal['5', '10', '20', '30']]
|
| 55 |
+
The maturity of the security in years - 5, 10, 20, 30 - defaults to all. Note that the maturity is the tenor of the security, not the time to maturity. (provider: fred)
|
| 56 |
+
frequency : Optional[Literal['a', 'q', 'm', 'w', 'd', 'wef', 'weth', 'wew', 'wetu', 'wem', 'wesu', 'wesa', 'bwew', 'bwem']]
|
| 57 |
+
Frequency aggregation to convert high frequency data to lower frequency.
|
| 58 |
+
None = No change
|
| 59 |
+
a = Annual
|
| 60 |
+
q = Quarterly
|
| 61 |
+
m = Monthly
|
| 62 |
+
w = Weekly
|
| 63 |
+
d = Daily
|
| 64 |
+
wef = Weekly, Ending Friday
|
| 65 |
+
weth = Weekly, Ending Thursday
|
| 66 |
+
wew = Weekly, Ending Wednesday
|
| 67 |
+
wetu = Weekly, Ending Tuesday
|
| 68 |
+
wem = Weekly, Ending Monday
|
| 69 |
+
wesu = Weekly, Ending Sunday
|
| 70 |
+
wesa = Weekly, Ending Saturday
|
| 71 |
+
bwew = Biweekly, Ending Wednesday
|
| 72 |
+
bwem = Biweekly, Ending Monday
|
| 73 |
+
(provider: fred)
|
| 74 |
+
aggregation_method : Optional[Literal['avg', 'sum', 'eop']]
|
| 75 |
+
A key that indicates the aggregation method used for frequency aggregation.
|
| 76 |
+
avg = Average
|
| 77 |
+
sum = Sum
|
| 78 |
+
eop = End of Period
|
| 79 |
+
(provider: fred)
|
| 80 |
+
transform : Optional[Literal['chg', 'ch1', 'pch', 'pc1', 'pca', 'cch', 'cca']]
|
| 81 |
+
Transformation type
|
| 82 |
+
None = No transformation
|
| 83 |
+
chg = Change
|
| 84 |
+
ch1 = Change from Year Ago
|
| 85 |
+
pch = Percent Change
|
| 86 |
+
pc1 = Percent Change from Year Ago
|
| 87 |
+
pca = Compounded Annual Rate of Change
|
| 88 |
+
cch = Continuously Compounded Rate of Change
|
| 89 |
+
cca = Continuously Compounded Annual Rate of Change
|
| 90 |
+
(provider: fred)
|
| 91 |
+
|
| 92 |
+
Returns
|
| 93 |
+
-------
|
| 94 |
+
OBBject
|
| 95 |
+
results : list[TipsYields]
|
| 96 |
+
Serializable results.
|
| 97 |
+
provider : Optional[str]
|
| 98 |
+
Provider name.
|
| 99 |
+
warnings : Optional[list[Warning_]]
|
| 100 |
+
list of warnings.
|
| 101 |
+
chart : Optional[Chart]
|
| 102 |
+
Chart object.
|
| 103 |
+
extra : Dict[str, Any]
|
| 104 |
+
Extra info.
|
| 105 |
+
|
| 106 |
+
TipsYields
|
| 107 |
+
----------
|
| 108 |
+
date : date
|
| 109 |
+
The date of the data.
|
| 110 |
+
symbol : Optional[str]
|
| 111 |
+
Symbol representing the entity requested in the data.
|
| 112 |
+
due : Optional[date]
|
| 113 |
+
The due date (maturation date) of the security.
|
| 114 |
+
name : Optional[str]
|
| 115 |
+
The name of the security.
|
| 116 |
+
value : Optional[float]
|
| 117 |
+
The yield value.
|
| 118 |
+
|
| 119 |
+
Examples
|
| 120 |
+
--------
|
| 121 |
+
>>> from openbb import obb
|
| 122 |
+
>>> obb.fixedincome.government.tips_yields(provider='fred')
|
| 123 |
+
>>> obb.fixedincome.government.tips_yields(maturity='10', provider='fred')
|
| 124 |
+
""" # noqa: E501
|
| 125 |
+
|
| 126 |
+
return self._run(
|
| 127 |
+
"/fixedincome/government/tips_yields",
|
| 128 |
+
**filter_inputs(
|
| 129 |
+
provider_choices={
|
| 130 |
+
"provider": self._get_provider(
|
| 131 |
+
provider,
|
| 132 |
+
"fixedincome.government.tips_yields",
|
| 133 |
+
("fred",),
|
| 134 |
+
)
|
| 135 |
+
},
|
| 136 |
+
standard_params={
|
| 137 |
+
"start_date": start_date,
|
| 138 |
+
"end_date": end_date,
|
| 139 |
+
},
|
| 140 |
+
extra_params=kwargs,
|
| 141 |
+
)
|
| 142 |
+
)
|
| 143 |
+
|
| 144 |
+
@exception_handler
|
| 145 |
+
@validate
|
| 146 |
+
def treasury_rates(
|
| 147 |
+
self,
|
| 148 |
+
start_date: Annotated[
|
| 149 |
+
Union[datetime.date, None, str],
|
| 150 |
+
OpenBBField(description="Start date of the data, in YYYY-MM-DD format."),
|
| 151 |
+
] = None,
|
| 152 |
+
end_date: Annotated[
|
| 153 |
+
Union[datetime.date, None, str],
|
| 154 |
+
OpenBBField(description="End date of the data, in YYYY-MM-DD format."),
|
| 155 |
+
] = None,
|
| 156 |
+
provider: Annotated[
|
| 157 |
+
Optional[Literal["federal_reserve", "fmp"]],
|
| 158 |
+
OpenBBField(
|
| 159 |
+
description="The provider to use, by default None. If None, the priority list configured in the settings is used. Default priority: federal_reserve, fmp."
|
| 160 |
+
),
|
| 161 |
+
] = None,
|
| 162 |
+
**kwargs
|
| 163 |
+
) -> OBBject:
|
| 164 |
+
"""Government Treasury Rates.
|
| 165 |
+
|
| 166 |
+
Parameters
|
| 167 |
+
----------
|
| 168 |
+
provider : str
|
| 169 |
+
The provider to use, by default None. If None, the priority list configured in the settings is used. Default priority: federal_reserve, fmp.
|
| 170 |
+
start_date : Union[date, None, str]
|
| 171 |
+
Start date of the data, in YYYY-MM-DD format.
|
| 172 |
+
end_date : Union[date, None, str]
|
| 173 |
+
End date of the data, in YYYY-MM-DD format.
|
| 174 |
+
|
| 175 |
+
Returns
|
| 176 |
+
-------
|
| 177 |
+
OBBject
|
| 178 |
+
results : list[TreasuryRates]
|
| 179 |
+
Serializable results.
|
| 180 |
+
provider : Optional[str]
|
| 181 |
+
Provider name.
|
| 182 |
+
warnings : Optional[list[Warning_]]
|
| 183 |
+
list of warnings.
|
| 184 |
+
chart : Optional[Chart]
|
| 185 |
+
Chart object.
|
| 186 |
+
extra : Dict[str, Any]
|
| 187 |
+
Extra info.
|
| 188 |
+
|
| 189 |
+
TreasuryRates
|
| 190 |
+
-------------
|
| 191 |
+
date : date
|
| 192 |
+
The date of the data.
|
| 193 |
+
week_4 : Optional[float]
|
| 194 |
+
4 week Treasury bills rate (secondary market).
|
| 195 |
+
month_1 : Optional[float]
|
| 196 |
+
1 month Treasury rate.
|
| 197 |
+
month_2 : Optional[float]
|
| 198 |
+
2 month Treasury rate.
|
| 199 |
+
month_3 : Optional[float]
|
| 200 |
+
3 month Treasury rate.
|
| 201 |
+
month_6 : Optional[float]
|
| 202 |
+
6 month Treasury rate.
|
| 203 |
+
year_1 : Optional[float]
|
| 204 |
+
1 year Treasury rate.
|
| 205 |
+
year_2 : Optional[float]
|
| 206 |
+
2 year Treasury rate.
|
| 207 |
+
year_3 : Optional[float]
|
| 208 |
+
3 year Treasury rate.
|
| 209 |
+
year_5 : Optional[float]
|
| 210 |
+
5 year Treasury rate.
|
| 211 |
+
year_7 : Optional[float]
|
| 212 |
+
7 year Treasury rate.
|
| 213 |
+
year_10 : Optional[float]
|
| 214 |
+
10 year Treasury rate.
|
| 215 |
+
year_20 : Optional[float]
|
| 216 |
+
20 year Treasury rate.
|
| 217 |
+
year_30 : Optional[float]
|
| 218 |
+
30 year Treasury rate.
|
| 219 |
+
|
| 220 |
+
Examples
|
| 221 |
+
--------
|
| 222 |
+
>>> from openbb import obb
|
| 223 |
+
>>> obb.fixedincome.government.treasury_rates(provider='fmp')
|
| 224 |
+
""" # noqa: E501
|
| 225 |
+
|
| 226 |
+
return self._run(
|
| 227 |
+
"/fixedincome/government/treasury_rates",
|
| 228 |
+
**filter_inputs(
|
| 229 |
+
provider_choices={
|
| 230 |
+
"provider": self._get_provider(
|
| 231 |
+
provider,
|
| 232 |
+
"fixedincome.government.treasury_rates",
|
| 233 |
+
("federal_reserve", "fmp"),
|
| 234 |
+
)
|
| 235 |
+
},
|
| 236 |
+
standard_params={
|
| 237 |
+
"start_date": start_date,
|
| 238 |
+
"end_date": end_date,
|
| 239 |
+
},
|
| 240 |
+
extra_params=kwargs,
|
| 241 |
+
)
|
| 242 |
+
)
|
| 243 |
+
|
| 244 |
+
@exception_handler
|
| 245 |
+
@validate
|
| 246 |
+
def yield_curve(
|
| 247 |
+
self,
|
| 248 |
+
date: Annotated[
|
| 249 |
+
Union[datetime.date, str, None, list[Union[datetime.date, str, None]]],
|
| 250 |
+
OpenBBField(
|
| 251 |
+
description="A specific date to get data for. By default is the current data. Multiple comma separated items allowed for provider(s): econdb, federal_reserve, fmp, fred."
|
| 252 |
+
),
|
| 253 |
+
] = None,
|
| 254 |
+
provider: Annotated[
|
| 255 |
+
Optional[Literal["econdb", "federal_reserve", "fmp", "fred"]],
|
| 256 |
+
OpenBBField(
|
| 257 |
+
description="The provider to use, by default None. If None, the priority list configured in the settings is used. Default priority: econdb, federal_reserve, fmp, fred."
|
| 258 |
+
),
|
| 259 |
+
] = None,
|
| 260 |
+
**kwargs
|
| 261 |
+
) -> OBBject:
|
| 262 |
+
"""Get yield curve data by country and date.
|
| 263 |
+
|
| 264 |
+
Parameters
|
| 265 |
+
----------
|
| 266 |
+
provider : str
|
| 267 |
+
The provider to use, by default None. If None, the priority list configured in the settings is used. Default priority: econdb, federal_reserve, fmp, fred.
|
| 268 |
+
date : Union[date, str, None, list[Union[date, str, None]]]
|
| 269 |
+
A specific date to get data for. By default is the current data. Multiple comma separated items allowed for provider(s): econdb, federal_reserve, fmp, fred.
|
| 270 |
+
country : str
|
| 271 |
+
The country to get data. New Zealand, Mexico, Singapore, and Thailand have only monthly data. The nearest date to the requested one will be used. Multiple comma separated items allowed. (provider: econdb)
|
| 272 |
+
use_cache : bool
|
| 273 |
+
If true, cache the request for four hours. (provider: econdb)
|
| 274 |
+
yield_curve_type : Literal['nominal', 'real', 'breakeven', 'treasury_minus_fed_funds', 'corporate_spot', 'corporate_par']
|
| 275 |
+
Yield curve type. Nominal and Real Rates are available daily, others are monthly. The closest date to the requested date will be returned. (provider: fred)
|
| 276 |
+
|
| 277 |
+
Returns
|
| 278 |
+
-------
|
| 279 |
+
OBBject
|
| 280 |
+
results : list[YieldCurve]
|
| 281 |
+
Serializable results.
|
| 282 |
+
provider : Optional[str]
|
| 283 |
+
Provider name.
|
| 284 |
+
warnings : Optional[list[Warning_]]
|
| 285 |
+
list of warnings.
|
| 286 |
+
chart : Optional[Chart]
|
| 287 |
+
Chart object.
|
| 288 |
+
extra : Dict[str, Any]
|
| 289 |
+
Extra info.
|
| 290 |
+
|
| 291 |
+
YieldCurve
|
| 292 |
+
----------
|
| 293 |
+
date : Optional[date]
|
| 294 |
+
The date of the data.
|
| 295 |
+
maturity : str
|
| 296 |
+
Maturity length of the security.
|
| 297 |
+
|
| 298 |
+
Examples
|
| 299 |
+
--------
|
| 300 |
+
>>> from openbb import obb
|
| 301 |
+
>>> obb.fixedincome.government.yield_curve(provider='federal_reserve')
|
| 302 |
+
>>> obb.fixedincome.government.yield_curve(date='2023-05-01,2024-05-01', provider='fmp')
|
| 303 |
+
>>> obb.fixedincome.government.yield_curve(date='2023-05-01', country='united_kingdom', provider='econdb')
|
| 304 |
+
>>> obb.fixedincome.government.yield_curve(provider='fred', yield_curve_type='real', date='2023-05-01,2024-05-01')
|
| 305 |
+
""" # noqa: E501
|
| 306 |
+
|
| 307 |
+
return self._run(
|
| 308 |
+
"/fixedincome/government/yield_curve",
|
| 309 |
+
**filter_inputs(
|
| 310 |
+
provider_choices={
|
| 311 |
+
"provider": self._get_provider(
|
| 312 |
+
provider,
|
| 313 |
+
"fixedincome.government.yield_curve",
|
| 314 |
+
("econdb", "federal_reserve", "fmp", "fred"),
|
| 315 |
+
)
|
| 316 |
+
},
|
| 317 |
+
standard_params={
|
| 318 |
+
"date": date,
|
| 319 |
+
},
|
| 320 |
+
extra_params=kwargs,
|
| 321 |
+
info={
|
| 322 |
+
"date": {
|
| 323 |
+
"econdb": {"multiple_items_allowed": True, "choices": None},
|
| 324 |
+
"federal_reserve": {
|
| 325 |
+
"multiple_items_allowed": True,
|
| 326 |
+
"choices": None,
|
| 327 |
+
},
|
| 328 |
+
"fmp": {"multiple_items_allowed": True, "choices": None},
|
| 329 |
+
"fred": {"multiple_items_allowed": True, "choices": None},
|
| 330 |
+
},
|
| 331 |
+
"country": {
|
| 332 |
+
"econdb": {
|
| 333 |
+
"multiple_items_allowed": True,
|
| 334 |
+
"choices": [
|
| 335 |
+
"australia",
|
| 336 |
+
"canada",
|
| 337 |
+
"china",
|
| 338 |
+
"ecb_instantaneous_forward",
|
| 339 |
+
"ecb_par_yield",
|
| 340 |
+
"ecb_spot_rate",
|
| 341 |
+
"hong_kong",
|
| 342 |
+
"india",
|
| 343 |
+
"japan",
|
| 344 |
+
"mexico",
|
| 345 |
+
"new_zealand",
|
| 346 |
+
"russia",
|
| 347 |
+
"saudi_arabia",
|
| 348 |
+
"singapore",
|
| 349 |
+
"south_africa",
|
| 350 |
+
"south_korea",
|
| 351 |
+
"taiwan",
|
| 352 |
+
"thailand",
|
| 353 |
+
"united_kingdom",
|
| 354 |
+
"united_states",
|
| 355 |
+
],
|
| 356 |
+
}
|
| 357 |
+
},
|
| 358 |
+
},
|
| 359 |
+
)
|
| 360 |
+
)
|
openbb_platform/openbb/package/fixedincome_rate.py
ADDED
|
@@ -0,0 +1,1159 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
### THIS FILE IS AUTO-GENERATED. DO NOT EDIT. ###
|
| 2 |
+
|
| 3 |
+
import datetime
|
| 4 |
+
from typing import Literal, Optional, Union
|
| 5 |
+
|
| 6 |
+
from openbb_core.app.model.field import OpenBBField
|
| 7 |
+
from openbb_core.app.model.obbject import OBBject
|
| 8 |
+
from openbb_core.app.static.container import Container
|
| 9 |
+
from openbb_core.app.static.utils.decorators import exception_handler, validate
|
| 10 |
+
from openbb_core.app.static.utils.filters import filter_inputs
|
| 11 |
+
from typing_extensions import Annotated
|
| 12 |
+
|
| 13 |
+
|
| 14 |
+
class ROUTER_fixedincome_rate(Container):
|
| 15 |
+
"""/fixedincome/rate
|
| 16 |
+
ameribor
|
| 17 |
+
dpcredit
|
| 18 |
+
ecb
|
| 19 |
+
effr
|
| 20 |
+
effr_forecast
|
| 21 |
+
estr
|
| 22 |
+
iorb
|
| 23 |
+
overnight_bank_funding
|
| 24 |
+
sofr
|
| 25 |
+
sonia
|
| 26 |
+
"""
|
| 27 |
+
|
| 28 |
+
def __repr__(self) -> str:
|
| 29 |
+
return self.__doc__ or ""
|
| 30 |
+
|
| 31 |
+
@exception_handler
|
| 32 |
+
@validate
|
| 33 |
+
def ameribor(
|
| 34 |
+
self,
|
| 35 |
+
start_date: Annotated[
|
| 36 |
+
Union[datetime.date, None, str],
|
| 37 |
+
OpenBBField(description="Start date of the data, in YYYY-MM-DD format."),
|
| 38 |
+
] = None,
|
| 39 |
+
end_date: Annotated[
|
| 40 |
+
Union[datetime.date, None, str],
|
| 41 |
+
OpenBBField(description="End date of the data, in YYYY-MM-DD format."),
|
| 42 |
+
] = None,
|
| 43 |
+
provider: Annotated[
|
| 44 |
+
Optional[Literal["fred"]],
|
| 45 |
+
OpenBBField(
|
| 46 |
+
description="The provider to use, by default None. If None, the priority list configured in the settings is used. Default priority: fred."
|
| 47 |
+
),
|
| 48 |
+
] = None,
|
| 49 |
+
**kwargs
|
| 50 |
+
) -> OBBject:
|
| 51 |
+
"""AMERIBOR.
|
| 52 |
+
|
| 53 |
+
AMERIBOR (short for the American interbank offered rate) is a benchmark interest rate that reflects the true cost of
|
| 54 |
+
short-term interbank borrowing. This rate is based on transactions in overnight unsecured loans conducted on the
|
| 55 |
+
American Financial Exchange (AFX).
|
| 56 |
+
|
| 57 |
+
|
| 58 |
+
Parameters
|
| 59 |
+
----------
|
| 60 |
+
provider : str
|
| 61 |
+
The provider to use, by default None. If None, the priority list configured in the settings is used. Default priority: fred.
|
| 62 |
+
start_date : Union[date, None, str]
|
| 63 |
+
Start date of the data, in YYYY-MM-DD format.
|
| 64 |
+
end_date : Union[date, None, str]
|
| 65 |
+
End date of the data, in YYYY-MM-DD format.
|
| 66 |
+
maturity : Union[Literal['all', 'overnight', 'average_30d', 'average_90d', 'term_30d', 'term_90d'], str]
|
| 67 |
+
Period of AMERIBOR rate. Multiple comma separated items allowed. (provider: fred)
|
| 68 |
+
frequency : Optional[Literal['a', 'q', 'm', 'w', 'wef', 'weth', 'wew', 'wetu', 'wem', 'wesu', 'wesa', 'bwew', 'bwem']]
|
| 69 |
+
|
| 70 |
+
Frequency aggregation to convert daily data to lower frequency.
|
| 71 |
+
a = Annual
|
| 72 |
+
q = Quarterly
|
| 73 |
+
m = Monthly
|
| 74 |
+
w = Weekly
|
| 75 |
+
wef = Weekly, Ending Friday
|
| 76 |
+
weth = Weekly, Ending Thursday
|
| 77 |
+
wew = Weekly, Ending Wednesday
|
| 78 |
+
wetu = Weekly, Ending Tuesday
|
| 79 |
+
wem = Weekly, Ending Monday
|
| 80 |
+
wesu = Weekly, Ending Sunday
|
| 81 |
+
wesa = Weekly, Ending Saturday
|
| 82 |
+
bwew = Biweekly, Ending Wednesday
|
| 83 |
+
bwem = Biweekly, Ending Monday
|
| 84 |
+
(provider: fred)
|
| 85 |
+
aggregation_method : Optional[Literal['avg', 'sum', 'eop']]
|
| 86 |
+
|
| 87 |
+
A key that indicates the aggregation method used for frequency aggregation.
|
| 88 |
+
avg = Average
|
| 89 |
+
sum = Sum
|
| 90 |
+
eop = End of Period
|
| 91 |
+
(provider: fred)
|
| 92 |
+
transform : Optional[Literal['chg', 'ch1', 'pch', 'pc1', 'pca', 'cch', 'cca', 'log']]
|
| 93 |
+
|
| 94 |
+
Transformation type
|
| 95 |
+
None = No transformation
|
| 96 |
+
chg = Change
|
| 97 |
+
ch1 = Change from Year Ago
|
| 98 |
+
pch = Percent Change
|
| 99 |
+
pc1 = Percent Change from Year Ago
|
| 100 |
+
pca = Compounded Annual Rate of Change
|
| 101 |
+
cch = Continuously Compounded Rate of Change
|
| 102 |
+
cca = Continuously Compounded Annual Rate of Change
|
| 103 |
+
log = Natural Log
|
| 104 |
+
(provider: fred)
|
| 105 |
+
|
| 106 |
+
Returns
|
| 107 |
+
-------
|
| 108 |
+
OBBject
|
| 109 |
+
results : list[Ameribor]
|
| 110 |
+
Serializable results.
|
| 111 |
+
provider : Optional[str]
|
| 112 |
+
Provider name.
|
| 113 |
+
warnings : Optional[list[Warning_]]
|
| 114 |
+
list of warnings.
|
| 115 |
+
chart : Optional[Chart]
|
| 116 |
+
Chart object.
|
| 117 |
+
extra : Dict[str, Any]
|
| 118 |
+
Extra info.
|
| 119 |
+
|
| 120 |
+
Ameribor
|
| 121 |
+
--------
|
| 122 |
+
date : date
|
| 123 |
+
The date of the data.
|
| 124 |
+
symbol : Optional[str]
|
| 125 |
+
Symbol representing the entity requested in the data.
|
| 126 |
+
maturity : str
|
| 127 |
+
Maturity length of the item.
|
| 128 |
+
rate : float
|
| 129 |
+
Interest rate.
|
| 130 |
+
title : Optional[str]
|
| 131 |
+
Title of the series.
|
| 132 |
+
|
| 133 |
+
Examples
|
| 134 |
+
--------
|
| 135 |
+
>>> from openbb import obb
|
| 136 |
+
>>> obb.fixedincome.rate.ameribor(provider='fred')
|
| 137 |
+
>>> # The change from one year ago is applied with the transform parameter.
|
| 138 |
+
>>> obb.fixedincome.rate.ameribor(maturity='all', transform='pc1', provider='fred')
|
| 139 |
+
""" # noqa: E501
|
| 140 |
+
|
| 141 |
+
return self._run(
|
| 142 |
+
"/fixedincome/rate/ameribor",
|
| 143 |
+
**filter_inputs(
|
| 144 |
+
provider_choices={
|
| 145 |
+
"provider": self._get_provider(
|
| 146 |
+
provider,
|
| 147 |
+
"fixedincome.rate.ameribor",
|
| 148 |
+
("fred",),
|
| 149 |
+
)
|
| 150 |
+
},
|
| 151 |
+
standard_params={
|
| 152 |
+
"start_date": start_date,
|
| 153 |
+
"end_date": end_date,
|
| 154 |
+
},
|
| 155 |
+
extra_params=kwargs,
|
| 156 |
+
info={
|
| 157 |
+
"maturity": {
|
| 158 |
+
"fred": {
|
| 159 |
+
"multiple_items_allowed": True,
|
| 160 |
+
"choices": [
|
| 161 |
+
"all",
|
| 162 |
+
"overnight",
|
| 163 |
+
"average_30d",
|
| 164 |
+
"average_90d",
|
| 165 |
+
"term_30d",
|
| 166 |
+
"term_90d",
|
| 167 |
+
],
|
| 168 |
+
}
|
| 169 |
+
}
|
| 170 |
+
},
|
| 171 |
+
)
|
| 172 |
+
)
|
| 173 |
+
|
| 174 |
+
@exception_handler
|
| 175 |
+
@validate
|
| 176 |
+
def dpcredit(
|
| 177 |
+
self,
|
| 178 |
+
start_date: Annotated[
|
| 179 |
+
Union[datetime.date, None, str],
|
| 180 |
+
OpenBBField(description="Start date of the data, in YYYY-MM-DD format."),
|
| 181 |
+
] = None,
|
| 182 |
+
end_date: Annotated[
|
| 183 |
+
Union[datetime.date, None, str],
|
| 184 |
+
OpenBBField(description="End date of the data, in YYYY-MM-DD format."),
|
| 185 |
+
] = None,
|
| 186 |
+
provider: Annotated[
|
| 187 |
+
Optional[Literal["fred"]],
|
| 188 |
+
OpenBBField(
|
| 189 |
+
description="The provider to use, by default None. If None, the priority list configured in the settings is used. Default priority: fred."
|
| 190 |
+
),
|
| 191 |
+
] = None,
|
| 192 |
+
**kwargs
|
| 193 |
+
) -> OBBject:
|
| 194 |
+
"""Discount Window Primary Credit Rate.
|
| 195 |
+
|
| 196 |
+
A bank rate is the interest rate a nation's central bank charges to its domestic banks to borrow money.
|
| 197 |
+
The rates central banks charge are set to stabilize the economy.
|
| 198 |
+
In the United States, the Federal Reserve System's Board of Governors set the bank rate,
|
| 199 |
+
also known as the discount rate.
|
| 200 |
+
|
| 201 |
+
|
| 202 |
+
Parameters
|
| 203 |
+
----------
|
| 204 |
+
provider : str
|
| 205 |
+
The provider to use, by default None. If None, the priority list configured in the settings is used. Default priority: fred.
|
| 206 |
+
start_date : Union[date, None, str]
|
| 207 |
+
Start date of the data, in YYYY-MM-DD format.
|
| 208 |
+
end_date : Union[date, None, str]
|
| 209 |
+
End date of the data, in YYYY-MM-DD format.
|
| 210 |
+
parameter : Literal['daily_excl_weekend', 'monthly', 'weekly', 'daily', 'annual']
|
| 211 |
+
FRED series ID of DWPCR data. (provider: fred)
|
| 212 |
+
|
| 213 |
+
Returns
|
| 214 |
+
-------
|
| 215 |
+
OBBject
|
| 216 |
+
results : list[DiscountWindowPrimaryCreditRate]
|
| 217 |
+
Serializable results.
|
| 218 |
+
provider : Optional[str]
|
| 219 |
+
Provider name.
|
| 220 |
+
warnings : Optional[list[Warning_]]
|
| 221 |
+
list of warnings.
|
| 222 |
+
chart : Optional[Chart]
|
| 223 |
+
Chart object.
|
| 224 |
+
extra : Dict[str, Any]
|
| 225 |
+
Extra info.
|
| 226 |
+
|
| 227 |
+
DiscountWindowPrimaryCreditRate
|
| 228 |
+
-------------------------------
|
| 229 |
+
date : date
|
| 230 |
+
The date of the data.
|
| 231 |
+
rate : Optional[float]
|
| 232 |
+
Discount Window Primary Credit Rate.
|
| 233 |
+
|
| 234 |
+
Examples
|
| 235 |
+
--------
|
| 236 |
+
>>> from openbb import obb
|
| 237 |
+
>>> obb.fixedincome.rate.dpcredit(provider='fred')
|
| 238 |
+
>>> obb.fixedincome.rate.dpcredit(start_date='2023-02-01', end_date='2023-05-01', provider='fred')
|
| 239 |
+
""" # noqa: E501
|
| 240 |
+
|
| 241 |
+
return self._run(
|
| 242 |
+
"/fixedincome/rate/dpcredit",
|
| 243 |
+
**filter_inputs(
|
| 244 |
+
provider_choices={
|
| 245 |
+
"provider": self._get_provider(
|
| 246 |
+
provider,
|
| 247 |
+
"fixedincome.rate.dpcredit",
|
| 248 |
+
("fred",),
|
| 249 |
+
)
|
| 250 |
+
},
|
| 251 |
+
standard_params={
|
| 252 |
+
"start_date": start_date,
|
| 253 |
+
"end_date": end_date,
|
| 254 |
+
},
|
| 255 |
+
extra_params=kwargs,
|
| 256 |
+
)
|
| 257 |
+
)
|
| 258 |
+
|
| 259 |
+
@exception_handler
|
| 260 |
+
@validate
|
| 261 |
+
def ecb(
|
| 262 |
+
self,
|
| 263 |
+
start_date: Annotated[
|
| 264 |
+
Union[datetime.date, None, str],
|
| 265 |
+
OpenBBField(description="Start date of the data, in YYYY-MM-DD format."),
|
| 266 |
+
] = None,
|
| 267 |
+
end_date: Annotated[
|
| 268 |
+
Union[datetime.date, None, str],
|
| 269 |
+
OpenBBField(description="End date of the data, in YYYY-MM-DD format."),
|
| 270 |
+
] = None,
|
| 271 |
+
interest_rate_type: Annotated[
|
| 272 |
+
Literal["deposit", "lending", "refinancing"],
|
| 273 |
+
OpenBBField(description="The type of interest rate."),
|
| 274 |
+
] = "lending",
|
| 275 |
+
provider: Annotated[
|
| 276 |
+
Optional[Literal["fred"]],
|
| 277 |
+
OpenBBField(
|
| 278 |
+
description="The provider to use, by default None. If None, the priority list configured in the settings is used. Default priority: fred."
|
| 279 |
+
),
|
| 280 |
+
] = None,
|
| 281 |
+
**kwargs
|
| 282 |
+
) -> OBBject:
|
| 283 |
+
"""European Central Bank Interest Rates.
|
| 284 |
+
|
| 285 |
+
The Governing Council of the ECB sets the key interest rates for the euro area:
|
| 286 |
+
|
| 287 |
+
- The interest rate on the main refinancing operations (MRO), which provide
|
| 288 |
+
the bulk of liquidity to the banking system.
|
| 289 |
+
- The rate on the deposit facility, which banks may use to make overnight deposits with the Eurosystem.
|
| 290 |
+
- The rate on the marginal lending facility, which offers overnight credit to banks from the Eurosystem.
|
| 291 |
+
|
| 292 |
+
|
| 293 |
+
Parameters
|
| 294 |
+
----------
|
| 295 |
+
provider : str
|
| 296 |
+
The provider to use, by default None. If None, the priority list configured in the settings is used. Default priority: fred.
|
| 297 |
+
start_date : Union[date, None, str]
|
| 298 |
+
Start date of the data, in YYYY-MM-DD format.
|
| 299 |
+
end_date : Union[date, None, str]
|
| 300 |
+
End date of the data, in YYYY-MM-DD format.
|
| 301 |
+
interest_rate_type : Literal['deposit', 'lending', 'refinancing']
|
| 302 |
+
The type of interest rate.
|
| 303 |
+
|
| 304 |
+
Returns
|
| 305 |
+
-------
|
| 306 |
+
OBBject
|
| 307 |
+
results : list[EuropeanCentralBankInterestRates]
|
| 308 |
+
Serializable results.
|
| 309 |
+
provider : Optional[str]
|
| 310 |
+
Provider name.
|
| 311 |
+
warnings : Optional[list[Warning_]]
|
| 312 |
+
list of warnings.
|
| 313 |
+
chart : Optional[Chart]
|
| 314 |
+
Chart object.
|
| 315 |
+
extra : Dict[str, Any]
|
| 316 |
+
Extra info.
|
| 317 |
+
|
| 318 |
+
EuropeanCentralBankInterestRates
|
| 319 |
+
--------------------------------
|
| 320 |
+
date : date
|
| 321 |
+
The date of the data.
|
| 322 |
+
rate : Optional[float]
|
| 323 |
+
European Central Bank Interest Rate.
|
| 324 |
+
|
| 325 |
+
Examples
|
| 326 |
+
--------
|
| 327 |
+
>>> from openbb import obb
|
| 328 |
+
>>> obb.fixedincome.rate.ecb(provider='fred')
|
| 329 |
+
>>> obb.fixedincome.rate.ecb(interest_rate_type='refinancing', provider='fred')
|
| 330 |
+
""" # noqa: E501
|
| 331 |
+
|
| 332 |
+
return self._run(
|
| 333 |
+
"/fixedincome/rate/ecb",
|
| 334 |
+
**filter_inputs(
|
| 335 |
+
provider_choices={
|
| 336 |
+
"provider": self._get_provider(
|
| 337 |
+
provider,
|
| 338 |
+
"fixedincome.rate.ecb",
|
| 339 |
+
("fred",),
|
| 340 |
+
)
|
| 341 |
+
},
|
| 342 |
+
standard_params={
|
| 343 |
+
"start_date": start_date,
|
| 344 |
+
"end_date": end_date,
|
| 345 |
+
"interest_rate_type": interest_rate_type,
|
| 346 |
+
},
|
| 347 |
+
extra_params=kwargs,
|
| 348 |
+
)
|
| 349 |
+
)
|
| 350 |
+
|
| 351 |
+
@exception_handler
|
| 352 |
+
@validate
|
| 353 |
+
def effr(
|
| 354 |
+
self,
|
| 355 |
+
start_date: Annotated[
|
| 356 |
+
Union[datetime.date, None, str],
|
| 357 |
+
OpenBBField(description="Start date of the data, in YYYY-MM-DD format."),
|
| 358 |
+
] = None,
|
| 359 |
+
end_date: Annotated[
|
| 360 |
+
Union[datetime.date, None, str],
|
| 361 |
+
OpenBBField(description="End date of the data, in YYYY-MM-DD format."),
|
| 362 |
+
] = None,
|
| 363 |
+
provider: Annotated[
|
| 364 |
+
Optional[Literal["federal_reserve", "fred"]],
|
| 365 |
+
OpenBBField(
|
| 366 |
+
description="The provider to use, by default None. If None, the priority list configured in the settings is used. Default priority: federal_reserve, fred."
|
| 367 |
+
),
|
| 368 |
+
] = None,
|
| 369 |
+
**kwargs
|
| 370 |
+
) -> OBBject:
|
| 371 |
+
"""Fed Funds Rate.
|
| 372 |
+
|
| 373 |
+
Get Effective Federal Funds Rate data. A bank rate is the interest rate a nation's central bank charges to its
|
| 374 |
+
domestic banks to borrow money. The rates central banks charge are set to stabilize the economy.
|
| 375 |
+
|
| 376 |
+
|
| 377 |
+
Parameters
|
| 378 |
+
----------
|
| 379 |
+
provider : str
|
| 380 |
+
The provider to use, by default None. If None, the priority list configured in the settings is used. Default priority: federal_reserve, fred.
|
| 381 |
+
start_date : Union[date, None, str]
|
| 382 |
+
Start date of the data, in YYYY-MM-DD format.
|
| 383 |
+
end_date : Union[date, None, str]
|
| 384 |
+
End date of the data, in YYYY-MM-DD format.
|
| 385 |
+
frequency : Optional[Literal['a', 'q', 'm', 'w', 'wef', 'weth', 'wew', 'wetu', 'wem', 'wesu', 'wesa', 'bwew', 'bwem']]
|
| 386 |
+
|
| 387 |
+
Frequency aggregation to convert daily data to lower frequency.
|
| 388 |
+
a = Annual
|
| 389 |
+
q = Quarterly
|
| 390 |
+
m = Monthly
|
| 391 |
+
w = Weekly
|
| 392 |
+
wef = Weekly, Ending Friday
|
| 393 |
+
weth = Weekly, Ending Thursday
|
| 394 |
+
wew = Weekly, Ending Wednesday
|
| 395 |
+
wetu = Weekly, Ending Tuesday
|
| 396 |
+
wem = Weekly, Ending Monday
|
| 397 |
+
wesu = Weekly, Ending Sunday
|
| 398 |
+
wesa = Weekly, Ending Saturday
|
| 399 |
+
bwew = Biweekly, Ending Wednesday
|
| 400 |
+
bwem = Biweekly, Ending Monday
|
| 401 |
+
(provider: fred)
|
| 402 |
+
aggregation_method : Optional[Literal['avg', 'sum', 'eop']]
|
| 403 |
+
|
| 404 |
+
A key that indicates the aggregation method used for frequency aggregation.
|
| 405 |
+
avg = Average
|
| 406 |
+
sum = Sum
|
| 407 |
+
eop = End of Period
|
| 408 |
+
(provider: fred)
|
| 409 |
+
transform : Optional[Literal['chg', 'ch1', 'pch', 'pc1', 'pca', 'cch', 'cca', 'log']]
|
| 410 |
+
|
| 411 |
+
Transformation type
|
| 412 |
+
None = No transformation
|
| 413 |
+
chg = Change
|
| 414 |
+
ch1 = Change from Year Ago
|
| 415 |
+
pch = Percent Change
|
| 416 |
+
pc1 = Percent Change from Year Ago
|
| 417 |
+
pca = Compounded Annual Rate of Change
|
| 418 |
+
cch = Continuously Compounded Rate of Change
|
| 419 |
+
cca = Continuously Compounded Annual Rate of Change
|
| 420 |
+
log = Natural Log
|
| 421 |
+
(provider: fred)
|
| 422 |
+
effr_only : bool
|
| 423 |
+
Return data without quantiles, target ranges, and volume. (provider: fred)
|
| 424 |
+
|
| 425 |
+
Returns
|
| 426 |
+
-------
|
| 427 |
+
OBBject
|
| 428 |
+
results : list[FederalFundsRate]
|
| 429 |
+
Serializable results.
|
| 430 |
+
provider : Optional[str]
|
| 431 |
+
Provider name.
|
| 432 |
+
warnings : Optional[list[Warning_]]
|
| 433 |
+
list of warnings.
|
| 434 |
+
chart : Optional[Chart]
|
| 435 |
+
Chart object.
|
| 436 |
+
extra : Dict[str, Any]
|
| 437 |
+
Extra info.
|
| 438 |
+
|
| 439 |
+
FederalFundsRate
|
| 440 |
+
----------------
|
| 441 |
+
date : date
|
| 442 |
+
The date of the data.
|
| 443 |
+
rate : float
|
| 444 |
+
Effective federal funds rate.
|
| 445 |
+
target_range_upper : Optional[float]
|
| 446 |
+
Upper bound of the target range.
|
| 447 |
+
target_range_lower : Optional[float]
|
| 448 |
+
Lower bound of the target range.
|
| 449 |
+
percentile_1 : Optional[float]
|
| 450 |
+
1st percentile of the distribution.
|
| 451 |
+
percentile_25 : Optional[float]
|
| 452 |
+
25th percentile of the distribution.
|
| 453 |
+
percentile_75 : Optional[float]
|
| 454 |
+
75th percentile of the distribution.
|
| 455 |
+
percentile_99 : Optional[float]
|
| 456 |
+
99th percentile of the distribution.
|
| 457 |
+
volume : Optional[float]
|
| 458 |
+
The trading volume.The notional volume of transactions (Billions of $).
|
| 459 |
+
intraday_low : Optional[float]
|
| 460 |
+
Intraday low. This field is only present for data before 2016. (provider: federal_reserve)
|
| 461 |
+
intraday_high : Optional[float]
|
| 462 |
+
Intraday high. This field is only present for data before 2016. (provider: federal_reserve)
|
| 463 |
+
standard_deviation : Optional[float]
|
| 464 |
+
Standard deviation. This field is only present for data before 2016. (provider: federal_reserve)
|
| 465 |
+
revision_indicator : Optional[str]
|
| 466 |
+
Indicates a revision of the data for that date. (provider: federal_reserve)
|
| 467 |
+
|
| 468 |
+
Examples
|
| 469 |
+
--------
|
| 470 |
+
>>> from openbb import obb
|
| 471 |
+
>>> obb.fixedincome.rate.effr(provider='fred')
|
| 472 |
+
>>> obb.fixedincome.rate.effr(effr_only=True, provider='fred')
|
| 473 |
+
""" # noqa: E501
|
| 474 |
+
|
| 475 |
+
return self._run(
|
| 476 |
+
"/fixedincome/rate/effr",
|
| 477 |
+
**filter_inputs(
|
| 478 |
+
provider_choices={
|
| 479 |
+
"provider": self._get_provider(
|
| 480 |
+
provider,
|
| 481 |
+
"fixedincome.rate.effr",
|
| 482 |
+
("federal_reserve", "fred"),
|
| 483 |
+
)
|
| 484 |
+
},
|
| 485 |
+
standard_params={
|
| 486 |
+
"start_date": start_date,
|
| 487 |
+
"end_date": end_date,
|
| 488 |
+
},
|
| 489 |
+
extra_params=kwargs,
|
| 490 |
+
)
|
| 491 |
+
)
|
| 492 |
+
|
| 493 |
+
@exception_handler
|
| 494 |
+
@validate
|
| 495 |
+
def effr_forecast(
|
| 496 |
+
self,
|
| 497 |
+
provider: Annotated[
|
| 498 |
+
Optional[Literal["fred"]],
|
| 499 |
+
OpenBBField(
|
| 500 |
+
description="The provider to use, by default None. If None, the priority list configured in the settings is used. Default priority: fred."
|
| 501 |
+
),
|
| 502 |
+
] = None,
|
| 503 |
+
**kwargs
|
| 504 |
+
) -> OBBject:
|
| 505 |
+
"""Fed Funds Rate Projections.
|
| 506 |
+
|
| 507 |
+
The projections for the federal funds rate are the value of the midpoint of the
|
| 508 |
+
projected appropriate target range for the federal funds rate or the projected
|
| 509 |
+
appropriate target level for the federal funds rate at the end of the specified
|
| 510 |
+
calendar year or over the longer run.
|
| 511 |
+
|
| 512 |
+
|
| 513 |
+
Parameters
|
| 514 |
+
----------
|
| 515 |
+
provider : str
|
| 516 |
+
The provider to use, by default None. If None, the priority list configured in the settings is used. Default priority: fred.
|
| 517 |
+
long_run : bool
|
| 518 |
+
Flag to show long run projections (provider: fred)
|
| 519 |
+
|
| 520 |
+
Returns
|
| 521 |
+
-------
|
| 522 |
+
OBBject
|
| 523 |
+
results : list[PROJECTIONS]
|
| 524 |
+
Serializable results.
|
| 525 |
+
provider : Optional[str]
|
| 526 |
+
Provider name.
|
| 527 |
+
warnings : Optional[list[Warning_]]
|
| 528 |
+
list of warnings.
|
| 529 |
+
chart : Optional[Chart]
|
| 530 |
+
Chart object.
|
| 531 |
+
extra : Dict[str, Any]
|
| 532 |
+
Extra info.
|
| 533 |
+
|
| 534 |
+
PROJECTIONS
|
| 535 |
+
-----------
|
| 536 |
+
date : date
|
| 537 |
+
The date of the data.
|
| 538 |
+
range_high : Optional[float]
|
| 539 |
+
High projection of rates.
|
| 540 |
+
central_tendency_high : Optional[float]
|
| 541 |
+
Central tendency of high projection of rates.
|
| 542 |
+
median : Optional[float]
|
| 543 |
+
Median projection of rates.
|
| 544 |
+
range_midpoint : Optional[float]
|
| 545 |
+
Midpoint projection of rates.
|
| 546 |
+
central_tendency_midpoint : Optional[float]
|
| 547 |
+
Central tendency of midpoint projection of rates.
|
| 548 |
+
range_low : Optional[float]
|
| 549 |
+
Low projection of rates.
|
| 550 |
+
central_tendency_low : Optional[float]
|
| 551 |
+
Central tendency of low projection of rates.
|
| 552 |
+
|
| 553 |
+
Examples
|
| 554 |
+
--------
|
| 555 |
+
>>> from openbb import obb
|
| 556 |
+
>>> obb.fixedincome.rate.effr_forecast(provider='fred')
|
| 557 |
+
>>> obb.fixedincome.rate.effr_forecast(long_run=True, provider='fred')
|
| 558 |
+
""" # noqa: E501
|
| 559 |
+
|
| 560 |
+
return self._run(
|
| 561 |
+
"/fixedincome/rate/effr_forecast",
|
| 562 |
+
**filter_inputs(
|
| 563 |
+
provider_choices={
|
| 564 |
+
"provider": self._get_provider(
|
| 565 |
+
provider,
|
| 566 |
+
"fixedincome.rate.effr_forecast",
|
| 567 |
+
("fred",),
|
| 568 |
+
)
|
| 569 |
+
},
|
| 570 |
+
standard_params={},
|
| 571 |
+
extra_params=kwargs,
|
| 572 |
+
)
|
| 573 |
+
)
|
| 574 |
+
|
| 575 |
+
@exception_handler
|
| 576 |
+
@validate
|
| 577 |
+
def estr(
|
| 578 |
+
self,
|
| 579 |
+
start_date: Annotated[
|
| 580 |
+
Union[datetime.date, None, str],
|
| 581 |
+
OpenBBField(description="Start date of the data, in YYYY-MM-DD format."),
|
| 582 |
+
] = None,
|
| 583 |
+
end_date: Annotated[
|
| 584 |
+
Union[datetime.date, None, str],
|
| 585 |
+
OpenBBField(description="End date of the data, in YYYY-MM-DD format."),
|
| 586 |
+
] = None,
|
| 587 |
+
provider: Annotated[
|
| 588 |
+
Optional[Literal["fred"]],
|
| 589 |
+
OpenBBField(
|
| 590 |
+
description="The provider to use, by default None. If None, the priority list configured in the settings is used. Default priority: fred."
|
| 591 |
+
),
|
| 592 |
+
] = None,
|
| 593 |
+
**kwargs
|
| 594 |
+
) -> OBBject:
|
| 595 |
+
"""Euro Short-Term Rate.
|
| 596 |
+
|
| 597 |
+
The euro short-term rate (€STR) reflects the wholesale euro unsecured overnight borrowing costs of banks located in
|
| 598 |
+
the euro area. The €STR is published on each TARGET2 business day based on transactions conducted and settled on
|
| 599 |
+
the previous TARGET2 business day (the reporting date “T”) with a maturity date of T+1 which are deemed to have been
|
| 600 |
+
executed at arm's length and thus reflect market rates in an unbiased way.
|
| 601 |
+
|
| 602 |
+
|
| 603 |
+
Parameters
|
| 604 |
+
----------
|
| 605 |
+
provider : str
|
| 606 |
+
The provider to use, by default None. If None, the priority list configured in the settings is used. Default priority: fred.
|
| 607 |
+
start_date : Union[date, None, str]
|
| 608 |
+
Start date of the data, in YYYY-MM-DD format.
|
| 609 |
+
end_date : Union[date, None, str]
|
| 610 |
+
End date of the data, in YYYY-MM-DD format.
|
| 611 |
+
frequency : Optional[Literal['a', 'q', 'm', 'w', 'wef', 'weth', 'wew', 'wetu', 'wem', 'wesu', 'wesa', 'bwew', 'bwem']]
|
| 612 |
+
Frequency aggregation to convert daily data to lower frequency.
|
| 613 |
+
|
| 614 |
+
a = Annual
|
| 615 |
+
|
| 616 |
+
q = Quarterly
|
| 617 |
+
|
| 618 |
+
m = Monthly
|
| 619 |
+
|
| 620 |
+
w = Weekly
|
| 621 |
+
|
| 622 |
+
d = Daily
|
| 623 |
+
|
| 624 |
+
wef = Weekly, Ending Friday
|
| 625 |
+
|
| 626 |
+
weth = Weekly, Ending Thursday
|
| 627 |
+
|
| 628 |
+
wew = Weekly, Ending Wednesday
|
| 629 |
+
|
| 630 |
+
wetu = Weekly, Ending Tuesday
|
| 631 |
+
|
| 632 |
+
wem = Weekly, Ending Monday
|
| 633 |
+
|
| 634 |
+
wesu = Weekly, Ending Sunday
|
| 635 |
+
|
| 636 |
+
wesa = Weekly, Ending Saturday
|
| 637 |
+
|
| 638 |
+
bwew = Biweekly, Ending Wednesday
|
| 639 |
+
|
| 640 |
+
bwem = Biweekly, Ending Monday
|
| 641 |
+
(provider: fred)
|
| 642 |
+
aggregation_method : Optional[Literal['avg', 'sum', 'eop']]
|
| 643 |
+
A key that indicates the aggregation method used for frequency aggregation.
|
| 644 |
+
|
| 645 |
+
avg = Average
|
| 646 |
+
|
| 647 |
+
sum = Sum
|
| 648 |
+
|
| 649 |
+
eop = End of Period
|
| 650 |
+
(provider: fred)
|
| 651 |
+
transform : Optional[Literal['chg', 'ch1', 'pch', 'pc1', 'pca', 'cch', 'cca', 'log']]
|
| 652 |
+
Transformation type
|
| 653 |
+
|
| 654 |
+
None = No transformation
|
| 655 |
+
|
| 656 |
+
chg = Change
|
| 657 |
+
|
| 658 |
+
ch1 = Change from Year Ago
|
| 659 |
+
|
| 660 |
+
pch = Percent Change
|
| 661 |
+
|
| 662 |
+
pc1 = Percent Change from Year Ago
|
| 663 |
+
|
| 664 |
+
pca = Compounded Annual Rate of Change
|
| 665 |
+
|
| 666 |
+
cch = Continuously Compounded Rate of Change
|
| 667 |
+
|
| 668 |
+
cca = Continuously Compounded Annual Rate of Change
|
| 669 |
+
|
| 670 |
+
log = Natural Log
|
| 671 |
+
(provider: fred)
|
| 672 |
+
|
| 673 |
+
Returns
|
| 674 |
+
-------
|
| 675 |
+
OBBject
|
| 676 |
+
results : list[EuroShortTermRate]
|
| 677 |
+
Serializable results.
|
| 678 |
+
provider : Optional[str]
|
| 679 |
+
Provider name.
|
| 680 |
+
warnings : Optional[list[Warning_]]
|
| 681 |
+
list of warnings.
|
| 682 |
+
chart : Optional[Chart]
|
| 683 |
+
Chart object.
|
| 684 |
+
extra : Dict[str, Any]
|
| 685 |
+
Extra info.
|
| 686 |
+
|
| 687 |
+
EuroShortTermRate
|
| 688 |
+
-----------------
|
| 689 |
+
date : date
|
| 690 |
+
The date of the data.
|
| 691 |
+
rate : float
|
| 692 |
+
Volume-weighted trimmed mean rate.
|
| 693 |
+
percentile_25 : Optional[float]
|
| 694 |
+
Rate at 25th percentile of volume.
|
| 695 |
+
percentile_75 : Optional[float]
|
| 696 |
+
Rate at 75th percentile of volume.
|
| 697 |
+
volume : Optional[float]
|
| 698 |
+
The trading volume. (Millions of €EUR).
|
| 699 |
+
transactions : Optional[int]
|
| 700 |
+
Number of transactions.
|
| 701 |
+
number_of_banks : Optional[int]
|
| 702 |
+
Number of active banks.
|
| 703 |
+
large_bank_share_of_volume : Optional[float]
|
| 704 |
+
The percent of volume attributable to the 5 largest active banks.
|
| 705 |
+
|
| 706 |
+
Examples
|
| 707 |
+
--------
|
| 708 |
+
>>> from openbb import obb
|
| 709 |
+
>>> obb.fixedincome.rate.estr(provider='fred')
|
| 710 |
+
>>> obb.fixedincome.rate.estr(transform='ch1', provider='fred')
|
| 711 |
+
""" # noqa: E501
|
| 712 |
+
|
| 713 |
+
return self._run(
|
| 714 |
+
"/fixedincome/rate/estr",
|
| 715 |
+
**filter_inputs(
|
| 716 |
+
provider_choices={
|
| 717 |
+
"provider": self._get_provider(
|
| 718 |
+
provider,
|
| 719 |
+
"fixedincome.rate.estr",
|
| 720 |
+
("fred",),
|
| 721 |
+
)
|
| 722 |
+
},
|
| 723 |
+
standard_params={
|
| 724 |
+
"start_date": start_date,
|
| 725 |
+
"end_date": end_date,
|
| 726 |
+
},
|
| 727 |
+
extra_params=kwargs,
|
| 728 |
+
)
|
| 729 |
+
)
|
| 730 |
+
|
| 731 |
+
@exception_handler
|
| 732 |
+
@validate
|
| 733 |
+
def iorb(
|
| 734 |
+
self,
|
| 735 |
+
start_date: Annotated[
|
| 736 |
+
Union[datetime.date, None, str],
|
| 737 |
+
OpenBBField(description="Start date of the data, in YYYY-MM-DD format."),
|
| 738 |
+
] = None,
|
| 739 |
+
end_date: Annotated[
|
| 740 |
+
Union[datetime.date, None, str],
|
| 741 |
+
OpenBBField(description="End date of the data, in YYYY-MM-DD format."),
|
| 742 |
+
] = None,
|
| 743 |
+
provider: Annotated[
|
| 744 |
+
Optional[Literal["fred"]],
|
| 745 |
+
OpenBBField(
|
| 746 |
+
description="The provider to use, by default None. If None, the priority list configured in the settings is used. Default priority: fred."
|
| 747 |
+
),
|
| 748 |
+
] = None,
|
| 749 |
+
**kwargs
|
| 750 |
+
) -> OBBject:
|
| 751 |
+
"""Interest on Reserve Balances.
|
| 752 |
+
|
| 753 |
+
Get Interest Rate on Reserve Balances data A bank rate is the interest rate a nation's central bank charges to its
|
| 754 |
+
domestic banks to borrow money. The rates central banks charge are set to stabilize the economy. In the
|
| 755 |
+
United States, the Federal Reserve System's Board of Governors set the bank rate, also known as the discount rate.
|
| 756 |
+
|
| 757 |
+
|
| 758 |
+
Parameters
|
| 759 |
+
----------
|
| 760 |
+
provider : str
|
| 761 |
+
The provider to use, by default None. If None, the priority list configured in the settings is used. Default priority: fred.
|
| 762 |
+
start_date : Union[date, None, str]
|
| 763 |
+
Start date of the data, in YYYY-MM-DD format.
|
| 764 |
+
end_date : Union[date, None, str]
|
| 765 |
+
End date of the data, in YYYY-MM-DD format.
|
| 766 |
+
|
| 767 |
+
Returns
|
| 768 |
+
-------
|
| 769 |
+
OBBject
|
| 770 |
+
results : list[IORB]
|
| 771 |
+
Serializable results.
|
| 772 |
+
provider : Optional[str]
|
| 773 |
+
Provider name.
|
| 774 |
+
warnings : Optional[list[Warning_]]
|
| 775 |
+
list of warnings.
|
| 776 |
+
chart : Optional[Chart]
|
| 777 |
+
Chart object.
|
| 778 |
+
extra : Dict[str, Any]
|
| 779 |
+
Extra info.
|
| 780 |
+
|
| 781 |
+
IORB
|
| 782 |
+
----
|
| 783 |
+
date : date
|
| 784 |
+
The date of the data.
|
| 785 |
+
rate : Optional[float]
|
| 786 |
+
IORB rate.
|
| 787 |
+
|
| 788 |
+
Examples
|
| 789 |
+
--------
|
| 790 |
+
>>> from openbb import obb
|
| 791 |
+
>>> obb.fixedincome.rate.iorb(provider='fred')
|
| 792 |
+
""" # noqa: E501
|
| 793 |
+
|
| 794 |
+
return self._run(
|
| 795 |
+
"/fixedincome/rate/iorb",
|
| 796 |
+
**filter_inputs(
|
| 797 |
+
provider_choices={
|
| 798 |
+
"provider": self._get_provider(
|
| 799 |
+
provider,
|
| 800 |
+
"fixedincome.rate.iorb",
|
| 801 |
+
("fred",),
|
| 802 |
+
)
|
| 803 |
+
},
|
| 804 |
+
standard_params={
|
| 805 |
+
"start_date": start_date,
|
| 806 |
+
"end_date": end_date,
|
| 807 |
+
},
|
| 808 |
+
extra_params=kwargs,
|
| 809 |
+
)
|
| 810 |
+
)
|
| 811 |
+
|
| 812 |
+
@exception_handler
|
| 813 |
+
@validate
|
| 814 |
+
def overnight_bank_funding(
|
| 815 |
+
self,
|
| 816 |
+
start_date: Annotated[
|
| 817 |
+
Union[datetime.date, None, str],
|
| 818 |
+
OpenBBField(description="Start date of the data, in YYYY-MM-DD format."),
|
| 819 |
+
] = None,
|
| 820 |
+
end_date: Annotated[
|
| 821 |
+
Union[datetime.date, None, str],
|
| 822 |
+
OpenBBField(description="End date of the data, in YYYY-MM-DD format."),
|
| 823 |
+
] = None,
|
| 824 |
+
provider: Annotated[
|
| 825 |
+
Optional[Literal["federal_reserve", "fred"]],
|
| 826 |
+
OpenBBField(
|
| 827 |
+
description="The provider to use, by default None. If None, the priority list configured in the settings is used. Default priority: federal_reserve, fred."
|
| 828 |
+
),
|
| 829 |
+
] = None,
|
| 830 |
+
**kwargs
|
| 831 |
+
) -> OBBject:
|
| 832 |
+
"""Overnight Bank Funding.
|
| 833 |
+
|
| 834 |
+
For the United States, the overnight bank funding rate (OBFR) is calculated as a volume-weighted median of
|
| 835 |
+
overnight federal funds transactions and Eurodollar transactions reported in the
|
| 836 |
+
FR 2420 Report of Selected Money Market Rates.
|
| 837 |
+
|
| 838 |
+
|
| 839 |
+
Parameters
|
| 840 |
+
----------
|
| 841 |
+
provider : str
|
| 842 |
+
The provider to use, by default None. If None, the priority list configured in the settings is used. Default priority: federal_reserve, fred.
|
| 843 |
+
start_date : Union[date, None, str]
|
| 844 |
+
Start date of the data, in YYYY-MM-DD format.
|
| 845 |
+
end_date : Union[date, None, str]
|
| 846 |
+
End date of the data, in YYYY-MM-DD format.
|
| 847 |
+
frequency : Optional[Literal['a', 'q', 'm', 'w', 'wef', 'weth', 'wew', 'wetu', 'wem', 'wesu', 'wesa', 'bwew', 'bwem']]
|
| 848 |
+
|
| 849 |
+
Frequency aggregation to convert daily data to lower frequency.
|
| 850 |
+
a = Annual
|
| 851 |
+
q = Quarterly
|
| 852 |
+
m = Monthly
|
| 853 |
+
w = Weekly
|
| 854 |
+
wef = Weekly, Ending Friday
|
| 855 |
+
weth = Weekly, Ending Thursday
|
| 856 |
+
wew = Weekly, Ending Wednesday
|
| 857 |
+
wetu = Weekly, Ending Tuesday
|
| 858 |
+
wem = Weekly, Ending Monday
|
| 859 |
+
wesu = Weekly, Ending Sunday
|
| 860 |
+
wesa = Weekly, Ending Saturday
|
| 861 |
+
bwew = Biweekly, Ending Wednesday
|
| 862 |
+
bwem = Biweekly, Ending Monday
|
| 863 |
+
(provider: fred)
|
| 864 |
+
aggregation_method : Optional[Literal['avg', 'sum', 'eop']]
|
| 865 |
+
|
| 866 |
+
A key that indicates the aggregation method used for frequency aggregation.
|
| 867 |
+
avg = Average
|
| 868 |
+
sum = Sum
|
| 869 |
+
eop = End of Period
|
| 870 |
+
(provider: fred)
|
| 871 |
+
transform : Optional[Literal['chg', 'ch1', 'pch', 'pc1', 'pca', 'cch', 'cca', 'log']]
|
| 872 |
+
|
| 873 |
+
Transformation type
|
| 874 |
+
None = No transformation
|
| 875 |
+
chg = Change
|
| 876 |
+
ch1 = Change from Year Ago
|
| 877 |
+
pch = Percent Change
|
| 878 |
+
pc1 = Percent Change from Year Ago
|
| 879 |
+
pca = Compounded Annual Rate of Change
|
| 880 |
+
cch = Continuously Compounded Rate of Change
|
| 881 |
+
cca = Continuously Compounded Annual Rate of Change
|
| 882 |
+
log = Natural Log
|
| 883 |
+
(provider: fred)
|
| 884 |
+
|
| 885 |
+
Returns
|
| 886 |
+
-------
|
| 887 |
+
OBBject
|
| 888 |
+
results : list[OvernightBankFundingRate]
|
| 889 |
+
Serializable results.
|
| 890 |
+
provider : Optional[str]
|
| 891 |
+
Provider name.
|
| 892 |
+
warnings : Optional[list[Warning_]]
|
| 893 |
+
list of warnings.
|
| 894 |
+
chart : Optional[Chart]
|
| 895 |
+
Chart object.
|
| 896 |
+
extra : Dict[str, Any]
|
| 897 |
+
Extra info.
|
| 898 |
+
|
| 899 |
+
OvernightBankFundingRate
|
| 900 |
+
------------------------
|
| 901 |
+
date : date
|
| 902 |
+
The date of the data.
|
| 903 |
+
rate : float
|
| 904 |
+
Overnight Bank Funding Rate.
|
| 905 |
+
percentile_1 : Optional[float]
|
| 906 |
+
1st percentile of the distribution.
|
| 907 |
+
percentile_25 : Optional[float]
|
| 908 |
+
25th percentile of the distribution.
|
| 909 |
+
percentile_75 : Optional[float]
|
| 910 |
+
75th percentile of the distribution.
|
| 911 |
+
percentile_99 : Optional[float]
|
| 912 |
+
99th percentile of the distribution.
|
| 913 |
+
volume : Optional[float]
|
| 914 |
+
The trading volume.The notional volume of transactions (Billions of $).
|
| 915 |
+
revision_indicator : Optional[str]
|
| 916 |
+
Indicates a revision of the data for that date. (provider: federal_reserve)
|
| 917 |
+
|
| 918 |
+
Examples
|
| 919 |
+
--------
|
| 920 |
+
>>> from openbb import obb
|
| 921 |
+
>>> obb.fixedincome.rate.overnight_bank_funding(provider='fred')
|
| 922 |
+
""" # noqa: E501
|
| 923 |
+
|
| 924 |
+
return self._run(
|
| 925 |
+
"/fixedincome/rate/overnight_bank_funding",
|
| 926 |
+
**filter_inputs(
|
| 927 |
+
provider_choices={
|
| 928 |
+
"provider": self._get_provider(
|
| 929 |
+
provider,
|
| 930 |
+
"fixedincome.rate.overnight_bank_funding",
|
| 931 |
+
("federal_reserve", "fred"),
|
| 932 |
+
)
|
| 933 |
+
},
|
| 934 |
+
standard_params={
|
| 935 |
+
"start_date": start_date,
|
| 936 |
+
"end_date": end_date,
|
| 937 |
+
},
|
| 938 |
+
extra_params=kwargs,
|
| 939 |
+
)
|
| 940 |
+
)
|
| 941 |
+
|
| 942 |
+
@exception_handler
|
| 943 |
+
@validate
|
| 944 |
+
def sofr(
|
| 945 |
+
self,
|
| 946 |
+
start_date: Annotated[
|
| 947 |
+
Union[datetime.date, None, str],
|
| 948 |
+
OpenBBField(description="Start date of the data, in YYYY-MM-DD format."),
|
| 949 |
+
] = None,
|
| 950 |
+
end_date: Annotated[
|
| 951 |
+
Union[datetime.date, None, str],
|
| 952 |
+
OpenBBField(description="End date of the data, in YYYY-MM-DD format."),
|
| 953 |
+
] = None,
|
| 954 |
+
provider: Annotated[
|
| 955 |
+
Optional[Literal["federal_reserve", "fred"]],
|
| 956 |
+
OpenBBField(
|
| 957 |
+
description="The provider to use, by default None. If None, the priority list configured in the settings is used. Default priority: federal_reserve, fred."
|
| 958 |
+
),
|
| 959 |
+
] = None,
|
| 960 |
+
**kwargs
|
| 961 |
+
) -> OBBject:
|
| 962 |
+
"""Secured Overnight Financing Rate.
|
| 963 |
+
|
| 964 |
+
The Secured Overnight Financing Rate (SOFR) is a broad measure of the cost of
|
| 965 |
+
borrowing cash overnight collateralizing by Treasury securities.
|
| 966 |
+
|
| 967 |
+
|
| 968 |
+
Parameters
|
| 969 |
+
----------
|
| 970 |
+
provider : str
|
| 971 |
+
The provider to use, by default None. If None, the priority list configured in the settings is used. Default priority: federal_reserve, fred.
|
| 972 |
+
start_date : Union[date, None, str]
|
| 973 |
+
Start date of the data, in YYYY-MM-DD format.
|
| 974 |
+
end_date : Union[date, None, str]
|
| 975 |
+
End date of the data, in YYYY-MM-DD format.
|
| 976 |
+
frequency : Optional[Literal['a', 'q', 'm', 'w', 'wef', 'weth', 'wew', 'wetu', 'wem', 'wesu', 'wesa', 'bwew', 'bwem']]
|
| 977 |
+
|
| 978 |
+
Frequency aggregation to convert daily data to lower frequency.
|
| 979 |
+
a = Annual
|
| 980 |
+
q = Quarterly
|
| 981 |
+
m = Monthly
|
| 982 |
+
w = Weekly
|
| 983 |
+
wef = Weekly, Ending Friday
|
| 984 |
+
weth = Weekly, Ending Thursday
|
| 985 |
+
wew = Weekly, Ending Wednesday
|
| 986 |
+
wetu = Weekly, Ending Tuesday
|
| 987 |
+
wem = Weekly, Ending Monday
|
| 988 |
+
wesu = Weekly, Ending Sunday
|
| 989 |
+
wesa = Weekly, Ending Saturday
|
| 990 |
+
bwew = Biweekly, Ending Wednesday
|
| 991 |
+
bwem = Biweekly, Ending Monday
|
| 992 |
+
(provider: fred)
|
| 993 |
+
aggregation_method : Optional[Literal['avg', 'sum', 'eop']]
|
| 994 |
+
|
| 995 |
+
A key that indicates the aggregation method used for frequency aggregation.
|
| 996 |
+
avg = Average
|
| 997 |
+
sum = Sum
|
| 998 |
+
eop = End of Period
|
| 999 |
+
(provider: fred)
|
| 1000 |
+
transform : Optional[Literal['chg', 'ch1', 'pch', 'pc1', 'pca', 'cch', 'cca', 'log']]
|
| 1001 |
+
|
| 1002 |
+
Transformation type
|
| 1003 |
+
None = No transformation
|
| 1004 |
+
chg = Change
|
| 1005 |
+
ch1 = Change from Year Ago
|
| 1006 |
+
pch = Percent Change
|
| 1007 |
+
pc1 = Percent Change from Year Ago
|
| 1008 |
+
pca = Compounded Annual Rate of Change
|
| 1009 |
+
cch = Continuously Compounded Rate of Change
|
| 1010 |
+
cca = Continuously Compounded Annual Rate of Change
|
| 1011 |
+
log = Natural Log
|
| 1012 |
+
(provider: fred)
|
| 1013 |
+
|
| 1014 |
+
Returns
|
| 1015 |
+
-------
|
| 1016 |
+
OBBject
|
| 1017 |
+
results : list[SOFR]
|
| 1018 |
+
Serializable results.
|
| 1019 |
+
provider : Optional[str]
|
| 1020 |
+
Provider name.
|
| 1021 |
+
warnings : Optional[list[Warning_]]
|
| 1022 |
+
list of warnings.
|
| 1023 |
+
chart : Optional[Chart]
|
| 1024 |
+
Chart object.
|
| 1025 |
+
extra : Dict[str, Any]
|
| 1026 |
+
Extra info.
|
| 1027 |
+
|
| 1028 |
+
SOFR
|
| 1029 |
+
----
|
| 1030 |
+
date : date
|
| 1031 |
+
The date of the data.
|
| 1032 |
+
rate : float
|
| 1033 |
+
Effective federal funds rate.
|
| 1034 |
+
percentile_1 : Optional[float]
|
| 1035 |
+
1st percentile of the distribution.
|
| 1036 |
+
percentile_25 : Optional[float]
|
| 1037 |
+
25th percentile of the distribution.
|
| 1038 |
+
percentile_75 : Optional[float]
|
| 1039 |
+
75th percentile of the distribution.
|
| 1040 |
+
percentile_99 : Optional[float]
|
| 1041 |
+
99th percentile of the distribution.
|
| 1042 |
+
volume : Optional[float]
|
| 1043 |
+
The trading volume.The notional volume of transactions (Billions of $).
|
| 1044 |
+
average_30d : Optional[float]
|
| 1045 |
+
30-Day Average SOFR (provider: fred)
|
| 1046 |
+
average_90d : Optional[float]
|
| 1047 |
+
90-Day Average SOFR (provider: fred)
|
| 1048 |
+
average_180d : Optional[float]
|
| 1049 |
+
180-Day Average SOFR (provider: fred)
|
| 1050 |
+
index : Optional[float]
|
| 1051 |
+
SOFR index as 2018-04-02 = 1 (provider: fred)
|
| 1052 |
+
|
| 1053 |
+
Examples
|
| 1054 |
+
--------
|
| 1055 |
+
>>> from openbb import obb
|
| 1056 |
+
>>> obb.fixedincome.rate.sofr(provider='fred')
|
| 1057 |
+
""" # noqa: E501
|
| 1058 |
+
|
| 1059 |
+
return self._run(
|
| 1060 |
+
"/fixedincome/rate/sofr",
|
| 1061 |
+
**filter_inputs(
|
| 1062 |
+
provider_choices={
|
| 1063 |
+
"provider": self._get_provider(
|
| 1064 |
+
provider,
|
| 1065 |
+
"fixedincome.rate.sofr",
|
| 1066 |
+
("federal_reserve", "fred"),
|
| 1067 |
+
)
|
| 1068 |
+
},
|
| 1069 |
+
standard_params={
|
| 1070 |
+
"start_date": start_date,
|
| 1071 |
+
"end_date": end_date,
|
| 1072 |
+
},
|
| 1073 |
+
extra_params=kwargs,
|
| 1074 |
+
)
|
| 1075 |
+
)
|
| 1076 |
+
|
| 1077 |
+
@exception_handler
|
| 1078 |
+
@validate
|
| 1079 |
+
def sonia(
|
| 1080 |
+
self,
|
| 1081 |
+
start_date: Annotated[
|
| 1082 |
+
Union[datetime.date, None, str],
|
| 1083 |
+
OpenBBField(description="Start date of the data, in YYYY-MM-DD format."),
|
| 1084 |
+
] = None,
|
| 1085 |
+
end_date: Annotated[
|
| 1086 |
+
Union[datetime.date, None, str],
|
| 1087 |
+
OpenBBField(description="End date of the data, in YYYY-MM-DD format."),
|
| 1088 |
+
] = None,
|
| 1089 |
+
provider: Annotated[
|
| 1090 |
+
Optional[Literal["fred"]],
|
| 1091 |
+
OpenBBField(
|
| 1092 |
+
description="The provider to use, by default None. If None, the priority list configured in the settings is used. Default priority: fred."
|
| 1093 |
+
),
|
| 1094 |
+
] = None,
|
| 1095 |
+
**kwargs
|
| 1096 |
+
) -> OBBject:
|
| 1097 |
+
"""Sterling Overnight Index Average.
|
| 1098 |
+
|
| 1099 |
+
SONIA (Sterling Overnight Index Average) is an important interest rate benchmark. SONIA is based on actual
|
| 1100 |
+
transactions and reflects the average of the interest rates that banks pay to borrow sterling overnight from other
|
| 1101 |
+
financial institutions and other institutional investors.
|
| 1102 |
+
|
| 1103 |
+
|
| 1104 |
+
Parameters
|
| 1105 |
+
----------
|
| 1106 |
+
provider : str
|
| 1107 |
+
The provider to use, by default None. If None, the priority list configured in the settings is used. Default priority: fred.
|
| 1108 |
+
start_date : Union[date, None, str]
|
| 1109 |
+
Start date of the data, in YYYY-MM-DD format.
|
| 1110 |
+
end_date : Union[date, None, str]
|
| 1111 |
+
End date of the data, in YYYY-MM-DD format.
|
| 1112 |
+
parameter : Literal['rate', 'index', '10th_percentile', '25th_percentile', '75th_percentile', '90th_percentile', 'total_nominal_value']
|
| 1113 |
+
Period of SONIA rate. (provider: fred)
|
| 1114 |
+
|
| 1115 |
+
Returns
|
| 1116 |
+
-------
|
| 1117 |
+
OBBject
|
| 1118 |
+
results : list[SONIA]
|
| 1119 |
+
Serializable results.
|
| 1120 |
+
provider : Optional[str]
|
| 1121 |
+
Provider name.
|
| 1122 |
+
warnings : Optional[list[Warning_]]
|
| 1123 |
+
list of warnings.
|
| 1124 |
+
chart : Optional[Chart]
|
| 1125 |
+
Chart object.
|
| 1126 |
+
extra : Dict[str, Any]
|
| 1127 |
+
Extra info.
|
| 1128 |
+
|
| 1129 |
+
SONIA
|
| 1130 |
+
-----
|
| 1131 |
+
date : date
|
| 1132 |
+
The date of the data.
|
| 1133 |
+
rate : Optional[float]
|
| 1134 |
+
SONIA rate.
|
| 1135 |
+
|
| 1136 |
+
Examples
|
| 1137 |
+
--------
|
| 1138 |
+
>>> from openbb import obb
|
| 1139 |
+
>>> obb.fixedincome.rate.sonia(provider='fred')
|
| 1140 |
+
>>> obb.fixedincome.rate.sonia(parameter='total_nominal_value', provider='fred')
|
| 1141 |
+
""" # noqa: E501
|
| 1142 |
+
|
| 1143 |
+
return self._run(
|
| 1144 |
+
"/fixedincome/rate/sonia",
|
| 1145 |
+
**filter_inputs(
|
| 1146 |
+
provider_choices={
|
| 1147 |
+
"provider": self._get_provider(
|
| 1148 |
+
provider,
|
| 1149 |
+
"fixedincome.rate.sonia",
|
| 1150 |
+
("fred",),
|
| 1151 |
+
)
|
| 1152 |
+
},
|
| 1153 |
+
standard_params={
|
| 1154 |
+
"start_date": start_date,
|
| 1155 |
+
"end_date": end_date,
|
| 1156 |
+
},
|
| 1157 |
+
extra_params=kwargs,
|
| 1158 |
+
)
|
| 1159 |
+
)
|
openbb_platform/openbb/package/fixedincome_spreads.py
ADDED
|
@@ -0,0 +1,291 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|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
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
### THIS FILE IS AUTO-GENERATED. DO NOT EDIT. ###
|
| 2 |
+
|
| 3 |
+
import datetime
|
| 4 |
+
from typing import Literal, Optional, Union
|
| 5 |
+
|
| 6 |
+
from openbb_core.app.model.field import OpenBBField
|
| 7 |
+
from openbb_core.app.model.obbject import OBBject
|
| 8 |
+
from openbb_core.app.static.container import Container
|
| 9 |
+
from openbb_core.app.static.utils.decorators import exception_handler, validate
|
| 10 |
+
from openbb_core.app.static.utils.filters import filter_inputs
|
| 11 |
+
from typing_extensions import Annotated
|
| 12 |
+
|
| 13 |
+
|
| 14 |
+
class ROUTER_fixedincome_spreads(Container):
|
| 15 |
+
"""/fixedincome/spreads
|
| 16 |
+
tcm
|
| 17 |
+
tcm_effr
|
| 18 |
+
treasury_effr
|
| 19 |
+
"""
|
| 20 |
+
|
| 21 |
+
def __repr__(self) -> str:
|
| 22 |
+
return self.__doc__ or ""
|
| 23 |
+
|
| 24 |
+
@exception_handler
|
| 25 |
+
@validate
|
| 26 |
+
def tcm(
|
| 27 |
+
self,
|
| 28 |
+
start_date: Annotated[
|
| 29 |
+
Union[datetime.date, None, str],
|
| 30 |
+
OpenBBField(description="Start date of the data, in YYYY-MM-DD format."),
|
| 31 |
+
] = None,
|
| 32 |
+
end_date: Annotated[
|
| 33 |
+
Union[datetime.date, None, str],
|
| 34 |
+
OpenBBField(description="End date of the data, in YYYY-MM-DD format."),
|
| 35 |
+
] = None,
|
| 36 |
+
maturity: Annotated[
|
| 37 |
+
Optional[Literal["3m", "2y"]], OpenBBField(description="The maturity")
|
| 38 |
+
] = "3m",
|
| 39 |
+
provider: Annotated[
|
| 40 |
+
Optional[Literal["fred"]],
|
| 41 |
+
OpenBBField(
|
| 42 |
+
description="The provider to use, by default None. If None, the priority list configured in the settings is used. Default priority: fred."
|
| 43 |
+
),
|
| 44 |
+
] = None,
|
| 45 |
+
**kwargs
|
| 46 |
+
) -> OBBject:
|
| 47 |
+
"""Treasury Constant Maturity.
|
| 48 |
+
|
| 49 |
+
Get data for 10-Year Treasury Constant Maturity Minus Selected Treasury Constant Maturity.
|
| 50 |
+
Constant maturity is the theoretical value of a U.S. Treasury that is based on recent values of auctioned U.S.
|
| 51 |
+
Treasuries. The value is obtained by the U.S. Treasury on a daily basis through interpolation of the Treasury
|
| 52 |
+
yield curve which, in turn, is based on closing bid-yields of actively-traded Treasury securities.
|
| 53 |
+
|
| 54 |
+
|
| 55 |
+
Parameters
|
| 56 |
+
----------
|
| 57 |
+
provider : str
|
| 58 |
+
The provider to use, by default None. If None, the priority list configured in the settings is used. Default priority: fred.
|
| 59 |
+
start_date : Union[date, None, str]
|
| 60 |
+
Start date of the data, in YYYY-MM-DD format.
|
| 61 |
+
end_date : Union[date, None, str]
|
| 62 |
+
End date of the data, in YYYY-MM-DD format.
|
| 63 |
+
maturity : Optional[Literal['3m', '2y']]
|
| 64 |
+
The maturity
|
| 65 |
+
|
| 66 |
+
Returns
|
| 67 |
+
-------
|
| 68 |
+
OBBject
|
| 69 |
+
results : list[TreasuryConstantMaturity]
|
| 70 |
+
Serializable results.
|
| 71 |
+
provider : Optional[str]
|
| 72 |
+
Provider name.
|
| 73 |
+
warnings : Optional[list[Warning_]]
|
| 74 |
+
list of warnings.
|
| 75 |
+
chart : Optional[Chart]
|
| 76 |
+
Chart object.
|
| 77 |
+
extra : Dict[str, Any]
|
| 78 |
+
Extra info.
|
| 79 |
+
|
| 80 |
+
TreasuryConstantMaturity
|
| 81 |
+
------------------------
|
| 82 |
+
date : date
|
| 83 |
+
The date of the data.
|
| 84 |
+
rate : Optional[float]
|
| 85 |
+
TreasuryConstantMaturity Rate.
|
| 86 |
+
|
| 87 |
+
Examples
|
| 88 |
+
--------
|
| 89 |
+
>>> from openbb import obb
|
| 90 |
+
>>> obb.fixedincome.spreads.tcm(provider='fred')
|
| 91 |
+
>>> obb.fixedincome.spreads.tcm(maturity='2y', provider='fred')
|
| 92 |
+
""" # noqa: E501
|
| 93 |
+
|
| 94 |
+
return self._run(
|
| 95 |
+
"/fixedincome/spreads/tcm",
|
| 96 |
+
**filter_inputs(
|
| 97 |
+
provider_choices={
|
| 98 |
+
"provider": self._get_provider(
|
| 99 |
+
provider,
|
| 100 |
+
"fixedincome.spreads.tcm",
|
| 101 |
+
("fred",),
|
| 102 |
+
)
|
| 103 |
+
},
|
| 104 |
+
standard_params={
|
| 105 |
+
"start_date": start_date,
|
| 106 |
+
"end_date": end_date,
|
| 107 |
+
"maturity": maturity,
|
| 108 |
+
},
|
| 109 |
+
extra_params=kwargs,
|
| 110 |
+
)
|
| 111 |
+
)
|
| 112 |
+
|
| 113 |
+
@exception_handler
|
| 114 |
+
@validate
|
| 115 |
+
def tcm_effr(
|
| 116 |
+
self,
|
| 117 |
+
start_date: Annotated[
|
| 118 |
+
Union[datetime.date, None, str],
|
| 119 |
+
OpenBBField(description="Start date of the data, in YYYY-MM-DD format."),
|
| 120 |
+
] = None,
|
| 121 |
+
end_date: Annotated[
|
| 122 |
+
Union[datetime.date, None, str],
|
| 123 |
+
OpenBBField(description="End date of the data, in YYYY-MM-DD format."),
|
| 124 |
+
] = None,
|
| 125 |
+
maturity: Annotated[
|
| 126 |
+
Optional[Literal["10y", "5y", "1y", "6m", "3m"]],
|
| 127 |
+
OpenBBField(description="The maturity"),
|
| 128 |
+
] = "10y",
|
| 129 |
+
provider: Annotated[
|
| 130 |
+
Optional[Literal["fred"]],
|
| 131 |
+
OpenBBField(
|
| 132 |
+
description="The provider to use, by default None. If None, the priority list configured in the settings is used. Default priority: fred."
|
| 133 |
+
),
|
| 134 |
+
] = None,
|
| 135 |
+
**kwargs
|
| 136 |
+
) -> OBBject:
|
| 137 |
+
"""Select Treasury Constant Maturity.
|
| 138 |
+
|
| 139 |
+
Get data for Selected Treasury Constant Maturity Minus Federal Funds Rate
|
| 140 |
+
Constant maturity is the theoretical value of a U.S. Treasury that is based on recent values of auctioned U.S.
|
| 141 |
+
Treasuries. The value is obtained by the U.S. Treasury on a daily basis through interpolation of the Treasury
|
| 142 |
+
yield curve which, in turn, is based on closing bid-yields of actively-traded Treasury securities.
|
| 143 |
+
|
| 144 |
+
|
| 145 |
+
Parameters
|
| 146 |
+
----------
|
| 147 |
+
provider : str
|
| 148 |
+
The provider to use, by default None. If None, the priority list configured in the settings is used. Default priority: fred.
|
| 149 |
+
start_date : Union[date, None, str]
|
| 150 |
+
Start date of the data, in YYYY-MM-DD format.
|
| 151 |
+
end_date : Union[date, None, str]
|
| 152 |
+
End date of the data, in YYYY-MM-DD format.
|
| 153 |
+
maturity : Optional[Literal['10y', '5y', '1y', '6m', '3m']]
|
| 154 |
+
The maturity
|
| 155 |
+
|
| 156 |
+
Returns
|
| 157 |
+
-------
|
| 158 |
+
OBBject
|
| 159 |
+
results : list[SelectedTreasuryConstantMaturity]
|
| 160 |
+
Serializable results.
|
| 161 |
+
provider : Optional[str]
|
| 162 |
+
Provider name.
|
| 163 |
+
warnings : Optional[list[Warning_]]
|
| 164 |
+
list of warnings.
|
| 165 |
+
chart : Optional[Chart]
|
| 166 |
+
Chart object.
|
| 167 |
+
extra : Dict[str, Any]
|
| 168 |
+
Extra info.
|
| 169 |
+
|
| 170 |
+
SelectedTreasuryConstantMaturity
|
| 171 |
+
--------------------------------
|
| 172 |
+
date : date
|
| 173 |
+
The date of the data.
|
| 174 |
+
rate : Optional[float]
|
| 175 |
+
Selected Treasury Constant Maturity Rate.
|
| 176 |
+
|
| 177 |
+
Examples
|
| 178 |
+
--------
|
| 179 |
+
>>> from openbb import obb
|
| 180 |
+
>>> obb.fixedincome.spreads.tcm_effr(provider='fred')
|
| 181 |
+
>>> obb.fixedincome.spreads.tcm_effr(maturity='10y', provider='fred')
|
| 182 |
+
""" # noqa: E501
|
| 183 |
+
|
| 184 |
+
return self._run(
|
| 185 |
+
"/fixedincome/spreads/tcm_effr",
|
| 186 |
+
**filter_inputs(
|
| 187 |
+
provider_choices={
|
| 188 |
+
"provider": self._get_provider(
|
| 189 |
+
provider,
|
| 190 |
+
"fixedincome.spreads.tcm_effr",
|
| 191 |
+
("fred",),
|
| 192 |
+
)
|
| 193 |
+
},
|
| 194 |
+
standard_params={
|
| 195 |
+
"start_date": start_date,
|
| 196 |
+
"end_date": end_date,
|
| 197 |
+
"maturity": maturity,
|
| 198 |
+
},
|
| 199 |
+
extra_params=kwargs,
|
| 200 |
+
)
|
| 201 |
+
)
|
| 202 |
+
|
| 203 |
+
@exception_handler
|
| 204 |
+
@validate
|
| 205 |
+
def treasury_effr(
|
| 206 |
+
self,
|
| 207 |
+
start_date: Annotated[
|
| 208 |
+
Union[datetime.date, None, str],
|
| 209 |
+
OpenBBField(description="Start date of the data, in YYYY-MM-DD format."),
|
| 210 |
+
] = None,
|
| 211 |
+
end_date: Annotated[
|
| 212 |
+
Union[datetime.date, None, str],
|
| 213 |
+
OpenBBField(description="End date of the data, in YYYY-MM-DD format."),
|
| 214 |
+
] = None,
|
| 215 |
+
maturity: Annotated[
|
| 216 |
+
Optional[Literal["3m", "6m"]], OpenBBField(description="The maturity")
|
| 217 |
+
] = "3m",
|
| 218 |
+
provider: Annotated[
|
| 219 |
+
Optional[Literal["fred"]],
|
| 220 |
+
OpenBBField(
|
| 221 |
+
description="The provider to use, by default None. If None, the priority list configured in the settings is used. Default priority: fred."
|
| 222 |
+
),
|
| 223 |
+
] = None,
|
| 224 |
+
**kwargs
|
| 225 |
+
) -> OBBject:
|
| 226 |
+
"""Select Treasury Bill.
|
| 227 |
+
|
| 228 |
+
Get Selected Treasury Bill Minus Federal Funds Rate.
|
| 229 |
+
Constant maturity is the theoretical value of a U.S. Treasury that is based on recent values of
|
| 230 |
+
auctioned U.S. Treasuries.
|
| 231 |
+
The value is obtained by the U.S. Treasury on a daily basis through interpolation of the Treasury
|
| 232 |
+
yield curve which, in turn, is based on closing bid-yields of actively-traded Treasury securities.
|
| 233 |
+
|
| 234 |
+
|
| 235 |
+
Parameters
|
| 236 |
+
----------
|
| 237 |
+
provider : str
|
| 238 |
+
The provider to use, by default None. If None, the priority list configured in the settings is used. Default priority: fred.
|
| 239 |
+
start_date : Union[date, None, str]
|
| 240 |
+
Start date of the data, in YYYY-MM-DD format.
|
| 241 |
+
end_date : Union[date, None, str]
|
| 242 |
+
End date of the data, in YYYY-MM-DD format.
|
| 243 |
+
maturity : Optional[Literal['3m', '6m']]
|
| 244 |
+
The maturity
|
| 245 |
+
|
| 246 |
+
Returns
|
| 247 |
+
-------
|
| 248 |
+
OBBject
|
| 249 |
+
results : list[SelectedTreasuryBill]
|
| 250 |
+
Serializable results.
|
| 251 |
+
provider : Optional[str]
|
| 252 |
+
Provider name.
|
| 253 |
+
warnings : Optional[list[Warning_]]
|
| 254 |
+
list of warnings.
|
| 255 |
+
chart : Optional[Chart]
|
| 256 |
+
Chart object.
|
| 257 |
+
extra : Dict[str, Any]
|
| 258 |
+
Extra info.
|
| 259 |
+
|
| 260 |
+
SelectedTreasuryBill
|
| 261 |
+
--------------------
|
| 262 |
+
date : date
|
| 263 |
+
The date of the data.
|
| 264 |
+
rate : Optional[float]
|
| 265 |
+
SelectedTreasuryBill Rate.
|
| 266 |
+
|
| 267 |
+
Examples
|
| 268 |
+
--------
|
| 269 |
+
>>> from openbb import obb
|
| 270 |
+
>>> obb.fixedincome.spreads.treasury_effr(provider='fred')
|
| 271 |
+
>>> obb.fixedincome.spreads.treasury_effr(maturity='6m', provider='fred')
|
| 272 |
+
""" # noqa: E501
|
| 273 |
+
|
| 274 |
+
return self._run(
|
| 275 |
+
"/fixedincome/spreads/treasury_effr",
|
| 276 |
+
**filter_inputs(
|
| 277 |
+
provider_choices={
|
| 278 |
+
"provider": self._get_provider(
|
| 279 |
+
provider,
|
| 280 |
+
"fixedincome.spreads.treasury_effr",
|
| 281 |
+
("fred",),
|
| 282 |
+
)
|
| 283 |
+
},
|
| 284 |
+
standard_params={
|
| 285 |
+
"start_date": start_date,
|
| 286 |
+
"end_date": end_date,
|
| 287 |
+
"maturity": maturity,
|
| 288 |
+
},
|
| 289 |
+
extra_params=kwargs,
|
| 290 |
+
)
|
| 291 |
+
)
|
openbb_platform/openbb/package/index.py
ADDED
|
@@ -0,0 +1,176 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
### THIS FILE IS AUTO-GENERATED. DO NOT EDIT. ###
|
| 2 |
+
|
| 3 |
+
from typing import Literal, Optional
|
| 4 |
+
|
| 5 |
+
from openbb_core.app.model.field import OpenBBField
|
| 6 |
+
from openbb_core.app.model.obbject import OBBject
|
| 7 |
+
from openbb_core.app.static.container import Container
|
| 8 |
+
from openbb_core.app.static.utils.decorators import exception_handler, validate
|
| 9 |
+
from openbb_core.app.static.utils.filters import filter_inputs
|
| 10 |
+
from typing_extensions import Annotated
|
| 11 |
+
|
| 12 |
+
|
| 13 |
+
class ROUTER_index(Container):
|
| 14 |
+
"""/index
|
| 15 |
+
available
|
| 16 |
+
constituents
|
| 17 |
+
/price
|
| 18 |
+
"""
|
| 19 |
+
|
| 20 |
+
def __repr__(self) -> str:
|
| 21 |
+
return self.__doc__ or ""
|
| 22 |
+
|
| 23 |
+
@exception_handler
|
| 24 |
+
@validate
|
| 25 |
+
def available(
|
| 26 |
+
self,
|
| 27 |
+
provider: Annotated[
|
| 28 |
+
Optional[Literal["fmp", "yfinance"]],
|
| 29 |
+
OpenBBField(
|
| 30 |
+
description="The provider to use, by default None. If None, the priority list configured in the settings is used. Default priority: fmp, yfinance."
|
| 31 |
+
),
|
| 32 |
+
] = None,
|
| 33 |
+
**kwargs
|
| 34 |
+
) -> OBBject:
|
| 35 |
+
"""All indices available from a given provider.
|
| 36 |
+
|
| 37 |
+
Parameters
|
| 38 |
+
----------
|
| 39 |
+
provider : str
|
| 40 |
+
The provider to use, by default None. If None, the priority list configured in the settings is used. Default priority: fmp, yfinance.
|
| 41 |
+
|
| 42 |
+
Returns
|
| 43 |
+
-------
|
| 44 |
+
OBBject
|
| 45 |
+
results : list[AvailableIndices]
|
| 46 |
+
Serializable results.
|
| 47 |
+
provider : Optional[str]
|
| 48 |
+
Provider name.
|
| 49 |
+
warnings : Optional[list[Warning_]]
|
| 50 |
+
list of warnings.
|
| 51 |
+
chart : Optional[Chart]
|
| 52 |
+
Chart object.
|
| 53 |
+
extra : Dict[str, Any]
|
| 54 |
+
Extra info.
|
| 55 |
+
|
| 56 |
+
AvailableIndices
|
| 57 |
+
----------------
|
| 58 |
+
name : Optional[str]
|
| 59 |
+
Name of the index.
|
| 60 |
+
currency : Optional[str]
|
| 61 |
+
Currency the index is traded in.
|
| 62 |
+
stock_exchange : Optional[str]
|
| 63 |
+
Stock exchange where the index is listed. (provider: fmp)
|
| 64 |
+
exchange_short_name : Optional[str]
|
| 65 |
+
Short name of the stock exchange where the index is listed. (provider: fmp)
|
| 66 |
+
code : Optional[str]
|
| 67 |
+
ID code for keying the index in the OpenBB Terminal. (provider: yfinance)
|
| 68 |
+
symbol : Optional[str]
|
| 69 |
+
Symbol for the index. (provider: yfinance)
|
| 70 |
+
|
| 71 |
+
Examples
|
| 72 |
+
--------
|
| 73 |
+
>>> from openbb import obb
|
| 74 |
+
>>> obb.index.available(provider='fmp')
|
| 75 |
+
>>> obb.index.available(provider='yfinance')
|
| 76 |
+
""" # noqa: E501
|
| 77 |
+
|
| 78 |
+
return self._run(
|
| 79 |
+
"/index/available",
|
| 80 |
+
**filter_inputs(
|
| 81 |
+
provider_choices={
|
| 82 |
+
"provider": self._get_provider(
|
| 83 |
+
provider,
|
| 84 |
+
"index.available",
|
| 85 |
+
("fmp", "yfinance"),
|
| 86 |
+
)
|
| 87 |
+
},
|
| 88 |
+
standard_params={},
|
| 89 |
+
extra_params=kwargs,
|
| 90 |
+
)
|
| 91 |
+
)
|
| 92 |
+
|
| 93 |
+
@exception_handler
|
| 94 |
+
@validate
|
| 95 |
+
def constituents(
|
| 96 |
+
self,
|
| 97 |
+
symbol: Annotated[str, OpenBBField(description="Symbol to get data for.")],
|
| 98 |
+
provider: Annotated[
|
| 99 |
+
Optional[Literal["fmp"]],
|
| 100 |
+
OpenBBField(
|
| 101 |
+
description="The provider to use, by default None. If None, the priority list configured in the settings is used. Default priority: fmp."
|
| 102 |
+
),
|
| 103 |
+
] = None,
|
| 104 |
+
**kwargs
|
| 105 |
+
) -> OBBject:
|
| 106 |
+
"""Get Index Constituents.
|
| 107 |
+
|
| 108 |
+
Parameters
|
| 109 |
+
----------
|
| 110 |
+
provider : str
|
| 111 |
+
The provider to use, by default None. If None, the priority list configured in the settings is used. Default priority: fmp.
|
| 112 |
+
symbol : str
|
| 113 |
+
Symbol to get data for.
|
| 114 |
+
|
| 115 |
+
Returns
|
| 116 |
+
-------
|
| 117 |
+
OBBject
|
| 118 |
+
results : list[IndexConstituents]
|
| 119 |
+
Serializable results.
|
| 120 |
+
provider : Optional[str]
|
| 121 |
+
Provider name.
|
| 122 |
+
warnings : Optional[list[Warning_]]
|
| 123 |
+
list of warnings.
|
| 124 |
+
chart : Optional[Chart]
|
| 125 |
+
Chart object.
|
| 126 |
+
extra : Dict[str, Any]
|
| 127 |
+
Extra info.
|
| 128 |
+
|
| 129 |
+
IndexConstituents
|
| 130 |
+
-----------------
|
| 131 |
+
symbol : str
|
| 132 |
+
Symbol representing the entity requested in the data.
|
| 133 |
+
name : Optional[str]
|
| 134 |
+
Name of the constituent company in the index.
|
| 135 |
+
sector : Optional[str]
|
| 136 |
+
Sector the constituent company in the index belongs to. (provider: fmp)
|
| 137 |
+
sub_sector : Optional[str]
|
| 138 |
+
Sub-sector the constituent company in the index belongs to. (provider: fmp)
|
| 139 |
+
headquarter : Optional[str]
|
| 140 |
+
Location of the headquarter of the constituent company in the index. (provider: fmp)
|
| 141 |
+
date_first_added : Optional[Union[date, str]]
|
| 142 |
+
Date the constituent company was added to the index. (provider: fmp)
|
| 143 |
+
cik : Optional[int]
|
| 144 |
+
Central Index Key (CIK) for the requested entity. (provider: fmp)
|
| 145 |
+
founded : Optional[Union[date, str]]
|
| 146 |
+
Founding year of the constituent company in the index. (provider: fmp)
|
| 147 |
+
|
| 148 |
+
Examples
|
| 149 |
+
--------
|
| 150 |
+
>>> from openbb import obb
|
| 151 |
+
>>> obb.index.constituents(symbol='dowjones', provider='fmp')
|
| 152 |
+
""" # noqa: E501
|
| 153 |
+
|
| 154 |
+
return self._run(
|
| 155 |
+
"/index/constituents",
|
| 156 |
+
**filter_inputs(
|
| 157 |
+
provider_choices={
|
| 158 |
+
"provider": self._get_provider(
|
| 159 |
+
provider,
|
| 160 |
+
"index.constituents",
|
| 161 |
+
("fmp",),
|
| 162 |
+
)
|
| 163 |
+
},
|
| 164 |
+
standard_params={
|
| 165 |
+
"symbol": symbol,
|
| 166 |
+
},
|
| 167 |
+
extra_params=kwargs,
|
| 168 |
+
)
|
| 169 |
+
)
|
| 170 |
+
|
| 171 |
+
@property
|
| 172 |
+
def price(self):
|
| 173 |
+
# pylint: disable=import-outside-toplevel
|
| 174 |
+
from . import index_price
|
| 175 |
+
|
| 176 |
+
return index_price.ROUTER_index_price(command_runner=self._command_runner)
|
openbb_platform/openbb/package/index_price.py
ADDED
|
@@ -0,0 +1,163 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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 7 |
+
from openbb_core.app.model.obbject import OBBject
|
| 8 |
+
from openbb_core.app.static.container import Container
|
| 9 |
+
from openbb_core.app.static.utils.decorators import exception_handler, validate
|
| 10 |
+
from openbb_core.app.static.utils.filters import filter_inputs
|
| 11 |
+
from typing_extensions import Annotated
|
| 12 |
+
|
| 13 |
+
|
| 14 |
+
class ROUTER_index_price(Container):
|
| 15 |
+
"""/index/price
|
| 16 |
+
historical
|
| 17 |
+
"""
|
| 18 |
+
|
| 19 |
+
def __repr__(self) -> str:
|
| 20 |
+
return self.__doc__ or ""
|
| 21 |
+
|
| 22 |
+
@exception_handler
|
| 23 |
+
@validate
|
| 24 |
+
def historical(
|
| 25 |
+
self,
|
| 26 |
+
symbol: Annotated[
|
| 27 |
+
Union[str, list[str]],
|
| 28 |
+
OpenBBField(
|
| 29 |
+
description="Symbol to get data for. Multiple comma separated items allowed for provider(s): fmp, intrinio, polygon, yfinance."
|
| 30 |
+
),
|
| 31 |
+
],
|
| 32 |
+
start_date: Annotated[
|
| 33 |
+
Union[datetime.date, None, str],
|
| 34 |
+
OpenBBField(description="Start date of the data, in YYYY-MM-DD format."),
|
| 35 |
+
] = None,
|
| 36 |
+
end_date: Annotated[
|
| 37 |
+
Union[datetime.date, None, str],
|
| 38 |
+
OpenBBField(description="End date of the data, in YYYY-MM-DD format."),
|
| 39 |
+
] = None,
|
| 40 |
+
provider: Annotated[
|
| 41 |
+
Optional[Literal["fmp", "intrinio", "polygon", "yfinance"]],
|
| 42 |
+
OpenBBField(
|
| 43 |
+
description="The provider to use, by default None. If None, the priority list configured in the settings is used. Default priority: fmp, intrinio, polygon, yfinance."
|
| 44 |
+
),
|
| 45 |
+
] = None,
|
| 46 |
+
**kwargs
|
| 47 |
+
) -> OBBject:
|
| 48 |
+
"""Historical Index Levels.
|
| 49 |
+
|
| 50 |
+
Parameters
|
| 51 |
+
----------
|
| 52 |
+
provider : str
|
| 53 |
+
The provider to use, by default None. If None, the priority list configured in the settings is used. Default priority: fmp, intrinio, polygon, yfinance.
|
| 54 |
+
symbol : Union[str, list[str]]
|
| 55 |
+
Symbol to get data for. Multiple comma separated items allowed for provider(s): fmp, intrinio, polygon, yfinance.
|
| 56 |
+
start_date : Union[date, None, str]
|
| 57 |
+
Start date of the data, in YYYY-MM-DD format.
|
| 58 |
+
end_date : Union[date, None, str]
|
| 59 |
+
End date of the data, in YYYY-MM-DD format.
|
| 60 |
+
interval : str
|
| 61 |
+
Time interval of the data to return. (provider: fmp, polygon, yfinance)
|
| 62 |
+
Choices for fmp: '1m', '5m', '15m', '30m', '1h', '4h', '1d'
|
| 63 |
+
Choices for yfinance: '1m', '2m', '5m', '15m', '30m', '60m', '90m', '1h', '1d', '5d', '1W', '1M', '1Q'
|
| 64 |
+
limit : Optional[int]
|
| 65 |
+
The number of data entries to return. (provider: intrinio, polygon)
|
| 66 |
+
sort : Literal['asc', 'desc']
|
| 67 |
+
Sort order of the data. This impacts the results in combination with the 'limit' parameter. The results are always returned in ascending order by date. (provider: polygon)
|
| 68 |
+
|
| 69 |
+
Returns
|
| 70 |
+
-------
|
| 71 |
+
OBBject
|
| 72 |
+
results : list[IndexHistorical]
|
| 73 |
+
Serializable results.
|
| 74 |
+
provider : Optional[str]
|
| 75 |
+
Provider name.
|
| 76 |
+
warnings : Optional[list[Warning_]]
|
| 77 |
+
list of warnings.
|
| 78 |
+
chart : Optional[Chart]
|
| 79 |
+
Chart object.
|
| 80 |
+
extra : Dict[str, Any]
|
| 81 |
+
Extra info.
|
| 82 |
+
|
| 83 |
+
IndexHistorical
|
| 84 |
+
---------------
|
| 85 |
+
date : Union[date, datetime]
|
| 86 |
+
The date of the data.
|
| 87 |
+
open : Optional[Annotated[float, Strict(strict=True)]]
|
| 88 |
+
The open price.
|
| 89 |
+
high : Optional[Annotated[float, Strict(strict=True)]]
|
| 90 |
+
The high price.
|
| 91 |
+
low : Optional[Annotated[float, Strict(strict=True)]]
|
| 92 |
+
The low price.
|
| 93 |
+
close : Optional[Annotated[float, Strict(strict=True)]]
|
| 94 |
+
The close price.
|
| 95 |
+
volume : Optional[int]
|
| 96 |
+
The trading volume.
|
| 97 |
+
vwap : Optional[float]
|
| 98 |
+
Volume Weighted Average Price over the period. (provider: fmp)
|
| 99 |
+
change : Optional[float]
|
| 100 |
+
Change in the price from the previous close. (provider: fmp)
|
| 101 |
+
change_percent : Optional[float]
|
| 102 |
+
Change in the price from the previous close, as a normalized percent. (provider: fmp)
|
| 103 |
+
transactions : Optional[Annotated[int, Gt(gt=0)]]
|
| 104 |
+
Number of transactions for the symbol in the time period. (provider: polygon)
|
| 105 |
+
|
| 106 |
+
Examples
|
| 107 |
+
--------
|
| 108 |
+
>>> from openbb import obb
|
| 109 |
+
>>> obb.index.price.historical(symbol='^GSPC', provider='fmp')
|
| 110 |
+
>>> # Not all providers have the same symbols.
|
| 111 |
+
>>> obb.index.price.historical(symbol='SPX', provider='intrinio')
|
| 112 |
+
""" # noqa: E501
|
| 113 |
+
|
| 114 |
+
return self._run(
|
| 115 |
+
"/index/price/historical",
|
| 116 |
+
**filter_inputs(
|
| 117 |
+
provider_choices={
|
| 118 |
+
"provider": self._get_provider(
|
| 119 |
+
provider,
|
| 120 |
+
"index.price.historical",
|
| 121 |
+
("fmp", "intrinio", "polygon", "yfinance"),
|
| 122 |
+
)
|
| 123 |
+
},
|
| 124 |
+
standard_params={
|
| 125 |
+
"symbol": symbol,
|
| 126 |
+
"start_date": start_date,
|
| 127 |
+
"end_date": end_date,
|
| 128 |
+
},
|
| 129 |
+
extra_params=kwargs,
|
| 130 |
+
info={
|
| 131 |
+
"symbol": {
|
| 132 |
+
"fmp": {"multiple_items_allowed": True, "choices": None},
|
| 133 |
+
"intrinio": {"multiple_items_allowed": True, "choices": None},
|
| 134 |
+
"polygon": {"multiple_items_allowed": True, "choices": None},
|
| 135 |
+
"yfinance": {"multiple_items_allowed": True, "choices": None},
|
| 136 |
+
},
|
| 137 |
+
"interval": {
|
| 138 |
+
"fmp": {
|
| 139 |
+
"multiple_items_allowed": False,
|
| 140 |
+
"choices": ["1m", "5m", "15m", "30m", "1h", "4h", "1d"],
|
| 141 |
+
},
|
| 142 |
+
"yfinance": {
|
| 143 |
+
"multiple_items_allowed": False,
|
| 144 |
+
"choices": [
|
| 145 |
+
"1m",
|
| 146 |
+
"2m",
|
| 147 |
+
"5m",
|
| 148 |
+
"15m",
|
| 149 |
+
"30m",
|
| 150 |
+
"60m",
|
| 151 |
+
"90m",
|
| 152 |
+
"1h",
|
| 153 |
+
"1d",
|
| 154 |
+
"5d",
|
| 155 |
+
"1W",
|
| 156 |
+
"1M",
|
| 157 |
+
"1Q",
|
| 158 |
+
],
|
| 159 |
+
},
|
| 160 |
+
},
|
| 161 |
+
},
|
| 162 |
+
)
|
| 163 |
+
)
|
openbb_platform/openbb/package/news.py
ADDED
|
@@ -0,0 +1,463 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|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
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
### THIS FILE IS AUTO-GENERATED. DO NOT EDIT. ###
|
| 2 |
+
|
| 3 |
+
import datetime
|
| 4 |
+
from typing import Literal, Optional, Union
|
| 5 |
+
|
| 6 |
+
from annotated_types import Ge
|
| 7 |
+
from openbb_core.app.model.field import OpenBBField
|
| 8 |
+
from openbb_core.app.model.obbject import OBBject
|
| 9 |
+
from openbb_core.app.static.container import Container
|
| 10 |
+
from openbb_core.app.static.utils.decorators import exception_handler, validate
|
| 11 |
+
from openbb_core.app.static.utils.filters import filter_inputs
|
| 12 |
+
from typing_extensions import Annotated
|
| 13 |
+
|
| 14 |
+
|
| 15 |
+
class ROUTER_news(Container):
|
| 16 |
+
"""/news
|
| 17 |
+
company
|
| 18 |
+
world
|
| 19 |
+
"""
|
| 20 |
+
|
| 21 |
+
def __repr__(self) -> str:
|
| 22 |
+
return self.__doc__ or ""
|
| 23 |
+
|
| 24 |
+
@exception_handler
|
| 25 |
+
@validate
|
| 26 |
+
def company(
|
| 27 |
+
self,
|
| 28 |
+
symbol: Annotated[
|
| 29 |
+
Union[str, None, list[Optional[str]]],
|
| 30 |
+
OpenBBField(
|
| 31 |
+
description="Symbol to get data for. Multiple comma separated items allowed for provider(s): benzinga, fmp, intrinio, polygon, tiingo, yfinance."
|
| 32 |
+
),
|
| 33 |
+
] = None,
|
| 34 |
+
start_date: Annotated[
|
| 35 |
+
Union[datetime.date, None, str],
|
| 36 |
+
OpenBBField(description="Start date of the data, in YYYY-MM-DD format."),
|
| 37 |
+
] = None,
|
| 38 |
+
end_date: Annotated[
|
| 39 |
+
Union[datetime.date, None, str],
|
| 40 |
+
OpenBBField(description="End date of the data, in YYYY-MM-DD format."),
|
| 41 |
+
] = None,
|
| 42 |
+
limit: Annotated[
|
| 43 |
+
Optional[Annotated[int, Ge(ge=0)]],
|
| 44 |
+
OpenBBField(description="The number of data entries to return."),
|
| 45 |
+
] = 2500,
|
| 46 |
+
provider: Annotated[
|
| 47 |
+
Optional[
|
| 48 |
+
Literal["benzinga", "fmp", "intrinio", "polygon", "tiingo", "yfinance"]
|
| 49 |
+
],
|
| 50 |
+
OpenBBField(
|
| 51 |
+
description="The provider to use, by default None. If None, the priority list configured in the settings is used. Default priority: benzinga, fmp, intrinio, polygon, tiingo, yfinance."
|
| 52 |
+
),
|
| 53 |
+
] = None,
|
| 54 |
+
**kwargs
|
| 55 |
+
) -> OBBject:
|
| 56 |
+
"""Company News. Get news for one or more companies.
|
| 57 |
+
|
| 58 |
+
Parameters
|
| 59 |
+
----------
|
| 60 |
+
provider : str
|
| 61 |
+
The provider to use, by default None. If None, the priority list configured in the settings is used. Default priority: benzinga, fmp, intrinio, polygon, tiingo, yfinance.
|
| 62 |
+
symbol : Union[str, None, list[Optional[str]]]
|
| 63 |
+
Symbol to get data for. Multiple comma separated items allowed for provider(s): benzinga, fmp, intrinio, polygon, tiingo, yfinance.
|
| 64 |
+
start_date : Union[date, None, str]
|
| 65 |
+
Start date of the data, in YYYY-MM-DD format.
|
| 66 |
+
end_date : Union[date, None, str]
|
| 67 |
+
End date of the data, in YYYY-MM-DD format.
|
| 68 |
+
limit : Optional[Annotated[int, Ge(ge=0)]]
|
| 69 |
+
The number of data entries to return.
|
| 70 |
+
date : Optional[date]
|
| 71 |
+
A specific date to get data for. (provider: benzinga)
|
| 72 |
+
display : Literal['headline', 'abstract', 'full']
|
| 73 |
+
Specify headline only (headline), headline + teaser (abstract), or headline + full body (full). (provider: benzinga)
|
| 74 |
+
updated_since : Optional[int]
|
| 75 |
+
Number of seconds since the news was updated. (provider: benzinga)
|
| 76 |
+
published_since : Optional[int]
|
| 77 |
+
Number of seconds since the news was published. (provider: benzinga)
|
| 78 |
+
sort : Literal['id', 'created', 'updated']
|
| 79 |
+
Key to sort the news by. (provider: benzinga)
|
| 80 |
+
order : Literal['asc', 'desc']
|
| 81 |
+
Order to sort the news by. (provider: benzinga)
|
| 82 |
+
isin : Optional[str]
|
| 83 |
+
The company's ISIN. (provider: benzinga)
|
| 84 |
+
cusip : Optional[str]
|
| 85 |
+
The company's CUSIP. (provider: benzinga)
|
| 86 |
+
channels : Optional[str]
|
| 87 |
+
Channels of the news to retrieve. (provider: benzinga)
|
| 88 |
+
topics : Optional[str]
|
| 89 |
+
Topics of the news to retrieve. (provider: benzinga)
|
| 90 |
+
authors : Optional[str]
|
| 91 |
+
Authors of the news to retrieve. (provider: benzinga)
|
| 92 |
+
content_types : Optional[str]
|
| 93 |
+
Content types of the news to retrieve. (provider: benzinga)
|
| 94 |
+
page : Optional[int]
|
| 95 |
+
Page number of the results. Use in combination with limit. (provider: fmp)
|
| 96 |
+
source : Union[Literal['yahoo', 'moody', 'moody_us_news', 'moody_us_press_releases'], None, str]
|
| 97 |
+
The source of the news article. (provider: intrinio)
|
| 98 |
+
sentiment : Optional[Literal['positive', 'neutral', 'negative']]
|
| 99 |
+
Return news only from this source. (provider: intrinio)
|
| 100 |
+
language : Optional[str]
|
| 101 |
+
Filter by language. Unsupported for yahoo source. (provider: intrinio)
|
| 102 |
+
topic : Optional[str]
|
| 103 |
+
Filter by topic. Unsupported for yahoo source. (provider: intrinio)
|
| 104 |
+
word_count_greater_than : Optional[int]
|
| 105 |
+
News stories will have a word count greater than this value. Unsupported for yahoo source. (provider: intrinio)
|
| 106 |
+
word_count_less_than : Optional[int]
|
| 107 |
+
News stories will have a word count less than this value. Unsupported for yahoo source. (provider: intrinio)
|
| 108 |
+
is_spam : Optional[bool]
|
| 109 |
+
Filter whether it is marked as spam or not. Unsupported for yahoo source. (provider: intrinio)
|
| 110 |
+
business_relevance_greater_than : Optional[float]
|
| 111 |
+
News stories will have a business relevance score more than this value. Unsupported for yahoo source. Value is a decimal between 0 and 1. (provider: intrinio)
|
| 112 |
+
business_relevance_less_than : Optional[float]
|
| 113 |
+
News stories will have a business relevance score less than this value. Unsupported for yahoo source. Value is a decimal between 0 and 1. (provider: intrinio)
|
| 114 |
+
offset : Optional[int]
|
| 115 |
+
Page offset, used in conjunction with limit. (provider: tiingo)
|
| 116 |
+
|
| 117 |
+
Returns
|
| 118 |
+
-------
|
| 119 |
+
OBBject
|
| 120 |
+
results : list[CompanyNews]
|
| 121 |
+
Serializable results.
|
| 122 |
+
provider : Optional[str]
|
| 123 |
+
Provider name.
|
| 124 |
+
warnings : Optional[list[Warning_]]
|
| 125 |
+
list of warnings.
|
| 126 |
+
chart : Optional[Chart]
|
| 127 |
+
Chart object.
|
| 128 |
+
extra : Dict[str, Any]
|
| 129 |
+
Extra info.
|
| 130 |
+
|
| 131 |
+
CompanyNews
|
| 132 |
+
-----------
|
| 133 |
+
date : datetime
|
| 134 |
+
The date of the data. Here it is the published date of the article.
|
| 135 |
+
title : str
|
| 136 |
+
Title of the article.
|
| 137 |
+
text : Optional[str]
|
| 138 |
+
Text/body of the article.
|
| 139 |
+
images : Optional[list[Dict[str, str]]]
|
| 140 |
+
Images associated with the article.
|
| 141 |
+
url : str
|
| 142 |
+
URL to the article.
|
| 143 |
+
symbols : Optional[str]
|
| 144 |
+
Symbols associated with the article.
|
| 145 |
+
id : Optional[str]
|
| 146 |
+
Article ID. (provider: benzinga, intrinio, polygon)
|
| 147 |
+
author : Optional[str]
|
| 148 |
+
Author of the article. (provider: benzinga)
|
| 149 |
+
teaser : Optional[str]
|
| 150 |
+
Teaser of the news. (provider: benzinga)
|
| 151 |
+
channels : Optional[str]
|
| 152 |
+
Channels associated with the news. (provider: benzinga)
|
| 153 |
+
stocks : Optional[str]
|
| 154 |
+
Stocks associated with the news. (provider: benzinga)
|
| 155 |
+
tags : Optional[str]
|
| 156 |
+
Tags associated with the news. (provider: benzinga, polygon, tiingo)
|
| 157 |
+
updated : Optional[datetime]
|
| 158 |
+
Updated date of the news. (provider: benzinga)
|
| 159 |
+
source : Optional[str]
|
| 160 |
+
Name of the news source. (provider: fmp);
|
| 161 |
+
The source of the news article. (provider: intrinio);
|
| 162 |
+
Source of the article. (provider: polygon);
|
| 163 |
+
News source. (provider: tiingo);
|
| 164 |
+
Source of the news article (provider: yfinance)
|
| 165 |
+
summary : Optional[str]
|
| 166 |
+
The summary of the news article. (provider: intrinio)
|
| 167 |
+
topics : Optional[str]
|
| 168 |
+
The topics related to the news article. (provider: intrinio)
|
| 169 |
+
word_count : Optional[int]
|
| 170 |
+
The word count of the news article. (provider: intrinio)
|
| 171 |
+
business_relevance : Optional[float]
|
| 172 |
+
How strongly correlated the news article is to the business (provider: intrinio)
|
| 173 |
+
sentiment : Optional[str]
|
| 174 |
+
The sentiment of the news article - i.e, negative, positive. (provider: intrinio)
|
| 175 |
+
sentiment_confidence : Optional[float]
|
| 176 |
+
The confidence score of the sentiment rating. (provider: intrinio)
|
| 177 |
+
language : Optional[str]
|
| 178 |
+
The language of the news article. (provider: intrinio)
|
| 179 |
+
spam : Optional[bool]
|
| 180 |
+
Whether the news article is spam. (provider: intrinio)
|
| 181 |
+
copyright : Optional[str]
|
| 182 |
+
The copyright notice of the news article. (provider: intrinio)
|
| 183 |
+
security : Optional[IntrinioSecurity]
|
| 184 |
+
The Intrinio Security object. Contains the security details related to the news article. (provider: intrinio)
|
| 185 |
+
amp_url : Optional[str]
|
| 186 |
+
AMP URL. (provider: polygon)
|
| 187 |
+
publisher : Optional[PolygonPublisher]
|
| 188 |
+
Publisher of the article. (provider: polygon)
|
| 189 |
+
article_id : Optional[int]
|
| 190 |
+
Unique ID of the news article. (provider: tiingo)
|
| 191 |
+
crawl_date : Optional[datetime]
|
| 192 |
+
Date the news article was crawled. (provider: tiingo)
|
| 193 |
+
|
| 194 |
+
Examples
|
| 195 |
+
--------
|
| 196 |
+
>>> from openbb import obb
|
| 197 |
+
>>> obb.news.company(provider='benzinga')
|
| 198 |
+
>>> obb.news.company(limit=100, provider='benzinga')
|
| 199 |
+
>>> # Get news on the specified dates.
|
| 200 |
+
>>> obb.news.company(symbol='AAPL', start_date='2024-02-01', end_date='2024-02-07', provider='intrinio')
|
| 201 |
+
>>> # Display the headlines of the news.
|
| 202 |
+
>>> obb.news.company(symbol='AAPL', display='headline', provider='benzinga')
|
| 203 |
+
>>> # Get news for multiple symbols.
|
| 204 |
+
>>> obb.news.company(symbol='aapl,tsla', provider='fmp')
|
| 205 |
+
>>> # Get news company's ISIN.
|
| 206 |
+
>>> obb.news.company(symbol='NVDA', isin='US0378331005', provider='benzinga')
|
| 207 |
+
""" # noqa: E501
|
| 208 |
+
|
| 209 |
+
return self._run(
|
| 210 |
+
"/news/company",
|
| 211 |
+
**filter_inputs(
|
| 212 |
+
provider_choices={
|
| 213 |
+
"provider": self._get_provider(
|
| 214 |
+
provider,
|
| 215 |
+
"news.company",
|
| 216 |
+
(
|
| 217 |
+
"benzinga",
|
| 218 |
+
"fmp",
|
| 219 |
+
"intrinio",
|
| 220 |
+
"polygon",
|
| 221 |
+
"tiingo",
|
| 222 |
+
"yfinance",
|
| 223 |
+
),
|
| 224 |
+
)
|
| 225 |
+
},
|
| 226 |
+
standard_params={
|
| 227 |
+
"symbol": symbol,
|
| 228 |
+
"start_date": start_date,
|
| 229 |
+
"end_date": end_date,
|
| 230 |
+
"limit": limit,
|
| 231 |
+
},
|
| 232 |
+
extra_params=kwargs,
|
| 233 |
+
info={
|
| 234 |
+
"symbol": {
|
| 235 |
+
"benzinga": {"multiple_items_allowed": True, "choices": None},
|
| 236 |
+
"fmp": {"multiple_items_allowed": True, "choices": None},
|
| 237 |
+
"intrinio": {"multiple_items_allowed": True, "choices": None},
|
| 238 |
+
"polygon": {"multiple_items_allowed": True, "choices": None},
|
| 239 |
+
"tiingo": {"multiple_items_allowed": True, "choices": None},
|
| 240 |
+
"yfinance": {"multiple_items_allowed": True, "choices": None},
|
| 241 |
+
},
|
| 242 |
+
"order": {
|
| 243 |
+
"polygon": {
|
| 244 |
+
"multiple_items_allowed": False,
|
| 245 |
+
"choices": ["asc", "desc"],
|
| 246 |
+
}
|
| 247 |
+
},
|
| 248 |
+
"source": {
|
| 249 |
+
"intrinio": {
|
| 250 |
+
"multiple_items_allowed": False,
|
| 251 |
+
"choices": [
|
| 252 |
+
"yahoo",
|
| 253 |
+
"moody",
|
| 254 |
+
"moody_us_news",
|
| 255 |
+
"moody_us_press_releases",
|
| 256 |
+
],
|
| 257 |
+
},
|
| 258 |
+
"tiingo": {"multiple_items_allowed": True, "choices": None},
|
| 259 |
+
},
|
| 260 |
+
"sentiment": {
|
| 261 |
+
"intrinio": {
|
| 262 |
+
"multiple_items_allowed": False,
|
| 263 |
+
"choices": ["positive", "neutral", "negative"],
|
| 264 |
+
}
|
| 265 |
+
},
|
| 266 |
+
},
|
| 267 |
+
)
|
| 268 |
+
)
|
| 269 |
+
|
| 270 |
+
@exception_handler
|
| 271 |
+
@validate
|
| 272 |
+
def world(
|
| 273 |
+
self,
|
| 274 |
+
limit: Annotated[
|
| 275 |
+
int,
|
| 276 |
+
OpenBBField(
|
| 277 |
+
description="The number of data entries to return. The number of articles to return."
|
| 278 |
+
),
|
| 279 |
+
] = 2500,
|
| 280 |
+
start_date: Annotated[
|
| 281 |
+
Union[datetime.date, None, str],
|
| 282 |
+
OpenBBField(description="Start date of the data, in YYYY-MM-DD format."),
|
| 283 |
+
] = None,
|
| 284 |
+
end_date: Annotated[
|
| 285 |
+
Union[datetime.date, None, str],
|
| 286 |
+
OpenBBField(description="End date of the data, in YYYY-MM-DD format."),
|
| 287 |
+
] = None,
|
| 288 |
+
provider: Annotated[
|
| 289 |
+
Optional[Literal["benzinga", "fmp", "intrinio", "tiingo"]],
|
| 290 |
+
OpenBBField(
|
| 291 |
+
description="The provider to use, by default None. If None, the priority list configured in the settings is used. Default priority: benzinga, fmp, intrinio, tiingo."
|
| 292 |
+
),
|
| 293 |
+
] = None,
|
| 294 |
+
**kwargs
|
| 295 |
+
) -> OBBject:
|
| 296 |
+
"""World News. Global news data.
|
| 297 |
+
|
| 298 |
+
Parameters
|
| 299 |
+
----------
|
| 300 |
+
provider : str
|
| 301 |
+
The provider to use, by default None. If None, the priority list configured in the settings is used. Default priority: benzinga, fmp, intrinio, tiingo.
|
| 302 |
+
limit : int
|
| 303 |
+
The number of data entries to return. The number of articles to return.
|
| 304 |
+
start_date : Union[date, None, str]
|
| 305 |
+
Start date of the data, in YYYY-MM-DD format.
|
| 306 |
+
end_date : Union[date, None, str]
|
| 307 |
+
End date of the data, in YYYY-MM-DD format.
|
| 308 |
+
date : Optional[date]
|
| 309 |
+
A specific date to get data for. (provider: benzinga)
|
| 310 |
+
display : Literal['headline', 'abstract', 'full']
|
| 311 |
+
Specify headline only (headline), headline + teaser (abstract), or headline + full body (full). (provider: benzinga)
|
| 312 |
+
updated_since : Optional[int]
|
| 313 |
+
Number of seconds since the news was updated. (provider: benzinga)
|
| 314 |
+
published_since : Optional[int]
|
| 315 |
+
Number of seconds since the news was published. (provider: benzinga)
|
| 316 |
+
sort : Literal['id', 'created', 'updated']
|
| 317 |
+
Key to sort the news by. (provider: benzinga)
|
| 318 |
+
order : Literal['asc', 'desc']
|
| 319 |
+
Order to sort the news by. (provider: benzinga)
|
| 320 |
+
isin : Optional[str]
|
| 321 |
+
The ISIN of the news to retrieve. (provider: benzinga)
|
| 322 |
+
cusip : Optional[str]
|
| 323 |
+
The CUSIP of the news to retrieve. (provider: benzinga)
|
| 324 |
+
channels : Optional[str]
|
| 325 |
+
Channels of the news to retrieve. (provider: benzinga)
|
| 326 |
+
topics : Optional[str]
|
| 327 |
+
Topics of the news to retrieve. (provider: benzinga)
|
| 328 |
+
authors : Optional[str]
|
| 329 |
+
Authors of the news to retrieve. (provider: benzinga)
|
| 330 |
+
content_types : Optional[str]
|
| 331 |
+
Content types of the news to retrieve. (provider: benzinga)
|
| 332 |
+
source : Union[Literal['yahoo', 'moody', 'moody_us_news', 'moody_us_press_releases'], None, str]
|
| 333 |
+
The source of the news article. (provider: intrinio)
|
| 334 |
+
sentiment : Optional[Literal['positive', 'neutral', 'negative']]
|
| 335 |
+
Return news only from this source. (provider: intrinio)
|
| 336 |
+
language : Optional[str]
|
| 337 |
+
Filter by language. Unsupported for yahoo source. (provider: intrinio)
|
| 338 |
+
topic : Optional[str]
|
| 339 |
+
Filter by topic. Unsupported for yahoo source. (provider: intrinio)
|
| 340 |
+
word_count_greater_than : Optional[int]
|
| 341 |
+
News stories will have a word count greater than this value. Unsupported for yahoo source. (provider: intrinio)
|
| 342 |
+
word_count_less_than : Optional[int]
|
| 343 |
+
News stories will have a word count less than this value. Unsupported for yahoo source. (provider: intrinio)
|
| 344 |
+
is_spam : Optional[bool]
|
| 345 |
+
Filter whether it is marked as spam or not. Unsupported for yahoo source. (provider: intrinio)
|
| 346 |
+
business_relevance_greater_than : Optional[float]
|
| 347 |
+
News stories will have a business relevance score more than this value. Unsupported for yahoo source. Value is a decimal between 0 and 1. (provider: intrinio)
|
| 348 |
+
business_relevance_less_than : Optional[float]
|
| 349 |
+
News stories will have a business relevance score less than this value. Unsupported for yahoo source. Value is a decimal between 0 and 1. (provider: intrinio)
|
| 350 |
+
offset : Optional[int]
|
| 351 |
+
Page offset, used in conjunction with limit. (provider: tiingo)
|
| 352 |
+
|
| 353 |
+
Returns
|
| 354 |
+
-------
|
| 355 |
+
OBBject
|
| 356 |
+
results : list[WorldNews]
|
| 357 |
+
Serializable results.
|
| 358 |
+
provider : Optional[str]
|
| 359 |
+
Provider name.
|
| 360 |
+
warnings : Optional[list[Warning_]]
|
| 361 |
+
list of warnings.
|
| 362 |
+
chart : Optional[Chart]
|
| 363 |
+
Chart object.
|
| 364 |
+
extra : Dict[str, Any]
|
| 365 |
+
Extra info.
|
| 366 |
+
|
| 367 |
+
WorldNews
|
| 368 |
+
---------
|
| 369 |
+
date : datetime
|
| 370 |
+
The date of the data. The published date of the article.
|
| 371 |
+
title : str
|
| 372 |
+
Title of the article.
|
| 373 |
+
images : Optional[list[Dict[str, str]]]
|
| 374 |
+
Images associated with the article.
|
| 375 |
+
text : Optional[str]
|
| 376 |
+
Text/body of the article.
|
| 377 |
+
url : Optional[str]
|
| 378 |
+
URL to the article.
|
| 379 |
+
id : Optional[str]
|
| 380 |
+
Article ID. (provider: benzinga, intrinio)
|
| 381 |
+
author : Optional[str]
|
| 382 |
+
Author of the news. (provider: benzinga)
|
| 383 |
+
teaser : Optional[str]
|
| 384 |
+
Teaser of the news. (provider: benzinga)
|
| 385 |
+
channels : Optional[str]
|
| 386 |
+
Channels associated with the news. (provider: benzinga)
|
| 387 |
+
stocks : Optional[str]
|
| 388 |
+
Stocks associated with the news. (provider: benzinga)
|
| 389 |
+
tags : Optional[str]
|
| 390 |
+
Tags associated with the news. (provider: benzinga, tiingo)
|
| 391 |
+
updated : Optional[datetime]
|
| 392 |
+
Updated date of the news. (provider: benzinga)
|
| 393 |
+
site : Optional[str]
|
| 394 |
+
News source. (provider: fmp, tiingo)
|
| 395 |
+
source : Optional[str]
|
| 396 |
+
The source of the news article. (provider: intrinio)
|
| 397 |
+
summary : Optional[str]
|
| 398 |
+
The summary of the news article. (provider: intrinio)
|
| 399 |
+
topics : Optional[str]
|
| 400 |
+
The topics related to the news article. (provider: intrinio)
|
| 401 |
+
word_count : Optional[int]
|
| 402 |
+
The word count of the news article. (provider: intrinio)
|
| 403 |
+
business_relevance : Optional[float]
|
| 404 |
+
How strongly correlated the news article is to the business (provider: intrinio)
|
| 405 |
+
sentiment : Optional[str]
|
| 406 |
+
The sentiment of the news article - i.e, negative, positive. (provider: intrinio)
|
| 407 |
+
sentiment_confidence : Optional[float]
|
| 408 |
+
The confidence score of the sentiment rating. (provider: intrinio)
|
| 409 |
+
language : Optional[str]
|
| 410 |
+
The language of the news article. (provider: intrinio)
|
| 411 |
+
spam : Optional[bool]
|
| 412 |
+
Whether the news article is spam. (provider: intrinio)
|
| 413 |
+
copyright : Optional[str]
|
| 414 |
+
The copyright notice of the news article. (provider: intrinio)
|
| 415 |
+
company : Optional[IntrinioCompany]
|
| 416 |
+
The Intrinio Company object. Contains details company reference data. (provider: intrinio)
|
| 417 |
+
security : Optional[IntrinioSecurity]
|
| 418 |
+
The Intrinio Security object. Contains the security details related to the news article. (provider: intrinio)
|
| 419 |
+
symbols : Optional[str]
|
| 420 |
+
Ticker tagged in the fetched news. (provider: tiingo)
|
| 421 |
+
article_id : Optional[int]
|
| 422 |
+
Unique ID of the news article. (provider: tiingo)
|
| 423 |
+
crawl_date : Optional[datetime]
|
| 424 |
+
Date the news article was crawled. (provider: tiingo)
|
| 425 |
+
|
| 426 |
+
Examples
|
| 427 |
+
--------
|
| 428 |
+
>>> from openbb import obb
|
| 429 |
+
>>> obb.news.world(provider='fmp')
|
| 430 |
+
>>> obb.news.world(limit=100, provider='intrinio')
|
| 431 |
+
>>> # Get news on the specified dates.
|
| 432 |
+
>>> obb.news.world(start_date='2024-02-01', end_date='2024-02-07', provider='intrinio')
|
| 433 |
+
>>> # Display the headlines of the news.
|
| 434 |
+
>>> obb.news.world(display='headline', provider='benzinga')
|
| 435 |
+
>>> # Get news by topics.
|
| 436 |
+
>>> obb.news.world(topics='finance', provider='benzinga')
|
| 437 |
+
>>> # Get news by source using 'tingo' as provider.
|
| 438 |
+
>>> obb.news.world(provider='tiingo', source='bloomberg')
|
| 439 |
+
""" # noqa: E501
|
| 440 |
+
|
| 441 |
+
return self._run(
|
| 442 |
+
"/news/world",
|
| 443 |
+
**filter_inputs(
|
| 444 |
+
provider_choices={
|
| 445 |
+
"provider": self._get_provider(
|
| 446 |
+
provider,
|
| 447 |
+
"news.world",
|
| 448 |
+
("benzinga", "fmp", "intrinio", "tiingo"),
|
| 449 |
+
)
|
| 450 |
+
},
|
| 451 |
+
standard_params={
|
| 452 |
+
"limit": limit,
|
| 453 |
+
"start_date": start_date,
|
| 454 |
+
"end_date": end_date,
|
| 455 |
+
},
|
| 456 |
+
extra_params=kwargs,
|
| 457 |
+
info={
|
| 458 |
+
"source": {
|
| 459 |
+
"tiingo": {"multiple_items_allowed": True, "choices": None}
|
| 460 |
+
}
|
| 461 |
+
},
|
| 462 |
+
)
|
| 463 |
+
)
|
openbb_platform/openbb/package/regulators.py
ADDED
|
@@ -0,0 +1,30 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
### THIS FILE IS AUTO-GENERATED. DO NOT EDIT. ###
|
| 2 |
+
|
| 3 |
+
|
| 4 |
+
from openbb_core.app.static.container import Container
|
| 5 |
+
|
| 6 |
+
|
| 7 |
+
class ROUTER_regulators(Container):
|
| 8 |
+
"""/regulators
|
| 9 |
+
/cftc
|
| 10 |
+
/sec
|
| 11 |
+
"""
|
| 12 |
+
|
| 13 |
+
def __repr__(self) -> str:
|
| 14 |
+
return self.__doc__ or ""
|
| 15 |
+
|
| 16 |
+
@property
|
| 17 |
+
def cftc(self):
|
| 18 |
+
# pylint: disable=import-outside-toplevel
|
| 19 |
+
from . import regulators_cftc
|
| 20 |
+
|
| 21 |
+
return regulators_cftc.ROUTER_regulators_cftc(
|
| 22 |
+
command_runner=self._command_runner
|
| 23 |
+
)
|
| 24 |
+
|
| 25 |
+
@property
|
| 26 |
+
def sec(self):
|
| 27 |
+
# pylint: disable=import-outside-toplevel
|
| 28 |
+
from . import regulators_sec
|
| 29 |
+
|
| 30 |
+
return regulators_sec.ROUTER_regulators_sec(command_runner=self._command_runner)
|
openbb_platform/openbb/package/regulators_cftc.py
ADDED
|
@@ -0,0 +1,248 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
### THIS FILE IS AUTO-GENERATED. DO NOT EDIT. ###
|
| 2 |
+
|
| 3 |
+
import datetime
|
| 4 |
+
from typing import Literal, Optional, Union
|
| 5 |
+
|
| 6 |
+
from openbb_core.app.model.field import OpenBBField
|
| 7 |
+
from openbb_core.app.model.obbject import OBBject
|
| 8 |
+
from openbb_core.app.static.container import Container
|
| 9 |
+
from openbb_core.app.static.utils.decorators import exception_handler, validate
|
| 10 |
+
from openbb_core.app.static.utils.filters import filter_inputs
|
| 11 |
+
from typing_extensions import Annotated
|
| 12 |
+
|
| 13 |
+
|
| 14 |
+
class ROUTER_regulators_cftc(Container):
|
| 15 |
+
"""/regulators/cftc
|
| 16 |
+
cot
|
| 17 |
+
cot_search
|
| 18 |
+
"""
|
| 19 |
+
|
| 20 |
+
def __repr__(self) -> str:
|
| 21 |
+
return self.__doc__ or ""
|
| 22 |
+
|
| 23 |
+
@exception_handler
|
| 24 |
+
@validate
|
| 25 |
+
def cot(
|
| 26 |
+
self,
|
| 27 |
+
id: Annotated[
|
| 28 |
+
str,
|
| 29 |
+
OpenBBField(
|
| 30 |
+
description="A string with the CFTC market code or other identifying string, such as the contract market name, commodity name, or commodity group - i.e, 'gold' or 'japanese yen'.Default report is Fed Funds Futures. Use the 'cftc_market_code' for an exact match."
|
| 31 |
+
),
|
| 32 |
+
] = "045601",
|
| 33 |
+
start_date: Annotated[
|
| 34 |
+
Union[datetime.date, None, str],
|
| 35 |
+
OpenBBField(
|
| 36 |
+
description="Start date of the data, in YYYY-MM-DD format. Default is the most recent report."
|
| 37 |
+
),
|
| 38 |
+
] = None,
|
| 39 |
+
end_date: Annotated[
|
| 40 |
+
Union[datetime.date, None, str],
|
| 41 |
+
OpenBBField(description="End date of the data, in YYYY-MM-DD format."),
|
| 42 |
+
] = None,
|
| 43 |
+
provider: Annotated[
|
| 44 |
+
Optional[Literal["cftc"]],
|
| 45 |
+
OpenBBField(
|
| 46 |
+
description="The provider to use, by default None. If None, the priority list configured in the settings is used. Default priority: cftc."
|
| 47 |
+
),
|
| 48 |
+
] = None,
|
| 49 |
+
**kwargs
|
| 50 |
+
) -> OBBject:
|
| 51 |
+
"""Get Commitment of Traders Reports.
|
| 52 |
+
|
| 53 |
+
Parameters
|
| 54 |
+
----------
|
| 55 |
+
provider : str
|
| 56 |
+
The provider to use, by default None. If None, the priority list configured in the settings is used. Default priority: cftc.
|
| 57 |
+
id : str
|
| 58 |
+
A string with the CFTC market code or other identifying string, such as the contract market name, commodity name, or commodity group - i.e, 'gold' or 'japanese yen'.Default report is Fed Funds Futures. Use the 'cftc_market_code' for an exact match.
|
| 59 |
+
start_date : Union[date, None, str]
|
| 60 |
+
Start date of the data, in YYYY-MM-DD format. Default is the most recent report.
|
| 61 |
+
end_date : Union[date, None, str]
|
| 62 |
+
End date of the data, in YYYY-MM-DD format.
|
| 63 |
+
report_type : Literal['legacy', 'disaggregated', 'financial', 'supplemental']
|
| 64 |
+
The type of report to retrieve. Set `id` as 'all' to return all items in the report
|
| 65 |
+
type (default date range returns the latest report). The Legacy report is broken down by exchange
|
| 66 |
+
with reported open interest further broken down into three trader classifications: commercial,
|
| 67 |
+
non-commercial and non-reportable. The Disaggregated reports are broken down by Agriculture and
|
| 68 |
+
Natural Resource contracts. The Disaggregated reports break down reportable open interest positions
|
| 69 |
+
into four classifications: Producer/Merchant, Swap Dealers, Managed Money and Other Reportables.
|
| 70 |
+
The Traders in Financial Futures (TFF) report includes financial contracts. The TFF report breaks
|
| 71 |
+
down the reported open interest into five classifications: Dealer, Asset Manager, Leveraged Money,
|
| 72 |
+
Other Reportables and Non-Reportables. (provider: cftc)
|
| 73 |
+
futures_only : bool
|
| 74 |
+
Returns the futures-only report. Default is False, for the combined report. (provider: cftc)
|
| 75 |
+
|
| 76 |
+
Returns
|
| 77 |
+
-------
|
| 78 |
+
OBBject
|
| 79 |
+
results : list[COT]
|
| 80 |
+
Serializable results.
|
| 81 |
+
provider : Optional[str]
|
| 82 |
+
Provider name.
|
| 83 |
+
warnings : Optional[list[Warning_]]
|
| 84 |
+
list of warnings.
|
| 85 |
+
chart : Optional[Chart]
|
| 86 |
+
Chart object.
|
| 87 |
+
extra : Dict[str, Any]
|
| 88 |
+
Extra info.
|
| 89 |
+
|
| 90 |
+
COT
|
| 91 |
+
---
|
| 92 |
+
date : date
|
| 93 |
+
The date of the data.
|
| 94 |
+
report_week : Optional[str]
|
| 95 |
+
Report week for the year.
|
| 96 |
+
market_and_exchange_names : Optional[str]
|
| 97 |
+
Market and exchange names.
|
| 98 |
+
cftc_contract_market_code : Optional[str]
|
| 99 |
+
CFTC contract market code.
|
| 100 |
+
cftc_market_code : Optional[str]
|
| 101 |
+
CFTC market code.
|
| 102 |
+
cftc_region_code : Optional[str]
|
| 103 |
+
CFTC region code.
|
| 104 |
+
cftc_commodity_code : Optional[str]
|
| 105 |
+
CFTC commodity code.
|
| 106 |
+
cftc_contract_market_code_quotes : Optional[str]
|
| 107 |
+
CFTC contract market code quotes.
|
| 108 |
+
cftc_market_code_quotes : Optional[str]
|
| 109 |
+
CFTC market code quotes.
|
| 110 |
+
cftc_commodity_code_quotes : Optional[str]
|
| 111 |
+
CFTC commodity code quotes.
|
| 112 |
+
cftc_subgroup_code : Optional[str]
|
| 113 |
+
CFTC subgroup code.
|
| 114 |
+
commodity : Optional[str]
|
| 115 |
+
Commodity.
|
| 116 |
+
commodity_group : Optional[str]
|
| 117 |
+
Commodity group name.
|
| 118 |
+
commodity_subgroup : Optional[str]
|
| 119 |
+
Commodity subgroup name.
|
| 120 |
+
futonly_or_combined : Optional[str]
|
| 121 |
+
If the report is futures-only or combined.
|
| 122 |
+
contract_units : Optional[str]
|
| 123 |
+
Contract units.
|
| 124 |
+
|
| 125 |
+
Examples
|
| 126 |
+
--------
|
| 127 |
+
>>> from openbb import obb
|
| 128 |
+
>>> # Get the latest report for all items classified as, GOLD.
|
| 129 |
+
>>> obb.regulators.cftc.cot(id='gold', provider='cftc')
|
| 130 |
+
>>> # Enter the entire history for a single CFTC Market Contract Code.
|
| 131 |
+
>>> obb.regulators.cftc.cot(id='088691', provider='cftc')
|
| 132 |
+
>>> # Get the report for futures only.
|
| 133 |
+
>>> obb.regulators.cftc.cot(id='088691', futures_only=True, provider='cftc')
|
| 134 |
+
>>> # Get the most recent Commodity Index Traders Supplemental Report.
|
| 135 |
+
>>> obb.regulators.cftc.cot(id='all', report_type='supplemental', provider='cftc')
|
| 136 |
+
""" # noqa: E501
|
| 137 |
+
|
| 138 |
+
return self._run(
|
| 139 |
+
"/regulators/cftc/cot",
|
| 140 |
+
**filter_inputs(
|
| 141 |
+
provider_choices={
|
| 142 |
+
"provider": self._get_provider(
|
| 143 |
+
provider,
|
| 144 |
+
"regulators.cftc.cot",
|
| 145 |
+
("cftc",),
|
| 146 |
+
)
|
| 147 |
+
},
|
| 148 |
+
standard_params={
|
| 149 |
+
"id": id,
|
| 150 |
+
"start_date": start_date,
|
| 151 |
+
"end_date": end_date,
|
| 152 |
+
},
|
| 153 |
+
extra_params=kwargs,
|
| 154 |
+
info={
|
| 155 |
+
"report_type": {
|
| 156 |
+
"cftc": {
|
| 157 |
+
"multiple_items_allowed": False,
|
| 158 |
+
"choices": [
|
| 159 |
+
"legacy",
|
| 160 |
+
"disaggregated",
|
| 161 |
+
"financial",
|
| 162 |
+
"supplemental",
|
| 163 |
+
],
|
| 164 |
+
}
|
| 165 |
+
}
|
| 166 |
+
},
|
| 167 |
+
)
|
| 168 |
+
)
|
| 169 |
+
|
| 170 |
+
@exception_handler
|
| 171 |
+
@validate
|
| 172 |
+
def cot_search(
|
| 173 |
+
self,
|
| 174 |
+
query: Annotated[str, OpenBBField(description="Search query.")] = "",
|
| 175 |
+
provider: Annotated[
|
| 176 |
+
Optional[Literal["cftc"]],
|
| 177 |
+
OpenBBField(
|
| 178 |
+
description="The provider to use, by default None. If None, the priority list configured in the settings is used. Default priority: cftc."
|
| 179 |
+
),
|
| 180 |
+
] = None,
|
| 181 |
+
**kwargs
|
| 182 |
+
) -> OBBject:
|
| 183 |
+
"""Get the current Commitment of Traders Reports.
|
| 184 |
+
|
| 185 |
+
Search a list of the current Commitment of Traders Reports series information.
|
| 186 |
+
|
| 187 |
+
|
| 188 |
+
Parameters
|
| 189 |
+
----------
|
| 190 |
+
provider : str
|
| 191 |
+
The provider to use, by default None. If None, the priority list configured in the settings is used. Default priority: cftc.
|
| 192 |
+
query : str
|
| 193 |
+
Search query.
|
| 194 |
+
|
| 195 |
+
Returns
|
| 196 |
+
-------
|
| 197 |
+
OBBject
|
| 198 |
+
results : list[COTSearch]
|
| 199 |
+
Serializable results.
|
| 200 |
+
provider : Optional[str]
|
| 201 |
+
Provider name.
|
| 202 |
+
warnings : Optional[list[Warning_]]
|
| 203 |
+
list of warnings.
|
| 204 |
+
chart : Optional[Chart]
|
| 205 |
+
Chart object.
|
| 206 |
+
extra : Dict[str, Any]
|
| 207 |
+
Extra info.
|
| 208 |
+
|
| 209 |
+
COTSearch
|
| 210 |
+
---------
|
| 211 |
+
code : str
|
| 212 |
+
CFTC market contract code of the report.
|
| 213 |
+
name : str
|
| 214 |
+
Name of the underlying asset.
|
| 215 |
+
category : Optional[str]
|
| 216 |
+
Category of the underlying asset.
|
| 217 |
+
subcategory : Optional[str]
|
| 218 |
+
Subcategory of the underlying asset.
|
| 219 |
+
units : Optional[str]
|
| 220 |
+
The units for one contract.
|
| 221 |
+
symbol : Optional[str]
|
| 222 |
+
Symbol representing the entity requested in the data.
|
| 223 |
+
commodity : Optional[str]
|
| 224 |
+
Name of the commodity. (provider: cftc)
|
| 225 |
+
|
| 226 |
+
Examples
|
| 227 |
+
--------
|
| 228 |
+
>>> from openbb import obb
|
| 229 |
+
>>> obb.regulators.cftc.cot_search(provider='cftc')
|
| 230 |
+
>>> obb.regulators.cftc.cot_search(query='gold', provider='cftc')
|
| 231 |
+
""" # noqa: E501
|
| 232 |
+
|
| 233 |
+
return self._run(
|
| 234 |
+
"/regulators/cftc/cot_search",
|
| 235 |
+
**filter_inputs(
|
| 236 |
+
provider_choices={
|
| 237 |
+
"provider": self._get_provider(
|
| 238 |
+
provider,
|
| 239 |
+
"regulators.cftc.cot_search",
|
| 240 |
+
("cftc",),
|
| 241 |
+
)
|
| 242 |
+
},
|
| 243 |
+
standard_params={
|
| 244 |
+
"query": query,
|
| 245 |
+
},
|
| 246 |
+
extra_params=kwargs,
|
| 247 |
+
)
|
| 248 |
+
)
|
openbb_platform/openbb/package/regulators_sec.py
ADDED
|
@@ -0,0 +1,613 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|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
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
### THIS FILE IS AUTO-GENERATED. DO NOT EDIT. ###
|
| 2 |
+
|
| 3 |
+
from typing import Literal, Optional
|
| 4 |
+
|
| 5 |
+
from openbb_core.app.model.field import OpenBBField
|
| 6 |
+
from openbb_core.app.model.obbject import OBBject
|
| 7 |
+
from openbb_core.app.static.container import Container
|
| 8 |
+
from openbb_core.app.static.utils.decorators import exception_handler, validate
|
| 9 |
+
from openbb_core.app.static.utils.filters import filter_inputs
|
| 10 |
+
from typing_extensions import Annotated
|
| 11 |
+
|
| 12 |
+
|
| 13 |
+
class ROUTER_regulators_sec(Container):
|
| 14 |
+
"""/regulators/sec
|
| 15 |
+
cik_map
|
| 16 |
+
filing_headers
|
| 17 |
+
htm_file
|
| 18 |
+
institutions_search
|
| 19 |
+
rss_litigation
|
| 20 |
+
schema_files
|
| 21 |
+
sic_search
|
| 22 |
+
symbol_map
|
| 23 |
+
"""
|
| 24 |
+
|
| 25 |
+
def __repr__(self) -> str:
|
| 26 |
+
return self.__doc__ or ""
|
| 27 |
+
|
| 28 |
+
@exception_handler
|
| 29 |
+
@validate
|
| 30 |
+
def cik_map(
|
| 31 |
+
self,
|
| 32 |
+
symbol: Annotated[str, OpenBBField(description="Symbol to get data for.")],
|
| 33 |
+
provider: Annotated[
|
| 34 |
+
Optional[Literal["sec"]],
|
| 35 |
+
OpenBBField(
|
| 36 |
+
description="The provider to use, by default None. If None, the priority list configured in the settings is used. Default priority: sec."
|
| 37 |
+
),
|
| 38 |
+
] = None,
|
| 39 |
+
**kwargs
|
| 40 |
+
) -> OBBject:
|
| 41 |
+
"""Map a ticker symbol to a CIK number.
|
| 42 |
+
|
| 43 |
+
Parameters
|
| 44 |
+
----------
|
| 45 |
+
provider : str
|
| 46 |
+
The provider to use, by default None. If None, the priority list configured in the settings is used. Default priority: sec.
|
| 47 |
+
symbol : str
|
| 48 |
+
Symbol to get data for.
|
| 49 |
+
use_cache : Optional[bool]
|
| 50 |
+
Whether or not to use cache for the request, default is True. (provider: sec)
|
| 51 |
+
|
| 52 |
+
Returns
|
| 53 |
+
-------
|
| 54 |
+
OBBject
|
| 55 |
+
results : CikMap
|
| 56 |
+
Serializable results.
|
| 57 |
+
provider : Optional[str]
|
| 58 |
+
Provider name.
|
| 59 |
+
warnings : Optional[list[Warning_]]
|
| 60 |
+
list of warnings.
|
| 61 |
+
chart : Optional[Chart]
|
| 62 |
+
Chart object.
|
| 63 |
+
extra : Dict[str, Any]
|
| 64 |
+
Extra info.
|
| 65 |
+
|
| 66 |
+
CikMap
|
| 67 |
+
------
|
| 68 |
+
cik : Optional[Union[int, str]]
|
| 69 |
+
Central Index Key (CIK) for the requested entity.
|
| 70 |
+
|
| 71 |
+
Examples
|
| 72 |
+
--------
|
| 73 |
+
>>> from openbb import obb
|
| 74 |
+
>>> obb.regulators.sec.cik_map(symbol='MSFT', provider='sec')
|
| 75 |
+
""" # noqa: E501
|
| 76 |
+
|
| 77 |
+
return self._run(
|
| 78 |
+
"/regulators/sec/cik_map",
|
| 79 |
+
**filter_inputs(
|
| 80 |
+
provider_choices={
|
| 81 |
+
"provider": self._get_provider(
|
| 82 |
+
provider,
|
| 83 |
+
"regulators.sec.cik_map",
|
| 84 |
+
("sec",),
|
| 85 |
+
)
|
| 86 |
+
},
|
| 87 |
+
standard_params={
|
| 88 |
+
"symbol": symbol,
|
| 89 |
+
},
|
| 90 |
+
extra_params=kwargs,
|
| 91 |
+
)
|
| 92 |
+
)
|
| 93 |
+
|
| 94 |
+
@exception_handler
|
| 95 |
+
@validate
|
| 96 |
+
def filing_headers(
|
| 97 |
+
self,
|
| 98 |
+
provider: Annotated[
|
| 99 |
+
Optional[Literal["sec"]],
|
| 100 |
+
OpenBBField(
|
| 101 |
+
description="The provider to use, by default None. If None, the priority list configured in the settings is used. Default priority: sec."
|
| 102 |
+
),
|
| 103 |
+
] = None,
|
| 104 |
+
**kwargs
|
| 105 |
+
) -> OBBject:
|
| 106 |
+
"""Download the index headers, and cover page if available, for any SEC filing.
|
| 107 |
+
|
| 108 |
+
Parameters
|
| 109 |
+
----------
|
| 110 |
+
provider : str
|
| 111 |
+
The provider to use, by default None. If None, the priority list configured in the settings is used. Default priority: sec.
|
| 112 |
+
url : str
|
| 113 |
+
URL for the SEC filing. The specific URL is not directly used or downloaded, but is used to generate the base URL for the filing. e.g. https://www.sec.gov/Archives/edgar/data/317540/000031754024000045/coke-20240731.htm and https://www.sec.gov/Archives/edgar/data/317540/000031754024000045/ are both valid URLs for the same filing. (provider: sec)
|
| 114 |
+
use_cache : bool
|
| 115 |
+
Use cache for the index headers and cover page. Default is True. (provider: sec)
|
| 116 |
+
|
| 117 |
+
Returns
|
| 118 |
+
-------
|
| 119 |
+
OBBject
|
| 120 |
+
results : SecFiling
|
| 121 |
+
Serializable results.
|
| 122 |
+
provider : Optional[str]
|
| 123 |
+
Provider name.
|
| 124 |
+
warnings : Optional[list[Warning_]]
|
| 125 |
+
list of warnings.
|
| 126 |
+
chart : Optional[Chart]
|
| 127 |
+
Chart object.
|
| 128 |
+
extra : Dict[str, Any]
|
| 129 |
+
Extra info.
|
| 130 |
+
|
| 131 |
+
SecFiling
|
| 132 |
+
---------
|
| 133 |
+
base_url : Optional[str]
|
| 134 |
+
Base URL of the filing. (provider: sec)
|
| 135 |
+
name : Optional[str]
|
| 136 |
+
Name of the entity filing. (provider: sec)
|
| 137 |
+
cik : Optional[str]
|
| 138 |
+
Central Index Key. (provider: sec)
|
| 139 |
+
trading_symbols : Optional[list]
|
| 140 |
+
Trading symbols, if available. (provider: sec)
|
| 141 |
+
sic : Optional[str]
|
| 142 |
+
Standard Industrial Classification. (provider: sec)
|
| 143 |
+
sic_organization_name : Optional[str]
|
| 144 |
+
SIC Organization Name. (provider: sec)
|
| 145 |
+
filing_date : Optional[date]
|
| 146 |
+
Filing date. (provider: sec)
|
| 147 |
+
period_ending : Optional[date]
|
| 148 |
+
Date of the ending period for the filing, if available. (provider: sec)
|
| 149 |
+
fiscal_year_end : Optional[str]
|
| 150 |
+
Fiscal year end of the entity, if available. Format: MM-DD (provider: sec)
|
| 151 |
+
document_type : Optional[str]
|
| 152 |
+
Specific SEC filing type. (provider: sec)
|
| 153 |
+
has_cover_page : Optional[bool]
|
| 154 |
+
True if the filing has a cover page. (provider: sec)
|
| 155 |
+
description : Optional[str]
|
| 156 |
+
Description of attached content, mostly applicable to 8-K filings. (provider: sec)
|
| 157 |
+
cover_page : Optional[dict]
|
| 158 |
+
Cover page information, if available. (provider: sec)
|
| 159 |
+
document_urls : Optional[list]
|
| 160 |
+
list of files associated with the filing. (provider: sec)
|
| 161 |
+
|
| 162 |
+
Examples
|
| 163 |
+
--------
|
| 164 |
+
>>> from openbb import obb
|
| 165 |
+
>>> obb.regulators.sec.filing_headers(url='https://www.sec.gov/Archives/edgar/data/317540/000119312524076556/d645509ddef14a.htm', provider='sec')
|
| 166 |
+
""" # noqa: E501
|
| 167 |
+
|
| 168 |
+
return self._run(
|
| 169 |
+
"/regulators/sec/filing_headers",
|
| 170 |
+
**filter_inputs(
|
| 171 |
+
provider_choices={
|
| 172 |
+
"provider": self._get_provider(
|
| 173 |
+
provider,
|
| 174 |
+
"regulators.sec.filing_headers",
|
| 175 |
+
("sec",),
|
| 176 |
+
)
|
| 177 |
+
},
|
| 178 |
+
standard_params={},
|
| 179 |
+
extra_params=kwargs,
|
| 180 |
+
info={"url": {"sec": {"x-widget_config": {"label": "Filing URL"}}}},
|
| 181 |
+
)
|
| 182 |
+
)
|
| 183 |
+
|
| 184 |
+
@exception_handler
|
| 185 |
+
@validate
|
| 186 |
+
def htm_file(
|
| 187 |
+
self,
|
| 188 |
+
provider: Annotated[
|
| 189 |
+
Optional[Literal["sec"]],
|
| 190 |
+
OpenBBField(
|
| 191 |
+
description="The provider to use, by default None. If None, the priority list configured in the settings is used. Default priority: sec."
|
| 192 |
+
),
|
| 193 |
+
] = None,
|
| 194 |
+
**kwargs
|
| 195 |
+
) -> OBBject:
|
| 196 |
+
"""Download a raw HTML object from the SEC website.
|
| 197 |
+
|
| 198 |
+
Parameters
|
| 199 |
+
----------
|
| 200 |
+
provider : str
|
| 201 |
+
The provider to use, by default None. If None, the priority list configured in the settings is used. Default priority: sec.
|
| 202 |
+
url : str
|
| 203 |
+
URL for the SEC filing. (provider: sec)
|
| 204 |
+
use_cache : bool
|
| 205 |
+
Cache the file for use later. Default is True. (provider: sec)
|
| 206 |
+
|
| 207 |
+
Returns
|
| 208 |
+
-------
|
| 209 |
+
OBBject
|
| 210 |
+
results : SecHtmFile
|
| 211 |
+
Serializable results.
|
| 212 |
+
provider : Optional[str]
|
| 213 |
+
Provider name.
|
| 214 |
+
warnings : Optional[list[Warning_]]
|
| 215 |
+
list of warnings.
|
| 216 |
+
chart : Optional[Chart]
|
| 217 |
+
Chart object.
|
| 218 |
+
extra : Dict[str, Any]
|
| 219 |
+
Extra info.
|
| 220 |
+
|
| 221 |
+
SecHtmFile
|
| 222 |
+
----------
|
| 223 |
+
url : Optional[str]
|
| 224 |
+
URL of the downloaded file. (provider: sec)
|
| 225 |
+
content : Optional[str]
|
| 226 |
+
Raw content of the HTM/HTML file. (provider: sec)
|
| 227 |
+
|
| 228 |
+
Examples
|
| 229 |
+
--------
|
| 230 |
+
>>> from openbb import obb
|
| 231 |
+
>>> obb.regulators.sec.htm_file(url='https://www.sec.gov/Archives/edgar/data/1723690/000119312525030074/d866336dex991.htm', provider='sec')
|
| 232 |
+
""" # noqa: E501
|
| 233 |
+
|
| 234 |
+
return self._run(
|
| 235 |
+
"/regulators/sec/htm_file",
|
| 236 |
+
**filter_inputs(
|
| 237 |
+
provider_choices={
|
| 238 |
+
"provider": self._get_provider(
|
| 239 |
+
provider,
|
| 240 |
+
"regulators.sec.htm_file",
|
| 241 |
+
("sec",),
|
| 242 |
+
)
|
| 243 |
+
},
|
| 244 |
+
standard_params={},
|
| 245 |
+
extra_params=kwargs,
|
| 246 |
+
)
|
| 247 |
+
)
|
| 248 |
+
|
| 249 |
+
@exception_handler
|
| 250 |
+
@validate
|
| 251 |
+
def institutions_search(
|
| 252 |
+
self,
|
| 253 |
+
query: Annotated[str, OpenBBField(description="Search query.")] = "",
|
| 254 |
+
provider: Annotated[
|
| 255 |
+
Optional[Literal["sec"]],
|
| 256 |
+
OpenBBField(
|
| 257 |
+
description="The provider to use, by default None. If None, the priority list configured in the settings is used. Default priority: sec."
|
| 258 |
+
),
|
| 259 |
+
] = None,
|
| 260 |
+
**kwargs
|
| 261 |
+
) -> OBBject:
|
| 262 |
+
"""Search SEC-regulated institutions by name and return a list of results with CIK numbers.
|
| 263 |
+
|
| 264 |
+
Parameters
|
| 265 |
+
----------
|
| 266 |
+
provider : str
|
| 267 |
+
The provider to use, by default None. If None, the priority list configured in the settings is used. Default priority: sec.
|
| 268 |
+
query : str
|
| 269 |
+
Search query.
|
| 270 |
+
use_cache : Optional[bool]
|
| 271 |
+
Whether or not to use cache. (provider: sec)
|
| 272 |
+
|
| 273 |
+
Returns
|
| 274 |
+
-------
|
| 275 |
+
OBBject
|
| 276 |
+
results : list[InstitutionsSearch]
|
| 277 |
+
Serializable results.
|
| 278 |
+
provider : Optional[str]
|
| 279 |
+
Provider name.
|
| 280 |
+
warnings : Optional[list[Warning_]]
|
| 281 |
+
list of warnings.
|
| 282 |
+
chart : Optional[Chart]
|
| 283 |
+
Chart object.
|
| 284 |
+
extra : Dict[str, Any]
|
| 285 |
+
Extra info.
|
| 286 |
+
|
| 287 |
+
InstitutionsSearch
|
| 288 |
+
------------------
|
| 289 |
+
name : Optional[str]
|
| 290 |
+
The name of the institution. (provider: sec)
|
| 291 |
+
cik : Optional[Union[int, str]]
|
| 292 |
+
Central Index Key (CIK) (provider: sec)
|
| 293 |
+
|
| 294 |
+
Examples
|
| 295 |
+
--------
|
| 296 |
+
>>> from openbb import obb
|
| 297 |
+
>>> obb.regulators.sec.institutions_search(provider='sec')
|
| 298 |
+
>>> obb.regulators.sec.institutions_search(query='blackstone real estate', provider='sec')
|
| 299 |
+
""" # noqa: E501
|
| 300 |
+
|
| 301 |
+
return self._run(
|
| 302 |
+
"/regulators/sec/institutions_search",
|
| 303 |
+
**filter_inputs(
|
| 304 |
+
provider_choices={
|
| 305 |
+
"provider": self._get_provider(
|
| 306 |
+
provider,
|
| 307 |
+
"regulators.sec.institutions_search",
|
| 308 |
+
("sec",),
|
| 309 |
+
)
|
| 310 |
+
},
|
| 311 |
+
standard_params={
|
| 312 |
+
"query": query,
|
| 313 |
+
},
|
| 314 |
+
extra_params=kwargs,
|
| 315 |
+
)
|
| 316 |
+
)
|
| 317 |
+
|
| 318 |
+
@exception_handler
|
| 319 |
+
@validate
|
| 320 |
+
def rss_litigation(
|
| 321 |
+
self,
|
| 322 |
+
provider: Annotated[
|
| 323 |
+
Optional[Literal["sec"]],
|
| 324 |
+
OpenBBField(
|
| 325 |
+
description="The provider to use, by default None. If None, the priority list configured in the settings is used. Default priority: sec."
|
| 326 |
+
),
|
| 327 |
+
] = None,
|
| 328 |
+
**kwargs
|
| 329 |
+
) -> OBBject:
|
| 330 |
+
"""Get the RSS feed that provides links to litigation releases concerning civil lawsuits brought by the Commission in federal court.
|
| 331 |
+
|
| 332 |
+
Parameters
|
| 333 |
+
----------
|
| 334 |
+
provider : str
|
| 335 |
+
The provider to use, by default None. If None, the priority list configured in the settings is used. Default priority: sec.
|
| 336 |
+
|
| 337 |
+
Returns
|
| 338 |
+
-------
|
| 339 |
+
OBBject
|
| 340 |
+
results : list[RssLitigation]
|
| 341 |
+
Serializable results.
|
| 342 |
+
provider : Optional[str]
|
| 343 |
+
Provider name.
|
| 344 |
+
warnings : Optional[list[Warning_]]
|
| 345 |
+
list of warnings.
|
| 346 |
+
chart : Optional[Chart]
|
| 347 |
+
Chart object.
|
| 348 |
+
extra : Dict[str, Any]
|
| 349 |
+
Extra info.
|
| 350 |
+
|
| 351 |
+
RssLitigation
|
| 352 |
+
-------------
|
| 353 |
+
published : Optional[datetime]
|
| 354 |
+
The date of publication. (provider: sec)
|
| 355 |
+
title : Optional[str]
|
| 356 |
+
The title of the release. (provider: sec)
|
| 357 |
+
summary : Optional[str]
|
| 358 |
+
Short summary of the release. (provider: sec)
|
| 359 |
+
id : Optional[str]
|
| 360 |
+
The identifier associated with the release. (provider: sec)
|
| 361 |
+
link : Optional[str]
|
| 362 |
+
URL to the release. (provider: sec)
|
| 363 |
+
|
| 364 |
+
Examples
|
| 365 |
+
--------
|
| 366 |
+
>>> from openbb import obb
|
| 367 |
+
>>> obb.regulators.sec.rss_litigation(provider='sec')
|
| 368 |
+
""" # noqa: E501
|
| 369 |
+
|
| 370 |
+
return self._run(
|
| 371 |
+
"/regulators/sec/rss_litigation",
|
| 372 |
+
**filter_inputs(
|
| 373 |
+
provider_choices={
|
| 374 |
+
"provider": self._get_provider(
|
| 375 |
+
provider,
|
| 376 |
+
"regulators.sec.rss_litigation",
|
| 377 |
+
("sec",),
|
| 378 |
+
)
|
| 379 |
+
},
|
| 380 |
+
standard_params={},
|
| 381 |
+
extra_params=kwargs,
|
| 382 |
+
)
|
| 383 |
+
)
|
| 384 |
+
|
| 385 |
+
@exception_handler
|
| 386 |
+
@validate
|
| 387 |
+
def schema_files(
|
| 388 |
+
self,
|
| 389 |
+
query: Annotated[str, OpenBBField(description="Search query.")] = "",
|
| 390 |
+
provider: Annotated[
|
| 391 |
+
Optional[Literal["sec"]],
|
| 392 |
+
OpenBBField(
|
| 393 |
+
description="The provider to use, by default None. If None, the priority list configured in the settings is used. Default priority: sec."
|
| 394 |
+
),
|
| 395 |
+
] = None,
|
| 396 |
+
**kwargs
|
| 397 |
+
) -> OBBject:
|
| 398 |
+
"""Use tool for navigating the directory of SEC XML schema files by year.
|
| 399 |
+
|
| 400 |
+
Parameters
|
| 401 |
+
----------
|
| 402 |
+
provider : str
|
| 403 |
+
The provider to use, by default None. If None, the priority list configured in the settings is used. Default priority: sec.
|
| 404 |
+
query : str
|
| 405 |
+
Search query.
|
| 406 |
+
url : Optional[str]
|
| 407 |
+
Enter an optional URL path to fetch the next level. (provider: sec)
|
| 408 |
+
use_cache : Optional[bool]
|
| 409 |
+
Whether or not to use cache. (provider: sec)
|
| 410 |
+
|
| 411 |
+
Returns
|
| 412 |
+
-------
|
| 413 |
+
OBBject
|
| 414 |
+
results : SchemaFiles
|
| 415 |
+
Serializable results.
|
| 416 |
+
provider : Optional[str]
|
| 417 |
+
Provider name.
|
| 418 |
+
warnings : Optional[list[Warning_]]
|
| 419 |
+
list of warnings.
|
| 420 |
+
chart : Optional[Chart]
|
| 421 |
+
Chart object.
|
| 422 |
+
extra : Dict[str, Any]
|
| 423 |
+
Extra info.
|
| 424 |
+
|
| 425 |
+
SchemaFiles
|
| 426 |
+
-----------
|
| 427 |
+
files : Optional[list[str]]
|
| 428 |
+
Dictionary of URLs to SEC Schema Files (provider: sec)
|
| 429 |
+
|
| 430 |
+
Examples
|
| 431 |
+
--------
|
| 432 |
+
>>> from openbb import obb
|
| 433 |
+
>>> obb.regulators.sec.schema_files(provider='sec')
|
| 434 |
+
>>> # Get a list of schema files.
|
| 435 |
+
>>> data = obb.regulators.sec.schema_files().results
|
| 436 |
+
>>> data.files[0]
|
| 437 |
+
>>> 'https://xbrl.fasb.org/us-gaap/'
|
| 438 |
+
>>> # The directory structure can be navigated by constructing a URL from the 'results' list.
|
| 439 |
+
>>> url = data.files[0]+data.files[-1]
|
| 440 |
+
>>> # The URL base will always be the 0 position in the list, feed the URL back in as a parameter.
|
| 441 |
+
>>> obb.regulators.sec.schema_files(url=url).results.files
|
| 442 |
+
>>> ['https://xbrl.fasb.org/us-gaap/2024/'
|
| 443 |
+
>>> 'USGAAP2024Filelist.xml'
|
| 444 |
+
>>> 'dis/'
|
| 445 |
+
>>> 'dqcrules/'
|
| 446 |
+
>>> 'ebp/'
|
| 447 |
+
>>> 'elts/'
|
| 448 |
+
>>> 'entire/'
|
| 449 |
+
>>> 'meta/'
|
| 450 |
+
>>> 'stm/'
|
| 451 |
+
>>> 'us-gaap-2024.zip']
|
| 452 |
+
""" # noqa: E501
|
| 453 |
+
|
| 454 |
+
return self._run(
|
| 455 |
+
"/regulators/sec/schema_files",
|
| 456 |
+
**filter_inputs(
|
| 457 |
+
provider_choices={
|
| 458 |
+
"provider": self._get_provider(
|
| 459 |
+
provider,
|
| 460 |
+
"regulators.sec.schema_files",
|
| 461 |
+
("sec",),
|
| 462 |
+
)
|
| 463 |
+
},
|
| 464 |
+
standard_params={
|
| 465 |
+
"query": query,
|
| 466 |
+
},
|
| 467 |
+
extra_params=kwargs,
|
| 468 |
+
)
|
| 469 |
+
)
|
| 470 |
+
|
| 471 |
+
@exception_handler
|
| 472 |
+
@validate
|
| 473 |
+
def sic_search(
|
| 474 |
+
self,
|
| 475 |
+
query: Annotated[str, OpenBBField(description="Search query.")] = "",
|
| 476 |
+
provider: Annotated[
|
| 477 |
+
Optional[Literal["sec"]],
|
| 478 |
+
OpenBBField(
|
| 479 |
+
description="The provider to use, by default None. If None, the priority list configured in the settings is used. Default priority: sec."
|
| 480 |
+
),
|
| 481 |
+
] = None,
|
| 482 |
+
**kwargs
|
| 483 |
+
) -> OBBject:
|
| 484 |
+
"""Search for Industry Titles, Reporting Office, and SIC Codes. An empty query string returns all results.
|
| 485 |
+
|
| 486 |
+
Parameters
|
| 487 |
+
----------
|
| 488 |
+
provider : str
|
| 489 |
+
The provider to use, by default None. If None, the priority list configured in the settings is used. Default priority: sec.
|
| 490 |
+
query : str
|
| 491 |
+
Search query.
|
| 492 |
+
use_cache : Optional[bool]
|
| 493 |
+
Whether or not to use cache. (provider: sec)
|
| 494 |
+
|
| 495 |
+
Returns
|
| 496 |
+
-------
|
| 497 |
+
OBBject
|
| 498 |
+
results : list[SicSearch]
|
| 499 |
+
Serializable results.
|
| 500 |
+
provider : Optional[str]
|
| 501 |
+
Provider name.
|
| 502 |
+
warnings : Optional[list[Warning_]]
|
| 503 |
+
list of warnings.
|
| 504 |
+
chart : Optional[Chart]
|
| 505 |
+
Chart object.
|
| 506 |
+
extra : Dict[str, Any]
|
| 507 |
+
Extra info.
|
| 508 |
+
|
| 509 |
+
SicSearch
|
| 510 |
+
---------
|
| 511 |
+
sic : Optional[int]
|
| 512 |
+
Sector Industrial Code (SIC) (provider: sec)
|
| 513 |
+
industry : Optional[str]
|
| 514 |
+
Industry title. (provider: sec)
|
| 515 |
+
office : Optional[str]
|
| 516 |
+
Reporting office within the Corporate Finance Office (provider: sec)
|
| 517 |
+
|
| 518 |
+
Examples
|
| 519 |
+
--------
|
| 520 |
+
>>> from openbb import obb
|
| 521 |
+
>>> obb.regulators.sec.sic_search(provider='sec')
|
| 522 |
+
>>> obb.regulators.sec.sic_search(query='real estate investment trusts', provider='sec')
|
| 523 |
+
""" # noqa: E501
|
| 524 |
+
|
| 525 |
+
return self._run(
|
| 526 |
+
"/regulators/sec/sic_search",
|
| 527 |
+
**filter_inputs(
|
| 528 |
+
provider_choices={
|
| 529 |
+
"provider": self._get_provider(
|
| 530 |
+
provider,
|
| 531 |
+
"regulators.sec.sic_search",
|
| 532 |
+
("sec",),
|
| 533 |
+
)
|
| 534 |
+
},
|
| 535 |
+
standard_params={
|
| 536 |
+
"query": query,
|
| 537 |
+
},
|
| 538 |
+
extra_params=kwargs,
|
| 539 |
+
)
|
| 540 |
+
)
|
| 541 |
+
|
| 542 |
+
@exception_handler
|
| 543 |
+
@validate
|
| 544 |
+
def symbol_map(
|
| 545 |
+
self,
|
| 546 |
+
query: Annotated[str, OpenBBField(description="Search query.")],
|
| 547 |
+
use_cache: Annotated[
|
| 548 |
+
Optional[bool],
|
| 549 |
+
OpenBBField(
|
| 550 |
+
description="Whether or not to use cache. If True, cache will store for seven days."
|
| 551 |
+
),
|
| 552 |
+
] = True,
|
| 553 |
+
provider: Annotated[
|
| 554 |
+
Optional[Literal["sec"]],
|
| 555 |
+
OpenBBField(
|
| 556 |
+
description="The provider to use, by default None. If None, the priority list configured in the settings is used. Default priority: sec."
|
| 557 |
+
),
|
| 558 |
+
] = None,
|
| 559 |
+
**kwargs
|
| 560 |
+
) -> OBBject:
|
| 561 |
+
"""Map a CIK number to a ticker symbol, leading 0s can be omitted or included.
|
| 562 |
+
|
| 563 |
+
Parameters
|
| 564 |
+
----------
|
| 565 |
+
provider : str
|
| 566 |
+
The provider to use, by default None. If None, the priority list configured in the settings is used. Default priority: sec.
|
| 567 |
+
query : str
|
| 568 |
+
Search query.
|
| 569 |
+
use_cache : Optional[bool]
|
| 570 |
+
Whether or not to use cache. If True, cache will store for seven days.
|
| 571 |
+
|
| 572 |
+
Returns
|
| 573 |
+
-------
|
| 574 |
+
OBBject
|
| 575 |
+
results : SymbolMap
|
| 576 |
+
Serializable results.
|
| 577 |
+
provider : Optional[str]
|
| 578 |
+
Provider name.
|
| 579 |
+
warnings : Optional[list[Warning_]]
|
| 580 |
+
list of warnings.
|
| 581 |
+
chart : Optional[Chart]
|
| 582 |
+
Chart object.
|
| 583 |
+
extra : Dict[str, Any]
|
| 584 |
+
Extra info.
|
| 585 |
+
|
| 586 |
+
SymbolMap
|
| 587 |
+
---------
|
| 588 |
+
symbol : Optional[str]
|
| 589 |
+
Symbol representing the entity requested in the data. (provider: sec)
|
| 590 |
+
|
| 591 |
+
Examples
|
| 592 |
+
--------
|
| 593 |
+
>>> from openbb import obb
|
| 594 |
+
>>> obb.regulators.sec.symbol_map(query='0000789019', provider='sec')
|
| 595 |
+
""" # noqa: E501
|
| 596 |
+
|
| 597 |
+
return self._run(
|
| 598 |
+
"/regulators/sec/symbol_map",
|
| 599 |
+
**filter_inputs(
|
| 600 |
+
provider_choices={
|
| 601 |
+
"provider": self._get_provider(
|
| 602 |
+
provider,
|
| 603 |
+
"regulators.sec.symbol_map",
|
| 604 |
+
("sec",),
|
| 605 |
+
)
|
| 606 |
+
},
|
| 607 |
+
standard_params={
|
| 608 |
+
"query": query,
|
| 609 |
+
"use_cache": use_cache,
|
| 610 |
+
},
|
| 611 |
+
extra_params=kwargs,
|
| 612 |
+
)
|
| 613 |
+
)
|
openbb_platform/openbb/py.typed
ADDED
|
File without changes
|