This is a stock sorter created using the Finnhub API, with the built-in webbrowser library utilized to display graphs for evaluating stock potential. A Pandas DataFrame was employed to generate an XLSX table, which can be imported as a CSV into Google Sheets. Additionally, histograms of profits and losses were created using the Matplotlib statistics library.
- ***You must already have a Finnhub account and have an api key. If not, use: https://finnhub.io/register
- Open your preferred code editor and navigate down using
cd Stock API Sorter\stocksto enter directory - Activate the virtual environment by running:
venv/scripts/activate(If not working, use:Unblock-File -Path ".\venv\Scripts\Activate.ps1") - Install the required libraries by running:
pip install -r requirements.txt - Go into branch that contains code files using
cd code_files - Download "https://marketplace.visualstudio.com/items/?itemName=GrapeCity.gc-excelviewer" extension to see XLSX as CSV file
- Run Steps
- Step 1:
py .\Step_1-api.py(Gets stock data) - Step 2:
py .\Step_2-spreadsheets.py(Puts data into chart) - Step 3:
py .\Step_3-stocks.xlsx(Makes xlsx file, look at point 5 to view file) - Step 4:
py .\Step_4-data_chart.py(Makes histogram of profits/loss)
- Step 1:
Finnhub, Pandas, Openpyxl, Numpy, Matplotlib, Yfinance
If needed, go into range.txt under my_texts folder. The top number is the minimum and the bottom number is the maximum for the companies sorted through so far. I recommend keeping the values at most 60 apart or else the API call limit for Finhubb free tier will be reached, and a error code will be returned.
