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

Cache queries / pass session parameter to Fred #6

Open
femtotrader opened this issue Dec 17, 2015 · 0 comments · May be fixed by #7
Open

Cache queries / pass session parameter to Fred #6

femtotrader opened this issue Dec 17, 2015 · 0 comments · May be fixed by #7

Comments

@femtotrader
Copy link

Hello,

you might pass a session parameter to Fred object (with default session=None)
and initialize session using

def _init_session(self, session):
    if session is None:
        session = requests.Session()
    return session

so it will be possible to cache queries to database using requests-cache http://requests-cache.readthedocs.org/ (optional dependency)

See
https://github.com/pydata/pandas-datareader/blob/master/pandas_datareader/base.py
https://github.com/pydata/pandas-datareader/blob/master/pandas_datareader/fred.py
http://pandas-datareader.readthedocs.org/en/latest/cache.html

Kind regards

PS: maybe we might merge our code ?

@femtotrader femtotrader linked a pull request Dec 17, 2015 that will close this issue
@femtotrader femtotrader changed the title Passing session to Fred Cache queries / pass session parameter to Fred Dec 17, 2015
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 a pull request may close this issue.

1 participant