finagg.yfinance package
Subpackages
Submodules
finagg.yfinance.api module
Simple wrappers for Yahoo! Finance.
- finagg.yfinance.api.get(ticker: str, /, *, start: None | str = None, end: None | str = None, interval: str = '1d', period: str = 'max') DataFrame [source]
Get a ticker’s stock price history.
Does a simple transform on Yahoo! Finance’s ticker API dataframe result to be a bit more consistent with other API implementations.
- Parameters:
ticker – Company ticker to get historical price data for.
start – Start date for stock price history. Defaults to the first recorded date.
end – End date for stock price history. Defaults to the last recorded date.
interval – Frequency at which stock price history is grabbed.
period – Time period to get in the past.
"max"
returns the full stock price history and the default.
- Returns:
Yahoo! Finance auto-adjusted stock price history with slightly different (more normalized) column names.
Examples
>>> finagg.yfinance.api.get("AAPL").head(5) date open high low close volume ticker 0 1980-12-12 0.0997 0.1002 0.0997 0.0997 469033600 AAPL 1 1980-12-15 0.0950 0.0950 0.0945 0.0945 175884800 AAPL 2 1980-12-16 0.0880 0.0880 0.0876 0.0876 105728000 AAPL 3 1980-12-17 0.0897 0.0902 0.0897 0.0897 86441600 AAPL 4 1980-12-18 0.0924 0.0928 0.0924 0.0924 73449600 AAPL
finagg.yfinance.sql module
Yahoo! finance SQLAlchemy interfaces.
- finagg.yfinance.sql.metadata
The metadata associated with all SQL tables defined in this module.
- finagg.yfinance.sql.prices
SQL table for storing raw data as managed by
finagg.yfinance.feat.prices
(an alias forfinagg.yfinance.feat.Prices
).
- finagg.yfinance.sql.daily
SQL table for storing refined data as managed by
finagg.yfinance.feat.daily
(an alias forfinagg.yfinance.feat.Daily
).
Module contents
Top-level yfinance interface.