Python Script that push windows 10 notifications on selected stock price.
The script loads configuration from config.py file.
- API_KEY --> The api key for rapidAPI yahoo finance.
- LOG_PATH --> Log file path.
- STOCK_SYMBOL --> Stock Symbol.
- STOCK_REGION --> Stock Region.
- ICON_PATH --> Path to Icon.
- CHECK_INTERVAL --> Interval For Checking stock price in seconds.
API_KEY = 'myapikey'
LOG_PATH = r"{}\DEBUG.log".format(os.path.dirname(os.path.realpath(__file__)))
STOCK_SYMBOL = "FVRR"
STOCK_REGION = "US"
ICON_PATH = r"{}\images\bull.ico".format(os.path.dirname(os.path.realpath(__file__)))
CHECK_INTERVAL = 60 # Check every x seconds
- Create rapid API account here and generate API key.
- Fill the configuration in config.py.
- Clone git repo.
- Install requirements for the script.
- Create Windows Service for the script/Run the script background or foreground.
- Go to https://rapidapi.com/.
- Register and create Account.
- Go to yahoo finance API.
- Get your API key in the "X-RapidAPI-Key" field.
Enter the API key and all the other variables to config.py.
Clone the repository:
git clone https://github.com/galbirk/python-stock-notifier.git
cd python-stock-notifier
Run the command below:
pip install -r requirements.txt
You can Compile the script with py2exe or other module, and run the exe file as windows service.
Run the script with pythonw.exe with the command below:
pythonw.exe getstock.py
To stop the script, stop his process in task manager.
You can simply run the script as regular python script with the command below:
python.exe getstock.py
BSD
Gal Birkman, DevOps Engineer.
email: galbirkman@gmail.com
GitHub: https://github.com/galbirk