How to use the cryptostore.engines.StorageEngines.arctic function in cryptostore

To help you get started, we’ve selected a few cryptostore examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github bmoscon / cryptostore / cryptostore / data / arctic.py View on Github external
elif data_type == TICKER:
            df = df.drop(['pair', 'feed'], axis=1)
            chunk_size = 'D'
        elif data_type in { L2_BOOK, L3_BOOK }:
            chunk_size = 'T'
        elif data_type == FUNDING:
            chunk_size = 'D'
        elif data_type == OPEN_INTEREST:
            df = df.drop(['pair', 'feed'], axis=1)
            chunk_size = 'D'

        df.set_index('date', inplace=True)
        # All timestamps are in UTC
        df.index = df.index.tz_localize(None)
        if exchange not in self.con.list_libraries():
            self.con.initialize_library(exchange, lib_type=StorageEngines.arctic.CHUNK_STORE)
        self.con[exchange].append(f"{data_type}-{pair}", df, upsert=True, chunk_size=chunk_size)