Created
March 11, 2011 21:34
-
-
Save clholgat/866620 to your computer and use it in GitHub Desktop.
blarg
This file contains 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
from datetime import datetime | |
def build_request_url(symbol, start_date, end_date): | |
""" | |
This function should take a stock symbol as a string | |
along with the start and end dates as Python dates | |
and return the yahoo csv download url. | |
""" | |
values = { 'symbol' : symbol, | |
'a' : start_date.month-1, | |
'b' : start_date.day, | |
'c' : start_date.year, | |
'd' : end_date.month-1, | |
'e' : end_date.day, | |
'f' : end_date.year } | |
return u'http://ichart.finance.yahoo.com/table.csv?s=%(symbol)s&a=%(a)i&b=%(b)i&c=%(c)i&d=%(d)i&e=%(e)i&f=%(f)i&g=d&ignore=.csv' % values |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment