-
Notifications
You must be signed in to change notification settings - Fork 679
Added QuandlReader (plus tests and doc) #361
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
Conversation
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 pretty good. some comments, can you also add a changelog entry (0.5.0) / enhancements.
@@ -79,7 +79,7 @@ Historical dividends from Yahoo! Finance. | |||
.. _remote_data.yahoo_quotes: |
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.
this got changed to 100755 for some reason, can you switch back
something like
git update-index --chmod -x <file>
should do it
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
docs/source/remote_data.rst
Outdated
df = web.DataReader(symbol, 'quandl', "2015-01-01", "2015-01-05") | ||
df.ix['2015-01-04'] | ||
|
||
.. _remote_data.quandl: |
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.
put this right before the Quandl (and move the enigma one right before the Enigma)
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
docs/source/remote_data.rst
Outdated
import pandas_datareader.data as web | ||
symbol = 'WIKI/AAPL' # or 'AAPL.US' | ||
df = web.DataReader(symbol, 'quandl', "2015-01-01", "2015-01-05") | ||
df.ix['2015-01-04'] |
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.
use df.loc[...]
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
@@ -22,6 +22,7 @@ | |||
from pandas_datareader.enigma import EnigmaReader | |||
from pandas_datareader.oanda import get_oanda_currency_historical_rates | |||
from pandas_datareader.nasdaq_trader import get_nasdaq_symbols |
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.
hmm lots of files look like the got the 100644 -> 100755
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.
corrected
|
||
class QuandlReader(_DailyBaseReader): | ||
|
||
""" |
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.
can you add a versionadded 0.5.0
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
pandas_datareader/quandl.py
Outdated
Beware of ambiguous symbols (different securities per country)! | ||
Note: Cannot use more than a single string because of the inflexible | ||
way the URL is composed of url and _get_params in the superclass | ||
start : string, |
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.
extra comman
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
pandas_datareader/quandl.py
Outdated
|
||
Parameters | ||
---------- | ||
symbols : string. |
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 period at the end
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
pandas_datareader/quandl.py
Outdated
# secondary convention SYM.CountryCode: | ||
symbol = mm.group(1) | ||
datasetname = self._db_from_countrycode(mm.group(4)) | ||
base_url = "https://www.quandl.com/api/v3/datasets/" |
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.
make the base_url a class property
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.
modeled after Google options _OPTIONS_BASE_URL
pandas_datareader/quandl.py
Outdated
return re.match("(?:" + regex + r")\Z", string, flags=flags) | ||
|
||
def _db_from_countrycode(self, code): | ||
map = dict( |
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.
maybe make a class property
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.
changed
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. some doc comments. ping on green.
docs/source/remote_data.rst
Outdated
@@ -199,6 +199,32 @@ Available expiry dates can be accessed from the ``expiry_dates`` property. | |||
|
|||
.. _remote_data.enigma: | |||
|
|||
Quandl |
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.
the quandl tag should be before the Quandle\n------\n
; and move the enigma one before Enigma
.
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.
moved
docs/source/remote_data.rst
Outdated
|
||
.. _remote_data.quandl: | ||
|
||
Daily financial data (prices of stocks, ETFs etc.) from quandl.com. |
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.
add the http link to quandl.com
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.
added
docs/source/remote_data.rst
Outdated
|
||
Daily financial data (prices of stocks, ETFs etc.) from quandl.com. | ||
The symbol names consist of two parts: DB name and symbol name. | ||
DB names can be all the free ones listed on the Quandl website. |
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.
can you add a link here to the 'free ones'
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.
added
docs/source/remote_data.rst
Outdated
ticker symbols, in some other cases (such as FSE) they can be a bit strange. | ||
Some sources are also mapped to suitable ISO country codes in the dot suffix | ||
style shown above, | ||
currently available for BE, CN, DE, FR, IN, JP, NL, PT, UK, US. |
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.
if available can you provide a link to the quandl docs about this
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.
added link to all datasets
docs/source/remote_data.rst
Outdated
style shown above, | ||
currently available for BE, CN, DE, FR, IN, JP, NL, PT, UK, US. | ||
|
||
Unfortunately (as of June 2017), each DB has a different data schema, |
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 would remove this comment.
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.
removed unfortunately
@@ -79,7 +79,7 @@ Historical dividends from Yahoo! Finance. | |||
.. _remote_data.yahoo_quotes: |
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.
there is also a TOC in this file (its done manually but that's ok). add an entry there as well.
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.
updated TOC
@jreback Green after updates |
thanks @gliptak ! |
Completing #346
Closing #360