Skip to content

Cache queries / pass session parameter to Fred #6

@femtotrader

Description

@femtotrader

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 ?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions