diff --git a/setup.py b/setup.py index c8712d5..03fa227 100644 --- a/setup.py +++ b/setup.py @@ -38,6 +38,7 @@ download_url='http://pypi.python.org/pypi/ystockquote', keywords='stocks stockmarket market finance yahoo quotes'.split(), license='GNU LGPLv2+', + install_requires=['python-dateutil >= 2.2'], classifiers=[ 'Development Status :: 4 - Beta', 'Intended Audience :: Developers', diff --git a/ystockquote.py b/ystockquote.py index 7cce2d2..90bae92 100644 --- a/ystockquote.py +++ b/ystockquote.py @@ -15,6 +15,8 @@ __version__ = '0.2.5dev' +from dateutil.parser import parse + try: # py3 from urllib.request import Request, urlopen @@ -489,7 +491,7 @@ def get_historical_prices(symbol, start_date, end_date): keys = daily_data[0].split(',') for day in daily_data[1:]: day_data = day.split(',') - date = day_data[0] + date = parse(day_data[0]).date() hist_dict[date] = \ {keys[1]: day_data[1], keys[2]: day_data[2],