Skip to content

Python Script that push windows 10 notifications on selected stock price.

Notifications You must be signed in to change notification settings

galbirk/python-stock-notifier

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

28 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

python-stock-notifier

python-version Build Status

bull

Python Script that push windows 10 notifications on selected stock price.

Table of Contents

Configuration

The script loads configuration from config.py file.

Config Variables

  • 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

How to Run?

  1. Create rapid API account here and generate API key.
  2. Fill the configuration in config.py.
  3. Clone git repo.
  4. Install requirements for the script.
  5. Create Windows Service for the script/Run the script background or foreground.

Create rapid API Acount and Get API key

  1. Go to https://rapidapi.com/.
  2. Register and create Account.
  3. Go to yahoo finance API.
  4. Get your API key in the "X-RapidAPI-Key" field.

    API key

Fill Configuration file

Enter the API key and all the other variables to config.py.

Clone git repo

Clone the repository:

git clone https://github.com/galbirk/python-stock-notifier.git
cd python-stock-notifier

Install requirements for the script

Run the command below:

pip install -r requirements.txt

Create Windows Service or Run the script background or foreground

Create Windows Service

You can Compile the script with py2exe or other module, and run the exe file as windows service.

Run the Script in the Background

Run the script with pythonw.exe with the command below:

pythonw.exe getstock.py

To stop the script, stop his process in task manager.

Run the script in the Foreground

You can simply run the script as regular python script with the command below:

python.exe getstock.py

License

BSD

Author Information

Gal Birkman, DevOps Engineer.
email: galbirkman@gmail.com
GitHub: https://github.com/galbirk