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

replaced yahoo backend with google for market data #386

Closed
wants to merge 3 commits into from
Closed

replaced yahoo backend with google for market data #386

wants to merge 3 commits into from

Conversation

closedLoop
Copy link

Referencing issue: #385

I have substituted out the yahoo backend for the google data using the pandas web.get_data_google(symbol, start=start, end=end) function

@twiecki
Copy link
Contributor

twiecki commented May 19, 2017

Thanks @closedLoop. Do they offer the same time-range?

@closedLoop
Copy link
Author

@twiecki I quick look at it has SPY since 1993. However, it looks like the API only returns the last 4000 days for any given range.

@twiecki
Copy link
Contributor

twiecki commented May 19, 2017

@closedLoop Yeah, that's how I remember google finance to work. I'd rather wait a few more days for pandas-datareader to fix the issue and update rather than switch the source. Appreciate the initiative though.

@twiecki
Copy link
Contributor

twiecki commented May 19, 2017

Actually it seems that yahoo is discontinuing its service in which case we would need to switch to google.

@gusgordon gusgordon mentioned this pull request May 24, 2017
@gusgordon
Copy link
Contributor

Thanks for the PR. Looks like Travis is spitting out this error:

======================================================================
ERROR: Failure: ImportError (cannot import name PandasError)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/home/travis/miniconda/envs/testenv/lib/python2.7/site-packages/nose/loader.py", line 418, in loadTestsFromName
    addr.filename, addr.module)
  File "/home/travis/miniconda/envs/testenv/lib/python2.7/site-packages/nose/importer.py", line 47, in importFromPath
    return self.importFromDir(dir_path, fqname)
  File "/home/travis/miniconda/envs/testenv/lib/python2.7/site-packages/nose/importer.py", line 94, in importFromDir
    mod = load_module(part_fqname, fh, filename, desc)
  File "/home/travis/build/quantopian/pyfolio/pyfolio/__init__.py", line 3, in <module>
    from . import utils
  File "/home/travis/build/quantopian/pyfolio/pyfolio/utils.py", line 27, in <module>
    from pandas_datareader import data as web
  File "/home/travis/miniconda/envs/testenv/lib/python2.7/site-packages/pandas_datareader/data.py", line 7, in <module>
    from pandas_datareader.google.daily import GoogleDailyReader
  File "/home/travis/miniconda/envs/testenv/lib/python2.7/site-packages/pandas_datareader/google/daily.py", line 1, in <module>
    from pandas_datareader.base import _DailyBaseReader
  File "/home/travis/miniconda/envs/testenv/lib/python2.7/site-packages/pandas_datareader/base.py", line 11, in <module>
    from pandas.core.common import PandasError, is_number
ImportError: cannot import name PandasError

Looks like this is a pandas issue between 0.19 and 0.20: https://stackoverflow.com/questions/43809620/importerror-cannot-import-name-pandaserror

I'm guessing you are on 0.20 @closedLoop ?

@twiecki
Copy link
Contributor

twiecki commented May 24, 2017

Yeah we need to fix that urgently.

@freddiev4
Copy link
Contributor

Hi @closedLoop, are you going to continue working on this PR 🙂 ?

@closedLoop
Copy link
Author

Sure I can adjust this. Which version of pandas should this support?

@gusgordon
Copy link
Contributor

Thanks. Ideally, it should support 0.18, .19, and .20. Also note that we only want to fall back to Google if the Yahoo fetching fails, because Google's prices aren't adjusted for splits and dividends.

@closedLoop
Copy link
Author

closedLoop commented Jun 15, 2017 via email

@gusgordon
Copy link
Contributor

Good idea. Maybe @twiecki or others have other thoughts, but I think we can just wrap Yahoo in a try/except all, then emit a warning and fall back to Google.

@twiecki
Copy link
Contributor

twiecki commented Jun 16, 2017

@closedLoop Yes, a warning would be perfect. I like the try/except approach as well.

@gtruben76
Copy link

How can I download these changes? NOOB alert

@twiecki
Copy link
Contributor

twiecki commented Jun 27, 2017

@closedLoop any progress?

@twiecki
Copy link
Contributor

twiecki commented Jun 29, 2017

Forked and extended on #395. Thanks @closedLoop.

@twiecki twiecki closed this Jun 29, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants