StockAnalysisProgram

Fetchers

Overview

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.

Classes


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.

FinancialMetricsFetcher

Description

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.

Initialization

FinancialMetricsFetcher(tickers)

Parameters

Methods

fetch_financial_metrics

Fetches and compiles financial metrics for each ticker in the list.

Returns

RevenueGrowthFetcher

Description

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.

Initialization

RevenueGrowthFetcher(tickers)

Parameters

Methods

fetch_revenue_growth: Calculates the most recent year-over-year revenue growth for each ticker.

Returns


StockDataFetcher

Description

Fetches various types of stock data, including historical data, moving averages, average trading volume, and key financial metrics.

Initialization

StockDataFetcher(ticker)

Parameters

Methods

fetch_historical_data

Retrieves historical stock data for the specified period.

Parameters
Returns

calculate_moving_averages

Calculates moving averages for given window sizes.

Parameters
Returns

get_average_volume

Calculates the average trading volume.

Parameters
Returns

get_financial_metrics

Fetches and returns key financial metrics for the stock.

Returns

StockSummaryFetcher

Description

Fetches and provides summary information for a list of stock tickers, including company name, sector, industry, and key financial metrics.

Initialization

StockSummaryFetcher(tickers)

Parameters

Methods

fetch_summary

Fetches summary information for a given stock ticker.

Parameters
Returns

get_summaries

Retrieves stock summaries for all tickers specified during initialization.

Returns