Skip to content

quantpylib.datapoller.master

DataPoller

__init__(config_keys={'yfinance': True, 'eodhd': os.getenv('EOD_KEY'), 'binance': True, 'phemex': True, 'oanda': ('practice', os.getenv('OANDA_ACC'), os.getenv('OANDA_KEY')), 'coinbase': False, 'hyperliquid': (os.getenv('HYP_PUBLIC'), os.getenv('HYP_KEY'))})

Initialize the DataPoller class with the provided configuration keys. The configuration keys can be passed as string format to the appropriate key-value pair, but you should not hardcode it in production environments. You can create a .envfile and place your keys there, or set it as environment variables. If you do not have the API keys, you can set the value=False, and this datasource will not be available for data retrieval. All the datapollers are available through this master poller, by accessing the attribute values datapoller.equities, datapoller.crypto and so on.

Parameters:

Name Type Description Default
config_keys dict

A dictionary containing configuration keys for different data sources. The default configuration includes parameters for yfinance, eodhd, binance, phemex, and oanda.

{'yfinance': True, 'eodhd': getenv('EOD_KEY'), 'binance': True, 'phemex': True, 'oanda': ('practice', getenv('OANDA_ACC'), getenv('OANDA_KEY')), 'coinbase': False, 'hyperliquid': (getenv('HYP_PUBLIC'), getenv('HYP_KEY'))}

Attributes:

Name Type Description
equities Equities

An instance of Equities that uses the specified data pollers and defaults to 'eodhd' as the source.

metadata Metadata

An instance of Metadata that uses the specified data pollers and defaults to 'eodhd' as the source.

crypto Crypto

An instance of Crypto that uses the specified data pollers and defaults to 'binance' as the source.

currencies Currencies

An instance of Currencies that uses the specified data pollers and defaults to 'eodhd' as the source.

exchange Exchange

An instance of Exchange that uses the specified data pollers and defaults to 'eodhd' as the source.