def check_dirs(self): if not os.path.exists(self.statement_source_files_dir): os.mkdir(self.statement_source_files_dir) if not os.path.exists(self.clean_statement_files_dir): os.mkdir(self.clean_statement_files_dir) if not os.path.exists(self.account_json_path): Functions.dict_to_json(self.account_dict, self.account_json_path)
def rewrite_projection_list(self, projection_list): if os.path.exists(self.scenario_json_path): os.remove(self.scenario_json_path) Functions.dict_to_json( [projection.to_dict() for projection in projection_list], self.scenario_json_path )
def update_curr_balance(self): self.curr_balance = self.statement_cleaner.super_statement_df[ "running_balance"][-1] self.account_dict = self.get_account_dict() if not os.path.exists(self.account_json_path): os.remove(self.account_json_path) Functions.dict_to_json(self.account_dict, self.account_json_path)
def create_empty_scenario(self, scenario_name): Functions.dict_to_json([], self.profile.scenarios_dir + "/" + "Scenario - {}.json".format(scenario_name))
def make_scenario_json(source_dir, scenario_name): Functions.dict_to_json({}, source_dir + "/" + scenario_name)
def initialize_bank_structure(self): os.mkdir(self.general_path) os.mkdir(self.accounts_dir_path) Functions.dict_to_json(self.bank_dict, self.bank_json_path)