CSVInputOutput#

class pybrops.core.io.CSVInputOutput.CSVInputOutput[source]#

Bases: object

Abstract class for defining CSV input/output functionality.

This abstract class defines two functions with the following purposes:

  • to_csv - write an object to a csv file.

  • from_csv - load an object from a csv file.

Methods

from_csv

Read an object from a CSV file.

to_csv

Write an object to a CSV file.

abstract classmethod from_csv(filename, **kwargs)[source]#

Read an object from a CSV file.

Parameters:
  • filename (str) – CSV file name from which to read.

  • kwargs (dict) – Additional keyword arguments to use for dictating importing from a CSV.

Returns:

out – An object read from a CSV file.

Return type:

CSVInputOutput

abstract to_csv(filename, **kwargs)[source]#

Write an object to a CSV file.

Parameters:
  • filename (str) – CSV file name to which to write.

  • kwargs (dict) – Additional keyword arguments to use for dictating export to a CSV.

Return type:

None