def dump(self,obj,fp): new_obj = to_ser(obj) with open(fp,'w') as json_file: json.dump(new_obj,json_file,indent=4)
def dumps(self, obj): try: return json.dumps(to_ser(obj)) except Exception: return None
def dump(self, obj, fp): new_obj = to_ser(obj) with open(fp, 'w') as yaml_file: yaml.dump(new_obj, yaml_file, default_flow_style=False)
def dumps(self, obj): try: return yaml.dump(to_ser(obj), indent=5) except Exception: return None
def dump(self, obj, fp): with open(fp, 'wb') as pickle_file: pickle.dump(to_ser(obj), pickle_file)
def dump(self, obj, fp): new_obj = to_ser(obj) with open(fp, 'w') as toml_file: toml.dump(new_obj, toml_file)