def extract_events_from_keen(client, event_collection, start_date=None, end_date=None):
 timeframe = VERY_LONG_TIMEFRAME
 if (start_date and end_date):
  logger.info('Gathering events from the {} collection between {} and {}'.format(event_collection, start_date, end_date))
  timeframe = {'start': start_date.isoformat(), 'end': end_date.isoformat()}
 else:
  logger.info('Gathering events from the {} collection using timeframe {}'.format(event_collection, VERY_LONG_TIMEFRAME))
 return client.extraction(event_collection, timeframe=timeframe)

def extract_events_from_keen ( client , event_collection , start_date = None , end_date = None ) : timeframe = VERY_LONG_TIMEFRAME if ( start_date and end_date ) : logger . info ( 'Gathering events from the {} collection between {} and {}' . format ( event_collection , start_date , end_date ) ) timeframe = { 'start' : start_date . isoformat ( ) , 'end' : end_date . isoformat ( ) } else : logger . info ( 'Gathering events from the {} collection using timeframe {}' . format ( event_collection , VERY_LONG_TIMEFRAME ) ) return client . extraction ( event_collection , timeframe = timeframe )
get analytics from keen to use as a starting point for smoothing or transferring .