PyStocks, as I hereby name it, has been fun to create.
Matter of fact, it is still incomplete. I need to implement python-daemon.
But here is what isn’t.
PyStocks has two main modes of usage.
- A Curses CLI
- A (to-be) daemonized, argument-based CLI
Said modes are executed through given arguments.
[ui] - stocks.py -u
[args] - stocks.py -t <ticker> -e <email>
The UI system is composed of the following functionalities:
1) Stock/ticker Selection
2) Data gathering, parsing and viewing:
a) general data of said stock
b) the earnings histories of said stock
c) financial statements of said stock
Stock data is scraped from Yahoo Finance.
The Argument/Daemon system is composed of the following functionalities:
1) It parses the given ticker and email provided in the arguments
2) The following sets of stock data are obtained: current price, PE/G ratio, trailing price/earnings, price/sales ratio. These are stored in memory and in a plaintext file.
3) It reads and parses a given SMTP server entry in the configuration file
4) An SSL connection is initiated with the SMTP server
5) Every 30 minutes, the current price of the stock is rechecked. If the price has decreased 5% or more, it sends an email notification to the provided email (given in arguments) containing a refreshed set of the information gathered in step 2, and the amount of percent decrease. All old data is overwritten by the new in the plaintext storage.
Never miss the dip again.