def __init__(self, sids, properties): ''' Combine rethinkdb and quandl backends ''' # Should save datafames downloaded from quandl ? self._save_missing_data = properties.get('save_missing') # Allow downloads ? self._offline = properties.get('offline') # Only get from db or quandl this field select = properties.get('select') self._select = [select] if select else [] self.db = RethinkdbFinance(db=properties.get('db', 'quotes')) self.quandl = DataQuandl() # TODO Check with dates self._missing_sids = [ sid for sid in sids if not self.db.available(sid) ] # Select the right mapping if self._select: self.mapping_choice = 'whatever_dataframe' else: if properties['universe'].exchange == 'forex': self.mapping_choice = 'forex_panel' else: #if properties['universe'].exchange.find('paris') > 0: self.mapping_choice = 'stock_panel'
def __init__(self, db='quotes'): self.db = RethinkdbFinance(db=db) log.info('using {} as data provider'.format('quandl.com')) self.feed = DataQuandl()