Files
ForexBot2/data_provider.py
T
Harwinder Sekhon 083a4e8d63 Provider abstraction: providers/ package with BaseDataProvider template
One class per provider (TwelveData, Oanda, Tiingo), all subclassing
BaseDataProvider which owns cache, validation/cleaning, freshness +
boundary guarantees, fetch_range pagination, and streaming stubs —
subclasses implement only _fetch_raw. config.json data_providers.active
selects the live feed; data_provider.py / oanda_provider.py stay as
back-compat shims. Module 16 provider-abstraction tests (253 total green).

Claude-Session: https://claude.ai/code/session_01Mc7XKYyPySVXiUpcN82QEK
2026-07-28 20:09:00 -04:00

25 lines
787 B
Python
Executable File

"""
ForexBot2 — Data Provider (back-compat shim)
=============================================
The provider implementations live in the `providers/` package:
providers/base.py BaseDataProvider (shared contract + behavior)
providers/twelve_data.py TwelveDataProvider (SDK fetch, throttle, WS)
providers/oanda.py OandaDataProvider (v20 REST, real spread)
`ForexDataProvider` is the historical name of the Twelve Data provider and
is kept as an alias so existing imports keep working.
"""
from providers import ( # noqa: F401
BaseDataProvider,
DataIntegrityError,
PROVIDER_REGISTRY,
TwelveDataProvider,
make_data_provider,
_is_forex_weekend,
)
# Historical name for the Twelve Data provider.
ForexDataProvider = TwelveDataProvider