BaseInputter

class astropy.io.ascii.BaseInputter[source] [edit on github]

Bases: object

Get the lines from the table input and return a list of lines.

Attributes Summary

encoding

Methods Summary

get_lines(table) Get the lines from the table input.
process_lines(lines) Process lines for subsequent use.

Attributes Documentation

encoding = None

Methods Documentation

get_lines(table)[source] [edit on github]

Get the lines from the table input. The input table can be one of:

  • File name
  • String (newline separated) with all header and data lines (must have at least 2 lines)
  • File-like object with read() method
  • List of strings
Parameters:
table : str, file_like, list

Can be either a file name, string (newline separated) with all header and data lines (must have at least 2 lines), a file-like object with a read() method, or a list of strings.

Returns:
lines : list

List of lines

process_lines(lines)[source] [edit on github]

Process lines for subsequent use. In the default case do nothing. This routine is not generally intended for removing comment lines or stripping whitespace. These are done (if needed) in the header and data line processing.

Override this method if something more has to be done to convert raw input lines to the table rows. For example the ContinuationLinesInputter derived class accounts for continuation characters if a row is split into lines.