Skip to content

Commit bea7abb

Browse files
committed
First Commit
0 parents  commit bea7abb

File tree

5 files changed

+686
-0
lines changed

5 files changed

+686
-0
lines changed

LICENSE

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
MIT License
2+
3+
Copyright (c) 2017 Massimiliano Terzi
4+
5+
Permission is hereby granted, free of charge, to any person obtaining a copy
6+
of this software and associated documentation files (the "Software"), to deal
7+
in the Software without restriction, including without limitation the rights
8+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9+
copies of the Software, and to permit persons to whom the Software is
10+
furnished to do so, subject to the following conditions:
11+
12+
The above copyright notice and this permission notice shall be included in all
13+
copies or substantial portions of the Software.
14+
15+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21+
SOFTWARE.

README.md

Lines changed: 107 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,107 @@
1+
# Google Stock Screener
2+
*Have you ever wished a good selection of stocks be delivered daily to your inbox?* *Have you ever wished you could navigate in a few moments through the thousands of names available for investment in the stock markets?* **So did I.**
3+
4+
Therefore, I created this module to support my own investment activity.
5+
6+
What it does:
7+
- It connects to the [Google Stock Screener API](https://www.google.com/finance/stockscreener);
8+
- Runs a query on it based on certain fundamental stock screening criteria (e.g. [P/E ratio](http://wwww.investopedia.com/terms/p/price-earningsratio.asp), [Dividend Yield](http://wwww.investopedia.com/terms/d/dividendyield.asp), [EBITDA Margin](http://wwww.investopedia.com/terms/e/ebitda-margin.asp)).
9+
- Delivers the result in a nice formatting to my inbox.
10+
11+
The module support **multi-exchange queries**, and a **maximum of 8 criteria** at a time.
12+
13+
## Installation Instructions
14+
Tested with, and assumes you already have at your disposal:
15+
- Ubuntu 16.04;
16+
- Anaconda Python 3.5.3
17+
- Gmail email server.
18+
19+
Install git
20+
```
21+
sudo apt-get update
22+
sudo apt-get install git
23+
```
24+
25+
Copy the repository on your computer and rename the sample config file
26+
```
27+
git clone https://github.com/terzim/GoogleStockScreener.git
28+
cd GoogleStockScreener
29+
mv config-sample.ini config.ini
30+
```
31+
Install the python requirements
32+
```
33+
conda install --yes --file requirements.txt # If using Anaconda Python distribution
34+
```
35+
or
36+
```
37+
pip3 install -r requirements.txt # If using a standard Python3 distributions
38+
```
39+
40+
## Configuration
41+
Open the ```config.ini``` file in your favourite text editor. Edit the configuration parameters accordingly.
42+
43+
### Screener data
44+
45+
Sample config file:
46+
```
47+
[screener_data]
48+
csv_file = YOUR_CSV_FILE_NAME (e.g. csv_file.csv)
49+
json_file = YOUR_JSON_FILE_NAME (e.g. json_file.json)
50+
currency = YOUR_CURRENCY_OF_CHOICE (e.g. USD)
51+
; Note - if left empty, defaults to standard currency of exchange
52+
exchanges = YOUR, LIST, OF, EXCHANGES, SEPARATED, BY COMMAS (e.g. NYSE, LON, BIT)
53+
sector = YOUR_SECTOR_OF_CHOICE ** TODO **
54+
; Note - to do leave sector empty for now
55+
```
56+
57+
### Email Data
58+
```
59+
[email_data]
60+
send_email = TRUE/FALSE
61+
; set send_email to True is wish to send the email
62+
sender = YOUR_SENDER_USERNAME (e.g. [email protected])
63+
recipient = YOUR_RECIPIENT_EMAIL (e.g. [email protected])
64+
pwd_sender = YOUR_SENDER_PASSWORD (e.g. catdog123)
65+
server_name = YOUR_SMTP_SERVER_NAME (e.g. smtp.gmail.com)
66+
; Note - gmail server_name is smtp.gmail.com
67+
server_port = YOUR_SMTP_SERVER_PORT (e.g. 587)
68+
; Note - gmail server_post is 587
69+
```
70+
71+
### Screening Criteria
72+
73+
These are also set at the bottom of the configuration file. A full list of the criteria (organized by topic) is to be found in the class documentation. **Leave blank the criteria you do not use**
74+
75+
```
76+
[screening_criteria]
77+
CRITERIA1 = (e.g. pe_ratio)
78+
CRITERIA1_MIN = (e.g. 5)
79+
CRITERIA1_MAX = (e.g. 15)
80+
CRITERIA2 = (e.g. price_to_book)
81+
CRITERIA2_MIN = 1
82+
CRITERIA2_MAX = 3
83+
CRITERIA3 =
84+
CRITERIA3_MIN =
85+
CRITERIA3_MAX =
86+
CRITERIA4 =
87+
CRITERIA4_MIN =
88+
CRITERIA4_MAX =
89+
CRITERIA5 =
90+
CRITERIA5_MIN =
91+
CRITERIA5_MAX =
92+
CRITERIA6 =
93+
CRITERIA6_MIN =
94+
CRITERIA6_MAX =
95+
CRITERIA7 =
96+
CRITERIA7_MIN =
97+
CRITERIA7_MAX =
98+
CRITERIA8 =
99+
CRITERIA8_MIN =
100+
CRITERIA8_MAX =
101+
```
102+
### Run the screen
103+
The screen can be run one-off
104+
```
105+
python StockScreener.py
106+
```
107+
or - in alternative - scheduled for periodical execution via crontab (and - possibly - a VPS). For instructions to setup crontab on a VPS, read a [shorthand guide here](https://www.digitalocean.com/community/tutorials/how-to-use-cron-to-automate-tasks-on-a-vps).

0 commit comments

Comments
 (0)