def isUpToDate(cacheFile): """Checks if a cache file is up to date""" currentDate = Utility.currentDate() if currentDate == cacheFile['date']: return 1 else: return 0
def updateCache(baseCurrency, apiResponse): """Updates cache file""" cacheFile = Utility.createFileName(baseCurrency) apiResponse['date'] = Utility.currentDate() with open(cacheFile, "wb") as file: pickle.dump(apiResponse, file, pickle.HIGHEST_PROTOCOL)