CSV Output¶
For easy importing into spreadsheet applications, the versuchung package offers means to export data to CSV.
-
class
versuchung.files.CSV_File(default_filename='', **csv_args)[source]¶ Can be used as: input parameter and output parameter
It is a normal
Filebut the content of the file is interpreted as a csv file. It is parsed before the value is exposed to the user. And formatted before the content is written to disk.Internally the
csvis used, so all arguments tocsv.readerandcsv.writercan be given in csv_args.-
append(row)[source]¶ Append a row to the csv file
It is just a shorthand for
>>> csv_file.value.append([1,2,3])
Parameters: row (list.) – row to append
-
flush()¶ Flush the cached content of the file to disk
-
path¶ Returns: string – path to the file/directory
-
value¶ Other than a normal CSV_File the value of a CSV_File is a list of lists, which represents the structure of the csv file. This value can be manipulated by the user.
>>> CSV_File("csv_output").value [["1", "2", "3"]]
-