https://github.com/thevickypedia/black_pearl
Stock Alerter
https://github.com/thevickypedia/black_pearl
Last synced: about 2 months ago
JSON representation
Stock Alerter
- Host: GitHub
- URL: https://github.com/thevickypedia/black_pearl
- Owner: thevickypedia
- License: mit
- Created: 2020-05-17T17:07:14.000Z (about 5 years ago)
- Default Branch: master
- Last Pushed: 2020-09-26T21:36:23.000Z (over 4 years ago)
- Last Synced: 2025-02-12T22:22:48.277Z (4 months ago)
- Language: Python
- Homepage:
- Size: 18.6 KB
- Stars: 0
- Watchers: 0
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Black Pearl
An application that alerts you via email and/or whatsapp when the stocks prices on your watchlist has either deceeded the MIN threshold or exceeded the MAX limit value.Note: This is a AWS version of the [stock_monitor](https://github.com/thevickypedia/stock_monitor) application.
## Setup
1. git clone this repository and alter the code to use local env instead of aws client (refer previous commits to look at the changes made)
2. Run this command in your terminal to install necessary packages
cd stock_monitor/lib && pip3 install -r requirements.txt2. Make sure you add the following env variables (AWS: key value pairs in your ssm parameter store)
* ACCESS_KEY - AWS access key id
* SECRET_KEY - AWS secret access key
* SENDER - sender email address (verified via AWS SES)
* RECIPIENT - receiver email address (verified via AWS SES)
* ACCESS_KEY - AWS access to authenticate into your AWS account
* SECRET_KEY - AWS secret key
* stock_1 - Symbol for the stock you'd like to track (Eg: MSFT for Microsoft)
* stock_1_min - The minimum value below which you'd like to be notified
* stock_1_max - The maximum value above which you'd like to be notified
* Note: Keep increasing the # as you want more stocks to be tracked. (Limit: 25)
Optional (If you'd like to setup whats app notifications else skip these):
* SID - S-ID from twilio
* TOKEN - Token from twilio
* SEND - sender whats app number (fromat - +1xxxxxxxxxx)
* RECEIVE - receiver whats app number (fromat - +1xxxxxxxxxx)## Usage
* Check the AWS lambda setup [here](https://github.com/thevickypedia/stock_hawk/blob/master/README.md#setup)
* To run local replace the AWSClients().* part to local env variables (os.getenv()) in [pirate.py](https://github.com/thevickypedia/black_pearl/blob/master/pirate.py#L138-L139) and [emailer.py](https://github.com/thevickypedia/black_pearl/blob/master/lib/emailer.py#L9-L10)
Click [here](https://www.twilio.com/docs/whatsapp/quickstart/python) to get started with Twilio or refer [twilio](https://pypi.org/project/twilio/) docs for quick start.
If you prefer not to use whats app notifications then simply change send_whatsapp() to send_email() in [stock_monitor.py](https://github.com/thevickypedia/stock_monitor/blob/master/stock_monitor.py#L92) and add arguments 'data, context'
By doing this the [send_whatsapp()](https://github.com/thevickypedia/black_pearl/blob/master/pirate.py#L99) function will never be called.## License & copyright
© Vignesh Sivanandha Rao, Black Pearl
Licensed under the [MIT License](LICENSE)