The fetcher
package is designed for financial data retrieval and analysis. It includes classes for fetching financial metrics, revenue growth, stock data, and stock summaries from Yahoo Finance using the yfinance
library. This package is suitable for investors, financial analysts, traders, and anyone interested in performing detailed stock market research and analysis.
FinancialMetricsFetcher
RevenueGrowthFetcher
StockDataFetcher
StockSummaryFetcher
Class / Initialization | Description | Methods |
---|---|---|
FinancialMetricsFetcher FinancialMetricsFetcher(tickers) |
Retrieves important financial metrics for a list of stock tickers, including: market capitalization, P/E ratio, forward P/E, price to book ratio, and profit margins. Ideal for financial analysis and comparisons across different stocks. |
fetch_financial_metrics : Fetches and compiles financial metrics for each ticker in the list.Returns - pandas.DataFrame : A DataFrame containing the financial metrics for each ticker. |
RevenueGrowthFetcher RevenueGrowthFetcher(tickers) |
Fetches and calculates the year-over-year revenue growth for a list of stock tickers. Utilizes historical financial data to assess company performance over time. |
fetch_revenue_growth : Calculates the most recent year-over-year revenue growth for each ticker.Returns - dict : A dictionary with tickers as keys and their respective year-over-year revenue growth percentages as values. |
StockDataFetcher StockDataFetcher(ticker) |
Fetches various types of stock data, including: historical data, moving averages, average trading volume, and key financial metrics. |
fetch_historical_data : Retrieves historical stock data for the specified period.Parameters - period (str, optional): The time period for which to fetch the data. Defaults to ‘1y’.Returns - pandas.DataFrame : Historical stock data.calculate_moving_averages : Calculates moving averages for given window sizes.get_average_volume : Calculates the average trading volume.get_financial_metrics : Fetches and returns key financial metrics. |
StockSummaryFetcher </br> StockSummaryFetcher(tickers) |
Fetches and provides summary information for a list of stock tickers, including: company name, sector, industry, and key financial metrics. |
fetch_summary : Fetches summary information for a given stock ticker.Parameters - ticker (str): The stock ticker.Returns - dict : Summary information of the stock.get_summaries : Retrieves stock summaries for all tickers specified during initialization.Returns - list of dict : Summaries for each stock ticker. |
Retrieves important financial metrics for a list of stock tickers, including market capitalization, P/E ratio, forward P/E, price to book ratio, and profit margins. Ideal for financial analysis and comparisons across different stocks.
FinancialMetricsFetcher(tickers)
tickers
(list of str): A list of stock ticker symbols (e.g., ['AAPL', 'MSFT']
) for which financial metrics are to be fetched.Fetches and compiles financial metrics for each ticker in the list.
pandas.DataFrame
: A DataFrame containing the financial metrics for each ticker.Fetches and calculates the year-over-year revenue growth for a list of stock tickers. Utilizes historical financial data to assess company performance over time.
RevenueGrowthFetcher(tickers)
tickers
(list of str): Stock tickers to fetch the revenue growth for.fetch_revenue_growth
: Calculates the most recent year-over-year revenue growth for each ticker.
Returns
dict
: A dictionary with tickers as keys and their respective year-over-year revenue growth percentages as values.Fetches various types of stock data, including historical data, moving averages, average trading volume, and key financial metrics.
StockDataFetcher(ticker)
ticker
(str): The stock ticker symbol for which the data is to be fetched.Retrieves historical stock data for the specified period.
period
(str, optional): The time period for which to fetch the data. Defaults to ‘1y’.pandas.DataFrame
: Historical stock data.Calculates moving averages for given window sizes.
data
(pandas.DataFrame): The historical stock data.window_sizes
(list of int, optional): Window sizes for calculating moving averages. Defaults to [20, 50, 200]
.dict
: Moving averages for each window size.Calculates the average trading volume.
data
(pandas.DataFrame): The historical stock data.float
: Average trading volume.Fetches and returns key financial metrics for the stock.
dict
: Key financial metrics.Fetches and provides summary information for a list of stock tickers, including company name, sector, industry, and key financial metrics.
StockSummaryFetcher(tickers)
tickers
(str or list of str): The stock ticker(s) for which the summary information is to be fetched.Fetches summary information for a given stock ticker.
ticker
(str): The stock ticker.dict
: Summary information of the stock.Retrieves stock summaries for all tickers specified during initialization.
list of dict
: Summaries for each stock ticker.