项目作者: twstewart42

项目描述 :
Python scripts to scrape stock prices
高级语言: Python
项目地址: git://github.com/twstewart42/Get_Stock_Prices.git
创建时间: 2017-05-05T19:18:18Z
项目社区:https://github.com/twstewart42/Get_Stock_Prices

开源协议:

下载


Get_Stock_Prices

Python scripts to scrape stock prices

stock_soup.py

Webscrape yahoo/google for stock prices
Runs in Python2.7 and Python 3.6

  1. pip install BeautifulSoup4

Writes/Reads data to stock_value.csv
Can choose between google or yahoo, also set custom ticker symbols

  1. >python stock_soup.py -S Y -t GOOG AAPL GOLD
  2. Alphabet Inc. (GOOG) 833.01 -1.56 (-0.19%)
  3. Apple Inc. (AAPL) 144.06 -0.71 (-0.49%)
  4. Randgold Resources Limited (GOLD) 89.26 -0.13 (-0.15%)
  5. ===== RESTART: stock_soup.py =====
  6. Ford Motor Company (F) 11.25 -0.12 (-1.06%)
  7. General Electric Company (GE) 30.01 -0.01 (-0.03%)
  8. Alphabet Inc. (GOOGL) 850.87 -1.70 (-0.20%)
  9. >python stock_soup.py -h
  10. usage: stock_soup.py [-h] [-f FILE] [-s SITE] [-t TICKER [TICKER ...]]
  11. webscrape yahoo/google for stock prices
  12. optional arguments:
  13. -h, --help show this help message and exit
  14. -f FILE Alternative CSV file to save data to
  15. -s SITE values: G(goole) or Y(yahoo)
  16. -t TICKER [TICKER ...]
  17. Type list of Ticker Symbols

ticker.py

Read csv of stock values and display them in a rotating visual

ticker

  1. pip install pandas

This is also Python2/3 compatibile.
This was my first attempt at “graphics” in python and more of a fun project

  1. >python ticker.py -h
  2. usage: ticker.py [-h] [-f FILE]
  3. read csv of stock values and display them in a rotating visuals
  4. optional arguments:
  5. -h, --help show this help message and exit
  6. -f FILE Alternative CSV file to read data from