Fundamental Analysis with Yahoo Finance and Python
This program is a Python implementation of fundamental analysis using financial data from Yahoo Finance. It includes a class called FundamentalAnalysis that can be used to perform fundamental analysis on a stock using historical stock price data from Yahoo Finance.
Getting Started
To use this program, you will need to install Python and the required Python packages. You can install the required packages using the following command:
pipinstall-rrequirements.txt
You can then run the program using the following command:
python main.py
By default, the program will perform fundamental analysis on Apple Inc. (AAPL). You can specify a different stock symbol by passing the stock symbol as a command line argument, like this:
python main.py
Class Usage
To use the FundamentalAnalysis class in your own Python programs, you can import the class from the FundamentalAnalysis.py file, like this:
fromFundamentalAnalysisimportFundamentalAnalysis# Create a FundamentalAnalysis object for a stockfa=FundamentalAnalysis('AAPL')
# Clean and process the datafa.clean_data()
# Analyze the datametrics=fa.analyze_data()
print(metrics)
# Create visualizationsfa.visualize_data()
This will create a FundamentalAnalysis object for Apple Inc. (AAPL), clean and process the data, analyze the data, and create visualizations.
Docker Usage
You can also use Docker to run the FundamentalAnalysis program in a containerized environment. To do this, you can build a Docker image using the provided Dockerfile, like this:
docker build -t fundamental_analysis .
You can then run the Docker container using the following command:
docker run -it -e STOCK_NAME=AAPL fundamental_analysis
This will build the Docker image and run the FundamentalAnalysis program for Apple Inc. (AAPL) inside the Docker container. You can specify a different stock symbol by changing the value of the STOCK_NAME environment variable.