msl.io package
Read and write data files.
- msl.io.read(file, **kwargs)[source]
Read a file that has a Reader implemented.
- Parameters:
file (path-like or file-like) – The file to read. For example, it could be a
str
representing a file system path or a stream.**kwargs – All keyword arguments are passed to the
Reader.can_read()
andReader.read()
methods.
- Returns:
Reader
– The data from the file.- Raises:
OSError – If no
Reader
exists to be able to read the specified file.
- msl.io.read_table(file, **kwargs)[source]
Read data in a table format from a file.
A table has the following properties:
The first row is a header.
All rows have the same number of columns.
All data values in a column have the same data type.
- Parameters:
file (path-like or file-like) – The file to read. For example, it could be a
str
representing a file system path or a stream. If file is a Google Sheets spreadsheet then file must end with.gsheet
even if the ID of the spreadsheet is specified.**kwargs – If the file is an Excel spreadsheet then the keyword arguments are passed to
read_table_excel()
. If a Google Sheets spreadsheet then the keyword arguments are passed toread_table_gsheets()
. Otherwise, all keyword arguments are passed toread_table_text()
.
- Returns:
Dataset
– The table as aDataset
. The header is included as metadata.
- msl.io.version_info = version_info(major=0, minor=2, micro=0, releaselevel='dev0')
Contains the version information as a (major, minor, micro, releaselevel) tuple.
- Type: