# DJIA Portfolio Analysis Tool
## Project Description
This project is a web-based tool built with Flask that allows users to analyze their stock portfolios. The tool scrapes Dow Jones Industrial Average (DJIA) stock symbols and their industries from Wikipedia and integrates with the Alpha Vantage API to fetch historical stock data. Users can input their stock portfolios and analyze performance metrics such as mean daily return, standard deviation of daily returns, and cumulative returns over a specified date range.
## Installation
To get started with this project, you need to have Python installed on your system. Then, you can follow these steps to install the necessary libraries:
```bash
pip install flask requests beautifulsoup4 pandas
Note: You'll need an API key from Alpha Vantage to fetch stock data. Obtain your key by signing up at Alpha Vantage.
To use this tool, follow these steps:
- Clone the repository to your local machine.
- Open the project in your preferred IDE or text editor.
- Replace the
rapidapi_key
variable value with your Alpha Vantage API key. - Run the Flask application:
python app.py
- Open your web browser and go to
http://127.0.0.1:5000/
. - Enter your stock portfolio using the format 'Symbol1 Quantity1, Symbol2 Quantity2,...' (e.g., 'AAPL 5, BA 5') and specify the start and end dates for the analysis.
- Click "Initiate Quantum Analysis" to see the portfolio performance metrics.
app.py
: The main Flask application file.scr.py
: Contains functions for scraping DJIA stocks and fetching stock data from Alpha Vantage.templates/index.html
: The HTML template for the web interface.static/script.js
: JavaScript file for handling frontend logic and AJAX requests.static/styles.css
: CSS file for styling the web interface.
python app.py
Navigate to http://127.0.0.1:5000/
in your web browser and input:
- Portfolio:
AAPL 5, GOOGL 3, TSLA 2
- Start Date:
2024-01-01
- End Date:
2024-12-31
Click "Initiate Quantum Analysis" to view the analysis results.
Contributions to this project are welcome. To contribute:
- Fork the repository.
- Create a new branch for your feature (
git checkout -b feature/AmazingFeature
). - Commit your changes (
git commit -m 'Add some AmazingFeature'
). - Push to the branch (
git push origin feature/AmazingFeature
). - Open a pull request.
This project is licensed under the MIT License - see the LICENSE file for details.
Yashu Patel
This updated README reflects the current state of your project, detailing how to install, run, and use the Flask application, as well as providing information on the project structure and contributing guidelines.