Skip to content
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

Added extra check for verifying data source #589

Merged
merged 2 commits into from
Oct 20, 2018
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 13 additions & 0 deletions pandas_datareader/data.py
Original file line number Diff line number Diff line change
Expand Up @@ -303,6 +303,19 @@ def DataReader(name, data_source=None, start=None, end=None,
ff = DataReader("6_Portfolios_2x3", "famafrench")
ff = DataReader("F-F_ST_Reversal_Factor", "famafrench")
"""
expected_source = ["yahoo", "google", "iex", "iex-tops", "iex-last",
"iex-last", "bankofcanada", "stooq", "iex-book",
"enigma", "fred", "famafrench", "oecd", "eurostat",
"nasdaq", "quandl", "moex", "morningstar", 'robinhood',
"tiingo", "yahoo-actions", "yahoo-dividends",
"av-forex", "av-daily", "av-daily-adjusted",
"av-weekly", "av-weekly-adjusted", "av-monthly",
"av-monthly-adjusted"]

if data_source not in expected_source:
msg = "data_source=%r is not implemented" % data_source
raise NotImplementedError(msg)

if data_source == "yahoo":
return YahooDailyReader(symbols=name, start=start, end=end,
adjust_price=False, chunksize=25,
Expand Down