Skip to content

patrick-hsbr/The_Stock_Ticker

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

The Stock Ticker

This project offers users the possibility to request stock data via the publicly available Yahoo Finance API and visualize the data in a candlestick chart using the plotly package. The application is hosted on http://thestockticker.pythonanywhere.com/ using the flask package.

Instructions

Follow these steps to set up and run the project:

  1. Install the required packages listed in the requirements.txt file.

  2. Create the main python file and name it app.py.

  3. Specify the stock symbols and names for the pull down select in the tickers.txt.

  4. Create the HTML files that will host the web visualization generated by your Python files.

    4.1 Create a file named home.html which will be the landing page for the user where the stock symbol can be selected.

    4.2 Create a file named response.html where the data of the requested stock symbol is retrieved and visualized.

    4.3. Create a file name error.html which will offer an error message in case the api response is empty.

  5. Create a free user account on PythonAnywhere.

    5.1. Create a new file named requirements.txt and enter the required packages.

    5.2. Sign up for a Beginner account, which is free. Choose a username that fits the application you want to host, as it will be part of the URL (e.g., username "TheStockTicker" results in http://thestockticker.pythonanywhere.com/).

    5.3. Create a web app by clicking on the "Add a new web app" button.

    5.4. Select your Python web framework and choose Python Version 3.10.

    5.5. Create a file named app.py inside the newly created folder /mysite and copy the contents of your app.py file into it.

    5.6. Create a folder called templates within the /mysite folder. Name the HTML file index.html and copy the contents of your index.html file into it.

    5.7. Save the requirements.txt file in the /mysite folder and install all the listed packages by executing the following command in the bash console within the /mysite directory: pip3 install -r requirements.txt --user.

    5.8. Configure the root file by opening the WSGI configuration file: /var/www/thestockticker_pythonanywhere_com_wsgi.py in the Web tab. Change the import statement for Flask to from app import app as application. This is necessary to define the correct location of your Python file.

    5.9. Run the web application, reload the URL, access it, and have fun!

Feel free to explore the visualization of stock data.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published