-
Notifications
You must be signed in to change notification settings - Fork 181
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix For Obtaining Yahoo Historical Data #52
base: master
Are you sure you want to change the base?
Conversation
changed date formats in get_historical_prices from YYYYMMDD to YYY-MM-DD
updated README.rst
Tested locally, and seems to work for me. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lgtm
'cookie': cookies} | ||
|
||
|
||
def get_historical_prices(symbol, start_date, end_date, interval='1d'): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I might be using this wrong, but can 'interval' only be a number of days? If so, maybe rename the variable to interval_days and have the input be an int? That will make it more clear how it's used.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
interval variable can take the following:
This determines if you would like to obtain data rolled up daily, weekly or monthly. Changing it to interval days might be misleading. However this library was used to obtain only daily data before so we could remove it as an argument.
What do you think?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh I see. Hmm... Either way seems fine. Maybe keep it because being able to request at a specific interval would be sweet :D although could you add a small docstring explaining the options?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No problem. Will add it and push the update. Any idea why Travis returns wrong assert?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done with the requested changes
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good. No clue on Travis... :/
except ImportError: | ||
# py2 | ||
from urllib2 import Request, urlopen | ||
from urllib import urlencode | ||
import sys | ||
reload(sys) | ||
sys.setdefaultencoding('utf8') |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
please don't reload sys to change the default encoding
hmm.. travis still failing. I'd like to get this merged. |
Fix to update API to get historical data based on recent changes made by Yahoo. Inspired by fix in pandas_reader using cookies