def reset_csv(path: str, title: str, ext: str = "csv"): """Reset the CSV file reader/writer. :param path: the directory path of the CSV file. :param title: the file name of the CSV file. :param ext: the extension of the CSV file (default: 'csv'). """ reader = CsvFile() reader.set(path, title, ext) reader.reset()
def save_csv(path: str, title: str, data: Callable[[List, Dict, PandasDataFrame], None], append: bool = False, ext: str = "csv", **kwargs: Any): """Append to CSV file using dataframe, dictionary or list. :param path: the directory path of the CSV file. :param title: the file name of the CSV file. :param data: the data to write. :param append: indicates if data to be appended to an existing file. :param ext: the extension of the CSV file (default: 'csv'). :param kwargs: any other arguments that the selected writer may accept. """ writer = CsvFile() writer.set(path, title, ext) if append is False: writer.reset() writer.append(data, **kwargs)