This Flask application allows users to enter the name of a company and visualize its performance using Plotly.
- Python 3.x
- Flask
- alpha_vantage library
- plotly library
- Clone the repository:
git clone <repository_url>
- Navigate to the project directory:
cd stock-market-visualization
- Install the required dependencies using pip:
pip install -r requirements.txt
-
Set your Alpha Vantage API key in the api_key variable in the main.py file.
-
Start the Flask development server:
python main.py
-
Open your web browser and go to http://localhost:5000.
-
Enter the name of a company in the input field and click "Submit".
-
The application will retrieve the stock market data for the specified company and display a plot of the closing prices over time.
-
To view the plot for a different company, simply enter a new company name and click "Submit" again.
The application includes a script, cleanup_html_files.py, that runs automatically every hour to remove all HTML files in the templates directory except index.html and plot.html. This helps to prevent the accumulation of unnecessary HTML files.
- The starting UI looks something like this:
- Searching Up for stock results for 'TSLA'
- Search Up TSLA hovering over the line graph you can see the price registered as well.
The plot over time is displayed.