Exemple #1
0
 def get(self, key):
     state_path = self.to_path(key) + ".json"
     if os.path.exists(state_path):
         state = State()
         state = state.from_state(json.loads(open(state_path).read()))
     else:
         return None
     path = self.to_path(key)
     if os.path.exists(path):
         return state.from_bytes(open(path, "rb").read())
Exemple #2
0
 def get(self, key):
     state_path = self.to_path(key) + ".json"
     if os.path.exists(state_path):
         state = State()
         state = state.from_state(json.loads(open(state_path).read()))
     else:
         return None
     csv_path = self.to_path(key) + ".csv"
     if os.path.exists(csv_path):
         df = pd.read_csv(csv_path)
         return state.with_df(df)