Created
November 26, 2016 18:09
-
-
Save kpmiller/607b2fe5faebb08b404a4a0439f9d610 to your computer and use it in GitHub Desktop.
Download historical stock data from yahoo
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/python | |
import sys, os | |
if len(sys.argv) < 2: | |
print """Usage: %s symbol | |
where symbol is the stock symbol to fetch | |
""" % sys.argv[0] | |
sys.exit(1) | |
cmd = 'curl -o %s.csv http://ichart.yahoo.com/table.csv?s=%s&a=1&b=1&c=2016&d=11&e=22&f=2016' % (sys.argv[1], sys.argv[1]) | |
print cmd | |
os.system(cmd) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment