def checkInstitutionRetentionsbyOCLCNumber(event, context): item_file = handle_files.readFilesFromBucket(event) csv_read = handle_files.loadCSV(item_file) csv_read = process_data.retrieveInstitutionRetentionsbyOCLCNumber( processConfig, csv_read) handle_files.saveFileToBucket(fileInfo['bucket'], fileInfo['key'] + "_updated", csv_read)
def addLBDs(event, context): item_file = handle_files.readFilesFromBucket(event) csv_read = handle_files.loadCSV(item_file) csv_read = process_data.addLBDs(processConfig, csv_read) handle_files.saveFileToBucket(fileInfo['bucket'], fileInfo['key'] + "_updated", csv_read) return saveFile(bucket, key + "_updated", csv_read)
def deleteHoldingsbyOCLCNumber(event, context): item_file = handle_files.readFilesFromBucket(event) csv_read = handle_files.loadCSV(item_file) csv_read = process_data.deleteHoldingsbyOCLCNumber(processConfig, csv_read) handle_files.saveFileToBucket(fileInfo['bucket'], fileInfo['key'] + "_updated", csv_read) return saveFile(bucket, key + "_updated", csv_read)
def getInstitutionRetentions(event, context): item_file = handle_files.readFilesFromBucket(event) csv_read = handle_files.loadCSV(item_file) results = [] for index, row in csv_read.iterrows(): retained_holdings = process_data.retrieveAllInstitutionRetentions( processConfig, row['symbol']) result = handle_files.saveFileToBucket( fileInfo['bucket'], fileInfo['key'] + "_" + row['symbol'] + "_retained", retained_holdings) results.append(row['symbol'] + ": " + result) return ",".join(results)
def getMergedOCLCNumbers(event, context): item_file = handle_files.readFilesFromBucket(event) csv_read = handle_files.loadCSV(item_file) csv_read = process_data.retrieveMergedOCLCNumbers(processConfig, csv_read) handle_files.saveFileToBucket(fileInfo['bucket'], fileInfo['key'] + "_updated", csv_read)