def __init__(self, input_file, input_dir, db_params, metric, debug): """Return an instance of MSHealthData given an input file or files and information on the databse to put it in.""" self.metric = metric self.mshealth_db = MSHealthDB.MSHealthDB(db_params, debug) if input_file: self.file_names = FileProcessor.match_file(input_file, r'Daily_Summary_.*\.csv') if input_dir: self.file_names = FileProcessor.dir_to_files(input_dir, r'Daily_Summary_.*\.csv')
def __init__(self, input_file, input_dir, db_params_dict, metric, debug): """Return a new instance of FitBitData given the location of the data files, paramters for accessing the database, and if the data should be stored in metric units.""" self.metric = metric self.fitbitdb = FitBitDB.FitBitDB(db_params_dict, debug) if input_file: self.file_names = FileProcessor.match_file(input_file, r'.*\.csv') if input_dir: self.file_names = FileProcessor.dir_to_files(input_dir, r'.*\.csv')
def __init__(self, input_file, input_dir, db_params, metric, debug): """Return an instance of MSVaultData given an input file or files and information on the databse to put it in.""" self.metric = metric self.mshealth_db = MSHealthDB.MSHealthDB(db_params, debug) self.cols_map = { 'Date': ('timestamp', CsvImporter.map_mdy_date), 'Weight': ('weight', MSVaultData.__map_weight), } if input_file: self.file_names = FileProcessor.match_file(input_file, r'HealthVault_Weight_.*\.csv') if input_dir: self.file_names = FileProcessor.dir_to_files(input_dir, r'HealthVault_Weight_.*\.csv')