pandas-datareader accepts a Requests session for its HTTP work. For example, a FRED reader can use a session configured by the application:

import requests
from pandas_datareader import data as web

with requests.Session() as session:
    session.proxies.update({
        "http": "http://proxy.example.net:8080",
        "https": "http://proxy.example.net:8080",
    })
    frame = web.DataReader(
        "GDP", "fred", start, end, session=session
    )

start and end are the application’s requested dates. The context closes the session after the reader finishes. A public HTTP endpoint selected from the HTTP proxy list can supply the address in this session’s proxy map.

Requests’ environment integration remains enabled in this example. If the application requires an explicit route independent of environment proxy values, set session.trust_env=False and supply any required CA bundle or .netrc-derived authentication separately.

Choose a reader supported by the installed pandas-datareader version. A discontinued provider API or changed symbol format can fail after a proxy connection succeeds; setting the session does not restore a removed data endpoint.

Tënë sô zo