BaseSplitter#
- class astropy.io.ascii.BaseSplitter[source]#
Bases:
object
Base splitter that uses python’s split method to do the work.
This does not handle quoted values. A key feature is the formulation of __call__ as a generator that returns a list of the split line values at each iteration.
There are two methods that are intended to be overridden, first
process_line()
to do pre-processing on each input line before splitting andprocess_val()
to do post-processing on each split string value. By default these apply the stringstrip()
function. These can be set to another function via the instance attribute or be disabled entirely, for example:reader.header.splitter.process_val = lambda x: x.lstrip() reader.data.splitter.process_val = None
Attributes Summary
one-character string used to separate fields
Methods Summary
__call__
(lines)Call self as a function.
join
(vals)process_line
(line)Remove whitespace at the beginning or end of line.
process_val
(val)Remove whitespace at the beginning or end of value.
Attributes Documentation
- delimiter = None#
one-character string used to separate fields
Methods Documentation