I recently completed Computational Investing Part 1 which further tickled my curiosity. Before completing the course I had started to play around with a few ideas. To do any kind of analytics with finance relating to the stock market you require symbols.
Created a simple module that uses BeatifulSoup to parse the list of S & P 500 symbols from Wikipedia and nicely formats the data to be use programmatically an application.
You can grab the code here http://skillachie.github.io/finsymbols/
Gist of it. Will return to you a list of all the symbols and related information
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 |
sp500 = finsymbols.get_sp500_symbols() pprint.pprint(sp500) {'company': u'Xcel Energy Inc', 'headquaters': u'Minneapolis, Minnesota', 'industry': u'Multi-Utilities & Unregulated Power', 'sector': u'Utilities', 'symbol': u'XEL'}, {'company': u'Xerox Corp.', 'headquaters': u'Norwalk, Connecticut', 'industry': u'IT Consulting & Services', 'sector': u'Information Technology', 'symbol': u'XRX'}, {'company': u'Xilinx Inc', 'headquaters': u'San Jose, California', 'industry': u'Semiconductors', 'sector': u'Information Technology', 'symbol': u'XLNX'}, {'company': u'XL Capital', 'headquaters': u'Hamilton, Bermuda', 'industry': u'Property & Casualty Insurance', 'sector': u'Financials', 'symbol': u'XL'}, {'company': u'Xylem Inc.', 'headquaters': u'White Plains, New York', 'industry': u'Industrial Conglomerates', 'sector': u'Industrials', 'symbol': u'XYL'}, |
Stay tuned to see how we then use the list of symbols to obtain prices for each symbol