Skip to content

SarahSchoonmaker/flask-stock-data

Repository files navigation

Stock Market Visualization Flask App

This Flask application allows users to enter the name of a company and visualize its performance using Plotly.

Prerequisites

  • Python 3.x
  • Flask
  • alpha_vantage library
  • plotly library

Installation

  1. Clone the repository:
git clone <repository_url>
  1. Navigate to the project directory:
cd stock-market-visualization
  1. Install the required dependencies using pip:
pip install -r requirements.txt

Usage

  1. Set your Alpha Vantage API key in the api_key variable in the main.py file.

  2. Start the Flask development server:

python main.py
  1. Open your web browser and go to http://localhost:5000.

  2. Enter the name of a company in the input field and click "Submit".

  3. The application will retrieve the stock market data for the specified company and display a plot of the closing prices over time.

  4. To view the plot for a different company, simply enter a new company name and click "Submit" again.

Automatic HTML File Cleanup

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.

Demo

  • The starting UI looks something like this:

img_2.png

  • Searching Up for stock results for 'TSLA'

img_1.png

  • Search Up TSLA hovering over the line graph you can see the price registered as well.

img.png

The plot over time is displayed.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages