Merge branch 'develop' into feature/argparse_translator

This commit is contained in:
Henrique Joaquim
2024-02-23 10:55:23 +00:00
committed by GitHub
43 changed files with 1645 additions and 1348 deletions

View File

@@ -20,15 +20,6 @@
"symbols": "AAPL,MSFT",
"query": "AAPL"
},
"equity.fundamental.historical_attributes": {
"tag": "ebitda"
},
"equity.fundamental.latest_attributes": {
"tag": "ceo"
},
"equity.fundamental.transcript": {
"year": 2020
},
"etf": {
"symbol": "SPY",
"query": "Vanguard"

View File

@@ -353,7 +353,7 @@ class ImportDefinition:
else:
code += "\nfrom typing_extensions import Annotated, deprecated"
code += "\nfrom openbb_core.app.utils import df_to_basemodel"
code += "\nfrom openbb_core.app.static.utils.decorators import validate\n"
code += "\nfrom openbb_core.app.static.utils.decorators import exception_handler, validate\n"
code += "\nfrom openbb_core.app.static.utils.filters import filter_inputs\n"
code += "\nfrom openbb_core.provider.abstract.data import Data"
code += "\nfrom openbb_core.app.deprecation import OpenBBDeprecationWarning\n"
@@ -677,19 +677,23 @@ class MethodDefinition:
else ""
)
msg = ""
code = ""
deprecated = ""
if MethodDefinition.is_deprecated_function(path):
deprecation_message = MethodDefinition.get_deprecation_message(path)
deprecation_type_class = type(
deprecation_message.metadata # type: ignore
).__name__
msg = "\n @deprecated("
msg += f'\n "{deprecation_message}",'
msg += f"\n category={deprecation_type_class},"
msg += "\n )"
deprecated = "\n @deprecated("
deprecated += f'\n "{deprecation_message}",'
deprecated += f"\n category={deprecation_type_class},"
deprecated += "\n )"
code = f"\n @validate{args}{msg}"
code += "\n @exception_handler"
code += f"\n @validate{args}"
code += deprecated
code += f"\n def {func_name}("
code += f"\n self,\n {func_params}\n ) -> {func_returns}:\n"
@@ -830,17 +834,17 @@ class DocstringGenerator:
available_providers = providers or "Optional[str]"
obbject_description = (
" OBBject\n"
f" results : {results_type}\n"
" Serializable results.\n"
f" provider : {available_providers}\n"
" Provider name.\n"
" warnings : Optional[List[Warning_]]\n"
" List of warnings.\n"
" chart : Optional[Chart]\n"
" Chart object.\n"
" extra: Dict[str, Any]\n"
" Extra info.\n"
" OBBject\n"
f" results : {results_type}\n"
" Serializable results.\n"
f" provider : {available_providers}\n"
" Provider name.\n"
" warnings : Optional[List[Warning_]]\n"
" List of warnings.\n"
" chart : Optional[Chart]\n"
" Chart object.\n"
" extra: Dict[str, Any]\n"
" Extra info.\n"
)
obbject_description = obbject_description.replace("NoneType", "None")
@@ -871,22 +875,22 @@ class DocstringGenerator:
def format_description(description: str) -> str:
"""Format description in docstrings."""
description = description.replace("\n", "\n ")
description = description.replace("\n", "\n ")
return description
standard_dict = params["standard"].__dataclass_fields__
extra_dict = params["extra"].__dataclass_fields__
if examples:
example_docstring = "\n Example\n -------\n"
example_docstring += " >>> from openbb import obb\n"
example_docstring = "\n Example\n -------\n"
example_docstring += " >>> from openbb import obb\n"
for example in examples:
example_docstring += f" >>> {example}\n"
example_docstring += f" >>> {example}\n"
docstring = summary
docstring = summary.strip("\n")
docstring += "\n\n"
docstring += " Parameters\n"
docstring += " ----------\n"
docstring += " Parameters\n"
docstring += " ----------\n"
# Explicit parameters
for param_name, param in explicit_params.items():
@@ -912,8 +916,8 @@ class DocstringGenerator:
description = ""
type_str = format_type(type_, char_limit=79) # type: ignore
docstring += f" {param_name} : {type_str}\n"
docstring += f" {format_description(description)}\n"
docstring += f" {param_name} : {type_str}\n"
docstring += f" {format_description(description)}\n"
# Kwargs
for param_name, param in extra_dict.items():
@@ -925,13 +929,13 @@ class DocstringGenerator:
description = getattr(param.default, "description", "")
docstring += f" {param_name} : {type_}\n"
docstring += f" {format_description(description)}\n"
docstring += f" {param_name} : {type_}\n"
docstring += f" {format_description(description)}\n"
# Returns
docstring += "\n"
docstring += " Returns\n"
docstring += " -------\n"
docstring += " Returns\n"
docstring += " -------\n"
provider_param = explicit_params.get("provider", None)
available_providers = getattr(provider_param, "_annotation", None)
@@ -939,7 +943,7 @@ class DocstringGenerator:
# Schema
underline = "-" * len(model_name)
docstring += f"\n {model_name}\n {underline}\n"
docstring += f"\n {model_name}\n {underline}\n"
for name, field in returns.items():
try:
@@ -970,8 +974,8 @@ class DocstringGenerator:
description = getattr(field, "description", "")
docstring += f" {field.alias or name} : {field_type}\n"
docstring += f" {format_description(description)}\n"
docstring += f" {field.alias or name} : {field_type}\n"
docstring += f" {format_description(description)}\n"
if examples:
docstring += example_docstring

View File

@@ -3,6 +3,8 @@
from functools import wraps
from typing import Any, Callable, Optional, TypeVar, overload
from openbb_core.app.model.abstract.error import OpenBBError
from openbb_core.env import Env
from pydantic import validate_call
from typing_extensions import ParamSpec
@@ -36,3 +38,20 @@ def validate(
return wrapper
return decorated if func is None else decorated(func)
def exception_handler(func: Callable[P, R]) -> Callable[P, R]:
"""Handle exceptions, attempting to focus on the last call from the traceback."""
@wraps(func)
def wrapper(*args, **kwargs):
try:
return func(*args, **kwargs)
except Exception as e:
if Env().DEBUG_MODE:
raise
raise OpenBBError(
f"\nType -> {e.__class__.__name__}\n\nDetail -> {str(e)}"
) from None
return wrapper

View File

@@ -42,11 +42,6 @@ class Env(metaclass=SingletonMeta):
"""Automatic build: enables automatic package build on import"""
return self.str2bool(self._environ.get("OPENBB_AUTO_BUILD", True))
@property
def CHARTING_EXTENSION(self) -> str:
"""Charting extension: specifies which charting extension to use"""
return self._environ.get("OPENBB_CHARTING_EXTENSION", "openbb_charting")
@property
def DEBUG_MODE(self) -> bool:
"""Debug mode: enables debug mode"""

View File

@@ -15,45 +15,71 @@ router = Router(prefix="/calendar")
# pylint: disable=unused-argument
@router.command(model="CalendarIpo")
@router.command(
model="CalendarIpo",
examples=[
"# Get all IPOs available.",
"obb.equity.calendar.ipo()",
"# Get IPOs for specific dates.",
"obb.equity.calendar.ipo(start_date='2024-02-01', end_date='2024-02-07')",
],
)
async def ipo(
cc: CommandContext,
provider_choices: ProviderChoices,
standard_params: StandardParams,
extra_params: ExtraParams,
) -> OBBject:
"""Upcoming and Historical IPO Calendar."""
"""Get historical and upcoming initial public offerings (IPOs)."""
return await OBBject.from_query(Query(**locals()))
@router.command(model="CalendarDividend")
@router.command(
model="CalendarDividend",
examples=[
"# Get dividend calendar for specific dates.",
"obb.equity.calendar.dividend(start_date='2024-02-01', end_date='2024-02-07')",
],
)
async def dividend(
cc: CommandContext,
provider_choices: ProviderChoices,
standard_params: StandardParams,
extra_params: ExtraParams,
) -> OBBject:
"""Upcoming and Historical Dividend Calendar."""
"""Get historical and upcoming dividend payments. Includes dividend amount, ex-dividend and payment dates."""
return await OBBject.from_query(Query(**locals()))
@router.command(model="CalendarSplits")
@router.command(
model="CalendarSplits",
examples=[
"# Get stock splits calendar for specific dates.",
"obb.equity.calendar.splits(start_date='2024-02-01', end_date='2024-02-07')",
],
)
async def splits(
cc: CommandContext,
provider_choices: ProviderChoices,
standard_params: StandardParams,
extra_params: ExtraParams,
) -> OBBject:
"""Calendar Splits. Show Stock Split Calendar."""
"""Get historical and upcoming stock split operations."""
return await OBBject.from_query(Query(**locals()))
@router.command(model="CalendarEarnings")
@router.command(
model="CalendarEarnings",
examples=[
"# Get earnings calendar for specific dates.",
"obb.equity.calendar.earnings(start_date='2024-02-01', end_date='2024-02-07')",
],
)
async def earnings(
cc: CommandContext,
provider_choices: ProviderChoices,
standard_params: StandardParams,
extra_params: ExtraParams,
) -> OBBject:
"""Upcoming and Historical earnings calendar."""
"""Get historical and upcoming company earnings releases. Includes earnings per share (EPS) and revenue data."""
return await OBBject.from_query(Query(**locals()))

View File

@@ -21,16 +21,32 @@ async def peers(
standard_params: StandardParams,
extra_params: ExtraParams,
) -> OBBject:
"""Equity Peers. Company peers."""
"""Get the closest peers for a given company.
Peers consist of companies trading on the same exchange, operating within the same sector
and with comparable market capitalizations."""
return await OBBject.from_query(Query(**locals()))
@router.command(model="CompareGroups")
@router.command(
model="CompareGroups",
examples=[
"# Group by sector and analyze valuation",
"obb.equity.compare.groups(group='sector', metric='valuation')",
"# Group by industry and analyze performance",
"obb.equity.compare.groups(group='industry', metric='performance')",
"# Group by country and analyze valuation",
"obb.equity.compare.groups(group='country', metric='valuation')",
],
)
async def groups(
cc: CommandContext,
provider_choices: ProviderChoices,
standard_params: StandardParams,
extra_params: ExtraParams,
) -> OBBject:
"""Compare Equity Sector and Industry Groups."""
"""Get company data grouped by sector, industry or country and display either performance or valuation metrics.
Valuation metrics include price to earnings, price to book, price to sales ratios and price to cash flow.
Performance metrics include the stock price change for different time periods."""
return await OBBject.from_query(Query(**locals()))

View File

@@ -15,16 +15,21 @@ router = Router(prefix="/darkpool")
# pylint: disable=unused-argument
@router.command(model="OTCAggregate")
@router.command(
model="OTCAggregate",
examples=[
"# Get OTC data for a symbol",
"obb.equity.darkpool.otc(symbol='AAPL')",
],
)
async def otc(
cc: CommandContext,
provider_choices: ProviderChoices,
standard_params: StandardParams,
extra_params: ExtraParams,
) -> OBBject:
"""Weekly aggregate trade data for Over The Counter deals.
"""Get the weekly aggregate trade data for Over The Counter deals.
ATS and non-ATS trading data for each ATS/firm
with trade reporting obligations under FINRA rules.
"""
with trade reporting obligations under FINRA rules."""
return await OBBject.from_query(Query(**locals()))

View File

@@ -21,7 +21,7 @@ async def gainers(
standard_params: StandardParams,
extra_params: ExtraParams,
) -> OBBject:
"""Get the top Equity gainers."""
"""Get the top price gainers in the stock market."""
return await OBBject.from_query(Query(**locals()))
@@ -32,7 +32,7 @@ async def losers(
standard_params: StandardParams,
extra_params: ExtraParams,
) -> OBBject:
"""Get the top Equity losers."""
"""Get the top price losers in the stock market."""
return await OBBject.from_query(Query(**locals()))
@@ -43,7 +43,7 @@ async def active(
standard_params: StandardParams,
extra_params: ExtraParams,
) -> OBBject:
"""Get the most active Equities."""
"""Get the most actively traded stocks based on volume."""
return await OBBject.from_query(Query(**locals()))
@@ -54,7 +54,7 @@ async def undervalued_large_caps(
standard_params: StandardParams,
extra_params: ExtraParams,
) -> OBBject:
"""Get undervalued large cap Equities."""
"""Get potentially undervalued large cap stocks."""
return await OBBject.from_query(Query(**locals()))
@@ -65,7 +65,7 @@ async def undervalued_growth(
standard_params: StandardParams,
extra_params: ExtraParams,
) -> OBBject:
"""Get undervalued growth Equities."""
"""Get potentially undervalued growth stocks."""
return await OBBject.from_query(Query(**locals()))
@@ -76,7 +76,7 @@ async def aggressive_small_caps(
standard_params: StandardParams,
extra_params: ExtraParams,
) -> OBBject:
"""Get aggressive small cap Equities."""
"""Get top small cap stocks based on earnings growth."""
return await OBBject.from_query(Query(**locals()))
@@ -87,7 +87,7 @@ async def growth_tech(
standard_params: StandardParams,
extra_params: ExtraParams,
) -> OBBject:
"""Get growth tech Equities."""
"""Get top tech stocks based on revenue and earnings growth."""
return await OBBject.from_query(Query(**locals()))
@@ -101,8 +101,7 @@ async def top_retail(
"""Tracks over $30B USD/day of individual investors trades.
It gives a daily view into retail activity and sentiment for over 9,500 US traded stocks,
ADRs, and ETPs.
"""
ADRs, and ETPs."""
return await OBBject.from_query(Query(**locals()))
@@ -113,16 +112,27 @@ async def upcoming_release_days(
standard_params: StandardParams,
extra_params: ExtraParams,
) -> OBBject:
"""Get upcoming release days."""
"""Get upcoming earnings release dates."""
return await OBBject.from_query(Query(**locals()))
@router.command(model="DiscoveryFilings")
@router.command(
model="DiscoveryFilings",
examples=[
"# Get filings for the year 2023, limited to 100 results",
"obb.equity.discovery.filings(start_date='2023-01-01', end_date='2023-12-31')",
],
)
async def filings(
cc: CommandContext,
provider_choices: ProviderChoices,
standard_params: StandardParams,
extra_params: ExtraParams,
) -> OBBject:
"""Get the most-recent filings submitted to the SEC."""
"""Get the URLs to SEC filings reported to EDGAR database, such as 10-K, 10-Q, 8-K, and more. SEC
filings include Form 10-K, Form 10-Q, Form 8-K, the proxy statement, Forms 3, 4, and 5, Schedule 13, Form 114,
Foreign Investment Disclosures and others. The annual 10-K report is required to be
filed annually and includes the company's financial statements, management discussion and analysis,
and audited financial statements.
"""
return await OBBject.from_query(Query(**locals()))

View File

@@ -41,7 +41,7 @@ async def search(
standard_params: StandardParams,
extra_params: ExtraParams,
) -> OBBject:
"""Equity Search. Search for a company or stock ticker."""
"""Search for stock symbol, CIK, LEI, or company name."""
return await OBBject.from_query(Query(**locals()))
@@ -52,7 +52,8 @@ async def screener(
standard_params: StandardParams,
extra_params: ExtraParams,
) -> OBBject:
"""Equity Screen. Screen for companies meeting various criteria."""
"""Screen for companies meeting various criteria. These criteria include
market cap, price, beta, volume, and dividend yield."""
return await OBBject.from_query(Query(**locals()))
@@ -63,7 +64,7 @@ async def profile(
standard_params: StandardParams,
extra_params: ExtraParams,
) -> OBBject:
"""Equity Info. Get general price and performance metrics of a stock."""
"""Get general information about a company. This includes company name, industry, sector and price data."""
return await OBBject.from_query(Query(**locals()))
@@ -74,5 +75,5 @@ async def market_snapshots(
standard_params: StandardParams,
extra_params: ExtraParams,
) -> OBBject:
"""Get a current, complete, market snapshot."""
"""Get an updated equity market snapshot. This includes price data for thousands of stocks."""
return await OBBject.from_query(Query(**locals()))

View File

@@ -28,7 +28,7 @@ async def price_target(
standard_params: StandardParams,
extra_params: ExtraParams,
) -> OBBject:
"""Analyst price targets by company."""
"""Get analyst price targets by company."""
return await OBBject.from_query(Query(**locals()))
@@ -45,7 +45,7 @@ async def historical(
standard_params: StandardParams,
extra_params: ExtraParams,
) -> OBBject:
"""Historical analyst estimates for earnings and revenue."""
"""Get historical analyst estimates for earnings and revenue."""
return await OBBject.from_query(Query(**locals()))
@@ -62,7 +62,7 @@ async def consensus(
standard_params: StandardParams,
extra_params: ExtraParams,
) -> OBBject:
"""Consensus price target and recommendation."""
"""Get consensus price target and recommendation."""
return await OBBject.from_query(Query(**locals()))

View File

@@ -22,7 +22,7 @@ async def multiples(
standard_params: StandardParams,
extra_params: ExtraParams,
) -> OBBject:
"""Equity Valuation Multiples. Valuation multiples for a stock ticker."""
"""Get equity valuation multiples for a given company."""
return await OBBject.from_query(Query(**locals()))
@@ -33,7 +33,7 @@ async def balance(
standard_params: StandardParams,
extra_params: ExtraParams,
) -> OBBject:
"""Balance Sheet. Balance sheet statement."""
"""Get the balance sheet for a given company."""
return await OBBject.from_query(Query(**locals()))
@@ -44,7 +44,7 @@ async def balance_growth(
standard_params: StandardParams,
extra_params: ExtraParams,
) -> OBBject:
"""Balance Sheet Statement Growth. Information about the growth of the company balance sheet."""
"""Get the growth of a company's balance sheet items over time."""
return await OBBject.from_query(Query(**locals()))
@@ -55,18 +55,26 @@ async def cash(
standard_params: StandardParams,
extra_params: ExtraParams,
) -> OBBject:
"""Cash Flow Statement. Information about the cash flow statement."""
"""Get the cash flow statement for a given company."""
return await OBBject.from_query(Query(**locals()))
@router.command(model="ReportedFinancials")
@router.command(
model="ReportedFinancials",
examples=[
"# Get reported income statement",
"obb.equity.fundamental.reported_financials(symbol='AAPL', statement_type='income)",
"# Get reported cash flow statement",
"obb.equity.fundamental.reported_financials(symbol='AAPL', statement_type='cash')",
],
)
async def reported_financials(
cc: CommandContext,
provider_choices: ProviderChoices,
standard_params: StandardParams,
extra_params: ExtraParams,
) -> OBBject:
"""Financial statements, as-reported."""
"""Get financial statements as reported by the company."""
return await OBBject.from_query(Query(**locals()))
@@ -77,7 +85,7 @@ async def cash_growth(
standard_params: StandardParams,
extra_params: ExtraParams,
) -> OBBject:
"""Cash Flow Statement Growth. Information about the growth of the company cash flow statement."""
"""Get the growth of a company's cash flow statement items over time."""
return await OBBject.from_query(Query(**locals()))
@@ -88,7 +96,7 @@ async def dividends(
standard_params: StandardParams,
extra_params: ExtraParams,
) -> OBBject:
"""Historical Dividends. Historical dividends data for a given company."""
"""Get historical dividend data for a given company."""
return await OBBject.from_query(Query(**locals()))
@@ -99,7 +107,7 @@ async def historical_eps(
standard_params: StandardParams,
extra_params: ExtraParams,
) -> OBBject:
"""Historical earnings-per-share for a given company."""
"""Get historical earnings per share data for a given company."""
return await OBBject.from_query(Query(**locals()))
@@ -110,40 +118,58 @@ async def employee_count(
standard_params: StandardParams,
extra_params: ExtraParams,
) -> OBBject:
"""Historical Employees. Historical number of employees."""
"""Get historical employee count data for a given company."""
return await OBBject.from_query(Query(**locals()))
@router.command(model="SearchAttributes")
@router.command(
model="SearchAttributes",
exclude_auto_examples=True,
examples=[
"obb.equity.fundamental.search_attributes(query='ebitda')",
],
)
async def search_attributes(
cc: CommandContext,
provider_choices: ProviderChoices,
standard_params: StandardParams,
extra_params: ExtraParams,
) -> OBBject:
"""Search Intrinio data tags."""
"""Search Intrinio data tags to search in latest or historical attributes."""
return await OBBject.from_query(Query(**locals()))
@router.command(model="LatestAttributes")
@router.command(
model="LatestAttributes",
exclude_auto_examples=True,
examples=[
"obb.equity.fundamental.latest_attributes(tag='ceo')",
],
)
async def latest_attributes(
cc: CommandContext,
provider_choices: ProviderChoices,
standard_params: StandardParams,
extra_params: ExtraParams,
) -> OBBject:
"""Fetch the latest value of a data tag from Intrinio."""
"""Get the latest value of a data tag from Intrinio."""
return await OBBject.from_query(Query(**locals()))
@router.command(model="HistoricalAttributes")
@router.command(
model="HistoricalAttributes",
exclude_auto_examples=True,
examples=[
"obb.equity.fundamental.historical_attributes(tag='ebitda')",
],
)
async def historical_attributes(
cc: CommandContext,
provider_choices: ProviderChoices,
standard_params: StandardParams,
extra_params: ExtraParams,
) -> OBBject:
"""Fetch the historical values of a data tag from Intrinio."""
"""Get the historical values of a data tag from Intrinio."""
return await OBBject.from_query(Query(**locals()))
@@ -154,7 +180,7 @@ async def income(
standard_params: StandardParams,
extra_params: ExtraParams,
) -> OBBject:
"""Income Statement. Report on a company's financial performance."""
"""Get the income statement for a given company."""
return await OBBject.from_query(Query(**locals()))
@@ -165,7 +191,7 @@ async def income_growth(
standard_params: StandardParams,
extra_params: ExtraParams,
) -> OBBject:
"""Income Statement Growth. Information about the growth of the company income statement."""
"""Get the growth of a company's income statement items over time."""
return await OBBject.from_query(Query(**locals()))
@@ -176,7 +202,7 @@ async def metrics(
standard_params: StandardParams,
extra_params: ExtraParams,
) -> OBBject:
"""Key Metrics. Key metrics for a given company."""
"""Get fundamental metrics for a given company."""
return await OBBject.from_query(Query(**locals()))
@@ -187,7 +213,7 @@ async def management(
standard_params: StandardParams,
extra_params: ExtraParams,
) -> OBBject:
"""Key Executives. Key executives for a given company."""
"""Get executive management team data for a given company."""
return await OBBject.from_query(Query(**locals()))
@@ -198,7 +224,7 @@ async def management_compensation(
standard_params: StandardParams,
extra_params: ExtraParams,
) -> OBBject:
"""Get Executive Compensation. Information about the executive compensation for a given company."""
"""Get executive management team compensation for a given company over time."""
return await OBBject.from_query(Query(**locals()))
@@ -217,7 +243,7 @@ async def overview(
standard_params: StandardParams,
extra_params: ExtraParams,
) -> OBBject:
"""Company Overview. General information about a company."""
"""Get company general business and stock data for a given company."""
return await OBBject.from_query(Query(**locals()))
@@ -228,7 +254,7 @@ async def ratios(
standard_params: StandardParams,
extra_params: ExtraParams,
) -> OBBject:
"""Extensive set of ratios over time. Financial ratios for a given company."""
"""Get an extensive set of financial and accounting ratios for a given company over time."""
return await OBBject.from_query(Query(**locals()))
@@ -239,7 +265,7 @@ async def revenue_per_geography(
standard_params: StandardParams,
extra_params: ExtraParams,
) -> OBBject:
"""Revenue Geographic. Geographic revenue data."""
"""Get the revenue geographic breakdown for a given company over time."""
return await OBBject.from_query(Query(**locals()))
@@ -250,7 +276,7 @@ async def revenue_per_segment(
standard_params: StandardParams,
extra_params: ExtraParams,
) -> OBBject:
"""Revenue Business Line. Business line revenue data."""
"""Get the revenue breakdown by business segment for a given company over time."""
return await OBBject.from_query(Query(**locals()))
@@ -261,7 +287,12 @@ async def filings(
standard_params: StandardParams,
extra_params: ExtraParams,
) -> OBBject:
"""Company Filings. Company filings data."""
"""Get the URLs to SEC filings reported to EDGAR database, such as 10-K, 10-Q, 8-K, and more. SEC
filings include Form 10-K, Form 10-Q, Form 8-K, the proxy statement, Forms 3, 4, and 5, Schedule 13, Form 114,
Foreign Investment Disclosures and others. The annual 10-K report is required to be
filed annually and includes the company's financial statements, management discussion and analysis,
and audited financial statements.
"""
return await OBBject.from_query(Query(**locals()))
@@ -272,18 +303,24 @@ async def historical_splits(
standard_params: StandardParams,
extra_params: ExtraParams,
) -> OBBject:
"""Historical Splits. Historical splits data."""
"""Get historical stock splits for a given company."""
return await OBBject.from_query(Query(**locals()))
@router.command(model="EarningsCallTranscript")
@router.command(
model="EarningsCallTranscript",
exclude_auto_examples=True,
examples=[
"obb.equity.fundamental.transcript(symbol='AAPL', year=2020)",
],
)
async def transcript(
cc: CommandContext,
provider_choices: ProviderChoices,
standard_params: StandardParams,
extra_params: ExtraParams,
) -> OBBject:
"""Earnings Call Transcript. Earnings call transcript for a given company."""
"""Get earnings call transcripts for a given company."""
return await OBBject.from_query(Query(**locals()))
@@ -294,5 +331,5 @@ async def trailing_dividend_yield(
standard_params: StandardParams,
extra_params: ExtraParams,
) -> OBBject:
"""Trailing 1yr dividend yield."""
"""Get the 1 year trailing dividend yield for a given company over time."""
return await OBBject.from_query(Query(**locals()))

View File

@@ -22,7 +22,7 @@ async def major_holders(
standard_params: StandardParams,
extra_params: ExtraParams,
) -> OBBject:
"""Equity Ownership. Information about the company ownership."""
"""Get data about major holders for a given company over time."""
return await OBBject.from_query(Query(**locals()))
@@ -33,7 +33,7 @@ async def institutional(
standard_params: StandardParams,
extra_params: ExtraParams,
) -> OBBject:
"""Institutional Ownership. Institutional ownership data."""
"""Get data about institutional ownership for a given company over time."""
return await OBBject.from_query(Query(**locals()))
@@ -44,7 +44,7 @@ async def insider_trading(
standard_params: StandardParams,
extra_params: ExtraParams,
) -> OBBject:
"""Insider Trading. Information about insider trading."""
"""Get data about trading by a company's management team and board of directors."""
return await OBBject.from_query(Query(**locals()))
@@ -55,5 +55,5 @@ async def share_statistics(
standard_params: StandardParams,
extra_params: ExtraParams,
) -> OBBject:
"""Share Statistics. Share statistics for a given company."""
"""Get data about share float for a given company."""
return await OBBject.from_query(Query(**locals()))

View File

@@ -22,7 +22,7 @@ async def quote(
standard_params: StandardParams,
extra_params: ExtraParams,
) -> OBBject:
"""Equity Quote. Load stock data for a specific ticker."""
"""Get the latest quote for a given stock. Quote includes price, volume, and other data."""
return await OBBject.from_query(Query(**locals()))
@@ -33,7 +33,7 @@ async def nbbo(
standard_params: StandardParams,
extra_params: ExtraParams,
) -> OBBject:
"""Equity NBBO. Load National Best Bid and Offer for a specific equity."""
"""Get the National Best Bid and Offer for a given stock."""
return await OBBject.from_query(Query(**locals()))
@@ -44,7 +44,7 @@ async def historical(
standard_params: StandardParams,
extra_params: ExtraParams,
) -> OBBject:
"""Equity Historical price. Load stock data for a specific ticker."""
"""Get historical price data for a given stock. This includes open, high, low, close, and volume."""
return await OBBject.from_query(Query(**locals()))
@@ -55,5 +55,5 @@ async def performance(
standard_params: StandardParams,
extra_params: ExtraParams,
) -> OBBject:
"""Price performance as a return, over different periods."""
"""Get price performance data for a given stock. This includes price changes for different time periods."""
return await OBBject.from_query(Query(**locals()))

View File

@@ -15,7 +15,11 @@ router = Router(prefix="/shorts")
# pylint: disable=unused-argument
@router.command(model="EquityFTD")
@router.command(
model="EquityFTD",
exclude_auto_examples=True,
examples=["obb.equity.shorts.fails_to_deliver(symbol='AAPL')"],
)
async def fails_to_deliver(
cc: CommandContext,
provider_choices: ProviderChoices,
@@ -26,7 +30,11 @@ async def fails_to_deliver(
return await OBBject.from_query(Query(**locals()))
@router.command(model="ShortVolume")
@router.command(
model="ShortVolume",
exclude_auto_examples=True,
examples=["obb.equity.shorts.short_volume(symbol='AAPL')"],
)
async def short_volume(
cc: CommandContext,
provider_choices: ProviderChoices,
@@ -37,12 +45,16 @@ async def short_volume(
return await OBBject.from_query(Query(**locals()))
@router.command(model="EquityShortInterest")
@router.command(
model="EquityShortInterest",
exclude_auto_examples=True,
examples=["obb.equity.shorts.short_interest(symbol='AAPL')"],
)
async def short_interest(
cc: CommandContext,
provider_choices: ProviderChoices,
standard_params: StandardParams,
extra_params: ExtraParams,
) -> OBBject:
"""Get reported Short Volume and Days to Cover data."""
"""Get reported short volume and days to cover data."""
return await OBBject.from_query(Query(**locals()))

View File

@@ -5,7 +5,7 @@ from typing import Literal, Optional
from openbb_core.app.model.custom_parameter import OpenBBCustomParameter
from openbb_core.app.model.obbject import OBBject
from openbb_core.app.static.container import Container
from openbb_core.app.static.utils.decorators import validate
from openbb_core.app.static.utils.decorators import exception_handler, validate
from openbb_core.app.static.utils.filters import filter_inputs
from typing_extensions import Annotated
@@ -26,6 +26,7 @@ class ROUTER_crypto(Container):
return crypto_price.ROUTER_crypto_price(command_runner=self._command_runner)
@exception_handler
@validate
def search(
self,

View File

@@ -6,7 +6,7 @@ from typing import List, Literal, Optional, Union
from openbb_core.app.model.custom_parameter import OpenBBCustomParameter
from openbb_core.app.model.obbject import OBBject
from openbb_core.app.static.container import Container
from openbb_core.app.static.utils.decorators import validate
from openbb_core.app.static.utils.decorators import exception_handler, validate
from openbb_core.app.static.utils.filters import filter_inputs
from typing_extensions import Annotated
@@ -19,6 +19,7 @@ class ROUTER_crypto_price(Container):
def __repr__(self) -> str:
return self.__doc__ or ""
@exception_handler
@validate
def historical(
self,
@@ -86,7 +87,7 @@ class ROUTER_crypto_price(Container):
CryptoHistorical
----------------
date : datetime
date : Union[date, datetime]
The date of the data.
open : float
The open price.

View File

@@ -4,7 +4,7 @@ from typing import Literal, Optional
from openbb_core.app.model.obbject import OBBject
from openbb_core.app.static.container import Container
from openbb_core.app.static.utils.decorators import validate
from openbb_core.app.static.utils.decorators import exception_handler, validate
from openbb_core.app.static.utils.filters import filter_inputs
@@ -24,12 +24,12 @@ class ROUTER_currency(Container):
return currency_price.ROUTER_currency_price(command_runner=self._command_runner)
@exception_handler
@validate
def search(
self, provider: Optional[Literal["fmp", "intrinio", "polygon"]] = None, **kwargs
) -> OBBject:
"""
Currency Search.
"""Currency Search.
Search available currency pairs.
Currency pairs are the national currencies from two countries coupled for trading on
@@ -40,86 +40,86 @@ class ROUTER_currency(Container):
Major currency pairs include pairs such as EUR/USD, USD/JPY, GBP/USD, etc.
Parameters
----------
Parameters
----------
provider : Optional[Literal['fmp', 'intrinio', 'polygon']]
The provider to use for the query, by default None.
If None, the provider specified in defaults is selected or 'fmp' if there is
no default.
symbol : Optional[str]
Symbol of the pair to search. (provider: polygon)
date : Optional[datetime.date]
A specific date to get data for. (provider: polygon)
search : Optional[str]
Search for terms within the ticker and/or company name. (provider: polygon)
active : Optional[bool]
Specify if the tickers returned should be actively traded on the queried date. (provider: polygon)
order : Optional[Literal['asc', 'desc']]
Order data by ascending or descending. (provider: polygon)
sort : Optional[Literal['ticker', 'name', 'market', 'locale', 'currency_symbol', 'currency_name', 'base_currency_symbol', 'base_currency_name', 'last_updated_utc', 'delisted_utc']]
Sort field used for ordering. (provider: polygon)
limit : Optional[Annotated[int, Gt(gt=0)]]
The number of data entries to return. (provider: polygon)
Returns
-------
OBBject
results : List[CurrencyPairs]
Serializable results.
provider : Optional[Literal['fmp', 'intrinio', 'polygon']]
The provider to use for the query, by default None.
If None, the provider specified in defaults is selected or 'fmp' if there is
no default.
symbol : Optional[str]
Symbol of the pair to search. (provider: polygon)
date : Optional[datetime.date]
A specific date to get data for. (provider: polygon)
search : Optional[str]
Search for terms within the ticker and/or company name. (provider: polygon)
active : Optional[bool]
Specify if the tickers returned should be actively traded on the queried date. (provider: polygon)
order : Optional[Literal['asc', 'desc']]
Order data by ascending or descending. (provider: polygon)
sort : Optional[Literal['ticker', 'name', 'market', 'locale', 'currency_symbol', 'currency_name', 'base_currency_symbol', 'base_currency_name', 'last_updated_utc', 'delisted_utc']]
Sort field used for ordering. (provider: polygon)
limit : Optional[Annotated[int, Gt(gt=0)]]
The number of data entries to return. (provider: polygon)
Provider name.
warnings : Optional[List[Warning_]]
List of warnings.
chart : Optional[Chart]
Chart object.
extra: Dict[str, Any]
Extra info.
Returns
-------
OBBject
results : List[CurrencyPairs]
Serializable results.
provider : Optional[Literal['fmp', 'intrinio', 'polygon']]
Provider name.
warnings : Optional[List[Warning_]]
List of warnings.
chart : Optional[Chart]
Chart object.
extra: Dict[str, Any]
Extra info.
CurrencyPairs
-------------
name : str
Name of the currency pair.
symbol : Optional[str]
Symbol of the currency pair. (provider: fmp)
currency : Optional[str]
Base currency of the currency pair. (provider: fmp)
stock_exchange : Optional[str]
Stock exchange of the currency pair. (provider: fmp)
exchange_short_name : Optional[str]
Short name of the stock exchange of the currency pair. (provider: fmp)
code : Optional[str]
Code of the currency pair. (provider: intrinio)
base_currency : Optional[str]
ISO 4217 currency code of the base currency. (provider: intrinio)
quote_currency : Optional[str]
ISO 4217 currency code of the quote currency. (provider: intrinio)
market : Optional[str]
Name of the trading market. Always 'fx'. (provider: polygon)
locale : Optional[str]
Locale of the currency pair. (provider: polygon)
currency_symbol : Optional[str]
The symbol of the quote currency. (provider: polygon)
currency_name : Optional[str]
Name of the quote currency. (provider: polygon)
base_currency_symbol : Optional[str]
The symbol of the base currency. (provider: polygon)
base_currency_name : Optional[str]
Name of the base currency. (provider: polygon)
last_updated_utc : Optional[datetime]
The last updated timestamp in UTC. (provider: polygon)
delisted_utc : Optional[datetime]
The delisted timestamp in UTC. (provider: polygon)
CurrencyPairs
-------------
name : str
Name of the currency pair.
symbol : Optional[str]
Symbol of the currency pair. (provider: fmp)
currency : Optional[str]
Base currency of the currency pair. (provider: fmp)
stock_exchange : Optional[str]
Stock exchange of the currency pair. (provider: fmp)
exchange_short_name : Optional[str]
Short name of the stock exchange of the currency pair. (provider: fmp)
code : Optional[str]
Code of the currency pair. (provider: intrinio)
base_currency : Optional[str]
ISO 4217 currency code of the base currency. (provider: intrinio)
quote_currency : Optional[str]
ISO 4217 currency code of the quote currency. (provider: intrinio)
market : Optional[str]
Name of the trading market. Always 'fx'. (provider: polygon)
locale : Optional[str]
Locale of the currency pair. (provider: polygon)
currency_symbol : Optional[str]
The symbol of the quote currency. (provider: polygon)
currency_name : Optional[str]
Name of the quote currency. (provider: polygon)
base_currency_symbol : Optional[str]
The symbol of the base currency. (provider: polygon)
base_currency_name : Optional[str]
Name of the base currency. (provider: polygon)
last_updated_utc : Optional[datetime]
The last updated timestamp in UTC. (provider: polygon)
delisted_utc : Optional[datetime]
The delisted timestamp in UTC. (provider: polygon)
Example
-------
>>> from openbb import obb
>>> obb.currency.search()
>>> # Search for 'EURUSD' currency pair using 'polygon' as provider.
>>> obb.currency.search(provider='polygon', symbol='EURUSD')
>>> # Search for terms using 'polygon' as provider.
>>> obb.currency.search(provider='polygon', search='Euro zone')
>>> # Search for actively traded currency pairs on the queried date using 'polygon' as provider.
>>> obb.currency.search(provider='polygon', date='2024-01-02', active=True)
Example
-------
>>> from openbb import obb
>>> obb.currency.search()
>>> # Search for 'EURUSD' currency pair using 'polygon' as provider.
>>> obb.currency.search(provider='polygon', symbol='EURUSD')
>>> # Search for terms using 'polygon' as provider.
>>> obb.currency.search(provider='polygon', search='Euro zone')
>>> # Search for actively traded currency pairs on the queried date using 'polygon' as provider.
>>> obb.currency.search(provider='polygon', date='2024-01-02', active=True)
""" # noqa: E501
return self._run(

View File

@@ -6,7 +6,7 @@ from typing import List, Literal, Optional, Union
from openbb_core.app.model.custom_parameter import OpenBBCustomParameter
from openbb_core.app.model.obbject import OBBject
from openbb_core.app.static.container import Container
from openbb_core.app.static.utils.decorators import validate
from openbb_core.app.static.utils.decorators import exception_handler, validate
from openbb_core.app.static.utils.filters import filter_inputs
from typing_extensions import Annotated
@@ -19,6 +19,7 @@ class ROUTER_currency_price(Container):
def __repr__(self) -> str:
return self.__doc__ or ""
@exception_handler
@validate
def historical(
self,
@@ -43,8 +44,7 @@ class ROUTER_currency_price(Container):
provider: Optional[Literal["fmp", "polygon", "tiingo", "yfinance"]] = None,
**kwargs
) -> OBBject:
"""
Currency Historical Price. Currency historical data.
"""Currency Historical Price. Currency historical data.
Currency historical prices refer to the past exchange rates of one currency against
another over a specific period.
@@ -53,80 +53,80 @@ class ROUTER_currency_price(Container):
evaluate economic health, and make predictions about future movements.
Parameters
----------
symbol : Union[str, List[str]]
Symbol to get data for. Can use CURR1-CURR2 or CURR1CURR2 format. Multiple items allowed: polygon, yfinance.
start_date : Union[datetime.date, None, str]
Start date of the data, in YYYY-MM-DD format.
end_date : Union[datetime.date, None, str]
End date of the data, in YYYY-MM-DD format.
Parameters
----------
symbol : Union[str, List[str]]
Symbol to get data for. Can use CURR1-CURR2 or CURR1CURR2 format. Multiple items allowed: polygon, yfinance.
start_date : Union[datetime.date, None, str]
Start date of the data, in YYYY-MM-DD format.
end_date : Union[datetime.date, None, str]
End date of the data, in YYYY-MM-DD format.
provider : Optional[Literal['fmp', 'polygon', 'tiingo', 'yfinance']]
The provider to use for the query, by default None.
If None, the provider specified in defaults is selected or 'fmp' if there is
no default.
interval : Optional[Union[Literal['1min', '5min', '15min', '30min', '1hour', '4hour', '1day'], str, Literal['1m', '2m', '5m', '15m', '30m', '60m', '90m', '1h', '1d', '5d', '1wk', '1mo', '3mo']]]
Data granularity. (provider: fmp, polygon, tiingo, yfinance)
sort : Literal['asc', 'desc']
Sort order of the data. (provider: polygon)
limit : int
The number of data entries to return. (provider: polygon)
period : Optional[Literal['1d', '5d', '1mo', '3mo', '6mo', '1y', '2y', '5y', '10y', 'ytd', 'max']]
Time period of the data to return. (provider: yfinance)
Returns
-------
OBBject
results : List[CurrencyHistorical]
Serializable results.
provider : Optional[Literal['fmp', 'polygon', 'tiingo', 'yfinance']]
The provider to use for the query, by default None.
If None, the provider specified in defaults is selected or 'fmp' if there is
no default.
interval : Optional[Union[Literal['1min', '5min', '15min', '30min', '1hour', '4hour', '1day'], str, Literal['1m', '2m', '5m', '15m', '30m', '60m', '90m', '1h', '1d', '5d', '1wk', '1mo', '3mo']]]
Data granularity. (provider: fmp, polygon, tiingo, yfinance)
sort : Literal['asc', 'desc']
Sort order of the data. (provider: polygon)
limit : int
The number of data entries to return. (provider: polygon)
period : Optional[Literal['1d', '5d', '1mo', '3mo', '6mo', '1y', '2y', '5y', '10y', 'ytd', 'max']]
Time period of the data to return. (provider: yfinance)
Provider name.
warnings : Optional[List[Warning_]]
List of warnings.
chart : Optional[Chart]
Chart object.
extra: Dict[str, Any]
Extra info.
Returns
-------
OBBject
results : List[CurrencyHistorical]
Serializable results.
provider : Optional[Literal['fmp', 'polygon', 'tiingo', 'yfinance']]
Provider name.
warnings : Optional[List[Warning_]]
List of warnings.
chart : Optional[Chart]
Chart object.
extra: Dict[str, Any]
Extra info.
CurrencyHistorical
------------------
date : Union[date, datetime]
The date of the data.
open : float
The open price.
high : float
The high price.
low : float
The low price.
close : float
The close price.
volume : Optional[float]
The trading volume.
vwap : Optional[Annotated[float, Gt(gt=0)]]
Volume Weighted Average Price over the period.
adj_close : Optional[float]
The adjusted close price. (provider: fmp)
unadjusted_volume : Optional[float]
Unadjusted volume of the symbol. (provider: fmp)
change : Optional[float]
Change in the price of the symbol from the previous day. (provider: fmp)
change_percent : Optional[float]
Change % in the price of the symbol. (provider: fmp)
label : Optional[str]
Human readable format of the date. (provider: fmp)
change_over_time : Optional[float]
Change % in the price of the symbol over a period of time. (provider: fmp)
transactions : Optional[Annotated[int, Gt(gt=0)]]
Number of transactions for the symbol in the time period. (provider: polygon)
CurrencyHistorical
------------------
date : datetime
The date of the data.
open : float
The open price.
high : float
The high price.
low : float
The low price.
close : float
The close price.
volume : Optional[float]
The trading volume.
vwap : Optional[Annotated[float, Gt(gt=0)]]
Volume Weighted Average Price over the period.
adj_close : Optional[float]
The adjusted close price. (provider: fmp)
unadjusted_volume : Optional[float]
Unadjusted volume of the symbol. (provider: fmp)
change : Optional[float]
Change in the price of the symbol from the previous day. (provider: fmp)
change_percent : Optional[float]
Change % in the price of the symbol. (provider: fmp)
label : Optional[str]
Human readable format of the date. (provider: fmp)
change_over_time : Optional[float]
Change % in the price of the symbol over a period of time. (provider: fmp)
transactions : Optional[Annotated[int, Gt(gt=0)]]
Number of transactions for the symbol in the time period. (provider: polygon)
Example
-------
>>> from openbb import obb
>>> obb.currency.price.historical(symbol="EURUSD")
>>> # Filter historical data with specific start and end date.
>>> obb.currency.price.historical(symbol='EURUSD', start_date='2023-01-01', end_date='20213-12-31')
>>> # Get data with different granularity.
>>> obb.currency.price.historical(symbol='EURUSD', interval='15m', provider='polygon')
Example
-------
>>> from openbb import obb
>>> obb.currency.price.historical(symbol="EURUSD")
>>> # Filter historical data with specific start and end date.
>>> obb.currency.price.historical(symbol='EURUSD', start_date='2023-01-01', end_date='20213-12-31')
>>> # Get data with different granularity.
>>> obb.currency.price.historical(symbol='EURUSD', interval='15m', provider='polygon')
""" # noqa: E501
return self._run(

View File

@@ -5,7 +5,7 @@ from typing import Literal, Optional
from openbb_core.app.model.custom_parameter import OpenBBCustomParameter
from openbb_core.app.model.obbject import OBBject
from openbb_core.app.static.container import Container
from openbb_core.app.static.utils.decorators import validate
from openbb_core.app.static.utils.decorators import exception_handler, validate
from openbb_core.app.static.utils.filters import filter_inputs
from typing_extensions import Annotated
@@ -19,6 +19,7 @@ class ROUTER_derivatives_options(Container):
def __repr__(self) -> str:
return self.__doc__ or ""
@exception_handler
@validate
def chains(
self,
@@ -171,6 +172,7 @@ class ROUTER_derivatives_options(Container):
)
)
@exception_handler
@validate
def unusual(
self,

View File

@@ -6,7 +6,7 @@ from typing import List, Literal, Optional, Union
from openbb_core.app.model.custom_parameter import OpenBBCustomParameter
from openbb_core.app.model.obbject import OBBject
from openbb_core.app.static.container import Container
from openbb_core.app.static.utils.decorators import validate
from openbb_core.app.static.utils.decorators import exception_handler, validate
from openbb_core.app.static.utils.filters import filter_inputs
from typing_extensions import Annotated
@@ -30,6 +30,7 @@ class ROUTER_economy(Container):
def __repr__(self) -> str:
return self.__doc__ or ""
@exception_handler
@validate
def calendar(
self,
@@ -146,6 +147,7 @@ class ROUTER_economy(Container):
)
)
@exception_handler
@validate
def composite_leading_indicator(
self,
@@ -169,46 +171,46 @@ class ROUTER_economy(Container):
CLIs show short-term economic movements in qualitative rather than quantitative terms.
Parameters
----------
start_date : Union[datetime.date, None, str]
Start date of the data, in YYYY-MM-DD format.
end_date : Union[datetime.date, None, str]
End date of the data, in YYYY-MM-DD format.
Parameters
----------
start_date : Union[datetime.date, None, str]
Start date of the data, in YYYY-MM-DD format.
end_date : Union[datetime.date, None, str]
End date of the data, in YYYY-MM-DD format.
provider : Optional[Literal['oecd']]
The provider to use for the query, by default None.
If None, the provider specified in defaults is selected or 'oecd' if there is
no default.
country : Literal['united_states', 'united_kingdom', 'japan', 'mexico', 'indonesia', 'australia', 'brazil', 'canada', 'italy', 'germany', 'turkey', 'france', 'south_africa', 'south_korea', 'spain', 'india', 'china', 'g7', 'g20', 'all']
Country to get GDP for. (provider: oecd)
Returns
-------
OBBject
results : List[CLI]
Serializable results.
provider : Optional[Literal['oecd']]
The provider to use for the query, by default None.
If None, the provider specified in defaults is selected or 'oecd' if there is
no default.
country : Literal['united_states', 'united_kingdom', 'japan', 'mexico', 'indonesia', 'australia', 'brazil', 'canada', 'italy', 'germany', 'turkey', 'france', 'south_africa', 'south_korea', 'spain', 'india', 'china', 'g7', 'g20', 'all']
Country to get GDP for. (provider: oecd)
Provider name.
warnings : Optional[List[Warning_]]
List of warnings.
chart : Optional[Chart]
Chart object.
extra: Dict[str, Any]
Extra info.
Returns
-------
OBBject
results : List[CLI]
Serializable results.
provider : Optional[Literal['oecd']]
Provider name.
warnings : Optional[List[Warning_]]
List of warnings.
chart : Optional[Chart]
Chart object.
extra: Dict[str, Any]
Extra info.
CLI
---
date : Optional[date]
The date of the data.
value : Optional[float]
CLI value
country : Optional[str]
Country for which CLI is given
CLI
---
date : Optional[date]
The date of the data.
value : Optional[float]
CLI value
country : Optional[str]
Country for which CLI is given
Example
-------
>>> from openbb import obb
>>> obb.economy.composite_leading_indicator(country="all").to_df()
Example
-------
>>> from openbb import obb
>>> obb.economy.composite_leading_indicator(country="all").to_df()
""" # noqa: E501
return self._run(
@@ -229,6 +231,7 @@ class ROUTER_economy(Container):
)
)
@exception_handler
@validate
def cpi(
self,
@@ -349,6 +352,7 @@ class ROUTER_economy(Container):
)
)
@exception_handler
@validate
def fred_regional(
self,
@@ -377,110 +381,109 @@ class ROUTER_economy(Container):
provider: Optional[Literal["fred"]] = None,
**kwargs
) -> OBBject:
"""
Query the Geo Fred API for regional economic data by series group.
"""Query the Geo Fred API for regional economic data by series group.
The series group ID is found by using `fred_search` and the `series_id` parameter.
Parameters
----------
symbol : Union[str, List[str]]
Symbol to get data for. Multiple items allowed: fred.
start_date : Union[datetime.date, None, str]
Start date of the data, in YYYY-MM-DD format.
end_date : Union[datetime.date, None, str]
End date of the data, in YYYY-MM-DD format.
limit : Optional[int]
The number of data entries to return.
Parameters
----------
symbol : Union[str, List[str]]
Symbol to get data for. Multiple items allowed: fred.
start_date : Union[datetime.date, None, str]
Start date of the data, in YYYY-MM-DD format.
end_date : Union[datetime.date, None, str]
End date of the data, in YYYY-MM-DD format.
limit : Optional[int]
The number of data entries to return.
provider : Optional[Literal['fred']]
The provider to use for the query, by default None.
If None, the provider specified in defaults is selected or 'fred' if there is
no default.
is_series_group : bool
When True, the symbol provided is for a series_group, else it is for a series ID. (provider: fred)
region_type : Optional[Literal['bea', 'msa', 'frb', 'necta', 'state', 'country', 'county', 'censusregion']]
The type of regional data. Parameter is only valid when `is_series_group` is True. (provider: fred)
season : Optional[Literal['SA', 'NSA', 'SSA']]
The seasonal adjustments to the data. Parameter is only valid when `is_series_group` is True. (provider: fred)
units : Optional[str]
The units of the data. This should match the units returned from searching by series ID. An incorrect field will not necessarily return an error. Parameter is only valid when `is_series_group` is True. (provider: fred)
frequency : Optional[Literal['d', 'w', 'bw', 'm', 'q', 'sa', 'a', 'wef', 'weth', 'wew', 'wetu', 'wem', 'wesu', 'wesa', 'bwew', 'bwem']]
Frequency aggregation to convert high frequency data to lower frequency.
Parameter is only valid when `is_series_group` is True.
a = Annual
sa= Semiannual
q = Quarterly
m = Monthly
w = Weekly
d = Daily
wef = Weekly, Ending Friday
weth = Weekly, Ending Thursday
wew = Weekly, Ending Wednesday
wetu = Weekly, Ending Tuesday
wem = Weekly, Ending Monday
wesu = Weekly, Ending Sunday
wesa = Weekly, Ending Saturday
bwew = Biweekly, Ending Wednesday
bwem = Biweekly, Ending Monday
(provider: fred)
aggregation_method : Literal['avg', 'sum', 'eop']
A key that indicates the aggregation method used for frequency aggregation.
This parameter has no affect if the frequency parameter is not set.
Only valid when `is_series_group` is True.
avg = Average
sum = Sum
eop = End of Period
(provider: fred)
transform : Literal['lin', 'chg', 'ch1', 'pch', 'pc1', 'pca', 'cch', 'cca', 'log']
Transformation type. Only valid when `is_series_group` is True.
lin = Levels (No transformation)
chg = Change
ch1 = Change from Year Ago
pch = Percent Change
pc1 = Percent Change from Year Ago
pca = Compounded Annual Rate of Change
cch = Continuously Compounded Rate of Change
cca = Continuously Compounded Annual Rate of Change
log = Natural Log
(provider: fred)
Returns
-------
OBBject
results : List[FredRegional]
Serializable results.
provider : Optional[Literal['fred']]
The provider to use for the query, by default None.
If None, the provider specified in defaults is selected or 'fred' if there is
no default.
is_series_group : bool
When True, the symbol provided is for a series_group, else it is for a series ID. (provider: fred)
region_type : Optional[Literal['bea', 'msa', 'frb', 'necta', 'state', 'country', 'county', 'censusregion']]
The type of regional data. Parameter is only valid when `is_series_group` is True. (provider: fred)
season : Optional[Literal['SA', 'NSA', 'SSA']]
The seasonal adjustments to the data. Parameter is only valid when `is_series_group` is True. (provider: fred)
units : Optional[str]
The units of the data. This should match the units returned from searching by series ID. An incorrect field will not necessarily return an error. Parameter is only valid when `is_series_group` is True. (provider: fred)
frequency : Optional[Literal['d', 'w', 'bw', 'm', 'q', 'sa', 'a', 'wef', 'weth', 'wew', 'wetu', 'wem', 'wesu', 'wesa', 'bwew', 'bwem']]
Provider name.
warnings : Optional[List[Warning_]]
List of warnings.
chart : Optional[Chart]
Chart object.
extra: Dict[str, Any]
Extra info.
Frequency aggregation to convert high frequency data to lower frequency.
Parameter is only valid when `is_series_group` is True.
a = Annual
sa= Semiannual
q = Quarterly
m = Monthly
w = Weekly
d = Daily
wef = Weekly, Ending Friday
weth = Weekly, Ending Thursday
wew = Weekly, Ending Wednesday
wetu = Weekly, Ending Tuesday
wem = Weekly, Ending Monday
wesu = Weekly, Ending Sunday
wesa = Weekly, Ending Saturday
bwew = Biweekly, Ending Wednesday
bwem = Biweekly, Ending Monday
(provider: fred)
aggregation_method : Literal['avg', 'sum', 'eop']
FredRegional
------------
date : date
The date of the data.
region : Optional[str]
The name of the region. (provider: fred)
code : Optional[Union[str, int]]
The code of the region. (provider: fred)
value : Optional[Union[float, int]]
The obersvation value. The units are defined in the search results by series ID. (provider: fred)
series_id : Optional[str]
The individual series ID for the region. (provider: fred)
A key that indicates the aggregation method used for frequency aggregation.
This parameter has no affect if the frequency parameter is not set.
Only valid when `is_series_group` is True.
avg = Average
sum = Sum
eop = End of Period
(provider: fred)
transform : Literal['lin', 'chg', 'ch1', 'pch', 'pc1', 'pca', 'cch', 'cca', 'log']
Transformation type. Only valid when `is_series_group` is True.
lin = Levels (No transformation)
chg = Change
ch1 = Change from Year Ago
pch = Percent Change
pc1 = Percent Change from Year Ago
pca = Compounded Annual Rate of Change
cch = Continuously Compounded Rate of Change
cca = Continuously Compounded Annual Rate of Change
log = Natural Log
(provider: fred)
Returns
-------
OBBject
results : List[FredRegional]
Serializable results.
provider : Optional[Literal['fred']]
Provider name.
warnings : Optional[List[Warning_]]
List of warnings.
chart : Optional[Chart]
Chart object.
extra: Dict[str, Any]
Extra info.
FredRegional
------------
date : date
The date of the data.
region : Optional[str]
The name of the region. (provider: fred)
code : Optional[Union[str, int]]
The code of the region. (provider: fred)
value : Optional[Union[float, int]]
The obersvation value. The units are defined in the search results by series ID. (provider: fred)
series_id : Optional[str]
The individual series ID for the region. (provider: fred)
Example
-------
>>> from openbb import obb
>>> #### With no date, the most recent report is returned. ####
>>> obb.economy.fred_regional("NYICLAIMS")
>>> #### With a date, time series data is returned. ####
>>> obb.economy.fred_regional("NYICLAIMS", start_date="2021-01-01")
Example
-------
>>> from openbb import obb
>>> #### With no date, the most recent report is returned. ####
>>> obb.economy.fred_regional("NYICLAIMS")
>>> #### With a date, time series data is returned. ####
>>> obb.economy.fred_regional("NYICLAIMS", start_date="2021-01-01")
""" # noqa: E501
return self._run(
@@ -504,6 +507,7 @@ class ROUTER_economy(Container):
)
)
@exception_handler
@validate
def fred_search(
self,
@@ -513,100 +517,99 @@ class ROUTER_economy(Container):
provider: Optional[Literal["fred"]] = None,
**kwargs
) -> OBBject:
"""
Search for FRED series or economic releases by ID or string.
"""Search for FRED series or economic releases by ID or string.
This does not return the observation values, only the metadata.
Use this function to find series IDs for `fred_series()`.
Parameters
----------
query : Optional[str]
The search word(s).
Parameters
----------
query : Optional[str]
The search word(s).
provider : Optional[Literal['fred']]
The provider to use for the query, by default None.
If None, the provider specified in defaults is selected or 'fred' if there is
no default.
is_release : Optional[bool]
Is release? If True, other search filter variables are ignored. If no query text or release_id is supplied, this defaults to True. (provider: fred)
release_id : Optional[Union[int, str]]
A specific release ID to target. (provider: fred)
limit : Optional[int]
The number of data entries to return. (1-1000) (provider: fred)
offset : Optional[Annotated[int, Ge(ge=0)]]
Offset the results in conjunction with limit. (provider: fred)
filter_variable : Literal[None, 'frequency', 'units', 'seasonal_adjustment']
Filter by an attribute. (provider: fred)
filter_value : Optional[str]
String value to filter the variable by. Used in conjunction with filter_variable. (provider: fred)
tag_names : Optional[str]
A semicolon delimited list of tag names that series match all of. Example: 'japan;imports' (provider: fred)
exclude_tag_names : Optional[str]
A semicolon delimited list of tag names that series match none of. Example: 'imports;services'. Requires that variable tag_names also be set to limit the number of matching series. (provider: fred)
series_id : Optional[str]
A FRED Series ID to return series group information for. This returns the required information to query for regional data. Not all series that are in FRED have geographical data. Entering a value for series_id will override all other parameters. Multiple series_ids can be separated by commas. (provider: fred)
Returns
-------
OBBject
results : List[FredSearch]
Serializable results.
provider : Optional[Literal['fred']]
The provider to use for the query, by default None.
If None, the provider specified in defaults is selected or 'fred' if there is
no default.
is_release : Optional[bool]
Is release? If True, other search filter variables are ignored. If no query text or release_id is supplied, this defaults to True. (provider: fred)
release_id : Optional[Union[int, str]]
A specific release ID to target. (provider: fred)
limit : Optional[int]
The number of data entries to return. (1-1000) (provider: fred)
offset : Optional[Annotated[int, Ge(ge=0)]]
Offset the results in conjunction with limit. (provider: fred)
filter_variable : Literal[None, 'frequency', 'units', 'seasonal_adjustment']
Filter by an attribute. (provider: fred)
filter_value : Optional[str]
String value to filter the variable by. Used in conjunction with filter_variable. (provider: fred)
tag_names : Optional[str]
A semicolon delimited list of tag names that series match all of. Example: 'japan;imports' (provider: fred)
exclude_tag_names : Optional[str]
A semicolon delimited list of tag names that series match none of. Example: 'imports;services'. Requires that variable tag_names also be set to limit the number of matching series. (provider: fred)
series_id : Optional[str]
A FRED Series ID to return series group information for. This returns the required information to query for regional data. Not all series that are in FRED have geographical data. Entering a value for series_id will override all other parameters. Multiple series_ids can be separated by commas. (provider: fred)
Provider name.
warnings : Optional[List[Warning_]]
List of warnings.
chart : Optional[Chart]
Chart object.
extra: Dict[str, Any]
Extra info.
Returns
-------
OBBject
results : List[FredSearch]
Serializable results.
provider : Optional[Literal['fred']]
Provider name.
warnings : Optional[List[Warning_]]
List of warnings.
chart : Optional[Chart]
Chart object.
extra: Dict[str, Any]
Extra info.
FredSearch
----------
release_id : Optional[Union[int, str]]
The release ID for queries.
series_id : Optional[str]
The series ID for the item in the release.
name : Optional[str]
The name of the release.
title : Optional[str]
The title of the series.
observation_start : Optional[date]
The date of the first observation in the series.
observation_end : Optional[date]
The date of the last observation in the series.
frequency : Optional[str]
The frequency of the data.
frequency_short : Optional[str]
Short form of the data frequency.
units : Optional[str]
The units of the data.
units_short : Optional[str]
Short form of the data units.
seasonal_adjustment : Optional[str]
The seasonal adjustment of the data.
seasonal_adjustment_short : Optional[str]
Short form of the data seasonal adjustment.
last_updated : Optional[datetime]
The datetime of the last update to the data.
notes : Optional[str]
Description of the release.
press_release : Optional[bool]
If the release is a press release.
url : Optional[str]
URL to the release.
popularity : Optional[int]
Popularity of the series (provider: fred)
group_popularity : Optional[int]
Group popularity of the release (provider: fred)
region_type : Optional[str]
The region type of the series. (provider: fred)
series_group : Optional[Union[int, str]]
The series group ID of the series. This value is used to query for regional data. (provider: fred)
FredSearch
----------
release_id : Optional[Union[int, str]]
The release ID for queries.
series_id : Optional[str]
The series ID for the item in the release.
name : Optional[str]
The name of the release.
title : Optional[str]
The title of the series.
observation_start : Optional[date]
The date of the first observation in the series.
observation_end : Optional[date]
The date of the last observation in the series.
frequency : Optional[str]
The frequency of the data.
frequency_short : Optional[str]
Short form of the data frequency.
units : Optional[str]
The units of the data.
units_short : Optional[str]
Short form of the data units.
seasonal_adjustment : Optional[str]
The seasonal adjustment of the data.
seasonal_adjustment_short : Optional[str]
Short form of the data seasonal adjustment.
last_updated : Optional[datetime]
The datetime of the last update to the data.
notes : Optional[str]
Description of the release.
press_release : Optional[bool]
If the release is a press release.
url : Optional[str]
URL to the release.
popularity : Optional[int]
Popularity of the series (provider: fred)
group_popularity : Optional[int]
Group popularity of the release (provider: fred)
region_type : Optional[str]
The region type of the series. (provider: fred)
series_group : Optional[Union[int, str]]
The series group ID of the series. This value is used to query for regional data. (provider: fred)
Example
-------
>>> from openbb import obb
>>> obb.economy.fred_search()
Example
-------
>>> from openbb import obb
>>> obb.economy.fred_search()
""" # noqa: E501
return self._run(
@@ -626,6 +629,7 @@ class ROUTER_economy(Container):
)
)
@exception_handler
@validate
def fred_series(
self,
@@ -774,6 +778,7 @@ class ROUTER_economy(Container):
return economy_gdp.ROUTER_economy_gdp(command_runner=self._command_runner)
@exception_handler
@validate
def long_term_interest_rate(
self,
@@ -792,8 +797,7 @@ class ROUTER_economy(Container):
provider: Optional[Literal["oecd"]] = None,
**kwargs
) -> OBBject:
"""
Long-term interest rates refer to government bonds maturing in ten years.
"""Long-term interest rates refer to government bonds maturing in ten years.
Rates are mainly determined by the price charged by the lender, the risk from the borrower and the
fall in the capital value. Long-term interest rates are generally averages of daily rates,
measured as a percentage. These interest rates are implied by the prices at which the government bonds are
@@ -803,48 +807,48 @@ class ROUTER_economy(Container):
Low long-term interest rates encourage investment in new equipment and high interest rates discourage it.
Investment is, in turn, a major source of economic growth.
Parameters
----------
start_date : Union[datetime.date, None, str]
Start date of the data, in YYYY-MM-DD format.
end_date : Union[datetime.date, None, str]
End date of the data, in YYYY-MM-DD format.
Parameters
----------
start_date : Union[datetime.date, None, str]
Start date of the data, in YYYY-MM-DD format.
end_date : Union[datetime.date, None, str]
End date of the data, in YYYY-MM-DD format.
provider : Optional[Literal['oecd']]
The provider to use for the query, by default None.
If None, the provider specified in defaults is selected or 'oecd' if there is
no default.
country : Literal['belgium', 'ireland', 'mexico', 'indonesia', 'new_zealand', 'japan', 'united_kingdom', 'france', 'chile', 'canada', 'netherlands', 'united_states', 'south_korea', 'norway', 'austria', 'south_africa', 'denmark', 'switzerland', 'hungary', 'luxembourg', 'australia', 'germany', 'sweden', 'iceland', 'turkey', 'greece', 'israel', 'czech_republic', 'latvia', 'slovenia', 'poland', 'estonia', 'lithuania', 'portugal', 'costa_rica', 'slovakia', 'finland', 'spain', 'russia', 'euro_area19', 'colombia', 'italy', 'india', 'china', 'croatia', 'all']
Country to get GDP for. (provider: oecd)
frequency : Literal['monthly', 'quarterly', 'annual']
Frequency to get interest rate for for. (provider: oecd)
Returns
-------
OBBject
results : List[LTIR]
Serializable results.
provider : Optional[Literal['oecd']]
The provider to use for the query, by default None.
If None, the provider specified in defaults is selected or 'oecd' if there is
no default.
country : Literal['belgium', 'ireland', 'mexico', 'indonesia', 'new_zealand', 'japan', 'united_kingdom', 'france', 'chile', 'canada', 'netherlands', 'united_states', 'south_korea', 'norway', 'austria', 'south_africa', 'denmark', 'switzerland', 'hungary', 'luxembourg', 'australia', 'germany', 'sweden', 'iceland', 'turkey', 'greece', 'israel', 'czech_republic', 'latvia', 'slovenia', 'poland', 'estonia', 'lithuania', 'portugal', 'costa_rica', 'slovakia', 'finland', 'spain', 'russia', 'euro_area19', 'colombia', 'italy', 'india', 'china', 'croatia', 'all']
Country to get GDP for. (provider: oecd)
frequency : Literal['monthly', 'quarterly', 'annual']
Frequency to get interest rate for for. (provider: oecd)
Provider name.
warnings : Optional[List[Warning_]]
List of warnings.
chart : Optional[Chart]
Chart object.
extra: Dict[str, Any]
Extra info.
Returns
-------
OBBject
results : List[LTIR]
Serializable results.
provider : Optional[Literal['oecd']]
Provider name.
warnings : Optional[List[Warning_]]
List of warnings.
chart : Optional[Chart]
Chart object.
extra: Dict[str, Any]
Extra info.
LTIR
----
date : Optional[date]
The date of the data.
value : Optional[float]
Interest rate (given as a whole number, i.e 10=10%)
country : Optional[str]
Country for which interest rate is given
LTIR
----
date : Optional[date]
The date of the data.
value : Optional[float]
Interest rate (given as a whole number, i.e 10=10%)
country : Optional[str]
Country for which interest rate is given
Example
-------
>>> from openbb import obb
>>> obb.economy.long_term_interest_rate(country="all", frequency="quarterly").to_df()
Example
-------
>>> from openbb import obb
>>> obb.economy.long_term_interest_rate(country="all", frequency="quarterly").to_df()
""" # noqa: E501
return self._run(
@@ -865,6 +869,7 @@ class ROUTER_economy(Container):
)
)
@exception_handler
@validate
def money_measures(
self,
@@ -962,6 +967,7 @@ class ROUTER_economy(Container):
)
)
@exception_handler
@validate
def risk_premium(
self, provider: Optional[Literal["fmp"]] = None, **kwargs
@@ -1021,6 +1027,7 @@ class ROUTER_economy(Container):
)
)
@exception_handler
@validate
def short_term_interest_rate(
self,
@@ -1039,56 +1046,55 @@ class ROUTER_economy(Container):
provider: Optional[Literal["oecd"]] = None,
**kwargs
) -> OBBject:
"""
Short-term interest rates are the rates at which short-term borrowings are effected between
"""Short-term interest rates are the rates at which short-term borrowings are effected between
financial institutions or the rate at which short-term government paper is issued or traded in the market.
Short-term interest rates are generally averages of daily rates, measured as a percentage.
Short-term interest rates are based on three-month money market rates where available.
Typical standardised names are "money market rate" and "treasury bill rate".
Parameters
----------
start_date : Union[datetime.date, None, str]
Start date of the data, in YYYY-MM-DD format.
end_date : Union[datetime.date, None, str]
End date of the data, in YYYY-MM-DD format.
Parameters
----------
start_date : Union[datetime.date, None, str]
Start date of the data, in YYYY-MM-DD format.
end_date : Union[datetime.date, None, str]
End date of the data, in YYYY-MM-DD format.
provider : Optional[Literal['oecd']]
The provider to use for the query, by default None.
If None, the provider specified in defaults is selected or 'oecd' if there is
no default.
country : Literal['belgium', 'ireland', 'mexico', 'indonesia', 'new_zealand', 'japan', 'united_kingdom', 'france', 'chile', 'canada', 'netherlands', 'united_states', 'south_korea', 'norway', 'austria', 'south_africa', 'denmark', 'switzerland', 'hungary', 'luxembourg', 'australia', 'germany', 'sweden', 'iceland', 'turkey', 'greece', 'israel', 'czech_republic', 'latvia', 'slovenia', 'poland', 'estonia', 'lithuania', 'portugal', 'costa_rica', 'slovakia', 'finland', 'spain', 'russia', 'euro_area19', 'colombia', 'italy', 'india', 'china', 'croatia', 'all']
Country to get GDP for. (provider: oecd)
frequency : Literal['monthly', 'quarterly', 'annual']
Frequency to get interest rate for for. (provider: oecd)
Returns
-------
OBBject
results : List[STIR]
Serializable results.
provider : Optional[Literal['oecd']]
The provider to use for the query, by default None.
If None, the provider specified in defaults is selected or 'oecd' if there is
no default.
country : Literal['belgium', 'ireland', 'mexico', 'indonesia', 'new_zealand', 'japan', 'united_kingdom', 'france', 'chile', 'canada', 'netherlands', 'united_states', 'south_korea', 'norway', 'austria', 'south_africa', 'denmark', 'switzerland', 'hungary', 'luxembourg', 'australia', 'germany', 'sweden', 'iceland', 'turkey', 'greece', 'israel', 'czech_republic', 'latvia', 'slovenia', 'poland', 'estonia', 'lithuania', 'portugal', 'costa_rica', 'slovakia', 'finland', 'spain', 'russia', 'euro_area19', 'colombia', 'italy', 'india', 'china', 'croatia', 'all']
Country to get GDP for. (provider: oecd)
frequency : Literal['monthly', 'quarterly', 'annual']
Frequency to get interest rate for for. (provider: oecd)
Provider name.
warnings : Optional[List[Warning_]]
List of warnings.
chart : Optional[Chart]
Chart object.
extra: Dict[str, Any]
Extra info.
Returns
-------
OBBject
results : List[STIR]
Serializable results.
provider : Optional[Literal['oecd']]
Provider name.
warnings : Optional[List[Warning_]]
List of warnings.
chart : Optional[Chart]
Chart object.
extra: Dict[str, Any]
Extra info.
STIR
----
date : Optional[date]
The date of the data.
value : Optional[float]
Interest rate (given as a whole number, i.e 10=10%)
country : Optional[str]
Country for which interest rate is given
STIR
----
date : Optional[date]
The date of the data.
value : Optional[float]
Interest rate (given as a whole number, i.e 10=10%)
country : Optional[str]
Country for which interest rate is given
Example
-------
>>> from openbb import obb
>>> obb.economy.short_term_interest_rate(country="all", frequency="quarterly").to_df()
Example
-------
>>> from openbb import obb
>>> obb.economy.short_term_interest_rate(country="all", frequency="quarterly").to_df()
""" # noqa: E501
return self._run(
@@ -1109,6 +1115,7 @@ class ROUTER_economy(Container):
)
)
@exception_handler
@validate
def unemployment(
self,

View File

@@ -6,7 +6,7 @@ from typing import Literal, Optional, Union
from openbb_core.app.model.custom_parameter import OpenBBCustomParameter
from openbb_core.app.model.obbject import OBBject
from openbb_core.app.static.container import Container
from openbb_core.app.static.utils.decorators import validate
from openbb_core.app.static.utils.decorators import exception_handler, validate
from openbb_core.app.static.utils.filters import filter_inputs
from typing_extensions import Annotated
@@ -21,6 +21,7 @@ class ROUTER_economy_gdp(Container):
def __repr__(self) -> str:
return self.__doc__ or ""
@exception_handler
@validate
def forecast(
self,
@@ -117,6 +118,7 @@ class ROUTER_economy_gdp(Container):
)
)
@exception_handler
@validate
def nominal(
self,
@@ -204,6 +206,7 @@ class ROUTER_economy_gdp(Container):
)
)
@exception_handler
@validate
def real(
self,

View File

@@ -5,7 +5,7 @@ from typing import List, Literal, Optional, Union
from openbb_core.app.model.custom_parameter import OpenBBCustomParameter
from openbb_core.app.model.obbject import OBBject
from openbb_core.app.static.container import Container
from openbb_core.app.static.utils.decorators import validate
from openbb_core.app.static.utils.decorators import exception_handler, validate
from openbb_core.app.static.utils.filters import filter_inputs
from typing_extensions import Annotated
@@ -72,11 +72,12 @@ class ROUTER_equity(Container):
command_runner=self._command_runner
)
@exception_handler
@validate
def market_snapshots(
self, provider: Optional[Literal["fmp", "polygon"]] = None, **kwargs
) -> OBBject:
"""Get a current, complete, market snapshot.
"""Get an updated equity market snapshot. This includes price data for thousands of stocks.
Parameters
----------
@@ -221,6 +222,7 @@ class ROUTER_equity(Container):
return equity_price.ROUTER_equity_price(command_runner=self._command_runner)
@exception_handler
@validate
def profile(
self,
@@ -233,7 +235,7 @@ class ROUTER_equity(Container):
provider: Optional[Literal["fmp", "intrinio", "yfinance"]] = None,
**kwargs
) -> OBBject:
"""Equity Info. Get general price and performance metrics of a stock.
"""Get general information about a company. This includes company name, industry, sector and price data.
Parameters
----------
@@ -410,9 +412,11 @@ class ROUTER_equity(Container):
)
)
@exception_handler
@validate
def screener(self, provider: Optional[Literal["fmp"]] = None, **kwargs) -> OBBject:
"""Equity Screen. Screen for companies meeting various criteria.
"""Screen for companies meeting various criteria. These criteria include
market cap, price, beta, volume, and dividend yield.
Parameters
----------
@@ -521,6 +525,7 @@ class ROUTER_equity(Container):
)
)
@exception_handler
@validate
def search(
self,
@@ -536,7 +541,7 @@ class ROUTER_equity(Container):
provider: Optional[Literal["intrinio", "sec"]] = None,
**kwargs
) -> OBBject:
"""Equity Search. Search for a company or stock ticker.
"""Search for stock symbol, CIK, LEI, or company name.
Parameters
----------

View File

@@ -6,7 +6,7 @@ from typing import Literal, Optional, Union
from openbb_core.app.model.custom_parameter import OpenBBCustomParameter
from openbb_core.app.model.obbject import OBBject
from openbb_core.app.static.container import Container
from openbb_core.app.static.utils.decorators import validate
from openbb_core.app.static.utils.decorators import exception_handler, validate
from openbb_core.app.static.utils.filters import filter_inputs
from typing_extensions import Annotated
@@ -22,6 +22,7 @@ class ROUTER_equity_calendar(Container):
def __repr__(self) -> str:
return self.__doc__ or ""
@exception_handler
@validate
def dividend(
self,
@@ -40,7 +41,7 @@ class ROUTER_equity_calendar(Container):
provider: Optional[Literal["fmp"]] = None,
**kwargs
) -> OBBject:
"""Upcoming and Historical Dividend Calendar.
"""Get historical and upcoming dividend payments. Includes dividend amount, ex-dividend and payment dates.
Parameters
----------
@@ -92,6 +93,8 @@ class ROUTER_equity_calendar(Container):
-------
>>> from openbb import obb
>>> obb.equity.calendar.dividend()
>>> # Get dividend calendar for specific dates.
>>> obb.equity.calendar.dividend(start_date='2024-02-01', end_date='2024-02-07')
""" # noqa: E501
return self._run(
@@ -112,6 +115,7 @@ class ROUTER_equity_calendar(Container):
)
)
@exception_handler
@validate
def earnings(
self,
@@ -130,7 +134,7 @@ class ROUTER_equity_calendar(Container):
provider: Optional[Literal["fmp"]] = None,
**kwargs
) -> OBBject:
"""Upcoming and Historical earnings calendar.
"""Get historical and upcoming company earnings releases. Includes earnings per share (EPS) and revenue data.
Parameters
----------
@@ -186,6 +190,8 @@ class ROUTER_equity_calendar(Container):
-------
>>> from openbb import obb
>>> obb.equity.calendar.earnings()
>>> # Get earnings calendar for specific dates.
>>> obb.equity.calendar.earnings(start_date='2024-02-01', end_date='2024-02-07')
""" # noqa: E501
return self._run(
@@ -206,6 +212,7 @@ class ROUTER_equity_calendar(Container):
)
)
@exception_handler
@validate
def ipo(
self,
@@ -231,7 +238,7 @@ class ROUTER_equity_calendar(Container):
provider: Optional[Literal["intrinio"]] = None,
**kwargs
) -> OBBject:
"""Upcoming and Historical IPO Calendar.
"""Get historical and upcoming initial public offerings (IPOs).
Parameters
----------
@@ -354,6 +361,10 @@ class ROUTER_equity_calendar(Container):
-------
>>> from openbb import obb
>>> obb.equity.calendar.ipo(limit=100)
>>> # Get all IPOs available.
>>> obb.equity.calendar.ipo()
>>> # Get IPOs for specific dates.
>>> obb.equity.calendar.ipo(start_date='2024-02-01', end_date='2024-02-07')
""" # noqa: E501
return self._run(
@@ -376,6 +387,7 @@ class ROUTER_equity_calendar(Container):
)
)
@exception_handler
@validate
def splits(
self,
@@ -394,7 +406,7 @@ class ROUTER_equity_calendar(Container):
provider: Optional[Literal["fmp"]] = None,
**kwargs
) -> OBBject:
"""Calendar Splits. Show Stock Split Calendar.
"""Get historical and upcoming stock split operations.
Parameters
----------
@@ -438,6 +450,8 @@ class ROUTER_equity_calendar(Container):
-------
>>> from openbb import obb
>>> obb.equity.calendar.splits()
>>> # Get stock splits calendar for specific dates.
>>> obb.equity.calendar.splits(start_date='2024-02-01', end_date='2024-02-07')
""" # noqa: E501
return self._run(

View File

@@ -5,7 +5,7 @@ from typing import Literal, Optional
from openbb_core.app.model.custom_parameter import OpenBBCustomParameter
from openbb_core.app.model.obbject import OBBject
from openbb_core.app.static.container import Container
from openbb_core.app.static.utils.decorators import validate
from openbb_core.app.static.utils.decorators import exception_handler, validate
from openbb_core.app.static.utils.filters import filter_inputs
from typing_extensions import Annotated
@@ -18,6 +18,7 @@ class ROUTER_equity_compare(Container):
def __repr__(self) -> str:
return self.__doc__ or ""
@exception_handler
@validate
def peers(
self,
@@ -27,7 +28,10 @@ class ROUTER_equity_compare(Container):
provider: Optional[Literal["fmp"]] = None,
**kwargs
) -> OBBject:
"""Equity Peers. Company peers.
"""Get the closest peers for a given company.
Peers consist of companies trading on the same exchange, operating within the same sector
and with comparable market capitalizations.
Parameters
----------

View File

@@ -6,7 +6,7 @@ from typing import Literal, Optional, Union
from openbb_core.app.model.custom_parameter import OpenBBCustomParameter
from openbb_core.app.model.obbject import OBBject
from openbb_core.app.static.container import Container
from openbb_core.app.static.utils.decorators import validate
from openbb_core.app.static.utils.decorators import exception_handler, validate
from openbb_core.app.static.utils.filters import filter_inputs
from typing_extensions import Annotated
@@ -26,6 +26,7 @@ class ROUTER_equity_discovery(Container):
def __repr__(self) -> str:
return self.__doc__ or ""
@exception_handler
@validate
def active(
self,
@@ -38,7 +39,7 @@ class ROUTER_equity_discovery(Container):
provider: Optional[Literal["yfinance"]] = None,
**kwargs
) -> OBBject:
"""Get the most active Equities.
"""Get the most actively traded stocks based on volume.
Parameters
----------
@@ -107,6 +108,7 @@ class ROUTER_equity_discovery(Container):
)
)
@exception_handler
@validate
def aggressive_small_caps(
self,
@@ -119,7 +121,7 @@ class ROUTER_equity_discovery(Container):
provider: Optional[Literal["yfinance"]] = None,
**kwargs
) -> OBBject:
"""Get aggressive small cap Equities.
"""Get top small cap stocks based on earnings growth.
Parameters
----------
@@ -188,6 +190,7 @@ class ROUTER_equity_discovery(Container):
)
)
@exception_handler
@validate
def filings(
self,
@@ -216,7 +219,12 @@ class ROUTER_equity_discovery(Container):
provider: Optional[Literal["fmp"]] = None,
**kwargs
) -> OBBject:
"""Get the most-recent filings submitted to the SEC.
"""Get the URLs to SEC filings reported to EDGAR database, such as 10-K, 10-Q, 8-K, and more. SEC
filings include Form 10-K, Form 10-Q, Form 8-K, the proxy statement, Forms 3, 4, and 5, Schedule 13, Form 114,
Foreign Investment Disclosures and others. The annual 10-K report is required to be
filed annually and includes the company's financial statements, management discussion and analysis,
and audited financial statements.
Parameters
----------
@@ -268,6 +276,8 @@ class ROUTER_equity_discovery(Container):
-------
>>> from openbb import obb
>>> obb.equity.discovery.filings(limit=100)
>>> # Get filings for the year 2023, limited to 100 results
>>> obb.equity.discovery.filings(start_date='2023-01-01', end_date='2023-12-31')
""" # noqa: E501
return self._run(
@@ -290,6 +300,7 @@ class ROUTER_equity_discovery(Container):
)
)
@exception_handler
@validate
def gainers(
self,
@@ -302,7 +313,7 @@ class ROUTER_equity_discovery(Container):
provider: Optional[Literal["yfinance"]] = None,
**kwargs
) -> OBBject:
"""Get the top Equity gainers.
"""Get the top price gainers in the stock market.
Parameters
----------
@@ -371,6 +382,7 @@ class ROUTER_equity_discovery(Container):
)
)
@exception_handler
@validate
def growth_tech(
self,
@@ -383,7 +395,7 @@ class ROUTER_equity_discovery(Container):
provider: Optional[Literal["yfinance"]] = None,
**kwargs
) -> OBBject:
"""Get growth tech Equities.
"""Get top tech stocks based on revenue and earnings growth.
Parameters
----------
@@ -452,6 +464,7 @@ class ROUTER_equity_discovery(Container):
)
)
@exception_handler
@validate
def losers(
self,
@@ -464,7 +477,7 @@ class ROUTER_equity_discovery(Container):
provider: Optional[Literal["yfinance"]] = None,
**kwargs
) -> OBBject:
"""Get the top Equity losers.
"""Get the top price losers in the stock market.
Parameters
----------
@@ -533,6 +546,7 @@ class ROUTER_equity_discovery(Container):
)
)
@exception_handler
@validate
def undervalued_growth(
self,
@@ -545,7 +559,7 @@ class ROUTER_equity_discovery(Container):
provider: Optional[Literal["yfinance"]] = None,
**kwargs
) -> OBBject:
"""Get undervalued growth Equities.
"""Get potentially undervalued growth stocks.
Parameters
----------
@@ -614,6 +628,7 @@ class ROUTER_equity_discovery(Container):
)
)
@exception_handler
@validate
def undervalued_large_caps(
self,
@@ -626,7 +641,7 @@ class ROUTER_equity_discovery(Container):
provider: Optional[Literal["yfinance"]] = None,
**kwargs
) -> OBBject:
"""Get undervalued large cap Equities.
"""Get potentially undervalued large cap stocks.
Parameters
----------

View File

@@ -5,7 +5,7 @@ from typing import List, Literal, Optional, Union
from openbb_core.app.model.custom_parameter import OpenBBCustomParameter
from openbb_core.app.model.obbject import OBBject
from openbb_core.app.static.container import Container
from openbb_core.app.static.utils.decorators import validate
from openbb_core.app.static.utils.decorators import exception_handler, validate
from openbb_core.app.static.utils.filters import filter_inputs
from typing_extensions import Annotated
@@ -21,6 +21,7 @@ class ROUTER_equity_estimates(Container):
def __repr__(self) -> str:
return self.__doc__ or ""
@exception_handler
@validate
def analyst_search(
self,
@@ -191,6 +192,7 @@ class ROUTER_equity_estimates(Container):
)
)
@exception_handler
@validate
def consensus(
self,
@@ -203,7 +205,7 @@ class ROUTER_equity_estimates(Container):
provider: Optional[Literal["fmp", "yfinance"]] = None,
**kwargs
) -> OBBject:
"""Consensus price target and recommendation.
"""Get consensus price target and recommendation.
Parameters
----------
@@ -275,6 +277,7 @@ class ROUTER_equity_estimates(Container):
)
)
@exception_handler
@validate
def historical(
self,
@@ -292,7 +295,7 @@ class ROUTER_equity_estimates(Container):
provider: Optional[Literal["fmp"]] = None,
**kwargs
) -> OBBject:
"""Historical analyst estimates for earnings and revenue.
"""Get historical analyst estimates for earnings and revenue.
Parameters
----------
@@ -393,6 +396,7 @@ class ROUTER_equity_estimates(Container):
)
)
@exception_handler
@validate
def price_target(
self,
@@ -409,7 +413,7 @@ class ROUTER_equity_estimates(Container):
provider: Optional[Literal["benzinga", "fmp"]] = None,
**kwargs
) -> OBBject:
"""Analyst price targets by company.
"""Get analyst price targets by company.
Parameters
----------

View File

@@ -9,7 +9,7 @@ from openbb_core.app.deprecation import OpenBBDeprecationWarning
from openbb_core.app.model.custom_parameter import OpenBBCustomParameter
from openbb_core.app.model.obbject import OBBject
from openbb_core.app.static.container import Container
from openbb_core.app.static.utils.decorators import validate
from openbb_core.app.static.utils.decorators import exception_handler, validate
from openbb_core.app.static.utils.filters import filter_inputs
from typing_extensions import Annotated, deprecated
@@ -46,6 +46,7 @@ class ROUTER_equity_fundamental(Container):
def __repr__(self) -> str:
return self.__doc__ or ""
@exception_handler
@validate
def balance(
self,
@@ -62,7 +63,7 @@ class ROUTER_equity_fundamental(Container):
provider: Optional[Literal["fmp", "intrinio", "polygon", "yfinance"]] = None,
**kwargs
) -> OBBject:
"""Balance Sheet. Balance sheet statement.
"""Get the balance sheet for a given company.
Parameters
----------
@@ -401,6 +402,7 @@ class ROUTER_equity_fundamental(Container):
)
)
@exception_handler
@validate
def balance_growth(
self,
@@ -414,7 +416,7 @@ class ROUTER_equity_fundamental(Container):
provider: Optional[Literal["fmp"]] = None,
**kwargs
) -> OBBject:
"""Balance Sheet Statement Growth. Information about the growth of the company balance sheet.
"""Get the growth of a company's balance sheet items over time.
Parameters
----------
@@ -552,6 +554,7 @@ class ROUTER_equity_fundamental(Container):
)
)
@exception_handler
@validate
def cash(
self,
@@ -568,7 +571,7 @@ class ROUTER_equity_fundamental(Container):
provider: Optional[Literal["fmp", "intrinio", "polygon", "yfinance"]] = None,
**kwargs
) -> OBBject:
"""Cash Flow Statement. Information about the cash flow statement.
"""Get the cash flow statement for a given company.
Parameters
----------
@@ -815,6 +818,7 @@ class ROUTER_equity_fundamental(Container):
)
)
@exception_handler
@validate
def cash_growth(
self,
@@ -828,7 +832,7 @@ class ROUTER_equity_fundamental(Container):
provider: Optional[Literal["fmp"]] = None,
**kwargs
) -> OBBject:
"""Cash Flow Statement Growth. Information about the growth of the company cash flow statement.
"""Get the growth of a company's cash flow statement items over time.
Parameters
----------
@@ -948,6 +952,7 @@ class ROUTER_equity_fundamental(Container):
)
)
@exception_handler
@validate
def dividends(
self,
@@ -969,7 +974,7 @@ class ROUTER_equity_fundamental(Container):
provider: Optional[Literal["fmp", "intrinio", "yfinance"]] = None,
**kwargs
) -> OBBject:
"""Historical Dividends. Historical dividends data for a given company.
"""Get historical dividend data for a given company.
Parameters
----------
@@ -1048,6 +1053,7 @@ class ROUTER_equity_fundamental(Container):
)
)
@exception_handler
@validate
def employee_count(
self,
@@ -1057,7 +1063,7 @@ class ROUTER_equity_fundamental(Container):
provider: Optional[Literal["fmp"]] = None,
**kwargs
) -> OBBject:
"""Historical Employees. Historical number of employees.
"""Get historical employee count data for a given company.
Parameters
----------
@@ -1126,6 +1132,7 @@ class ROUTER_equity_fundamental(Container):
)
)
@exception_handler
@validate
def filings(
self,
@@ -1145,7 +1152,12 @@ class ROUTER_equity_fundamental(Container):
provider: Optional[Literal["fmp", "intrinio", "sec"]] = None,
**kwargs
) -> OBBject:
"""Company Filings. Company filings data.
"""Get the URLs to SEC filings reported to EDGAR database, such as 10-K, 10-Q, 8-K, and more. SEC
filings include Form 10-K, Form 10-Q, Form 8-K, the proxy statement, Forms 3, 4, and 5, Schedule 13, Form 114,
Foreign Investment Disclosures and others. The annual 10-K report is required to be
filed annually and includes the company's financial statements, management discussion and analysis,
and audited financial statements.
Parameters
----------
@@ -1266,6 +1278,7 @@ class ROUTER_equity_fundamental(Container):
)
)
@exception_handler
@validate
def historical_attributes(
self,
@@ -1312,7 +1325,7 @@ class ROUTER_equity_fundamental(Container):
provider: Optional[Literal["intrinio"]] = None,
**kwargs
) -> OBBject:
"""Fetch the historical values of a data tag from Intrinio.
"""Get the historical values of a data tag from Intrinio.
Parameters
----------
@@ -1365,7 +1378,7 @@ class ROUTER_equity_fundamental(Container):
Example
-------
>>> from openbb import obb
>>> obb.equity.fundamental.historical_attributes(symbol="AAPL", tag="ebitda", frequency="yearly", limit=1000, sort="desc")
>>> obb.equity.fundamental.historical_attributes(tag='ebitda')
""" # noqa: E501
return self._run(
@@ -1396,6 +1409,7 @@ class ROUTER_equity_fundamental(Container):
)
)
@exception_handler
@validate
def historical_eps(
self,
@@ -1405,7 +1419,7 @@ class ROUTER_equity_fundamental(Container):
provider: Optional[Literal["fmp"]] = None,
**kwargs
) -> OBBject:
"""Historical earnings-per-share for a given company.
"""Get historical earnings per share data for a given company.
Parameters
----------
@@ -1478,6 +1492,7 @@ class ROUTER_equity_fundamental(Container):
)
)
@exception_handler
@validate
def historical_splits(
self,
@@ -1487,7 +1502,7 @@ class ROUTER_equity_fundamental(Container):
provider: Optional[Literal["fmp"]] = None,
**kwargs
) -> OBBject:
"""Historical Splits. Historical splits data.
"""Get historical stock splits for a given company.
Parameters
----------
@@ -1546,6 +1561,7 @@ class ROUTER_equity_fundamental(Container):
)
)
@exception_handler
@validate
def income(
self,
@@ -1562,7 +1578,7 @@ class ROUTER_equity_fundamental(Container):
provider: Optional[Literal["fmp", "intrinio", "polygon", "yfinance"]] = None,
**kwargs
) -> OBBject:
"""Income Statement. Report on a company's financial performance.
"""Get the income statement for a given company.
Parameters
----------
@@ -1903,6 +1919,7 @@ class ROUTER_equity_fundamental(Container):
)
)
@exception_handler
@validate
def income_growth(
self,
@@ -1920,7 +1937,7 @@ class ROUTER_equity_fundamental(Container):
provider: Optional[Literal["fmp"]] = None,
**kwargs
) -> OBBject:
"""Income Statement Growth. Information about the growth of the company income statement.
"""Get the growth of a company's income statement items over time.
Parameters
----------
@@ -2035,6 +2052,7 @@ class ROUTER_equity_fundamental(Container):
)
)
@exception_handler
@validate
def latest_attributes(
self,
@@ -2053,7 +2071,7 @@ class ROUTER_equity_fundamental(Container):
provider: Optional[Literal["intrinio"]] = None,
**kwargs
) -> OBBject:
"""Fetch the latest value of a data tag from Intrinio.
"""Get the latest value of a data tag from Intrinio.
Parameters
----------
@@ -2092,7 +2110,7 @@ class ROUTER_equity_fundamental(Container):
Example
-------
>>> from openbb import obb
>>> obb.equity.fundamental.latest_attributes(symbol="AAPL", tag="ceo")
>>> obb.equity.fundamental.latest_attributes(tag='ceo')
""" # noqa: E501
return self._run(
@@ -2117,6 +2135,7 @@ class ROUTER_equity_fundamental(Container):
)
)
@exception_handler
@validate
def management(
self,
@@ -2126,7 +2145,7 @@ class ROUTER_equity_fundamental(Container):
provider: Optional[Literal["fmp", "yfinance"]] = None,
**kwargs
) -> OBBject:
"""Key Executives. Key executives for a given company.
"""Get executive management team data for a given company.
Parameters
----------
@@ -2195,6 +2214,7 @@ class ROUTER_equity_fundamental(Container):
)
)
@exception_handler
@validate
def management_compensation(
self,
@@ -2219,7 +2239,7 @@ class ROUTER_equity_fundamental(Container):
provider: Optional[Literal["fmp"]] = None,
**kwargs
) -> OBBject:
"""Get Executive Compensation. Information about the executive compensation for a given company.
"""Get executive management team compensation for a given company over time.
Parameters
----------
@@ -2303,6 +2323,7 @@ class ROUTER_equity_fundamental(Container):
)
)
@exception_handler
@validate
def metrics(
self,
@@ -2323,7 +2344,7 @@ class ROUTER_equity_fundamental(Container):
provider: Optional[Literal["fmp", "intrinio", "yfinance"]] = None,
**kwargs
) -> OBBject:
"""Key Metrics. Key metrics for a given company.
"""Get fundamental metrics for a given company.
Parameters
----------
@@ -2568,6 +2589,7 @@ class ROUTER_equity_fundamental(Container):
)
)
@exception_handler
@validate
def multiples(
self,
@@ -2580,7 +2602,7 @@ class ROUTER_equity_fundamental(Container):
provider: Optional[Literal["fmp"]] = None,
**kwargs
) -> OBBject:
"""Equity Valuation Multiples. Valuation multiples for a stock ticker.
"""Get equity valuation multiples for a given company.
Parameters
----------
@@ -2754,6 +2776,7 @@ class ROUTER_equity_fundamental(Container):
)
)
@exception_handler
@validate
@deprecated(
"This endpoint is deprecated; use `/equity/profile` instead. Deprecated in OpenBB Platform V4.1 to be removed in V4.3.",
@@ -2767,7 +2790,7 @@ class ROUTER_equity_fundamental(Container):
provider: Optional[Literal["fmp"]] = None,
**kwargs
) -> OBBject:
"""Company Overview. General information about a company.
"""Get company general business and stock data for a given company.
Parameters
----------
@@ -2897,6 +2920,7 @@ class ROUTER_equity_fundamental(Container):
)
)
@exception_handler
@validate
def ratios(
self,
@@ -2913,7 +2937,7 @@ class ROUTER_equity_fundamental(Container):
provider: Optional[Literal["fmp", "intrinio"]] = None,
**kwargs
) -> OBBject:
"""Extensive set of ratios over time. Financial ratios for a given company.
"""Get an extensive set of financial and accounting ratios for a given company over time.
Parameters
----------
@@ -3090,6 +3114,7 @@ class ROUTER_equity_fundamental(Container):
)
)
@exception_handler
@validate
def reported_financials(
self,
@@ -3114,7 +3139,7 @@ class ROUTER_equity_fundamental(Container):
provider: Optional[Literal["intrinio"]] = None,
**kwargs
) -> OBBject:
"""Financial statements, as-reported.
"""Get financial statements as reported by the company.
Parameters
----------
@@ -3160,6 +3185,10 @@ class ROUTER_equity_fundamental(Container):
-------
>>> from openbb import obb
>>> obb.equity.fundamental.reported_financials(symbol="AAPL", period="annual", statement_type="balance", limit=100)
>>> # Get reported income statement
>>> obb.equity.fundamental.reported_financials(symbol='AAPL', statement_type='income)
>>> # Get reported cash flow statement
>>> obb.equity.fundamental.reported_financials(symbol='AAPL', statement_type='cash')
""" # noqa: E501
return self._run(
@@ -3182,6 +3211,7 @@ class ROUTER_equity_fundamental(Container):
)
)
@exception_handler
@validate
def revenue_per_geography(
self,
@@ -3199,7 +3229,7 @@ class ROUTER_equity_fundamental(Container):
provider: Optional[Literal["fmp"]] = None,
**kwargs
) -> OBBject:
"""Revenue Geographic. Geographic revenue data.
"""Get the revenue geographic breakdown for a given company over time.
Parameters
----------
@@ -3266,6 +3296,7 @@ class ROUTER_equity_fundamental(Container):
)
)
@exception_handler
@validate
def revenue_per_segment(
self,
@@ -3283,7 +3314,7 @@ class ROUTER_equity_fundamental(Container):
provider: Optional[Literal["fmp"]] = None,
**kwargs
) -> OBBject:
"""Revenue Business Line. Business line revenue data.
"""Get the revenue breakdown by business segment for a given company over time.
Parameters
----------
@@ -3350,6 +3381,7 @@ class ROUTER_equity_fundamental(Container):
)
)
@exception_handler
@validate
def search_attributes(
self,
@@ -3363,7 +3395,7 @@ class ROUTER_equity_fundamental(Container):
provider: Optional[Literal["intrinio"]] = None,
**kwargs
) -> OBBject:
"""Search Intrinio data tags.
"""Search Intrinio data tags to search in latest or historical attributes.
Parameters
----------
@@ -3418,7 +3450,7 @@ class ROUTER_equity_fundamental(Container):
Example
-------
>>> from openbb import obb
>>> obb.equity.fundamental.search_attributes(query="AAPL", limit=1000)
>>> obb.equity.fundamental.search_attributes(query='ebitda')
""" # noqa: E501
return self._run(
@@ -3439,6 +3471,7 @@ class ROUTER_equity_fundamental(Container):
)
)
@exception_handler
@validate
def trailing_dividend_yield(
self,
@@ -3454,7 +3487,7 @@ class ROUTER_equity_fundamental(Container):
provider: Optional[Literal["tiingo"]] = None,
**kwargs
) -> OBBject:
"""Trailing 1yr dividend yield.
"""Get the 1 year trailing dividend yield for a given company over time.
Parameters
----------
@@ -3512,6 +3545,7 @@ class ROUTER_equity_fundamental(Container):
)
)
@exception_handler
@validate
def transcript(
self,
@@ -3525,7 +3559,7 @@ class ROUTER_equity_fundamental(Container):
provider: Optional[Literal["fmp"]] = None,
**kwargs
) -> OBBject:
"""Earnings Call Transcript. Earnings call transcript for a given company.
"""Get earnings call transcripts for a given company.
Parameters
----------
@@ -3568,7 +3602,7 @@ class ROUTER_equity_fundamental(Container):
Example
-------
>>> from openbb import obb
>>> obb.equity.fundamental.transcript(symbol="AAPL", year=2020)
>>> obb.equity.fundamental.transcript(symbol='AAPL', year=2020)
""" # noqa: E501
return self._run(

View File

@@ -6,7 +6,7 @@ from typing import List, Literal, Optional, Union
from openbb_core.app.model.custom_parameter import OpenBBCustomParameter
from openbb_core.app.model.obbject import OBBject
from openbb_core.app.static.container import Container
from openbb_core.app.static.utils.decorators import validate
from openbb_core.app.static.utils.decorators import exception_handler, validate
from openbb_core.app.static.utils.filters import filter_inputs
from typing_extensions import Annotated
@@ -22,6 +22,7 @@ class ROUTER_equity_ownership(Container):
def __repr__(self) -> str:
return self.__doc__ or ""
@exception_handler
@validate
def insider_trading(
self,
@@ -35,7 +36,7 @@ class ROUTER_equity_ownership(Container):
provider: Optional[Literal["fmp", "intrinio"]] = None,
**kwargs
) -> OBBject:
"""Insider Trading. Information about insider trading.
"""Get data about trading by a company's management team and board of directors.
Parameters
----------
@@ -157,6 +158,7 @@ class ROUTER_equity_ownership(Container):
)
)
@exception_handler
@validate
def institutional(
self,
@@ -166,7 +168,7 @@ class ROUTER_equity_ownership(Container):
provider: Optional[Literal["fmp", "intrinio"]] = None,
**kwargs
) -> OBBject:
"""Institutional Ownership. Institutional ownership data.
"""Get data about institutional ownership for a given company over time.
Parameters
----------
@@ -313,6 +315,7 @@ class ROUTER_equity_ownership(Container):
)
)
@exception_handler
@validate
def major_holders(
self,
@@ -330,7 +333,7 @@ class ROUTER_equity_ownership(Container):
provider: Optional[Literal["fmp"]] = None,
**kwargs
) -> OBBject:
"""Equity Ownership. Information about the company ownership.
"""Get data about major holders for a given company over time.
Parameters
----------
@@ -465,6 +468,7 @@ class ROUTER_equity_ownership(Container):
)
)
@exception_handler
@validate
def share_statistics(
self,
@@ -477,7 +481,7 @@ class ROUTER_equity_ownership(Container):
provider: Optional[Literal["fmp", "intrinio", "yfinance"]] = None,
**kwargs
) -> OBBject:
"""Share Statistics. Share statistics for a given company.
"""Get data about share float for a given company.
Parameters
----------

View File

@@ -6,7 +6,7 @@ from typing import List, Literal, Optional, Union
from openbb_core.app.model.custom_parameter import OpenBBCustomParameter
from openbb_core.app.model.obbject import OBBject
from openbb_core.app.static.container import Container
from openbb_core.app.static.utils.decorators import validate
from openbb_core.app.static.utils.decorators import exception_handler, validate
from openbb_core.app.static.utils.filters import filter_inputs
from typing_extensions import Annotated
@@ -22,6 +22,7 @@ class ROUTER_equity_price(Container):
def __repr__(self) -> str:
return self.__doc__ or ""
@exception_handler
@validate
def historical(
self,
@@ -52,7 +53,7 @@ class ROUTER_equity_price(Container):
] = None,
**kwargs
) -> OBBject:
"""Equity Historical price. Load stock data for a specific ticker.
"""Get historical price data for a given stock. This includes open, high, low, close, and volume.
Parameters
----------
@@ -202,6 +203,7 @@ class ROUTER_equity_price(Container):
)
)
@exception_handler
@validate
def nbbo(
self,
@@ -211,7 +213,7 @@ class ROUTER_equity_price(Container):
provider: Optional[Literal["polygon"]] = None,
**kwargs
) -> OBBject:
"""Equity NBBO. Load National Best Bid and Offer for a specific equity.
"""Get the National Best Bid and Offer for a given stock.
Parameters
----------
@@ -331,6 +333,7 @@ class ROUTER_equity_price(Container):
)
)
@exception_handler
@validate
def performance(
self,
@@ -343,7 +346,7 @@ class ROUTER_equity_price(Container):
provider: Optional[Literal["fmp"]] = None,
**kwargs
) -> OBBject:
"""Price performance as a return, over different periods.
"""Get price performance data for a given stock. This includes price changes for different time periods.
Parameters
----------
@@ -425,6 +428,7 @@ class ROUTER_equity_price(Container):
)
)
@exception_handler
@validate
def quote(
self,
@@ -437,7 +441,7 @@ class ROUTER_equity_price(Container):
provider: Optional[Literal["fmp", "intrinio", "yfinance"]] = None,
**kwargs
) -> OBBject:
"""Equity Quote. Load stock data for a specific ticker.
"""Get the latest quote for a given stock. Quote includes price, volume, and other data.
Parameters
----------

View File

@@ -5,7 +5,7 @@ from typing import Literal, Optional
from openbb_core.app.model.custom_parameter import OpenBBCustomParameter
from openbb_core.app.model.obbject import OBBject
from openbb_core.app.static.container import Container
from openbb_core.app.static.utils.decorators import validate
from openbb_core.app.static.utils.decorators import exception_handler, validate
from openbb_core.app.static.utils.filters import filter_inputs
from typing_extensions import Annotated
@@ -18,6 +18,7 @@ class ROUTER_equity_shorts(Container):
def __repr__(self) -> str:
return self.__doc__ or ""
@exception_handler
@validate
def fails_to_deliver(
self,
@@ -79,7 +80,7 @@ class ROUTER_equity_shorts(Container):
Example
-------
>>> from openbb import obb
>>> obb.equity.shorts.fails_to_deliver(symbol="AAPL")
>>> obb.equity.shorts.fails_to_deliver(symbol='AAPL')
""" # noqa: E501
return self._run(

View File

@@ -6,7 +6,7 @@ from typing import List, Literal, Optional, Union
from openbb_core.app.model.custom_parameter import OpenBBCustomParameter
from openbb_core.app.model.obbject import OBBject
from openbb_core.app.static.container import Container
from openbb_core.app.static.utils.decorators import validate
from openbb_core.app.static.utils.decorators import exception_handler, validate
from openbb_core.app.static.utils.filters import filter_inputs
from typing_extensions import Annotated
@@ -28,6 +28,7 @@ class ROUTER_etf(Container):
def __repr__(self) -> str:
return self.__doc__ or ""
@exception_handler
@validate
def countries(
self,
@@ -94,6 +95,7 @@ class ROUTER_etf(Container):
)
)
@exception_handler
@validate
def equity_exposure(
self,
@@ -170,6 +172,7 @@ class ROUTER_etf(Container):
)
)
@exception_handler
@validate
def historical(
self,
@@ -222,7 +225,7 @@ class ROUTER_etf(Container):
EtfHistorical
-------------
date : date
date : Union[date, datetime]
The date of the data.
open : float
The open price.
@@ -265,6 +268,7 @@ class ROUTER_etf(Container):
)
)
@exception_handler
@validate
def holdings(
self,
@@ -497,6 +501,7 @@ class ROUTER_etf(Container):
)
)
@exception_handler
@validate
def holdings_date(
self,
@@ -561,6 +566,7 @@ class ROUTER_etf(Container):
)
)
@exception_handler
@validate
def holdings_performance(
self,
@@ -655,6 +661,7 @@ class ROUTER_etf(Container):
)
)
@exception_handler
@validate
def info(
self,
@@ -815,6 +822,7 @@ class ROUTER_etf(Container):
)
)
@exception_handler
@validate
def price_performance(
self,
@@ -909,6 +917,7 @@ class ROUTER_etf(Container):
)
)
@exception_handler
@validate
def search(
self,
@@ -923,68 +932,68 @@ class ROUTER_etf(Container):
An empty query returns the full list of ETFs from the provider.
Parameters
----------
query : Optional[str]
Search query.
Parameters
----------
query : Optional[str]
Search query.
provider : Optional[Literal['fmp']]
The provider to use for the query, by default None.
If None, the provider specified in defaults is selected or 'fmp' if there is
no default.
exchange : Optional[Literal['AMEX', 'NYSE', 'NASDAQ', 'ETF', 'TSX', 'EURONEXT']]
The exchange code the ETF trades on. (provider: fmp)
is_active : Optional[Literal[True, False]]
Whether the ETF is actively trading. (provider: fmp)
Returns
-------
OBBject
results : List[EtfSearch]
Serializable results.
provider : Optional[Literal['fmp']]
The provider to use for the query, by default None.
If None, the provider specified in defaults is selected or 'fmp' if there is
no default.
exchange : Optional[Literal['AMEX', 'NYSE', 'NASDAQ', 'ETF', 'TSX', 'EURONEXT']]
The exchange code the ETF trades on. (provider: fmp)
is_active : Optional[Literal[True, False]]
Whether the ETF is actively trading. (provider: fmp)
Provider name.
warnings : Optional[List[Warning_]]
List of warnings.
chart : Optional[Chart]
Chart object.
extra: Dict[str, Any]
Extra info.
Returns
-------
OBBject
results : List[EtfSearch]
Serializable results.
provider : Optional[Literal['fmp']]
Provider name.
warnings : Optional[List[Warning_]]
List of warnings.
chart : Optional[Chart]
Chart object.
extra: Dict[str, Any]
Extra info.
EtfSearch
---------
symbol : str
Symbol representing the entity requested in the data.(ETF)
name : Optional[str]
Name of the ETF.
market_cap : Optional[float]
The market cap of the ETF. (provider: fmp)
sector : Optional[str]
The sector of the ETF. (provider: fmp)
industry : Optional[str]
The industry of the ETF. (provider: fmp)
beta : Optional[float]
The beta of the ETF. (provider: fmp)
price : Optional[float]
The current price of the ETF. (provider: fmp)
last_annual_dividend : Optional[float]
The last annual dividend paid. (provider: fmp)
volume : Optional[float]
The current trading volume of the ETF. (provider: fmp)
exchange : Optional[str]
The exchange code the ETF trades on. (provider: fmp)
exchange_name : Optional[str]
The full name of the exchange the ETF trades on. (provider: fmp)
country : Optional[str]
The country the ETF is registered in. (provider: fmp)
actively_trading : Optional[Literal[True, False]]
Whether the ETF is actively trading. (provider: fmp)
EtfSearch
---------
symbol : str
Symbol representing the entity requested in the data.(ETF)
name : Optional[str]
Name of the ETF.
market_cap : Optional[float]
The market cap of the ETF. (provider: fmp)
sector : Optional[str]
The sector of the ETF. (provider: fmp)
industry : Optional[str]
The industry of the ETF. (provider: fmp)
beta : Optional[float]
The beta of the ETF. (provider: fmp)
price : Optional[float]
The current price of the ETF. (provider: fmp)
last_annual_dividend : Optional[float]
The last annual dividend paid. (provider: fmp)
volume : Optional[float]
The current trading volume of the ETF. (provider: fmp)
exchange : Optional[str]
The exchange code the ETF trades on. (provider: fmp)
exchange_name : Optional[str]
The full name of the exchange the ETF trades on. (provider: fmp)
country : Optional[str]
The country the ETF is registered in. (provider: fmp)
actively_trading : Optional[Literal[True, False]]
Whether the ETF is actively trading. (provider: fmp)
Example
-------
>>> from openbb import obb
>>> ### An empty query returns the full list of ETFs from the provider. ###
>>> obb.etf.search("", provider="fmp")
>>> #### The query will return results from text-based fields containing the term. ####obb.etf.search("commercial real estate", provider="fmp")
Example
-------
>>> from openbb import obb
>>> ### An empty query returns the full list of ETFs from the provider. ###
>>> obb.etf.search("", provider="fmp")
>>> #### The query will return results from text-based fields containing the term. ####obb.etf.search("commercial real estate", provider="fmp")
""" # noqa: E501
return self._run(
@@ -1004,6 +1013,7 @@ class ROUTER_etf(Container):
)
)
@exception_handler
@validate
def sectors(
self,

View File

@@ -6,7 +6,7 @@ from typing import Literal, Optional, Union
from openbb_core.app.model.custom_parameter import OpenBBCustomParameter
from openbb_core.app.model.obbject import OBBject
from openbb_core.app.static.container import Container
from openbb_core.app.static.utils.decorators import validate
from openbb_core.app.static.utils.decorators import exception_handler, validate
from openbb_core.app.static.utils.filters import filter_inputs
from typing_extensions import Annotated
@@ -50,6 +50,7 @@ class ROUTER_fixedincome(Container):
command_runner=self._command_runner
)
@exception_handler
@validate
def sofr(
self,
@@ -74,44 +75,44 @@ class ROUTER_fixedincome(Container):
borrowing cash overnight collateralizing by Treasury securities.
Parameters
----------
start_date : Union[datetime.date, None, str]
Start date of the data, in YYYY-MM-DD format.
end_date : Union[datetime.date, None, str]
End date of the data, in YYYY-MM-DD format.
Parameters
----------
start_date : Union[datetime.date, None, str]
Start date of the data, in YYYY-MM-DD format.
end_date : Union[datetime.date, None, str]
End date of the data, in YYYY-MM-DD format.
provider : Optional[Literal['fred']]
The provider to use for the query, by default None.
If None, the provider specified in defaults is selected or 'fred' if there is
no default.
period : Literal['overnight', '30_day', '90_day', '180_day', 'index']
Period of SOFR rate. (provider: fred)
Returns
-------
OBBject
results : List[SOFR]
Serializable results.
provider : Optional[Literal['fred']]
The provider to use for the query, by default None.
If None, the provider specified in defaults is selected or 'fred' if there is
no default.
period : Literal['overnight', '30_day', '90_day', '180_day', 'index']
Period of SOFR rate. (provider: fred)
Provider name.
warnings : Optional[List[Warning_]]
List of warnings.
chart : Optional[Chart]
Chart object.
extra: Dict[str, Any]
Extra info.
Returns
-------
OBBject
results : List[SOFR]
Serializable results.
provider : Optional[Literal['fred']]
Provider name.
warnings : Optional[List[Warning_]]
List of warnings.
chart : Optional[Chart]
Chart object.
extra: Dict[str, Any]
Extra info.
SOFR
----
date : date
The date of the data.
rate : Optional[float]
SOFR rate.
SOFR
----
date : date
The date of the data.
rate : Optional[float]
SOFR rate.
Example
-------
>>> from openbb import obb
>>> obb.fixedincome.fixedincome.sofr(period="overnight")
Example
-------
>>> from openbb import obb
>>> obb.fixedincome.fixedincome.sofr(period="overnight")
""" # noqa: E501
return self._run(

View File

@@ -6,7 +6,7 @@ from typing import List, Literal, Optional, Union
from openbb_core.app.model.custom_parameter import OpenBBCustomParameter
from openbb_core.app.model.obbject import OBBject
from openbb_core.app.static.container import Container
from openbb_core.app.static.utils.decorators import validate
from openbb_core.app.static.utils.decorators import exception_handler, validate
from openbb_core.app.static.utils.filters import filter_inputs
from typing_extensions import Annotated
@@ -23,6 +23,7 @@ class ROUTER_fixedincome_corporate(Container):
def __repr__(self) -> str:
return self.__doc__ or ""
@exception_handler
@validate
def commercial_paper(
self,
@@ -60,48 +61,48 @@ class ROUTER_fixedincome_corporate(Container):
and many find it to be a lower-cost alternative to bank loans.
Parameters
----------
start_date : Union[datetime.date, None, str]
Start date of the data, in YYYY-MM-DD format.
end_date : Union[datetime.date, None, str]
End date of the data, in YYYY-MM-DD format.
maturity : Literal['overnight', '7d', '15d', '30d', '60d', '90d']
The maturity.
category : Literal['asset_backed', 'financial', 'nonfinancial']
The category.
grade : Literal['aa', 'a2_p2']
The grade.
Parameters
----------
start_date : Union[datetime.date, None, str]
Start date of the data, in YYYY-MM-DD format.
end_date : Union[datetime.date, None, str]
End date of the data, in YYYY-MM-DD format.
maturity : Literal['overnight', '7d', '15d', '30d', '60d', '90d']
The maturity.
category : Literal['asset_backed', 'financial', 'nonfinancial']
The category.
grade : Literal['aa', 'a2_p2']
The grade.
provider : Optional[Literal['fred']]
The provider to use for the query, by default None.
If None, the provider specified in defaults is selected or 'fred' if there is
no default.
Returns
-------
OBBject
results : List[CommercialPaper]
Serializable results.
provider : Optional[Literal['fred']]
The provider to use for the query, by default None.
If None, the provider specified in defaults is selected or 'fred' if there is
no default.
Provider name.
warnings : Optional[List[Warning_]]
List of warnings.
chart : Optional[Chart]
Chart object.
extra: Dict[str, Any]
Extra info.
Returns
-------
OBBject
results : List[CommercialPaper]
Serializable results.
provider : Optional[Literal['fred']]
Provider name.
warnings : Optional[List[Warning_]]
List of warnings.
chart : Optional[Chart]
Chart object.
extra: Dict[str, Any]
Extra info.
CommercialPaper
---------------
date : date
The date of the data.
rate : Optional[float]
Commercial Paper Rate.
CommercialPaper
---------------
date : date
The date of the data.
rate : Optional[float]
Commercial Paper Rate.
Example
-------
>>> from openbb import obb
>>> obb.fixedincome.corporate.commercial_paper(maturity="15d")
Example
-------
>>> from openbb import obb
>>> obb.fixedincome.corporate.commercial_paper(maturity="15d")
""" # noqa: E501
return self._run(
@@ -125,6 +126,7 @@ class ROUTER_fixedincome_corporate(Container):
)
)
@exception_handler
@validate
def hqm(
self,
@@ -147,48 +149,48 @@ class ROUTER_fixedincome_corporate(Container):
that is the market-weighted average (MWA) quality of high quality bonds.
Parameters
----------
date : Union[datetime.date, None, str]
A specific date to get data for.
yield_curve : Literal['spot', 'par']
The yield curve type.
Parameters
----------
date : Union[datetime.date, None, str]
A specific date to get data for.
yield_curve : Literal['spot', 'par']
The yield curve type.
provider : Optional[Literal['fred']]
The provider to use for the query, by default None.
If None, the provider specified in defaults is selected or 'fred' if there is
no default.
Returns
-------
OBBject
results : List[HighQualityMarketCorporateBond]
Serializable results.
provider : Optional[Literal['fred']]
The provider to use for the query, by default None.
If None, the provider specified in defaults is selected or 'fred' if there is
no default.
Provider name.
warnings : Optional[List[Warning_]]
List of warnings.
chart : Optional[Chart]
Chart object.
extra: Dict[str, Any]
Extra info.
Returns
-------
OBBject
results : List[HighQualityMarketCorporateBond]
Serializable results.
provider : Optional[Literal['fred']]
Provider name.
warnings : Optional[List[Warning_]]
List of warnings.
chart : Optional[Chart]
Chart object.
extra: Dict[str, Any]
Extra info.
HighQualityMarketCorporateBond
------------------------------
date : date
The date of the data.
rate : Optional[float]
HighQualityMarketCorporateBond Rate.
maturity : str
Maturity.
yield_curve : Literal['spot', 'par']
The yield curve type.
series_id : Optional[str]
FRED series id. (provider: fred)
HighQualityMarketCorporateBond
------------------------------
date : date
The date of the data.
rate : Optional[float]
HighQualityMarketCorporateBond Rate.
maturity : str
Maturity.
yield_curve : Literal['spot', 'par']
The yield curve type.
series_id : Optional[str]
FRED series id. (provider: fred)
Example
-------
>>> from openbb import obb
>>> obb.fixedincome.corporate.hqm(yield_curve="par")
Example
-------
>>> from openbb import obb
>>> obb.fixedincome.corporate.hqm(yield_curve="par")
""" # noqa: E501
return self._run(
@@ -209,6 +211,7 @@ class ROUTER_fixedincome_corporate(Container):
)
)
@exception_handler
@validate
def ice_bofa(
self,
@@ -240,52 +243,52 @@ class ROUTER_fixedincome_corporate(Container):
outstanding of $250 million. The ICE BofA US Corporate Index is a component of the US Corporate Master Index.
Parameters
----------
start_date : Union[datetime.date, None, str]
Start date of the data, in YYYY-MM-DD format.
end_date : Union[datetime.date, None, str]
End date of the data, in YYYY-MM-DD format.
index_type : Literal['yield', 'yield_to_worst', 'total_return', 'spread']
The type of series.
Parameters
----------
start_date : Union[datetime.date, None, str]
Start date of the data, in YYYY-MM-DD format.
end_date : Union[datetime.date, None, str]
End date of the data, in YYYY-MM-DD format.
index_type : Literal['yield', 'yield_to_worst', 'total_return', 'spread']
The type of series.
provider : Optional[Literal['fred']]
The provider to use for the query, by default None.
If None, the provider specified in defaults is selected or 'fred' if there is
no default.
category : Literal['all', 'duration', 'eur', 'usd']
The type of category. (provider: fred)
area : Literal['asia', 'emea', 'eu', 'ex_g10', 'latin_america', 'us']
The type of area. (provider: fred)
grade : Literal['a', 'aa', 'aaa', 'b', 'bb', 'bbb', 'ccc', 'crossover', 'high_grade', 'high_yield', 'non_financial', 'non_sovereign', 'private_sector', 'public_sector']
The type of grade. (provider: fred)
options : bool
Whether to include options in the results. (provider: fred)
Returns
-------
OBBject
results : List[ICEBofA]
Serializable results.
provider : Optional[Literal['fred']]
The provider to use for the query, by default None.
If None, the provider specified in defaults is selected or 'fred' if there is
no default.
category : Literal['all', 'duration', 'eur', 'usd']
The type of category. (provider: fred)
area : Literal['asia', 'emea', 'eu', 'ex_g10', 'latin_america', 'us']
The type of area. (provider: fred)
grade : Literal['a', 'aa', 'aaa', 'b', 'bb', 'bbb', 'ccc', 'crossover', 'high_grade', 'high_yield', 'non_financial', 'non_sovereign', 'private_sector', 'public_sector']
The type of grade. (provider: fred)
options : bool
Whether to include options in the results. (provider: fred)
Provider name.
warnings : Optional[List[Warning_]]
List of warnings.
chart : Optional[Chart]
Chart object.
extra: Dict[str, Any]
Extra info.
Returns
-------
OBBject
results : List[ICEBofA]
Serializable results.
provider : Optional[Literal['fred']]
Provider name.
warnings : Optional[List[Warning_]]
List of warnings.
chart : Optional[Chart]
Chart object.
extra: Dict[str, Any]
Extra info.
ICEBofA
-------
date : date
The date of the data.
rate : Optional[float]
ICE BofA US Corporate Bond Indices Rate.
ICEBofA
-------
date : date
The date of the data.
rate : Optional[float]
ICE BofA US Corporate Bond Indices Rate.
Example
-------
>>> from openbb import obb
>>> obb.fixedincome.corporate.ice_bofa(index_type="yield_to_worst")
Example
-------
>>> from openbb import obb
>>> obb.fixedincome.corporate.ice_bofa(index_type="yield_to_worst")
""" # noqa: E501
return self._run(
@@ -307,6 +310,7 @@ class ROUTER_fixedincome_corporate(Container):
)
)
@exception_handler
@validate
def moody(
self,
@@ -337,46 +341,46 @@ class ROUTER_fixedincome_corporate(Container):
Treasury Bill as an indicator of the interest rate.
Parameters
----------
start_date : Union[datetime.date, None, str]
Start date of the data, in YYYY-MM-DD format.
end_date : Union[datetime.date, None, str]
End date of the data, in YYYY-MM-DD format.
index_type : Literal['aaa', 'baa']
The type of series.
Parameters
----------
start_date : Union[datetime.date, None, str]
Start date of the data, in YYYY-MM-DD format.
end_date : Union[datetime.date, None, str]
End date of the data, in YYYY-MM-DD format.
index_type : Literal['aaa', 'baa']
The type of series.
provider : Optional[Literal['fred']]
The provider to use for the query, by default None.
If None, the provider specified in defaults is selected or 'fred' if there is
no default.
spread : Optional[Literal['treasury', 'fed_funds']]
The type of spread. (provider: fred)
Returns
-------
OBBject
results : List[MoodyCorporateBondIndex]
Serializable results.
provider : Optional[Literal['fred']]
The provider to use for the query, by default None.
If None, the provider specified in defaults is selected or 'fred' if there is
no default.
spread : Optional[Literal['treasury', 'fed_funds']]
The type of spread. (provider: fred)
Provider name.
warnings : Optional[List[Warning_]]
List of warnings.
chart : Optional[Chart]
Chart object.
extra: Dict[str, Any]
Extra info.
Returns
-------
OBBject
results : List[MoodyCorporateBondIndex]
Serializable results.
provider : Optional[Literal['fred']]
Provider name.
warnings : Optional[List[Warning_]]
List of warnings.
chart : Optional[Chart]
Chart object.
extra: Dict[str, Any]
Extra info.
MoodyCorporateBondIndex
-----------------------
date : date
The date of the data.
rate : Optional[float]
Moody Corporate Bond Index Rate.
MoodyCorporateBondIndex
-----------------------
date : date
The date of the data.
rate : Optional[float]
Moody Corporate Bond Index Rate.
Example
-------
>>> from openbb import obb
>>> obb.fixedincome.corporate.moody(index_type="baa")
Example
-------
>>> from openbb import obb
>>> obb.fixedincome.corporate.moody(index_type="baa")
""" # noqa: E501
return self._run(
@@ -398,6 +402,7 @@ class ROUTER_fixedincome_corporate(Container):
)
)
@exception_handler
@validate
def spot_rates(
self,
@@ -431,46 +436,46 @@ class ROUTER_fixedincome_corporate(Container):
concept for discounting a pension liability at the same maturity.
Parameters
----------
start_date : Union[datetime.date, None, str]
Start date of the data, in YYYY-MM-DD format.
end_date : Union[datetime.date, None, str]
End date of the data, in YYYY-MM-DD format.
maturity : List[float]
The maturities in years.
category : List[Literal['par_yield', 'spot_rate']]
The category.
Parameters
----------
start_date : Union[datetime.date, None, str]
Start date of the data, in YYYY-MM-DD format.
end_date : Union[datetime.date, None, str]
End date of the data, in YYYY-MM-DD format.
maturity : List[float]
The maturities in years.
category : List[Literal['par_yield', 'spot_rate']]
The category.
provider : Optional[Literal['fred']]
The provider to use for the query, by default None.
If None, the provider specified in defaults is selected or 'fred' if there is
no default.
Returns
-------
OBBject
results : List[SpotRate]
Serializable results.
provider : Optional[Literal['fred']]
The provider to use for the query, by default None.
If None, the provider specified in defaults is selected or 'fred' if there is
no default.
Provider name.
warnings : Optional[List[Warning_]]
List of warnings.
chart : Optional[Chart]
Chart object.
extra: Dict[str, Any]
Extra info.
Returns
-------
OBBject
results : List[SpotRate]
Serializable results.
provider : Optional[Literal['fred']]
Provider name.
warnings : Optional[List[Warning_]]
List of warnings.
chart : Optional[Chart]
Chart object.
extra: Dict[str, Any]
Extra info.
SpotRate
--------
date : date
The date of the data.
rate : Optional[float]
Spot Rate.
SpotRate
--------
date : date
The date of the data.
rate : Optional[float]
Spot Rate.
Example
-------
>>> from openbb import obb
>>> obb.fixedincome.corporate.spot_rates(maturity=[10,20,30,50])
Example
-------
>>> from openbb import obb
>>> obb.fixedincome.corporate.spot_rates(maturity=[10,20,30,50])
""" # noqa: E501
return self._run(

View File

@@ -6,7 +6,7 @@ from typing import Literal, Optional, Union
from openbb_core.app.model.custom_parameter import OpenBBCustomParameter
from openbb_core.app.model.obbject import OBBject
from openbb_core.app.static.container import Container
from openbb_core.app.static.utils.decorators import validate
from openbb_core.app.static.utils.decorators import exception_handler, validate
from openbb_core.app.static.utils.filters import filter_inputs
from typing_extensions import Annotated
@@ -20,6 +20,7 @@ class ROUTER_fixedincome_government(Container):
def __repr__(self) -> str:
return self.__doc__ or ""
@exception_handler
@validate
def treasury_rates(
self,
@@ -120,6 +121,7 @@ class ROUTER_fixedincome_government(Container):
)
)
@exception_handler
@validate
def us_yield_curve(
self,

View File

@@ -6,7 +6,7 @@ from typing import Literal, Optional, Union
from openbb_core.app.model.custom_parameter import OpenBBCustomParameter
from openbb_core.app.model.obbject import OBBject
from openbb_core.app.static.container import Container
from openbb_core.app.static.utils.decorators import validate
from openbb_core.app.static.utils.decorators import exception_handler, validate
from openbb_core.app.static.utils.filters import filter_inputs
from typing_extensions import Annotated
@@ -26,6 +26,7 @@ class ROUTER_fixedincome_rate(Container):
def __repr__(self) -> str:
return self.__doc__ or ""
@exception_handler
@validate
def ameribor(
self,
@@ -51,44 +52,44 @@ class ROUTER_fixedincome_rate(Container):
American Financial Exchange (AFX).
Parameters
----------
start_date : Union[datetime.date, None, str]
Start date of the data, in YYYY-MM-DD format.
end_date : Union[datetime.date, None, str]
End date of the data, in YYYY-MM-DD format.
Parameters
----------
start_date : Union[datetime.date, None, str]
Start date of the data, in YYYY-MM-DD format.
end_date : Union[datetime.date, None, str]
End date of the data, in YYYY-MM-DD format.
provider : Optional[Literal['fred']]
The provider to use for the query, by default None.
If None, the provider specified in defaults is selected or 'fred' if there is
no default.
parameter : Literal['overnight', 'term_30', 'term_90', '1_week_term_structure', '1_month_term_structure', '3_month_term_structure', '6_month_term_structure', '1_year_term_structure', '2_year_term_structure', '30_day_ma', '90_day_ma']
Period of AMERIBOR rate. (provider: fred)
Returns
-------
OBBject
results : List[AMERIBOR]
Serializable results.
provider : Optional[Literal['fred']]
The provider to use for the query, by default None.
If None, the provider specified in defaults is selected or 'fred' if there is
no default.
parameter : Literal['overnight', 'term_30', 'term_90', '1_week_term_structure', '1_month_term_structure', '3_month_term_structure', '6_month_term_structure', '1_year_term_structure', '2_year_term_structure', '30_day_ma', '90_day_ma']
Period of AMERIBOR rate. (provider: fred)
Provider name.
warnings : Optional[List[Warning_]]
List of warnings.
chart : Optional[Chart]
Chart object.
extra: Dict[str, Any]
Extra info.
Returns
-------
OBBject
results : List[AMERIBOR]
Serializable results.
provider : Optional[Literal['fred']]
Provider name.
warnings : Optional[List[Warning_]]
List of warnings.
chart : Optional[Chart]
Chart object.
extra: Dict[str, Any]
Extra info.
AMERIBOR
--------
date : date
The date of the data.
rate : Optional[float]
AMERIBOR rate.
AMERIBOR
--------
date : date
The date of the data.
rate : Optional[float]
AMERIBOR rate.
Example
-------
>>> from openbb import obb
>>> obb.fixedincome.rate.ameribor(parameter="30_day_ma").to_df()
Example
-------
>>> from openbb import obb
>>> obb.fixedincome.rate.ameribor(parameter="30_day_ma").to_df()
""" # noqa: E501
return self._run(
@@ -109,6 +110,7 @@ class ROUTER_fixedincome_rate(Container):
)
)
@exception_handler
@validate
def dpcredit(
self,
@@ -135,44 +137,44 @@ class ROUTER_fixedincome_rate(Container):
also known as the discount rate.
Parameters
----------
start_date : Union[datetime.date, None, str]
Start date of the data, in YYYY-MM-DD format.
end_date : Union[datetime.date, None, str]
End date of the data, in YYYY-MM-DD format.
Parameters
----------
start_date : Union[datetime.date, None, str]
Start date of the data, in YYYY-MM-DD format.
end_date : Union[datetime.date, None, str]
End date of the data, in YYYY-MM-DD format.
provider : Optional[Literal['fred']]
The provider to use for the query, by default None.
If None, the provider specified in defaults is selected or 'fred' if there is
no default.
parameter : Literal['daily_excl_weekend', 'monthly', 'weekly', 'daily', 'annual']
FRED series ID of DWPCR data. (provider: fred)
Returns
-------
OBBject
results : List[DiscountWindowPrimaryCreditRate]
Serializable results.
provider : Optional[Literal['fred']]
The provider to use for the query, by default None.
If None, the provider specified in defaults is selected or 'fred' if there is
no default.
parameter : Literal['daily_excl_weekend', 'monthly', 'weekly', 'daily', 'annual']
FRED series ID of DWPCR data. (provider: fred)
Provider name.
warnings : Optional[List[Warning_]]
List of warnings.
chart : Optional[Chart]
Chart object.
extra: Dict[str, Any]
Extra info.
Returns
-------
OBBject
results : List[DiscountWindowPrimaryCreditRate]
Serializable results.
provider : Optional[Literal['fred']]
Provider name.
warnings : Optional[List[Warning_]]
List of warnings.
chart : Optional[Chart]
Chart object.
extra: Dict[str, Any]
Extra info.
DiscountWindowPrimaryCreditRate
-------------------------------
date : date
The date of the data.
rate : Optional[float]
Discount Window Primary Credit Rate.
DiscountWindowPrimaryCreditRate
-------------------------------
date : date
The date of the data.
rate : Optional[float]
Discount Window Primary Credit Rate.
Example
-------
>>> from openbb import obb
>>> obb.fixedincome.rate.dpcredit(start_date="2023-02-01", end_date="2023-05-01").to_df()
Example
-------
>>> from openbb import obb
>>> obb.fixedincome.rate.dpcredit(start_date="2023-02-01", end_date="2023-05-01").to_df()
""" # noqa: E501
return self._run(
@@ -193,6 +195,7 @@ class ROUTER_fixedincome_rate(Container):
)
)
@exception_handler
@validate
def ecb(
self,
@@ -225,44 +228,44 @@ class ROUTER_fixedincome_rate(Container):
- The rate on the marginal lending facility, which offers overnight credit to banks from the Eurosystem.
Parameters
----------
start_date : Union[datetime.date, None, str]
Start date of the data, in YYYY-MM-DD format.
end_date : Union[datetime.date, None, str]
End date of the data, in YYYY-MM-DD format.
interest_rate_type : Literal['deposit', 'lending', 'refinancing']
The type of interest rate.
Parameters
----------
start_date : Union[datetime.date, None, str]
Start date of the data, in YYYY-MM-DD format.
end_date : Union[datetime.date, None, str]
End date of the data, in YYYY-MM-DD format.
interest_rate_type : Literal['deposit', 'lending', 'refinancing']
The type of interest rate.
provider : Optional[Literal['fred']]
The provider to use for the query, by default None.
If None, the provider specified in defaults is selected or 'fred' if there is
no default.
Returns
-------
OBBject
results : List[EuropeanCentralBankInterestRates]
Serializable results.
provider : Optional[Literal['fred']]
The provider to use for the query, by default None.
If None, the provider specified in defaults is selected or 'fred' if there is
no default.
Provider name.
warnings : Optional[List[Warning_]]
List of warnings.
chart : Optional[Chart]
Chart object.
extra: Dict[str, Any]
Extra info.
Returns
-------
OBBject
results : List[EuropeanCentralBankInterestRates]
Serializable results.
provider : Optional[Literal['fred']]
Provider name.
warnings : Optional[List[Warning_]]
List of warnings.
chart : Optional[Chart]
Chart object.
extra: Dict[str, Any]
Extra info.
EuropeanCentralBankInterestRates
--------------------------------
date : date
The date of the data.
rate : Optional[float]
European Central Bank Interest Rate.
EuropeanCentralBankInterestRates
--------------------------------
date : date
The date of the data.
rate : Optional[float]
European Central Bank Interest Rate.
Example
-------
>>> from openbb import obb
>>> obb.fixedincome.rate.ecb(interest_rate_type="refinancing")
Example
-------
>>> from openbb import obb
>>> obb.fixedincome.rate.ecb(interest_rate_type="refinancing")
""" # noqa: E501
return self._run(
@@ -284,6 +287,7 @@ class ROUTER_fixedincome_rate(Container):
)
)
@exception_handler
@validate
def effr(
self,
@@ -309,44 +313,44 @@ class ROUTER_fixedincome_rate(Container):
United States, the Federal Reserve System's Board of Governors set the bank rate, also known as the discount rate.
Parameters
----------
start_date : Union[datetime.date, None, str]
Start date of the data, in YYYY-MM-DD format.
end_date : Union[datetime.date, None, str]
End date of the data, in YYYY-MM-DD format.
Parameters
----------
start_date : Union[datetime.date, None, str]
Start date of the data, in YYYY-MM-DD format.
end_date : Union[datetime.date, None, str]
End date of the data, in YYYY-MM-DD format.
provider : Optional[Literal['federal_reserve', 'fred']]
The provider to use for the query, by default None.
If None, the provider specified in defaults is selected or 'federal_reserve' if there is
no default.
parameter : Literal['monthly', 'daily', 'weekly', 'daily_excl_weekend', 'annual', 'biweekly', 'volume']
Period of FED rate. (provider: fred)
Returns
-------
OBBject
results : List[FEDFUNDS]
Serializable results.
provider : Optional[Literal['federal_reserve', 'fred']]
The provider to use for the query, by default None.
If None, the provider specified in defaults is selected or 'federal_reserve' if there is
no default.
parameter : Literal['monthly', 'daily', 'weekly', 'daily_excl_weekend', 'annual', 'biweekly', 'volume']
Period of FED rate. (provider: fred)
Provider name.
warnings : Optional[List[Warning_]]
List of warnings.
chart : Optional[Chart]
Chart object.
extra: Dict[str, Any]
Extra info.
Returns
-------
OBBject
results : List[FEDFUNDS]
Serializable results.
provider : Optional[Literal['federal_reserve', 'fred']]
Provider name.
warnings : Optional[List[Warning_]]
List of warnings.
chart : Optional[Chart]
Chart object.
extra: Dict[str, Any]
Extra info.
FEDFUNDS
--------
date : date
The date of the data.
rate : Optional[float]
FED rate.
FEDFUNDS
--------
date : date
The date of the data.
rate : Optional[float]
FED rate.
Example
-------
>>> from openbb import obb
>>> obb.fixedincome.rate.effr(parameter="daily", provider="fred").to_df()
Example
-------
>>> from openbb import obb
>>> obb.fixedincome.rate.effr(parameter="daily", provider="fred").to_df()
""" # noqa: E501
return self._run(
@@ -367,6 +371,7 @@ class ROUTER_fixedincome_rate(Container):
)
)
@exception_handler
@validate
def effr_forecast(
self, provider: Optional[Literal["fred"]] = None, **kwargs
@@ -379,52 +384,52 @@ class ROUTER_fixedincome_rate(Container):
calendar year or over the longer run.
Parameters
----------
Parameters
----------
provider : Optional[Literal['fred']]
The provider to use for the query, by default None.
If None, the provider specified in defaults is selected or 'fred' if there is
no default.
long_run : bool
Flag to show long run projections (provider: fred)
Returns
-------
OBBject
results : List[PROJECTIONS]
Serializable results.
provider : Optional[Literal['fred']]
The provider to use for the query, by default None.
If None, the provider specified in defaults is selected or 'fred' if there is
no default.
long_run : bool
Flag to show long run projections (provider: fred)
Provider name.
warnings : Optional[List[Warning_]]
List of warnings.
chart : Optional[Chart]
Chart object.
extra: Dict[str, Any]
Extra info.
Returns
-------
OBBject
results : List[PROJECTIONS]
Serializable results.
provider : Optional[Literal['fred']]
Provider name.
warnings : Optional[List[Warning_]]
List of warnings.
chart : Optional[Chart]
Chart object.
extra: Dict[str, Any]
Extra info.
PROJECTIONS
-----------
date : date
The date of the data.
range_high : Optional[float]
High projection of rates.
central_tendency_high : Optional[float]
Central tendency of high projection of rates.
median : Optional[float]
Median projection of rates.
range_midpoint : Optional[float]
Midpoint projection of rates.
central_tendency_midpoint : Optional[float]
Central tendency of midpoint projection of rates.
range_low : Optional[float]
Low projection of rates.
central_tendency_low : Optional[float]
Central tendency of low projection of rates.
PROJECTIONS
-----------
date : date
The date of the data.
range_high : Optional[float]
High projection of rates.
central_tendency_high : Optional[float]
Central tendency of high projection of rates.
median : Optional[float]
Median projection of rates.
range_midpoint : Optional[float]
Midpoint projection of rates.
central_tendency_midpoint : Optional[float]
Central tendency of midpoint projection of rates.
range_low : Optional[float]
Low projection of rates.
central_tendency_low : Optional[float]
Central tendency of low projection of rates.
Example
-------
>>> from openbb import obb
>>> obb.fixedincome.rate.effr_forecast(long_run=True)
Example
-------
>>> from openbb import obb
>>> obb.fixedincome.rate.effr_forecast(long_run=True)
""" # noqa: E501
return self._run(
@@ -442,6 +447,7 @@ class ROUTER_fixedincome_rate(Container):
)
)
@exception_handler
@validate
def estr(
self,
@@ -468,44 +474,44 @@ class ROUTER_fixedincome_rate(Container):
executed at arm’s length and thus reflect market rates in an unbiased way.
Parameters
----------
start_date : Union[datetime.date, None, str]
Start date of the data, in YYYY-MM-DD format.
end_date : Union[datetime.date, None, str]
End date of the data, in YYYY-MM-DD format.
Parameters
----------
start_date : Union[datetime.date, None, str]
Start date of the data, in YYYY-MM-DD format.
end_date : Union[datetime.date, None, str]
End date of the data, in YYYY-MM-DD format.
provider : Optional[Literal['fred']]
The provider to use for the query, by default None.
If None, the provider specified in defaults is selected or 'fred' if there is
no default.
parameter : Literal['volume_weighted_trimmed_mean_rate', 'number_of_transactions', 'number_of_active_banks', 'total_volume', 'share_of_volume_of_the_5_largest_active_banks', 'rate_at_75th_percentile_of_volume', 'rate_at_25th_percentile_of_volume']
Period of ESTR rate. (provider: fred)
Returns
-------
OBBject
results : List[ESTR]
Serializable results.
provider : Optional[Literal['fred']]
The provider to use for the query, by default None.
If None, the provider specified in defaults is selected or 'fred' if there is
no default.
parameter : Literal['volume_weighted_trimmed_mean_rate', 'number_of_transactions', 'number_of_active_banks', 'total_volume', 'share_of_volume_of_the_5_largest_active_banks', 'rate_at_75th_percentile_of_volume', 'rate_at_25th_percentile_of_volume']
Period of ESTR rate. (provider: fred)
Provider name.
warnings : Optional[List[Warning_]]
List of warnings.
chart : Optional[Chart]
Chart object.
extra: Dict[str, Any]
Extra info.
Returns
-------
OBBject
results : List[ESTR]
Serializable results.
provider : Optional[Literal['fred']]
Provider name.
warnings : Optional[List[Warning_]]
List of warnings.
chart : Optional[Chart]
Chart object.
extra: Dict[str, Any]
Extra info.
ESTR
----
date : date
The date of the data.
rate : Optional[float]
ESTR rate.
ESTR
----
date : date
The date of the data.
rate : Optional[float]
ESTR rate.
Example
-------
>>> from openbb import obb
>>> obb.fixedincome.rate.estr(parameter="number_of_active_banks")
Example
-------
>>> from openbb import obb
>>> obb.fixedincome.rate.estr(parameter="number_of_active_banks")
""" # noqa: E501
return self._run(
@@ -526,6 +532,7 @@ class ROUTER_fixedincome_rate(Container):
)
)
@exception_handler
@validate
def iorb(
self,
@@ -551,42 +558,42 @@ class ROUTER_fixedincome_rate(Container):
United States, the Federal Reserve System's Board of Governors set the bank rate, also known as the discount rate.
Parameters
----------
start_date : Union[datetime.date, None, str]
Start date of the data, in YYYY-MM-DD format.
end_date : Union[datetime.date, None, str]
End date of the data, in YYYY-MM-DD format.
Parameters
----------
start_date : Union[datetime.date, None, str]
Start date of the data, in YYYY-MM-DD format.
end_date : Union[datetime.date, None, str]
End date of the data, in YYYY-MM-DD format.
provider : Optional[Literal['fred']]
The provider to use for the query, by default None.
If None, the provider specified in defaults is selected or 'fred' if there is
no default.
Returns
-------
OBBject
results : List[IORB]
Serializable results.
provider : Optional[Literal['fred']]
The provider to use for the query, by default None.
If None, the provider specified in defaults is selected or 'fred' if there is
no default.
Provider name.
warnings : Optional[List[Warning_]]
List of warnings.
chart : Optional[Chart]
Chart object.
extra: Dict[str, Any]
Extra info.
Returns
-------
OBBject
results : List[IORB]
Serializable results.
provider : Optional[Literal['fred']]
Provider name.
warnings : Optional[List[Warning_]]
List of warnings.
chart : Optional[Chart]
Chart object.
extra: Dict[str, Any]
Extra info.
IORB
----
date : date
The date of the data.
rate : Optional[float]
IORB rate.
IORB
----
date : date
The date of the data.
rate : Optional[float]
IORB rate.
Example
-------
>>> from openbb import obb
>>> obb.fixedincome.rate.iorb()
Example
-------
>>> from openbb import obb
>>> obb.fixedincome.rate.iorb()
""" # noqa: E501
return self._run(
@@ -607,6 +614,7 @@ class ROUTER_fixedincome_rate(Container):
)
)
@exception_handler
@validate
def sonia(
self,
@@ -632,44 +640,44 @@ class ROUTER_fixedincome_rate(Container):
financial institutions and other institutional investors.
Parameters
----------
start_date : Union[datetime.date, None, str]
Start date of the data, in YYYY-MM-DD format.
end_date : Union[datetime.date, None, str]
End date of the data, in YYYY-MM-DD format.
Parameters
----------
start_date : Union[datetime.date, None, str]
Start date of the data, in YYYY-MM-DD format.
end_date : Union[datetime.date, None, str]
End date of the data, in YYYY-MM-DD format.
provider : Optional[Literal['fred']]
The provider to use for the query, by default None.
If None, the provider specified in defaults is selected or 'fred' if there is
no default.
parameter : Literal['rate', 'index', '10th_percentile', '25th_percentile', '75th_percentile', '90th_percentile', 'total_nominal_value']
Period of SONIA rate. (provider: fred)
Returns
-------
OBBject
results : List[SONIA]
Serializable results.
provider : Optional[Literal['fred']]
The provider to use for the query, by default None.
If None, the provider specified in defaults is selected or 'fred' if there is
no default.
parameter : Literal['rate', 'index', '10th_percentile', '25th_percentile', '75th_percentile', '90th_percentile', 'total_nominal_value']
Period of SONIA rate. (provider: fred)
Provider name.
warnings : Optional[List[Warning_]]
List of warnings.
chart : Optional[Chart]
Chart object.
extra: Dict[str, Any]
Extra info.
Returns
-------
OBBject
results : List[SONIA]
Serializable results.
provider : Optional[Literal['fred']]
Provider name.
warnings : Optional[List[Warning_]]
List of warnings.
chart : Optional[Chart]
Chart object.
extra: Dict[str, Any]
Extra info.
SONIA
-----
date : date
The date of the data.
rate : Optional[float]
SONIA rate.
SONIA
-----
date : date
The date of the data.
rate : Optional[float]
SONIA rate.
Example
-------
>>> from openbb import obb
>>> obb.fixedincome.rate.sonia(parameter="total_nominal_value")
Example
-------
>>> from openbb import obb
>>> obb.fixedincome.rate.sonia(parameter="total_nominal_value")
""" # noqa: E501
return self._run(

View File

@@ -6,7 +6,7 @@ from typing import Literal, Optional, Union
from openbb_core.app.model.custom_parameter import OpenBBCustomParameter
from openbb_core.app.model.obbject import OBBject
from openbb_core.app.static.container import Container
from openbb_core.app.static.utils.decorators import validate
from openbb_core.app.static.utils.decorators import exception_handler, validate
from openbb_core.app.static.utils.filters import filter_inputs
from typing_extensions import Annotated
@@ -21,6 +21,7 @@ class ROUTER_fixedincome_spreads(Container):
def __repr__(self) -> str:
return self.__doc__ or ""
@exception_handler
@validate
def tcm(
self,
@@ -51,44 +52,44 @@ class ROUTER_fixedincome_spreads(Container):
yield curve which, in turn, is based on closing bid-yields of actively-traded Treasury securities.
Parameters
----------
start_date : Union[datetime.date, None, str]
Start date of the data, in YYYY-MM-DD format.
end_date : Union[datetime.date, None, str]
End date of the data, in YYYY-MM-DD format.
maturity : Optional[Literal['3m', '2y']]
The maturity
Parameters
----------
start_date : Union[datetime.date, None, str]
Start date of the data, in YYYY-MM-DD format.
end_date : Union[datetime.date, None, str]
End date of the data, in YYYY-MM-DD format.
maturity : Optional[Literal['3m', '2y']]
The maturity
provider : Optional[Literal['fred']]
The provider to use for the query, by default None.
If None, the provider specified in defaults is selected or 'fred' if there is
no default.
Returns
-------
OBBject
results : List[TreasuryConstantMaturity]
Serializable results.
provider : Optional[Literal['fred']]
The provider to use for the query, by default None.
If None, the provider specified in defaults is selected or 'fred' if there is
no default.
Provider name.
warnings : Optional[List[Warning_]]
List of warnings.
chart : Optional[Chart]
Chart object.
extra: Dict[str, Any]
Extra info.
Returns
-------
OBBject
results : List[TreasuryConstantMaturity]
Serializable results.
provider : Optional[Literal['fred']]
Provider name.
warnings : Optional[List[Warning_]]
List of warnings.
chart : Optional[Chart]
Chart object.
extra: Dict[str, Any]
Extra info.
TreasuryConstantMaturity
------------------------
date : date
The date of the data.
rate : Optional[float]
TreasuryConstantMaturity Rate.
TreasuryConstantMaturity
------------------------
date : date
The date of the data.
rate : Optional[float]
TreasuryConstantMaturity Rate.
Example
-------
>>> from openbb import obb
>>> obb.fixedincome.fixedincome.spreads.tcm(maturity="2y")
Example
-------
>>> from openbb import obb
>>> obb.fixedincome.fixedincome.spreads.tcm(maturity="2y")
""" # noqa: E501
return self._run(
@@ -110,6 +111,7 @@ class ROUTER_fixedincome_spreads(Container):
)
)
@exception_handler
@validate
def tcm_effr(
self,
@@ -140,44 +142,44 @@ class ROUTER_fixedincome_spreads(Container):
yield curve which, in turn, is based on closing bid-yields of actively-traded Treasury securities.
Parameters
----------
start_date : Union[datetime.date, None, str]
Start date of the data, in YYYY-MM-DD format.
end_date : Union[datetime.date, None, str]
End date of the data, in YYYY-MM-DD format.
maturity : Optional[Literal['10y', '5y', '1y', '6m', '3m']]
The maturity
Parameters
----------
start_date : Union[datetime.date, None, str]
Start date of the data, in YYYY-MM-DD format.
end_date : Union[datetime.date, None, str]
End date of the data, in YYYY-MM-DD format.
maturity : Optional[Literal['10y', '5y', '1y', '6m', '3m']]
The maturity
provider : Optional[Literal['fred']]
The provider to use for the query, by default None.
If None, the provider specified in defaults is selected or 'fred' if there is
no default.
Returns
-------
OBBject
results : List[SelectedTreasuryConstantMaturity]
Serializable results.
provider : Optional[Literal['fred']]
The provider to use for the query, by default None.
If None, the provider specified in defaults is selected or 'fred' if there is
no default.
Provider name.
warnings : Optional[List[Warning_]]
List of warnings.
chart : Optional[Chart]
Chart object.
extra: Dict[str, Any]
Extra info.
Returns
-------
OBBject
results : List[SelectedTreasuryConstantMaturity]
Serializable results.
provider : Optional[Literal['fred']]
Provider name.
warnings : Optional[List[Warning_]]
List of warnings.
chart : Optional[Chart]
Chart object.
extra: Dict[str, Any]
Extra info.
SelectedTreasuryConstantMaturity
--------------------------------
date : date
The date of the data.
rate : Optional[float]
Selected Treasury Constant Maturity Rate.
SelectedTreasuryConstantMaturity
--------------------------------
date : date
The date of the data.
rate : Optional[float]
Selected Treasury Constant Maturity Rate.
Example
-------
>>> from openbb import obb
>>> obb.fixedincome.fixedincome.spreads.tcm_effr(maturity="10y")
Example
-------
>>> from openbb import obb
>>> obb.fixedincome.fixedincome.spreads.tcm_effr(maturity="10y")
""" # noqa: E501
return self._run(
@@ -199,6 +201,7 @@ class ROUTER_fixedincome_spreads(Container):
)
)
@exception_handler
@validate
def treasury_effr(
self,
@@ -230,44 +233,44 @@ class ROUTER_fixedincome_spreads(Container):
yield curve which, in turn, is based on closing bid-yields of actively-traded Treasury securities.
Parameters
----------
start_date : Union[datetime.date, None, str]
Start date of the data, in YYYY-MM-DD format.
end_date : Union[datetime.date, None, str]
End date of the data, in YYYY-MM-DD format.
maturity : Optional[Literal['3m', '6m']]
The maturity
Parameters
----------
start_date : Union[datetime.date, None, str]
Start date of the data, in YYYY-MM-DD format.
end_date : Union[datetime.date, None, str]
End date of the data, in YYYY-MM-DD format.
maturity : Optional[Literal['3m', '6m']]
The maturity
provider : Optional[Literal['fred']]
The provider to use for the query, by default None.
If None, the provider specified in defaults is selected or 'fred' if there is
no default.
Returns
-------
OBBject
results : List[SelectedTreasuryBill]
Serializable results.
provider : Optional[Literal['fred']]
The provider to use for the query, by default None.
If None, the provider specified in defaults is selected or 'fred' if there is
no default.
Provider name.
warnings : Optional[List[Warning_]]
List of warnings.
chart : Optional[Chart]
Chart object.
extra: Dict[str, Any]
Extra info.
Returns
-------
OBBject
results : List[SelectedTreasuryBill]
Serializable results.
provider : Optional[Literal['fred']]
Provider name.
warnings : Optional[List[Warning_]]
List of warnings.
chart : Optional[Chart]
Chart object.
extra: Dict[str, Any]
Extra info.
SelectedTreasuryBill
--------------------
date : date
The date of the data.
rate : Optional[float]
SelectedTreasuryBill Rate.
SelectedTreasuryBill
--------------------
date : date
The date of the data.
rate : Optional[float]
SelectedTreasuryBill Rate.
Example
-------
>>> from openbb import obb
>>> obb.fixedincome.fixedincome.spreads.treasury_effr(maturity="6m")
Example
-------
>>> from openbb import obb
>>> obb.fixedincome.fixedincome.spreads.treasury_effr(maturity="6m")
""" # noqa: E501
return self._run(

View File

@@ -8,7 +8,7 @@ from openbb_core.app.deprecation import OpenBBDeprecationWarning
from openbb_core.app.model.custom_parameter import OpenBBCustomParameter
from openbb_core.app.model.obbject import OBBject
from openbb_core.app.static.container import Container
from openbb_core.app.static.utils.decorators import validate
from openbb_core.app.static.utils.decorators import exception_handler, validate
from openbb_core.app.static.utils.filters import filter_inputs
from typing_extensions import Annotated, deprecated
@@ -24,6 +24,7 @@ class ROUTER_index(Container):
def __repr__(self) -> str:
return self.__doc__ or ""
@exception_handler
@validate
def available(
self, provider: Optional[Literal["fmp", "yfinance"]] = None, **kwargs
@@ -87,6 +88,7 @@ class ROUTER_index(Container):
)
)
@exception_handler
@validate
def constituents(
self,
@@ -165,6 +167,7 @@ class ROUTER_index(Container):
)
)
@exception_handler
@validate
@deprecated(
"This endpoint is deprecated; use `/index/price/historical` instead. Deprecated in OpenBB Platform V4.1 to be removed in V4.3.",

View File

@@ -7,7 +7,7 @@ from annotated_types import Ge
from openbb_core.app.model.custom_parameter import OpenBBCustomParameter
from openbb_core.app.model.obbject import OBBject
from openbb_core.app.static.container import Container
from openbb_core.app.static.utils.decorators import validate
from openbb_core.app.static.utils.decorators import exception_handler, validate
from openbb_core.app.static.utils.filters import filter_inputs
from typing_extensions import Annotated
@@ -21,6 +21,7 @@ class ROUTER_news(Container):
def __repr__(self) -> str:
return self.__doc__ or ""
@exception_handler
@validate
def company(
self,
@@ -209,6 +210,7 @@ class ROUTER_news(Container):
)
)
@exception_handler
@validate
def world(
self,

View File

@@ -5,7 +5,7 @@ from typing import List, Literal, Optional, Union
from openbb_core.app.model.custom_parameter import OpenBBCustomParameter
from openbb_core.app.model.obbject import OBBject
from openbb_core.app.static.container import Container
from openbb_core.app.static.utils.decorators import validate
from openbb_core.app.static.utils.decorators import exception_handler, validate
from openbb_core.app.static.utils.filters import filter_inputs
from typing_extensions import Annotated
@@ -23,6 +23,7 @@ class ROUTER_regulators_sec(Container):
def __repr__(self) -> str:
return self.__doc__ or ""
@exception_handler
@validate
def cik_map(
self,
@@ -94,6 +95,7 @@ class ROUTER_regulators_sec(Container):
)
)
@exception_handler
@validate
def institutions_search(
self,
@@ -165,6 +167,7 @@ class ROUTER_regulators_sec(Container):
)
)
@exception_handler
@validate
def rss_litigation(
self, provider: Optional[Literal["sec"]] = None, **kwargs
@@ -226,6 +229,7 @@ class ROUTER_regulators_sec(Container):
)
)
@exception_handler
@validate
def schema_files(
self,
@@ -313,6 +317,7 @@ class ROUTER_regulators_sec(Container):
)
)
@exception_handler
@validate
def sic_search(
self,
@@ -386,6 +391,7 @@ class ROUTER_regulators_sec(Container):
)
)
@exception_handler
@validate
def symbol_map(
self,

View File

@@ -4,6 +4,7 @@ from datetime import datetime
from typing import Any, Dict, List, Optional
import requests
from openbb_core.app.model.abstract.error import OpenBBError
from openbb_core.provider.abstract.fetcher import Fetcher
from openbb_core.provider.standard_models.top_retail import (
TopRetailData,
@@ -49,8 +50,12 @@ class NasdaqTopRetailFetcher(
response = requests.get(
f"https://data.nasdaq.com/api/v3/datatables/NDAQ/RTAT10/?api_key={api_key}",
timeout=5,
).json()
return response["datatable"]["data"][: query.limit]
)
if response.status_code != 200:
reason = getattr(response, "reason", "Unknown")
raise OpenBBError(f"Failed to get data from Nasdaq -> {reason}")
content = response.json()
return content["datatable"]["data"][: query.limit]
@staticmethod
def transform_data(

View File

@@ -73,6 +73,20 @@ class YFinanceEquityHistoricalQueryParams(EquityHistoricalQueryParams):
class YFinanceEquityHistoricalData(EquityHistoricalData):
"""Yahoo Finance Equity Historical Price Data."""
__alias_dict__ = {
"split_ratio": "stock_splits",
"dividend": "dividends",
}
split_ratio: Optional[float] = Field(
default=None,
description="Ratio of the equity split, if a split occurred.",
)
dividend: Optional[float] = Field(
default=None,
description="Dividend amount (split-adjusted), if a dividend was paid.",
)
@field_validator("date", mode="before", check_fields=False)
def date_validate(cls, v): # pylint: disable=E0213
"""Return formatted datetime."""
@@ -164,6 +178,11 @@ class YFinanceEquityHistoricalFetcher(
if query.interval in ["1d", "1W", "1M", "3M"]:
data["date"] = data["date"].dt.strftime("%Y-%m-%d")
if "dividends" in data.columns and data.dividends.sum() == 0:
data.drop(columns=["dividends"], inplace=True)
if "stock_splits" in data.columns and all(data.stock_splits) == 0:
data.drop(columns=["stock_splits"], inplace=True)
return data.to_dict("records")
@staticmethod

View File

@@ -71,7 +71,6 @@ These packages are what will be installed when `pip install openbb` is run
| openbb-sec | [SEC](https://www.sec.gov/edgar/sec-api-documentation) data connector | pip install openbb-sec | None |
| openbb-tiingo | [Tiingo](https://www.tiingo.com/about/pricing) data connector | pip install openbb-tiingo | Free |
| openbb-tradingeconomics | [TradingEconomics](https://tradingeconomics.com/api) data connector | pip install openbb-tradingeconomics | Paid |
| openbb-ultima | [Ultima Insights](https://ultimainsights.ai/openbb) data connector | pip install openbb-ultima | Paid |
| openbb-yfinance | [Yahoo Finance](https://finance.yahoo.com/) data connector | pip install openbb-yfinance | None |
### Community Providers
@@ -84,12 +83,14 @@ These packages are not installed when `pip install openbb` is run. They are ava
| openbb-biztoc | [Biztoc](https://api.biztoc.com/#biztoc-default) News data connector | pip install openbb-biztoc | Free |
| openbb-cboe | [Cboe](https://www.cboe.com/delayed_quotes/) data connector | pip install openbb-cboe | None |
| openbb-ecb | [ECB](https://data.ecb.europa.eu/) data connector | pip install openbb-ecb | None |
| openbb-federal-reserve | [Federal Reserve](https://www.federalreserve.gov/) data connector | pip install openbb-federal-reserve | None |
| openbb-finra | [FINRA](https://www.finra.org/finra-data) data connector | pip install openbb-finra | None / Free |
| openbb-finviz | [Finviz](https://finviz.com) data connector | pip install openbb-finviz | None |
| openbb-government-us | [US Government](https://data.gov) data connector | pip install openbb-us-government | None |
| openbb-nasdaq | [Nasdaq Data Link](https://data.nasdaq.com/) connector | pip install openbb-nasdaq | None / Free |
| openbb-seeking-alpha | [Seeking Alpha](https://seekingalpha.com/) data connector | pip install openbb-seeking-alpha | None |
| openbb-stockgrid | [Stockgrid](https://stockgrid.io) data connector | pip install openbb-stockgrid | None |
| openbb-tmx | [TMX](https://money.tmx.com) data connector | pip install openbb-tmx | None |
| openbb-wsj | [Wall Street Journal](https://www.wsj.com/) data connector | pip install openbb-wsj | None |
Have you published a data provider extension and want it featured on this list? Tell us about it! Open a pull request on [GitHub](https://github.com/OpenBB-finance/OpenBBTerminal/) to submit an extension for inclusion. Code contributions, for new and existing, data providers are always welcome.

View File

@@ -50,6 +50,17 @@ Functions with charting enabled return figures to a field (`chart`) in the `OBBj
The `openbb-charting` is in fact an [`OBBject` extension](/website/content/platform/development/developer-guidelines/obbject_extensions.md) which means you'll have the functionality it exposes on every command result.
:::
The following packages are dependencies of the `openbb-charting` extension:
- scipy
- plotly
- statsmodels
- reportlab
- pywry
- svglib
- nbformat
- pandas-ta
### Installation
To install the extension, run the following command in this folder:
@@ -88,6 +99,12 @@ When using Linux distributions, the PyWry dependency requires certain dependenci
- Fedora:
`sudo dnf install gtk3-devel webkit2gtk3-devel`
If Rust (Cargo) is required, install it:
```console
curl --proto '=https' --tlsv1.3 https://sh.rustup.rs -sSf | sh
```
## Devtools
This extension aggregates the dependencies that facilitate a nice development experience