def dump(self, path, formatter, *args, **kwargs): fmt = find_formatter(formatter, path) transfer_kwargs, kwargs = split_transfer_kwargs(kwargs) with self.open(path, "w", _yield_path=True, **transfer_kwargs) as lpath: return fmt.dump(lpath, *args, **kwargs)
def load(self, path, formatter, *args, **kwargs): _, kwargs = split_transfer_kwargs(kwargs) path = self._unscheme(path) return find_formatter(path, "load", formatter).load(path, *args, **kwargs)
def dump(self, path, formatter, *args, **kwargs): _, kwargs = split_transfer_kwargs(kwargs) path = self._unscheme(path) return find_formatter(path, "dump", formatter).dump(path, *args, **kwargs)
def load(self, path, formatter, *args, **kwargs): fmt = find_formatter(path, "load", formatter) transfer_kwargs, kwargs = split_transfer_kwargs(kwargs) with self.open(path, "r", _yield_path=True, **transfer_kwargs) as lpath: return fmt.load(lpath, *args, **kwargs)