This repository contains a small script that gets stocks prices, dividend frequency, and dividend from the TMX website using the ticker. The prices are updated in the original Excel file from which the ticker is retrieved.
Python Version: 3.7.6
- time
- openpyxl
- bs4
- requests
- pandas
- re
- sys
- The Excel file and script must be in the same folder
- The Excel file must be named 'Stock_Analysis.xlsx'
- The Excel file must contain the following sheets: 'Potential_Investments', 'Current_Holdings'
- The sheets must contain the following columns and they must be populated:
- 'Ticker': Stock symbol (CTC.A, BMO, etc.)
- 'Currency': 'CAD' or 'USD'
- The sheets must contain the following columns but do not need to be populated:'Current_Price', 'Div_Frequency', 'Dividend', 'Link'
Note: The Excel file attached in this repo is already formatted to work with this script.
The script can be run from the command line based on your Python configurations or manually run using tools like VSCode, Spyder, etc.
- Just ensure the script and Excel file are in the same folder
- A sample Excel file has been upload to test