abaquant.marketdata.providers.yahoo¶
Import path: abaquant.marketdata.providers.yahoo
Domain: Provider-neutral market-data facades, normalized records, caching, and analytics.
Purpose¶
Yahoo Finance adapter backed by the optional yfinance dependency.
When to use it¶
This module belongs to the provider layer. Most users reach it through the market-data facades; custom integrations can implement or instantiate the documented contracts directly.
Public objects¶
class:
YahooFinanceProvider— Yahoo Finance provider adapter backed by optional yfinance. *YahooFinanceProvider.fast_info— Retrieve a lightweight quote metadata mapping from the provider. *YahooFinanceProvider.info— Return provider metadata normalized to a plain Python dictionary. *YahooFinanceProvider.history— Retrieve historical market data through the configured provider. *YahooFinanceProvider.history_many— Retrieve batched historical market data through the configured provider. *YahooFinanceProvider.option_expirations— Retrieve listed option expiration dates from the provider. *YahooFinanceProvider.option_chain— Retrieve raw call and put option-chain tables from the provider. *YahooFinanceProvider.income_statement— Retrieve a structured annual or quarterly income statement from yfinance. *YahooFinanceProvider.balance_sheet— Retrieve a structured annual or quarterly balance sheet from yfinance. *YahooFinanceProvider.cash_flow_statement— Retrieve a structured annual or quarterly cash-flow statement from yfinance.
Detailed reference¶
Yahoo Finance adapter backed by the optional yfinance dependency.
Purpose¶
The module translates yfinance quote, history, and option-chain responses into package-level primitives and DataFrames.
Conventions¶
The yfinance import is lazy. Dates and data fields retain provider semantics until normalized by the ticker or universe layer.
Scope and limitations¶
Yahoo Finance and yfinance are external, unofficial, and potentially rate-limited data sources. Their data should not be treated as production-grade or authoritative.
References
[ 1 ] Black, F., and M. Scholes (1973), “The Pricing of Options and Corporate Liabilities”; Merton, R. C. (1973), “Theory of Rational Option Pricing”.
- class abaquant.marketdata.providers.yahoo.YahooFinanceProvider¶
Bases:
objectYahoo Finance provider adapter backed by optional yfinance.
Notes
Construction is lazy where documented: provider data are requested only by retrieval methods, not by object creation.
Create a provider adapter without importing yfinance or fetching data.
- fast_info(symbol)¶
Retrieve a lightweight quote metadata mapping from the provider.
- Parameters:
symbol (str) – Ticker symbol to normalize and query.
- Returns:
Named outputs of the fast info calculation.
- Return type:
dict[str, Any]
Notes
The applied layer normalizes provider data but cannot guarantee provider completeness, timeliness, or accuracy.
- info(symbol)¶
Return provider metadata normalized to a plain Python dictionary.
- Parameters:
symbol (str) – Ticker symbol to normalize and query.
- Returns:
Named outputs of the info calculation.
- Return type:
dict[str, Any]
Notes
The applied layer normalizes provider data but cannot guarantee provider completeness, timeliness, or accuracy.
- history(symbol, *, period='1y', start=None, end=None, auto_adjust=True)¶
Retrieve historical market data through the configured provider.
- Parameters:
symbol (str) – Ticker symbol to normalize and query.
period (str | None, default='1y') – Provider history period label, such as
"1y", when explicit dates are not supplied.start (str | None, default=None) – Optional inclusive history start date.
end (str | None, default=None) – Optional exclusive or provider-defined history end date.
auto_adjust (bool, default=True) – Whether provider-adjusted price history is requested.
- Returns:
Tabular result with the index, column schema, units, and missing-value treatment defined by the module convention.
- Return type:
pandas.DataFrame
Notes
The applied layer normalizes provider data but cannot guarantee provider completeness, timeliness, or accuracy.
- history_many(symbols, *, start=None, end=None, period='1y', interval='1d', auto_adjust=True)¶
Retrieve batched historical market data through the configured provider.
- Parameters:
symbols (Sequence[str]) – Ticker symbols to normalize and include in the applied universe.
start (str | date | None, default=None) – Optional inclusive history start date.
end (str | date | None, default=None) – Optional exclusive or provider-defined history end date.
period (str | None, default='1y') – Provider history period label, such as
"1y", when explicit dates are not supplied.interval (str, default='1d') – Provider sampling interval label, such as
"1d".auto_adjust (bool, default=True) – Whether provider-adjusted price history is requested.
- Returns:
Tabular result with the index, column schema, units, and missing-value treatment defined by the module convention.
- Return type:
pandas.DataFrame
Notes
The applied layer normalizes provider data but cannot guarantee provider completeness, timeliness, or accuracy.
- option_expirations(symbol)¶
Retrieve listed option expiration dates from the provider.
- Parameters:
symbol (str) – Ticker symbol to normalize and query.
- Returns:
Available labels in the order supplied by the provider or defined by the implementation.
- Return type:
list[str]
Notes
The applied layer normalizes provider data but cannot guarantee provider completeness, timeliness, or accuracy.
- option_chain(symbol, expiry)¶
Retrieve raw call and put option-chain tables from the provider.
- Parameters:
symbol (str) – Ticker symbol to normalize and query.
expiry (str) – Option expiry date in ISO
YYYY-MM-DDform.
- Returns:
Positional outputs produced by the option chain calculation.
- Return type:
tuple[pd.DataFrame, pd.DataFrame]
Notes
The applied layer normalizes provider data but cannot guarantee provider completeness, timeliness, or accuracy.
- income_statement(symbol, *, period='annual')¶
Retrieve a structured annual or quarterly income statement from yfinance.
- Parameters:
symbol (str)
period (str)
- Return type:
DataFrame
- balance_sheet(symbol, *, period='annual')¶
Retrieve a structured annual or quarterly balance sheet from yfinance.
- Parameters:
symbol (str)
period (str)
- Return type:
DataFrame
- cash_flow_statement(symbol, *, period='annual')¶
Retrieve a structured annual or quarterly cash-flow statement from yfinance.
- Parameters:
symbol (str)
period (str)
- Return type:
DataFrame